Module: CIJoe::Campfire
- Defined in:
- lib/cijoe/campfire.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.activate ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cijoe/campfire.rb', line 3 def self.activate if valid_config? require 'tinder' CIJoe::Build.class_eval do include CIJoe::Campfire end puts "Loaded Campfire notifier" else puts "Can't load Campfire notifier." puts "Please add the following to your project's .git/config:" puts "[campfire]" puts "\token = yourcampfiretoken" puts "\tsubdomain = whatever" puts "\troom = Awesomeness" puts "\tssl = false" end end |
.config ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/cijoe/campfire.rb', line 23 def self.config @config ||= { :token => Config.campfire.token.to_s, :subdomain => Config.campfire.subdomain.to_s, :room => Config.campfire.room.to_s, :ssl => Config.campfire.ssl.to_s.strip == 'true' } end |
.valid_config? ⇒ Boolean
32 33 34 35 36 |
# File 'lib/cijoe/campfire.rb', line 32 def self.valid_config? %w( token subdomain room ).all? do |key| !config[key.intern].empty? end end |
Instance Method Details
#notify ⇒ Object
38 39 40 41 42 |
# File 'lib/cijoe/campfire.rb', line 38 def notify room.speak "#{}. #{commit.url}" room.paste if failed? room.leave end |