dslkit 0.2.4 → 0.2.5

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 CHANGED
@@ -1,4 +1,6 @@
1
- 2007-11-29 (0.2.4)
1
+ 2008-12-01 (0.2.5)
2
+ * Added shorter call to constant method.
3
+ 2008-02-22 (0.2.4)
2
4
  * Fixed bug: use @@mutex instead of @mutex in cleanup handler, duh.
3
5
  2007-11-29 (0.2.3)
4
6
  * Now compatible to Ruby 1.9 (for the moment).
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.2.5
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/install.rb CHANGED
File without changes
@@ -276,7 +276,7 @@ module DSLKit
276
276
  # Create a constant named _name_, that refers to value _value_. _value is
277
277
  # frozen, if this is possible. If you want to modify/exchange a value use
278
278
  # DSLAccessor#dsl_reader/DSLAccessor#dsl_accessor instead.
279
- def constant(name, value)
279
+ def constant(name, value = name)
280
280
  value = value.freeze rescue value
281
281
  define_method(name) { value }
282
282
  end
@@ -289,8 +289,8 @@ module DSLKit
289
289
  # class CoffeeMaker
290
290
  # extend DSLKit::Constant
291
291
  #
292
- # constant :on, :on
293
- # constant :off, :off
292
+ # constant :on
293
+ # constant :off
294
294
  #
295
295
  # extend DSLKit::DSLAccessor
296
296
  #
@@ -1,6 +1,6 @@
1
1
  module DSLKit
2
2
  # DSLKit version
3
- VERSION = '0.2.4'
3
+ VERSION = '0.2.5'
4
4
  VERSION_ARRAY = VERSION.split(/\./).map { |x| x.to_i } # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
File without changes
@@ -65,6 +65,7 @@ class TC_DSLKit < Test::Unit::TestCase
65
65
 
66
66
  def test_constant
67
67
  assert_equal :foo, @c.foo
68
+ assert_equal :baz, @c.bar
68
69
  end
69
70
 
70
71
  def test_dsl_accessor
@@ -38,7 +38,9 @@ end
38
38
  class C
39
39
  extend DSLKit::Constant
40
40
 
41
- constant :foo, :foo
41
+ constant :foo
42
+
43
+ constant :bar, :baz
42
44
  end
43
45
 
44
46
  class DA
@@ -31,7 +31,9 @@ class IE
31
31
  end
32
32
 
33
33
  class C
34
- constant :foo, :foo
34
+ constant :foo
35
+
36
+ constant :bar, :baz
35
37
  end
36
38
 
37
39
  class DA
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dslkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-02-22 00:00:00 +01:00
12
+ date: 2008-12-01 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
71
71
  requirements: []
72
72
 
73
73
  rubyforge_project: dslkit
74
- rubygems_version: 1.0.1
74
+ rubygems_version: 1.3.1
75
75
  signing_key:
76
76
  specification_version: 2
77
77
  summary: Kit for building DSLs in Ruby