-
Notifications
You must be signed in to change notification settings - Fork 0
Working with multiple environments
Johann edited this page Dec 8, 2018
·
1 revision
Default environment is set to development.
development:
key: value
production:
key: other_valueKnowledge.config.environment = :production
knowledge = Knowledge::Learner.new
knowledge.use(name: :file)
knowledge.variables = 'path/to/file.yml'
knowledge.gather!
Knowledge::Configuration.key # => "other_value"development:
key: value
production:
key: other_valuevariables = {
development: {
key: 'value'
},
production: {
key: 'other_value'
}
}
Knowledge.config.environment = :production
knowledge = Knowledge::Learner.new
knowledge.use(name: :default)
knowledge.variables = variables
knowledge.gather!
Knowledge::Configuration.key # => "other_value"