lib/tmp/config.rb in tmp-1.1.0 vs lib/tmp/config.rb in tmp-1.2.0
- old
+ new
@@ -1,31 +1,34 @@
#encoding: UTF-8
module TMP
- module Config
- class << self
- def default_folder_path
- File.join( Dir.tmpdir, ( Dir.pwd.split(File::Separator).last.to_s ) )
- end
+ module ConfigCore
- @@config_path= nil
- def folder_path path= nil
+ def default_folder_path
+ File.join( Dir.tmpdir, ( Dir.pwd.split(File::Separator).last.to_s ) )
+ end
- unless path.nil?
+ @config_path= nil
+ def folder_path path= nil
- unless path.class <= String
- raise ArgumentError,"invalid path class"
- end
+ unless path.nil?
- @@config_path = File.absolute_path(path)
-
+ unless path.class <= String
+ raise ArgumentError,"invalid path class"
end
- @@config_path || default_folder_path
+ @config_path = File.absolute_path(path)
end
+ @config_path || default_folder_path
+
end
+
+ end
+
+ module Config
+ extend ConfigCore
end
def self.folder_path obj
self::Config.folder_path(obj)
end