blockenspiel 0.2.1-java → 0.2.2-java
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/History.rdoc +8 -0
- data/ImplementingDSLblocks.rdoc +16 -10
- data/README.rdoc +9 -10
- data/Rakefile +47 -31
- data/lib/blockenspiel.rb +1 -1
- data/lib/blockenspiel/impl.rb +37 -37
- data/lib/blockenspiel/version.rb +2 -2
- data/lib/blockenspiel_unmixer.jar +0 -0
- data/tests/tc_basic.rb +8 -8
- data/tests/tc_behaviors.rb +23 -23
- data/tests/tc_dsl_methods.rb +28 -28
- data/tests/tc_dynamic.rb +15 -15
- data/tests/tc_mixins.rb +20 -20
- metadata +62 -63
data/tests/tc_mixins.rb
CHANGED
@@ -38,16 +38,16 @@
|
|
38
38
|
|
39
39
|
|
40
40
|
require 'test/unit'
|
41
|
-
require File.expand_path("#{File.dirname(__FILE__)}/../lib/blockenspiel.rb")
|
41
|
+
require ::File.expand_path("#{::File.dirname(__FILE__)}/../lib/blockenspiel.rb")
|
42
42
|
|
43
43
|
|
44
44
|
module Blockenspiel
|
45
45
|
module Tests # :nodoc:
|
46
46
|
|
47
|
-
class TestMixins < Test::Unit::TestCase # :nodoc:
|
47
|
+
class TestMixins < ::Test::Unit::TestCase # :nodoc:
|
48
48
|
|
49
49
|
|
50
|
-
class Target1 < Blockenspiel::Base
|
50
|
+
class Target1 < ::Blockenspiel::Base
|
51
51
|
|
52
52
|
def initialize(hash_)
|
53
53
|
@hash = hash_
|
@@ -64,12 +64,12 @@ module Blockenspiel
|
|
64
64
|
end
|
65
65
|
|
66
66
|
|
67
|
-
class Target2 < Blockenspiel::Base
|
67
|
+
class Target2 < ::Blockenspiel::Base
|
68
68
|
|
69
69
|
dsl_methods false
|
70
70
|
|
71
71
|
def initialize(hash_=nil)
|
72
|
-
@hash = hash_ || Hash.new
|
72
|
+
@hash = hash_ || ::Hash.new
|
73
73
|
end
|
74
74
|
|
75
75
|
def set_value(key_, value_)
|
@@ -92,7 +92,7 @@ module Blockenspiel
|
|
92
92
|
# * Asserts that self doesn't change, and instance variables are preserved.
|
93
93
|
|
94
94
|
def test_basic_mixin
|
95
|
-
hash_ = Hash.new
|
95
|
+
hash_ = ::Hash.new
|
96
96
|
saved_object_id_ = self.object_id
|
97
97
|
@my_instance_variable_test = :hello
|
98
98
|
assert(!self.respond_to?(:set_value))
|
@@ -103,7 +103,7 @@ module Blockenspiel
|
|
103
103
|
assert_equal(:hello, @my_instance_variable_test)
|
104
104
|
assert_equal(saved_object_id_, self.object_id)
|
105
105
|
end
|
106
|
-
Blockenspiel.invoke(block_, Target1.new(hash_))
|
106
|
+
::Blockenspiel.invoke(block_, Target1.new(hash_))
|
107
107
|
assert(!self.respond_to?(:set_value))
|
108
108
|
assert(!self.respond_to?(:set_value2))
|
109
109
|
assert_equal(1, hash_['a1'])
|
@@ -117,7 +117,7 @@ module Blockenspiel
|
|
117
117
|
# * Asserts that the methods properly delegate to the target object.
|
118
118
|
|
119
119
|
def test_mixin_with_renaming
|
120
|
-
hash_ = Hash.new
|
120
|
+
hash_ = ::Hash.new
|
121
121
|
assert(!self.respond_to?(:set_value))
|
122
122
|
assert(!self.respond_to?(:set_value2))
|
123
123
|
assert(!self.respond_to?(:set_value2_inmixin))
|
@@ -126,7 +126,7 @@ module Blockenspiel
|
|
126
126
|
set_value2_inmixin('b'){ 2 }
|
127
127
|
assert(!self.respond_to?(:set_value2))
|
128
128
|
end
|
129
|
-
Blockenspiel.invoke(block_, Target2.new(hash_))
|
129
|
+
::Blockenspiel.invoke(block_, Target2.new(hash_))
|
130
130
|
assert(!self.respond_to?(:set_value))
|
131
131
|
assert(!self.respond_to?(:set_value2))
|
132
132
|
assert(!self.respond_to?(:set_value2_inmixin))
|
@@ -142,15 +142,15 @@ module Blockenspiel
|
|
142
142
|
# multiple mixins add the same method name
|
143
143
|
|
144
144
|
def test_nested_different
|
145
|
-
hash_ = Hash.new
|
145
|
+
hash_ = ::Hash.new
|
146
146
|
assert(!self.respond_to?(:set_value))
|
147
147
|
assert(!self.respond_to?(:set_value2))
|
148
148
|
assert(!self.respond_to?(:set_value2_inmixin))
|
149
|
-
Blockenspiel.invoke(proc do
|
149
|
+
::Blockenspiel.invoke(proc do
|
150
150
|
set_value('a', 1)
|
151
151
|
set_value2('b'){ 2 }
|
152
152
|
assert(!self.respond_to?(:set_value2_inmixin))
|
153
|
-
Blockenspiel.invoke(proc do
|
153
|
+
::Blockenspiel.invoke(proc do
|
154
154
|
set_value('c', 1)
|
155
155
|
set_value2_inmixin('d'){ 2 }
|
156
156
|
end, Target2.new(hash_))
|
@@ -175,14 +175,14 @@ module Blockenspiel
|
|
175
175
|
# * Asserts that the methods are added and removed at the right time.
|
176
176
|
|
177
177
|
def test_nested_same
|
178
|
-
hash_ = Hash.new
|
178
|
+
hash_ = ::Hash.new
|
179
179
|
assert(!self.respond_to?(:set_value))
|
180
180
|
assert(!self.respond_to?(:set_value2))
|
181
181
|
assert(!self.respond_to?(:set_value2_inmixin))
|
182
|
-
Blockenspiel.invoke(proc do
|
182
|
+
::Blockenspiel.invoke(proc do
|
183
183
|
set_value('a', 1)
|
184
184
|
set_value2_inmixin('b'){ 2 }
|
185
|
-
Blockenspiel.invoke(proc do
|
185
|
+
::Blockenspiel.invoke(proc do
|
186
186
|
set_value('c', 1)
|
187
187
|
set_value2_inmixin('d'){ 2 }
|
188
188
|
assert(!self.respond_to?(:set_value2))
|
@@ -207,7 +207,7 @@ module Blockenspiel
|
|
207
207
|
# * Asserts that the mixin is removed only after the second thread is done.
|
208
208
|
|
209
209
|
def test_threads_same_mixin
|
210
|
-
hash_ = Hash.new
|
210
|
+
hash_ = ::Hash.new
|
211
211
|
block1_ = proc do
|
212
212
|
set_value('a', 1)
|
213
213
|
sleep(0.5)
|
@@ -219,11 +219,11 @@ module Blockenspiel
|
|
219
219
|
set_value2('d'){ 4 }
|
220
220
|
end
|
221
221
|
target_ = Target1.new(hash_)
|
222
|
-
thread1_ = Thread.new do
|
223
|
-
Blockenspiel.invoke(block1_, target_)
|
222
|
+
thread1_ = ::Thread.new do
|
223
|
+
::Blockenspiel.invoke(block1_, target_)
|
224
224
|
end
|
225
|
-
thread2_ = Thread.new do
|
226
|
-
Blockenspiel.invoke(block2_, target_)
|
225
|
+
thread2_ = ::Thread.new do
|
226
|
+
::Blockenspiel.invoke(block2_, target_)
|
227
227
|
end
|
228
228
|
thread1_.join
|
229
229
|
thread2_.join
|
metadata
CHANGED
@@ -1,77 +1,76 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
+
name: blockenspiel
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.2
|
5
|
+
platform: java
|
6
|
+
authors:
|
7
|
+
- Daniel Azuma
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-10-28 00:00:00 -07:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Blockenspiel is a helper library designed to make it easy to implement DSL blocks. It is designed to be comprehensive and robust, supporting most common usage patterns, and working correctly in the presence of nested blocks and multithreading.
|
17
|
+
email: dazuma@gmail.com
|
18
|
+
executables: []
|
19
|
+
|
2
20
|
extensions: []
|
3
21
|
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.rdoc
|
24
|
+
- History.rdoc
|
25
|
+
- ImplementingDSLblocks.rdoc
|
26
|
+
files:
|
27
|
+
- ext/blockenspiel/unmixer.c
|
28
|
+
- ext/blockenspiel/extconf.rb
|
29
|
+
- ext/blockenspiel/BlockenspielUnmixerService.java
|
30
|
+
- lib/blockenspiel.rb
|
31
|
+
- lib/blockenspiel/impl.rb
|
32
|
+
- lib/blockenspiel/version.rb
|
33
|
+
- tests/tc_basic.rb
|
34
|
+
- tests/tc_behaviors.rb
|
35
|
+
- tests/tc_dsl_methods.rb
|
36
|
+
- tests/tc_dynamic.rb
|
37
|
+
- tests/tc_mixins.rb
|
38
|
+
- History.rdoc
|
39
|
+
- ImplementingDSLblocks.rdoc
|
40
|
+
- README.rdoc
|
41
|
+
- Rakefile
|
42
|
+
- lib/blockenspiel_unmixer.jar
|
43
|
+
has_rdoc: true
|
4
44
|
homepage: http://virtuoso.rubyforge.org/blockenspiel
|
5
|
-
|
45
|
+
licenses: []
|
6
46
|
|
7
|
-
version: !ruby/object:Gem::Version
|
8
|
-
version: 0.2.1
|
9
47
|
post_install_message:
|
10
|
-
date: 2009-04-16 07:00:00 +00:00
|
11
|
-
files:
|
12
|
-
- ext/blockenspiel/unmixer.c
|
13
|
-
- ext/blockenspiel/extconf.rb
|
14
|
-
- ext/blockenspiel/BlockenspielUnmixerService.java
|
15
|
-
- lib/blockenspiel.rb
|
16
|
-
- lib/blockenspiel/impl.rb
|
17
|
-
- lib/blockenspiel/version.rb
|
18
|
-
- tests/tc_basic.rb
|
19
|
-
- tests/tc_behaviors.rb
|
20
|
-
- tests/tc_dsl_methods.rb
|
21
|
-
- tests/tc_dynamic.rb
|
22
|
-
- tests/tc_mixins.rb
|
23
|
-
- History.rdoc
|
24
|
-
- ImplementingDSLblocks.rdoc
|
25
|
-
- README.rdoc
|
26
|
-
- Rakefile
|
27
|
-
- lib/blockenspiel_unmixer.jar
|
28
|
-
rubygems_version: 1.3.1
|
29
48
|
rdoc_options: []
|
30
49
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
name: blockenspiel
|
35
|
-
has_rdoc: true
|
36
|
-
platform: java
|
37
|
-
summary: Blockenspiel is a helper library designed to make it easy to implement DSL
|
38
|
-
blocks.
|
39
|
-
default_executable:
|
40
|
-
bindir: bin
|
41
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
-
version:
|
43
|
-
requirements:
|
44
|
-
- - '>='
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: "0"
|
50
|
+
require_paths:
|
51
|
+
- lib
|
47
52
|
required_ruby_version: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 1.8.6
|
48
57
|
version:
|
58
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
59
|
requirements:
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
- lib
|
55
|
-
specification_version: 2
|
56
|
-
test_files:
|
57
|
-
- tests/tc_basic.rb
|
58
|
-
- tests/tc_behaviors.rb
|
59
|
-
- tests/tc_dsl_methods.rb
|
60
|
-
- tests/tc_dynamic.rb
|
61
|
-
- tests/tc_mixins.rb
|
62
|
-
dependencies: []
|
63
|
-
|
64
|
-
description: Blockenspiel is a helper library designed to make it easy to implement
|
65
|
-
DSL blocks. It is designed to be comprehensive and robust, supporting most common
|
66
|
-
usage patterns, and working correctly in the presence of nested blocks and multithreading.
|
67
|
-
email: dazuma@gmail.com
|
68
|
-
authors:
|
69
|
-
- Daniel Azuma
|
70
|
-
extra_rdoc_files:
|
71
|
-
- README.rdoc
|
72
|
-
- History.rdoc
|
73
|
-
- ImplementingDSLblocks.rdoc
|
60
|
+
- - ">="
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: "0"
|
63
|
+
version:
|
74
64
|
requirements: []
|
75
65
|
|
76
66
|
rubyforge_project: virtuoso
|
77
|
-
|
67
|
+
rubygems_version: 1.3.5
|
68
|
+
signing_key:
|
69
|
+
specification_version: 3
|
70
|
+
summary: Blockenspiel is a helper library designed to make it easy to implement DSL blocks.
|
71
|
+
test_files:
|
72
|
+
- tests/tc_basic.rb
|
73
|
+
- tests/tc_behaviors.rb
|
74
|
+
- tests/tc_dsl_methods.rb
|
75
|
+
- tests/tc_dynamic.rb
|
76
|
+
- tests/tc_mixins.rb
|