caesars 0.5.3 → 0.5.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.
Files changed (4) hide show
  1. data/CHANGES.txt +6 -0
  2. data/caesars.gemspec +2 -2
  3. data/lib/caesars.rb +11 -8
  4. metadata +5 -3
data/CHANGES.txt CHANGED
@@ -1,6 +1,12 @@
1
1
  CAESAR -- CHANGES
2
2
 
3
3
 
4
+ #### 0.5.4 (2009-04-11) ###############################
5
+
6
+ * FIXED: find_deferred would abort early because the safety limit
7
+ to prevent endless loops wasn't being reset between calls.
8
+
9
+
4
10
  #### 0.5.3 (2009-04-10) ###############################
5
11
 
6
12
  * ADDED: Better error handling when reading DSL config files
data/caesars.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  @spec = Gem::Specification.new do |s|
2
2
  s.name = %q{caesars}
3
- s.version = "0.5.3"
4
- s.date = %q{2009-04-10}
3
+ s.version = "0.5.4"
4
+ s.date = %q{2009-04-11}
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
@@ -7,7 +7,7 @@
7
7
  # See bin/example
8
8
  #
9
9
  class Caesars
10
- VERSION = "0.5.3"
10
+ VERSION = "0.5.4"
11
11
  @@debug = false
12
12
 
13
13
  def Caesars.enable_debug; @@debug = true; end
@@ -126,25 +126,28 @@ class Caesars
126
126
  # * [:environment][:ami]
127
127
  # * [:ami]
128
128
  #
129
+ # NOTE: There is a maximum depth of 10.
130
+ #
129
131
  # Returns the attribute if found or nil.
130
132
  #
131
133
  def find_deferred(*criteria)
134
+
132
135
  # The last element is assumed to be the attribute we're looking for.
133
136
  # The purpose of this function is to bubble up the hierarchy of a
134
137
  # hash to find it.
135
138
  att = criteria.pop
136
-
139
+
137
140
  # Account for everything being sent as an Array
138
141
  # i.e. find([1, 2, :attribute])
139
142
  # We don't use flatten b/c we don't want to disturb nested Arrays
140
143
  if criteria.empty?
141
- criteria = attribute
144
+ criteria = att
142
145
  att = criteria.pop
143
146
  end
144
-
147
+
145
148
  found = nil
146
149
  sacrifice = nil
147
-
150
+
148
151
  while !criteria.empty?
149
152
  found = find(criteria, att)
150
153
  break if found
@@ -167,9 +170,8 @@ class Caesars
167
170
 
168
171
  # We need to make a sacrifice
169
172
  sacrifice = criteria.pop if sacrifice.nil?
170
-
171
- break if (@limit ||= 0) > 5 # A failsafe
172
- @limit += 1
173
+ break if (limit ||= 0) > 10 # A failsafe
174
+ limit += 1
173
175
  sacrifice = nil
174
176
  end
175
177
 
@@ -358,6 +360,7 @@ class Caesars
358
360
 
359
361
  end
360
362
  }, __FILE__, __LINE__
363
+
361
364
  end
362
365
 
363
366
  end
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.5.3
4
+ version: 0.5.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-04-10 00:00:00 -04:00
12
+ date: 2009-04-11 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -35,6 +35,8 @@ files:
35
35
  - lib/caesars.rb
36
36
  has_rdoc: true
37
37
  homepage: http://github.com/delano/caesar
38
+ licenses: []
39
+
38
40
  post_install_message:
39
41
  rdoc_options:
40
42
  - --line-numbers
@@ -60,7 +62,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
62
  requirements: []
61
63
 
62
64
  rubyforge_project: caesars
63
- rubygems_version: 1.3.1
65
+ rubygems_version: 1.3.2
64
66
  signing_key:
65
67
  specification_version: 1
66
68
  summary: "Caesars: A simple class for rapid DSL prototyping in Ruby."