mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-17 07:40:12 +01:00
22 lines
521 B
Ruby
22 lines
521 B
Ruby
require 'yaml'
|
|
|
|
class SeleniumOnRailsConfig
|
|
@@defaults = {:environments => ['test']}
|
|
def self.get var, default = nil
|
|
value = configs[var.to_s]
|
|
value ||= @@defaults[var]
|
|
value ||= default
|
|
value ||= yield if block_given?
|
|
value
|
|
end
|
|
|
|
private
|
|
def self.configs
|
|
unless defined? @@configs
|
|
file = File.expand_path(File.dirname(__FILE__) + '/../config.yml')
|
|
@@configs = File.exist?(file) ? YAML.load_file(file) : {}
|
|
end
|
|
@@configs
|
|
end
|
|
|
|
end
|