caesars 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.txt CHANGED
@@ -1,9 +1,13 @@
1
1
  CAESAR -- CHANGES
2
2
 
3
3
 
4
- #### 0.4.1 (2009-03-05) ###############################
4
+ #### 0.4.2 (2009-03-05) ###############################
5
5
 
6
6
  * FIX: missing bin/party.conf in gem release
7
+ * FIX: Now works with Ruby 1.8+
8
+ * NEW: Cleaner rdocs.
9
+ * TODO: Fix support for top level methods with names:
10
+ food :extra do; end; # => food_extra
7
11
 
8
12
 
9
13
  #### 0.4.0 (2009-03-05) ###############################
data/README.rdoc CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  A simple class for rapid DSL prototyping in Ruby.
4
4
 
5
- NOTE: Currently runs only with Ruby 1.9+!
6
-
7
5
  == Installation
8
6
 
9
7
  One of:
data/bin/party.conf CHANGED
@@ -7,10 +7,6 @@ food do
7
7
  end
8
8
  end
9
9
 
10
- food :extra do
11
- chips :lots!
12
- end
13
-
14
10
  drink do
15
11
  wine "12L"
16
12
  end
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.4.1"
4
- s.date = %q{2009-03-04}
3
+ s.version = "0.4.2"
4
+ s.date = %q{2009-03-05}
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.4.1"
10
+ VERSION = "0.4.2"
11
11
  # A subclass of ::Hash that provides method names for hash parameters.
12
12
  # It's like a lightweight OpenStruct.
13
13
  # ch = Caesars::Hash[:tabasco => :lots!]
@@ -104,22 +104,22 @@ class Caesars
104
104
  end
105
105
 
106
106
  def self.chill(meth)
107
- define_method(meth) do |*names,&b| # |*names,&b| syntax does not parse in Ruby 1.8
108
- # caesar.toplevel.unnamed_chilled_attribute
109
- return @caesars_pointer[meth] if names.empty? && b.nil?
107
+ module_eval %Q{
108
+ def #{meth}(*names,&b)
109
+ # caesar.toplevel.unnamed_chilled_attribute
110
+ return @caesars_pointer[:'#{meth}'] if names.empty? && b.nil?
110
111
 
111
- # Use the name of the bloody method if no name is supplied.
112
- names << meth if names.empty?
112
+ # Use the name of the bloody method if no name is supplied.
113
+ names << :'#{meth}' if names.empty?
113
114
 
114
- names.each do |name|
115
- @caesars_pointer[name] = b
116
- end
115
+ names.each do |name|
116
+ @caesars_pointer[name] = b
117
+ end
117
118
 
118
- nil
119
- end
120
- #define_method("#{meth}_values") do ||
121
- # instance_variable_get("@" << meth.to_s) || []
122
- #end
119
+ @caesars_pointer[:'#{meth}']
120
+ end
121
+ }
122
+ nil
123
123
  end
124
124
  # Executes automatically when Caesars is subclassed. This creates the
125
125
  # YourClass::DSL module which contains a single method named after YourClass
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.4.1
4
+ version: 0.4.2
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-03-04 00:00:00 -05:00
12
+ date: 2009-03-05 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15