Class: Capistrano::Lingr

Inherits:
Object
  • Object
show all
Defined in:
lib/capistrano/lingr/version.rb,
lib/capistrano/lingr.rb

Constant Summary collapse

VERSION =
'0.0.4'
HOST =
'lingr.com'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(capistrano) ⇒ Lingr

Returns a new instance of Lingr.



21
22
23
# File 'lib/capistrano/lingr.rb', line 21

def initialize(capistrano)
  @cap = capistrano
end

Class Method Details

.load_into(configuration) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/capistrano/lingr.rb', line 8

def self.load_into(configuration)
  configuration.load do
    namespace :notify do
      desc 'Send a notification of deploy to Lingr'
      task :lingr do
        Capistrano::Lingr.new(configuration).notification
      end
    end
  end
end

Instance Method Details

#notificationObject



25
26
27
28
29
# File 'lib/capistrano/lingr.rb', line 25

def notification
  Net::HTTP.start(HOST, 80) do |http|
    http.get("/api/room/say?bot=#{bot_id}&bot_verifier=#{verifier}&room=#{room_id}&text=#{URI.escape(text)}")
  end
end