Class: Pullrequest::Bitbucket

Inherits:
Object
  • Object
show all
Defined in:
lib/pullrequest/bitbucket.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(context) ⇒ Bitbucket

Returns a new instance of Bitbucket.



8
9
10
# File 'lib/pullrequest/bitbucket.rb', line 8

def initialize(context)
  @context = context
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



6
7
8
# File 'lib/pullrequest/bitbucket.rb', line 6

def context
  @context
end

Instance Method Details

#commandObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/pullrequest/bitbucket.rb', line 12

def command
  data # ask these questions first
  [
    "curl",
    "-X POST",
    "-H 'Content-Type: application/json'",
    "-u #{username}:#{password}",
    "https://bitbucket.org/api/2.0/repositories/#{dest_repo}/pullrequests",
    "-d '#{data.to_json}'",
  ].join(' ')
end