Class: FlowdockBuildNotifier::Configuration
- Inherits:
-
Object
- Object
- FlowdockBuildNotifier::Configuration
- Defined in:
- lib/flowdock_build_notifier/configuration.rb
Constant Summary collapse
- FLOWDOCK_CONFIG =
'.flowdock_build_notifier.yml'
Instance Attribute Summary collapse
-
#email_map ⇒ Object
readonly
Returns the value of attribute email_map.
-
#flow_name ⇒ Object
readonly
Returns the value of attribute flow_name.
-
#flowdock_user_token ⇒ Object
readonly
Returns the value of attribute flowdock_user_token.
-
#teamcity_password ⇒ Object
readonly
Returns the value of attribute teamcity_password.
-
#teamcity_url ⇒ Object
readonly
Returns the value of attribute teamcity_url.
-
#teamcity_user ⇒ Object
readonly
Returns the value of attribute teamcity_user.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(config) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(config) ⇒ Configuration
Returns a new instance of Configuration.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/flowdock_build_notifier/configuration.rb', line 16 def initialize(config) @flowdock_user_token = ENV['FLOWDOCK_USER_TOKEN'] || config.fetch('flowdock_user_token') @flow_name= config.fetch('flow_name') @email_map = config.fetch('email_map') { {} } @teamcity_url = config.fetch('teamcity_url') @teamcity_user = ENV['FLOWDOCK_NOTIFIER_TEAMCITY_USER'] || config.fetch('teamcity_user') @teamcity_password = ENV['FLOWDOCK_NOTIFIER_TEAMCITY_PASSWORD'] || config.fetch('teamcity_password') end |
Instance Attribute Details
#email_map ⇒ Object (readonly)
Returns the value of attribute email_map.
13 14 15 |
# File 'lib/flowdock_build_notifier/configuration.rb', line 13 def email_map @email_map end |
#flow_name ⇒ Object (readonly)
Returns the value of attribute flow_name.
13 14 15 |
# File 'lib/flowdock_build_notifier/configuration.rb', line 13 def flow_name @flow_name end |
#flowdock_user_token ⇒ Object (readonly)
Returns the value of attribute flowdock_user_token.
13 14 15 |
# File 'lib/flowdock_build_notifier/configuration.rb', line 13 def flowdock_user_token @flowdock_user_token end |
#teamcity_password ⇒ Object (readonly)
Returns the value of attribute teamcity_password.
13 14 15 |
# File 'lib/flowdock_build_notifier/configuration.rb', line 13 def teamcity_password @teamcity_password end |
#teamcity_url ⇒ Object (readonly)
Returns the value of attribute teamcity_url.
13 14 15 |
# File 'lib/flowdock_build_notifier/configuration.rb', line 13 def teamcity_url @teamcity_url end |
#teamcity_user ⇒ Object (readonly)
Returns the value of attribute teamcity_user.
13 14 15 |
# File 'lib/flowdock_build_notifier/configuration.rb', line 13 def teamcity_user @teamcity_user end |
Class Method Details
.load ⇒ Object
7 8 9 10 11 |
# File 'lib/flowdock_build_notifier/configuration.rb', line 7 def self.load new(YAML.load_file(FLOWDOCK_CONFIG)) rescue Errno::ENOENT raise "#{FLOWDOCK_CONFIG} configuration not found" end |