diff --git a/CHANGES.txt b/CHANGES.txt index b78aa98..7ff249c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,10 @@ CAESARS -- CHANGES +#### 0.7.3 (2009-06-23) ############################### + +* FIXED: Caesars::Config now correctly reports the config file in exceptions + #### 0.7.2 (2009-06-13) ############################### * FIXED: Caesars::Hash method missing now correctly returns diff --git a/caesars.gemspec b/caesars.gemspec index f671f65..3a73b29 100644 --- a/caesars.gemspec +++ b/caesars.gemspec @@ -1,7 +1,11 @@ @spec = Gem::Specification.new do |s| s.name = "caesars" s.rubyforge_project = "caesars" +<<<<<<< HEAD:caesars.gemspec s.version = "0.7.2" +======= + s.version = "0.7.3" +>>>>>>> master:caesars.gemspec s.specification_version = 1 if s.respond_to? :specification_version= s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= diff --git a/lib/caesars.rb b/lib/caesars.rb index 3dff811..e7c2b41 100644 --- a/lib/caesars.rb +++ b/lib/caesars.rb @@ -13,15 +13,18 @@ class Caesars require 'caesars/exceptions' require 'caesars/config' - VERSION = "0.7.2" + VERSION = "0.7.3" + @@debug = false @@chilled = {} @@forced_array = {} @@forced_ignore = {} @@known_symbols = [] @@known_symbols_by_glass = {} + HASH_TYPE = (RUBY_VERSION =~ /1.9/) ? ::Hash : Caesars::OrderedHash - + DIGEST_TYPE = Digest::SHA1 + require 'caesars/hash' def Caesars.enable_debug; @@debug = true; end diff --git a/lib/caesars/config.rb b/lib/caesars/config.rb index 04ea810..78b1f8c 100644 --- a/lib/caesars/config.rb +++ b/lib/caesars/config.rb @@ -93,7 +93,7 @@ def refresh puts "Loading config from #{path}" if @verbose || Caesars.debug? dsl = File.read path # eval so the DSL code can be executed in this namespace. - eval dsl, binding, __FILE__, __LINE__ + eval dsl, binding, path end # Execute Caesars::Config.postprocesses after all files are loaded. diff --git a/lib/caesars/hash.rb b/lib/caesars/hash.rb index 5935fcb..2693c41 100644 --- a/lib/caesars/hash.rb +++ b/lib/caesars/hash.rb @@ -1,10 +1,13 @@ -# A subclass of ::Hash that provides method names for hash parameters. -# It's like a lightweight OpenStruct. -# ch = Caesars::Hash[:tabasco => :lots!] -# puts ch.tabasco # => lots! -# class Caesars + # = Caesars::Hash + # + # A subclass of ::Hash (1.9) or Caesars::OrderedHash (1.8) that provides + # method names for hash parameters. It's like a lightweight OpenStruct. + # + # ch = Caesars::Hash[:tabasco => :lots!] + # puts ch.tabasco # => lots! + # class Hash < HASH_TYPE def method_missing(meth) @@ -33,5 +36,14 @@ def __class__ HASH_TYPE end + + ##def githash(s) + ## # http://stackoverflow.com/questions/552659/assigning-git-sha1s-without-git + ## # http://github.com/mojombo/grit/blob/master/lib/grit/git-ruby/git_object.rb#L81 + ## # http://github.com/mojombo/grit/blob/master/lib/grit/git-ruby/git_object.rb#L225 + ## # http://www.kernel.org/pub/software/scm/git-core/docs/git-hash-object.html + ## # $ git hash-object file + ## DIGEST_TYPE.hexdigest(("%s %d\0" % ['blob', s.length]) << s) + ##end end end