lib/sandboxy/configuration.rb in sandboxy-1.1.0 vs lib/sandboxy/configuration.rb in sandboxy-1.1.1
- old
+ new
@@ -1,10 +1,10 @@
module Sandboxy
def self.environment
config = get_config
- if config&.key :environment
+ if config&.key(:environment)
config[:environment]
else
'live'
end
end
@@ -17,11 +17,11 @@
!Sandboxy.sandbox?
end
def self.retain_environment
config = get_config
- if config&.key :retain_environment
+ if config&.key(:retain_environment)
config[:retain_environment]
else
false
end
end
@@ -32,11 +32,13 @@
def self.get_config
require 'yaml'
begin
- YAML.load_file 'config/sandboxy.yml'
+ config = YAML.load_file 'config/sandboxy.yml'
rescue Exception
end
+
+ return config if config
end
end