lib/scide/global.rb in scide-0.0.6 vs lib/scide/global.rb in scide-0.0.7
- old
+ new
@@ -15,11 +15,12 @@
#
# ==== Arguments
# * <tt>contents</tt> - The global options hash.
def initialize contents
raise ArgumentError, 'global configuration must be a hash' unless contents.kind_of? Hash
+ raise ArgumentError, 'global options must be a hash' unless contents[:options].nil? or contents[:options].kind_of?(Hash)
- @options = contents[:options] || {}
+ @options = contents[:options].try(:dup) || {}
# default to home directory
@path = contents[:path].try(:to_s) || File.expand_path('~')
# expand from home directory unless absolute
@path = File.join File.expand_path('~'), @path unless @path.match /^\//