Class: BitbucketPullRequest::Opener

Inherits:
Object
  • Object
show all
Defined in:
lib/bitbucket-pull-request/opener.rb

Class Method Summary collapse

Class Method Details

.branchObject



21
22
23
# File 'lib/bitbucket-pull-request/opener.rb', line 21

def self.branch
  Branch.get
end

.dest_paramObject



29
30
31
# File 'lib/bitbucket-pull-request/opener.rb', line 29

def self.dest_param
  CGI.escape "#{self.path}::master"
end

.full_urlObject



9
10
11
# File 'lib/bitbucket-pull-request/opener.rb', line 9

def self.full_url
  "#{self.root_url}#{self.path}/#{self.pull_request_path}"
end

.openObject



5
6
7
# File 'lib/bitbucket-pull-request/opener.rb', line 5

def self.open
  `open "#{self.full_url}"`
end

.pathObject



17
18
19
# File 'lib/bitbucket-pull-request/opener.rb', line 17

def self.path
  Remotes.remote_path
end

.pull_request_pathObject



33
34
35
# File 'lib/bitbucket-pull-request/opener.rb', line 33

def self.pull_request_path
  "pull-request/new?source=#{self.source_param}&dest=#{self.dest_param}"
end

.root_urlObject



13
14
15
# File 'lib/bitbucket-pull-request/opener.rb', line 13

def self.root_url
  "https://bitbucket.org/"
end

.source_paramObject



25
26
27
# File 'lib/bitbucket-pull-request/opener.rb', line 25

def self.source_param
  CGI.escape "#{self.path}::#{self.branch}"
end