Module: CIJoe::Email
- Defined in:
- lib/cijoe/email.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.activate ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cijoe/email.rb', line 5 def self.activate if valid_config? CIJoe::Build.class_eval do include CIJoe::Email end puts "Loaded Email notifier" else puts "Can't load Email notifier." puts "Please add the following to your project's .git/config:" puts "[email]" puts "\tto = [email protected]" puts "\tuser = horst" puts "\tpass = passw0rd" puts "\thost = mail.example.com" end end |
.config ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/cijoe/email.rb', line 23 def self.config @config ||= { :to => Config.email.to.to_s, :user => Config.email.user.to_s, :pass => Config.email.pass.to_s, :host => Config.email.host.to_s } end |
.valid_config? ⇒ Boolean
32 33 34 35 36 |
# File 'lib/cijoe/email.rb', line 32 def self.valid_config? %w( host user pass to ).all? do |key| !config[key.intern].empty? end end |