Class: DPL::Provider::Launchpad
- Inherits:
-
DPL::Provider
- Object
- DPL::Provider
- DPL::Provider::Launchpad
- Defined in:
- lib/dpl/provider/launchpad.rb
Instance Method Summary collapse
- #check_auth ⇒ Object
-
#initialize(context, options) ⇒ Launchpad
constructor
A new instance of Launchpad.
- #needs_key? ⇒ Boolean
- #push_app ⇒ Object
Constructor Details
#initialize(context, options) ⇒ Launchpad
Returns a new instance of Launchpad.
8 9 10 11 12 |
# File 'lib/dpl/provider/launchpad.rb', line 8 def initialize(context, ) super @http = Net::HTTP.new('api.launchpad.net', 443) @http.use_ssl = true end |
Instance Method Details
#check_auth ⇒ Object
14 15 |
# File 'lib/dpl/provider/launchpad.rb', line 14 def check_auth end |
#needs_key? ⇒ Boolean
17 18 19 |
# File 'lib/dpl/provider/launchpad.rb', line 17 def needs_key? false end |
#push_app ⇒ Object
21 22 23 24 25 |
# File 'lib/dpl/provider/launchpad.rb', line 21 def push_app response = api_call('/1.0/' + [:slug] + '/+code-import', {'ws.op' => 'requestImport'}) error('Deploy failed! Launchpad credentials invalid. ' + response.code.to_s) if response.code == '401' error('Error: ' + response.code.to_s + ' ' + response.body) unless response.kind_of? Net::HTTPSuccess end |