blockenspiel 0.4.5 → 0.5.0
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.
- checksums.yaml +7 -0
- data/Blockenspiel.rdoc +48 -42
- data/History.rdoc +14 -0
- data/README.rdoc +20 -19
- data/Version +1 -1
- data/lib/blockenspiel.rb +2 -2
- data/lib/blockenspiel/builder.rb +1 -1
- data/lib/blockenspiel/dsl_setup.rb +1 -1
- data/lib/blockenspiel/errors.rb +1 -1
- data/lib/blockenspiel/impl.rb +60 -48
- data/lib/blockenspiel/unmixer_rubinius.rb +18 -3
- data/lib/blockenspiel/unmixer_unimplemented.rb +4 -1
- data/lib/blockenspiel/version.rb +1 -1
- data/lib/blockenspiel/versionomy.rb +1 -1
- data/lib/blockenspiel_unmixer_jruby.jar +0 -0
- data/test/tc_basic.rb +9 -8
- data/test/tc_behaviors.rb +9 -9
- data/test/tc_dsl_attrs.rb +2 -2
- data/test/tc_dsl_methods.rb +10 -10
- data/test/tc_dynamic.rb +5 -5
- data/test/tc_embedded_block.rb +2 -2
- data/test/tc_mixins.rb +40 -22
- data/test/tc_modules.rb +3 -3
- data/test/tc_version.rb +3 -3
- metadata +17 -21
- data/ext/unmixer_mri/extconf.rb +0 -47
- data/ext/unmixer_mri/unmixer_mri.c +0 -103
data/test/tc_modules.rb
CHANGED
@@ -36,14 +36,14 @@
|
|
36
36
|
;
|
37
37
|
|
38
38
|
|
39
|
-
require '
|
39
|
+
require 'minitest/autorun'
|
40
40
|
require 'blockenspiel'
|
41
41
|
|
42
42
|
|
43
43
|
module Blockenspiel
|
44
44
|
module Tests # :nodoc:
|
45
45
|
|
46
|
-
class
|
46
|
+
class TestModules < ::Minitest::Test # :nodoc:
|
47
47
|
|
48
48
|
|
49
49
|
class Target1
|
@@ -143,7 +143,7 @@ module Blockenspiel
|
|
143
143
|
set_value(:a, 1)
|
144
144
|
assert(!self.respond_to?(:_helper_method))
|
145
145
|
assert_equal(:helper, get_value(:a))
|
146
|
-
|
146
|
+
assert_raises(::NoMethodError) do
|
147
147
|
get_value2(:a)
|
148
148
|
end
|
149
149
|
end
|
data/test/tc_version.rb
CHANGED
@@ -36,20 +36,20 @@
|
|
36
36
|
;
|
37
37
|
|
38
38
|
|
39
|
-
require '
|
39
|
+
require 'minitest/autorun'
|
40
40
|
require 'blockenspiel'
|
41
41
|
|
42
42
|
|
43
43
|
module Blockenspiel
|
44
44
|
module Tests # :nodoc:
|
45
45
|
|
46
|
-
class TestVersion < ::Test
|
46
|
+
class TestVersion < ::Minitest::Test # :nodoc:
|
47
47
|
|
48
48
|
|
49
49
|
# Test that the version autoload works.
|
50
50
|
|
51
51
|
def test_version
|
52
|
-
|
52
|
+
refute_nil(::Blockenspiel::VERSION)
|
53
53
|
end
|
54
54
|
|
55
55
|
|
metadata
CHANGED
@@ -1,29 +1,33 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blockenspiel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Daniel Azuma
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2016-01-07 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Blockenspiel is a helper library designed to make it easy to implement
|
15
14
|
DSL blocks. It is designed to be comprehensive and robust, supporting most common
|
16
15
|
usage patterns, and working correctly in the presence of nested blocks and multithreading.
|
17
16
|
email: dazuma@gmail.com
|
18
17
|
executables: []
|
19
|
-
extensions:
|
20
|
-
- ext/unmixer_mri/extconf.rb
|
18
|
+
extensions: []
|
21
19
|
extra_rdoc_files:
|
22
20
|
- Blockenspiel.rdoc
|
23
21
|
- History.rdoc
|
24
22
|
- ImplementingDSLblocks.rdoc
|
25
23
|
- README.rdoc
|
26
24
|
files:
|
25
|
+
- Blockenspiel.rdoc
|
26
|
+
- History.rdoc
|
27
|
+
- ImplementingDSLblocks.rdoc
|
28
|
+
- README.rdoc
|
29
|
+
- Version
|
30
|
+
- lib/blockenspiel.rb
|
27
31
|
- lib/blockenspiel/builder.rb
|
28
32
|
- lib/blockenspiel/dsl_setup.rb
|
29
33
|
- lib/blockenspiel/errors.rb
|
@@ -32,10 +36,7 @@ files:
|
|
32
36
|
- lib/blockenspiel/unmixer_unimplemented.rb
|
33
37
|
- lib/blockenspiel/version.rb
|
34
38
|
- lib/blockenspiel/versionomy.rb
|
35
|
-
- lib/blockenspiel.rb
|
36
39
|
- lib/blockenspiel_unmixer_jruby.jar
|
37
|
-
- ext/unmixer_mri/unmixer_mri.c
|
38
|
-
- ext/unmixer_mri/extconf.rb
|
39
40
|
- test/files/file1.rb
|
40
41
|
- test/tc_basic.rb
|
41
42
|
- test/tc_behaviors.rb
|
@@ -46,34 +47,29 @@ files:
|
|
46
47
|
- test/tc_mixins.rb
|
47
48
|
- test/tc_modules.rb
|
48
49
|
- test/tc_version.rb
|
49
|
-
- Blockenspiel.rdoc
|
50
|
-
- History.rdoc
|
51
|
-
- ImplementingDSLblocks.rdoc
|
52
|
-
- README.rdoc
|
53
|
-
- Version
|
54
50
|
homepage: http://dazuma.github.com/blockenspiel
|
55
|
-
licenses:
|
51
|
+
licenses:
|
52
|
+
- BSD-3-Clause
|
53
|
+
metadata: {}
|
56
54
|
post_install_message:
|
57
55
|
rdoc_options: []
|
58
56
|
require_paths:
|
59
57
|
- lib
|
60
58
|
required_ruby_version: !ruby/object:Gem::Requirement
|
61
|
-
none: false
|
62
59
|
requirements:
|
63
|
-
- -
|
60
|
+
- - ">="
|
64
61
|
- !ruby/object:Gem::Version
|
65
|
-
version: 1.
|
62
|
+
version: 1.9.3
|
66
63
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
-
none: false
|
68
64
|
requirements:
|
69
|
-
- -
|
65
|
+
- - ">"
|
70
66
|
- !ruby/object:Gem::Version
|
71
67
|
version: 1.3.1
|
72
68
|
requirements: []
|
73
69
|
rubyforge_project: virtuoso
|
74
|
-
rubygems_version:
|
70
|
+
rubygems_version: 2.5.1
|
75
71
|
signing_key:
|
76
|
-
specification_version:
|
72
|
+
specification_version: 4
|
77
73
|
summary: Blockenspiel is a helper library designed to make it easy to implement DSL
|
78
74
|
blocks.
|
79
75
|
test_files:
|
data/ext/unmixer_mri/extconf.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
# -----------------------------------------------------------------------------
|
2
|
-
#
|
3
|
-
# Blockenspiel native library builder
|
4
|
-
#
|
5
|
-
# -----------------------------------------------------------------------------
|
6
|
-
# Copyright 2010-2011 Daniel Azuma
|
7
|
-
#
|
8
|
-
# All rights reserved.
|
9
|
-
#
|
10
|
-
# Redistribution and use in source and binary forms, with or without
|
11
|
-
# modification, are permitted provided that the following conditions are met:
|
12
|
-
#
|
13
|
-
# * Redistributions of source code must retain the above copyright notice,
|
14
|
-
# this list of conditions and the following disclaimer.
|
15
|
-
# * Redistributions in binary form must reproduce the above copyright notice,
|
16
|
-
# this list of conditions and the following disclaimer in the documentation
|
17
|
-
# and/or other materials provided with the distribution.
|
18
|
-
# * Neither the name of the copyright holder, nor the names of any other
|
19
|
-
# contributors to this software, may be used to endorse or promote products
|
20
|
-
# derived from this software without specific prior written permission.
|
21
|
-
#
|
22
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
23
|
-
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
24
|
-
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
25
|
-
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
26
|
-
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
27
|
-
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
28
|
-
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
29
|
-
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
30
|
-
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
31
|
-
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
32
|
-
# POSSIBILITY OF SUCH DAMAGE.
|
33
|
-
# -----------------------------------------------------------------------------
|
34
|
-
;
|
35
|
-
|
36
|
-
|
37
|
-
if ::RUBY_DESCRIPTION =~ /^jruby\s/
|
38
|
-
|
39
|
-
::File.open('Makefile', 'w'){ |f_| f_.write(".PHONY: install\ninstall:\n") }
|
40
|
-
|
41
|
-
else
|
42
|
-
|
43
|
-
require 'mkmf'
|
44
|
-
have_header('ruby/backward/classext.h')
|
45
|
-
create_makefile 'blockenspiel/unmixer_mri'
|
46
|
-
|
47
|
-
end
|
@@ -1,103 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
-----------------------------------------------------------------------------
|
3
|
-
|
4
|
-
Blockenspiel unmixer (MRI implementation)
|
5
|
-
|
6
|
-
-----------------------------------------------------------------------------
|
7
|
-
Copyright 2008-2011 Daniel Azuma
|
8
|
-
|
9
|
-
All rights reserved.
|
10
|
-
|
11
|
-
Redistribution and use in source and binary forms, with or without
|
12
|
-
modification, are permitted provided that the following conditions are met:
|
13
|
-
|
14
|
-
* Redistributions of source code must retain the above copyright notice,
|
15
|
-
this list of conditions and the following disclaimer.
|
16
|
-
* Redistributions in binary form must reproduce the above copyright notice,
|
17
|
-
this list of conditions and the following disclaimer in the documentation
|
18
|
-
and/or other materials provided with the distribution.
|
19
|
-
* Neither the name of the copyright holder, nor the names of any other
|
20
|
-
contributors to this software, may be used to endorse or promote products
|
21
|
-
derived from this software without specific prior written permission.
|
22
|
-
|
23
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
24
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
25
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
26
|
-
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
27
|
-
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
28
|
-
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
29
|
-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
30
|
-
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
31
|
-
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
32
|
-
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
33
|
-
POSSIBILITY OF SUCH DAMAGE.
|
34
|
-
-----------------------------------------------------------------------------
|
35
|
-
*/
|
36
|
-
|
37
|
-
|
38
|
-
/*
|
39
|
-
This implementation based on Mixology 0.1,
|
40
|
-
written by Patrick Farley, anonymous z, Dan Manges, and Clint Bishop.
|
41
|
-
http://rubyforge.org/projects/mixology
|
42
|
-
http://github.com/dan-manges/mixology/tree/master
|
43
|
-
|
44
|
-
It has been stripped down and modified for compatibility with Ruby 1.9.
|
45
|
-
|
46
|
-
Note that this C extension is specific to MRI.
|
47
|
-
*/
|
48
|
-
|
49
|
-
|
50
|
-
#include <ruby.h>
|
51
|
-
|
52
|
-
/* Support for ruby >= 1.9.3 that deprecates RCLASS_SUPER */
|
53
|
-
#ifdef HAVE_RUBY_BACKWARD_CLASSEXT_H
|
54
|
-
#include <ruby/backward/classext.h>
|
55
|
-
#endif
|
56
|
-
|
57
|
-
/* Support for pre-1.9 rubies that don't provide RCLASS_SUPER */
|
58
|
-
#ifndef RCLASS_SUPER
|
59
|
-
#define RCLASS_SUPER(c) (RCLASS(c)->super)
|
60
|
-
#endif
|
61
|
-
|
62
|
-
|
63
|
-
#ifndef RUBINIUS
|
64
|
-
|
65
|
-
|
66
|
-
static void remove_nested_module(VALUE klass, VALUE module) {
|
67
|
-
if (CLASS_OF(RCLASS_SUPER(klass)) == CLASS_OF(RCLASS_SUPER(module))) {
|
68
|
-
if (RCLASS_SUPER(RCLASS_SUPER(module)) && BUILTIN_TYPE(RCLASS_SUPER(module)) == T_ICLASS) {
|
69
|
-
remove_nested_module(RCLASS_SUPER(klass), RCLASS_SUPER(module));
|
70
|
-
}
|
71
|
-
RCLASS_SUPER(klass) = RCLASS_SUPER(RCLASS_SUPER(klass));
|
72
|
-
}
|
73
|
-
}
|
74
|
-
|
75
|
-
|
76
|
-
static VALUE do_unmix(VALUE self, VALUE receiver, VALUE module) {
|
77
|
-
VALUE klass = CLASS_OF(receiver);
|
78
|
-
while (klass != rb_class_real(klass)) {
|
79
|
-
VALUE super = RCLASS_SUPER(klass);
|
80
|
-
if (BUILTIN_TYPE(super) == T_ICLASS && CLASS_OF(super) == module) {
|
81
|
-
if (RCLASS_SUPER(module) && BUILTIN_TYPE(RCLASS_SUPER(module)) == T_ICLASS) {
|
82
|
-
remove_nested_module(super, module);
|
83
|
-
}
|
84
|
-
RCLASS_SUPER(klass) = RCLASS_SUPER(super);
|
85
|
-
rb_clear_cache();
|
86
|
-
}
|
87
|
-
klass = super;
|
88
|
-
}
|
89
|
-
return receiver;
|
90
|
-
}
|
91
|
-
|
92
|
-
|
93
|
-
#endif
|
94
|
-
|
95
|
-
|
96
|
-
void Init_unmixer_mri() {
|
97
|
-
#ifndef RUBINIUS
|
98
|
-
|
99
|
-
VALUE container = rb_singleton_class(rb_define_module_under(rb_define_module("Blockenspiel"), "Unmixer"));
|
100
|
-
rb_define_method(container, "unmix", do_unmix, 2);
|
101
|
-
|
102
|
-
#endif
|
103
|
-
}
|