Class: Pullrequest::Bitbucket
- Inherits:
-
Object
- Object
- Pullrequest::Bitbucket
- Defined in:
- lib/pullrequest/bitbucket.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(context) ⇒ Bitbucket
constructor
A new instance of Bitbucket.
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
#context ⇒ Object (readonly)
Returns the value of attribute context.
6 7 8 |
# File 'lib/pullrequest/bitbucket.rb', line 6 def context @context end |
Instance Method Details
#command ⇒ Object
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 |