7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/capistrano/campfire.rb', line 7
def initialize(campfire_options)
rooms_options = campfire_options[:rooms]
unless rooms_options
rooms_options = [{}]
end
@rooms = rooms_options.map do |room_options|
account = room_options[:account] || campfire_options[:account]
token = room_options[:token] || campfire_options[:token]
ssl = room_options[:ssl] || campfire_options[:ssl]
ssl_verify = room_options[:ssl_verify] || campfire_options[:ssl_verify]
room_name = room_options[:room] || campfire_options[:room]
room_id = room_options[:room] || campfire_options[:room_id]
campfire = ::Tinder::Campfire.new account,
:token => token,
:ssl => ssl,
:ssl_verify => ssl_verify
if room_name
campfire.find_room_by_name(room_name)
elsif room_id
campfire.find_room_by_id(room_id)
else
raise "Please, specify room name or room_id for your Campfire room"
end
end
end
|