caesars 0.6.3 → 0.6.4
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 +5 -0
- data/README.rdoc +1 -0
- data/caesars.gemspec +1 -1
- data/lib/caesars.rb +5 -3
- metadata +2 -2
data/CHANGES.txt
CHANGED
data/README.rdoc
CHANGED
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.6.
|
4
|
+
s.version = "0.6.4"
|
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
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'orderedhash'
|
1
2
|
|
2
3
|
# Caesars -- Rapid DSL prototyping in Ruby.
|
3
4
|
#
|
@@ -14,6 +15,7 @@ class Caesars
|
|
14
15
|
@@forced_ignore = {}
|
15
16
|
@@known_symbols = []
|
16
17
|
@@known_symbols_by_glass = {}
|
18
|
+
HASH_TYPE = (RUBY_VERSION =~ /1.9/) ? ::Hash : ::OrderedHash
|
17
19
|
|
18
20
|
def Caesars.enable_debug; @@debug = true; end
|
19
21
|
def Caesars.disable_debug; @@debug = false; end
|
@@ -60,7 +62,7 @@ class Caesars
|
|
60
62
|
# ch = Caesars::Hash[:tabasco => :lots!]
|
61
63
|
# puts ch.tabasco # => lots!
|
62
64
|
#
|
63
|
-
class Hash <
|
65
|
+
class Hash < HASH_TYPE
|
64
66
|
def method_missing(meth)
|
65
67
|
self[meth] if self.has_key?(meth)
|
66
68
|
end
|
@@ -68,7 +70,7 @@ class Caesars
|
|
68
70
|
# Returns a clone of itself and all children cast as ::Hash objects
|
69
71
|
def to_hash(hash=self)
|
70
72
|
return hash unless hash.is_a?(Caesars::Hash) # nothing to do
|
71
|
-
target = ::
|
73
|
+
target = (Caesars::HASH_TYPE)[dup]
|
72
74
|
hash.keys.each do |key|
|
73
75
|
if hash[key].is_a? Caesars::Hash
|
74
76
|
target[key] = hash[key].to_hash
|
@@ -571,7 +573,7 @@ class Caesars::Config
|
|
571
573
|
#
|
572
574
|
def initialize(*args)
|
573
575
|
# We store the options hash b/c we reapply them when we refresh.
|
574
|
-
@options = args.last.
|
576
|
+
@options = args.last.kind_of?(Hash) ? args.pop : {}
|
575
577
|
@paths = args.empty? ? [] : args
|
576
578
|
@options = {}
|
577
579
|
@forced_refreshes = 0
|
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.6.
|
4
|
+
version: 0.6.4
|
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-05-
|
12
|
+
date: 2009-05-09 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|