caesars 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES.txt +4 -0
- data/caesars.gemspec +1 -1
- data/lib/caesars.rb +5 -2
- data/lib/caesars/config.rb +1 -1
- data/lib/caesars/hash.rb +10 -7
- data/lib/caesars/orderedhash.rb +0 -3
- metadata +3 -3
data/CHANGES.txt
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
CAESARS -- CHANGES
|
2
2
|
|
3
3
|
|
4
|
+
#### 0.7.3 (2009-06-23) ###############################
|
5
|
+
|
6
|
+
* FIXED: Caesars::Config now correctly reports the config file in exceptions
|
7
|
+
|
4
8
|
#### 0.7.2 (2009-06-13) ###############################
|
5
9
|
|
6
10
|
* FIXED: Caesars::Hash method missing now correctly returns
|
data/caesars.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
@spec = Gem::Specification.new do |s|
|
2
2
|
s.name = "caesars"
|
3
3
|
s.rubyforge_project = "caesars"
|
4
|
-
s.version = "0.7.
|
4
|
+
s.version = "0.7.3"
|
5
5
|
s.specification_version = 1 if s.respond_to? :specification_version=
|
6
6
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
7
7
|
|
data/lib/caesars.rb
CHANGED
@@ -13,15 +13,18 @@ class Caesars
|
|
13
13
|
require 'caesars/exceptions'
|
14
14
|
require 'caesars/config'
|
15
15
|
|
16
|
-
VERSION = "0.7.
|
16
|
+
VERSION = "0.7.3"
|
17
|
+
|
17
18
|
@@debug = false
|
18
19
|
@@chilled = {}
|
19
20
|
@@forced_array = {}
|
20
21
|
@@forced_ignore = {}
|
21
22
|
@@known_symbols = []
|
22
23
|
@@known_symbols_by_glass = {}
|
24
|
+
|
23
25
|
HASH_TYPE = (RUBY_VERSION =~ /1.9/) ? ::Hash : Caesars::OrderedHash
|
24
|
-
|
26
|
+
DIGEST_TYPE = Digest::SHA1
|
27
|
+
|
25
28
|
require 'caesars/hash'
|
26
29
|
|
27
30
|
def Caesars.enable_debug; @@debug = true; end
|
data/lib/caesars/config.rb
CHANGED
@@ -93,7 +93,7 @@ class Caesars
|
|
93
93
|
puts "Loading config from #{path}" if @verbose || Caesars.debug?
|
94
94
|
dsl = File.read path
|
95
95
|
# eval so the DSL code can be executed in this namespace.
|
96
|
-
eval dsl, binding,
|
96
|
+
eval dsl, binding, path
|
97
97
|
end
|
98
98
|
|
99
99
|
# Execute Caesars::Config.postprocesses after all files are loaded.
|
data/lib/caesars/hash.rb
CHANGED
@@ -1,17 +1,20 @@
|
|
1
1
|
|
2
|
-
# A subclass of ::Hash that provides method names for hash parameters.
|
3
|
-
# It's like a lightweight OpenStruct.
|
4
|
-
# ch = Caesars::Hash[:tabasco => :lots!]
|
5
|
-
# puts ch.tabasco # => lots!
|
6
|
-
#
|
7
2
|
class Caesars
|
3
|
+
# = Caesars::Hash
|
4
|
+
#
|
5
|
+
# A subclass of ::Hash (1.9) or Caesars::OrderedHash (1.8) that provides
|
6
|
+
# method names for hash parameters. It's like a lightweight OpenStruct.
|
7
|
+
#
|
8
|
+
# ch = Caesars::Hash[:tabasco => :lots!]
|
9
|
+
# puts ch.tabasco # => lots!
|
10
|
+
#
|
8
11
|
class Hash < HASH_TYPE
|
9
12
|
|
10
13
|
def method_missing(meth)
|
11
14
|
STDERR.puts "Caesars::Hash.method_missing: #{meth}" if Caesars.debug?
|
12
15
|
self[meth] || self[meth.to_s]
|
13
16
|
end
|
14
|
-
|
17
|
+
|
15
18
|
# Returns a clone of itself and all children cast as ::Hash objects
|
16
19
|
def to_hash(hash=self)
|
17
20
|
return hash unless hash.is_a?(Caesars::Hash) # nothing to do
|
@@ -32,6 +35,6 @@ class Caesars
|
|
32
35
|
def __class__
|
33
36
|
HASH_TYPE
|
34
37
|
end
|
35
|
-
|
38
|
+
|
36
39
|
end
|
37
40
|
end
|
data/lib/caesars/orderedhash.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caesars
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Delano Mandelbaum
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-11-23 00:00:00 -05:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -65,7 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
65
65
|
requirements: []
|
66
66
|
|
67
67
|
rubyforge_project: caesars
|
68
|
-
rubygems_version: 1.3.
|
68
|
+
rubygems_version: 1.3.5
|
69
69
|
signing_key:
|
70
70
|
specification_version: 1
|
71
71
|
summary: "Caesars: Rapid DSL prototyping in Ruby."
|