paramix 2.0.0 → 2.0.1
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/.ruby +42 -0
- data/.yardopts +6 -0
- data/COPYING.rdoc +31 -0
- data/HISTORY.rdoc +16 -5
- data/QED.rdoc +206 -0
- data/README.md +53 -0
- data/lib/paramix.rb +6 -3
- data/lib/paramix/version.rb +3 -0
- data/qed/01_basic.rdoc +87 -0
- data/qed/02_general.rdoc +87 -0
- data/qed/03_battery.rdoc +29 -0
- data/spec/nested_spec.rb +229 -0
- data/spec/paramix_dynamic_spec.rb +48 -0
- data/spec/paramix_extend_spec.rb +21 -0
- data/spec/paramix_include_spec.rb +44 -0
- data/{test/test_paramix_namespace.rb → spec/paramix_namespace_spec.rb} +5 -9
- metadata +73 -79
- data/LICENSE +0 -23
- data/README.rdoc +0 -49
- data/Syckfile +0 -87
- data/meta/authors +0 -1
- data/meta/collection +0 -1
- data/meta/contact +0 -1
- data/meta/created +0 -1
- data/meta/description +0 -1
- data/meta/homepage +0 -1
- data/meta/license +0 -1
- data/meta/name +0 -1
- data/meta/repository +0 -1
- data/meta/resources/homepage +0 -1
- data/meta/resources/repository +0 -1
- data/meta/summary +0 -1
- data/meta/title +0 -1
- data/meta/version +0 -1
- data/test/nested/test_nested_both.rb +0 -56
- data/test/nested/test_nested_bottom.rb +0 -55
- data/test/nested/test_nested_moot.rb +0 -48
- data/test/nested/test_nested_simple.rb +0 -41
- data/test/nested/test_nested_top.rb +0 -56
- data/test/test_paramix_callback.rb +0 -66
- data/test/test_paramix_extend.rb +0 -39
- data/test/test_paramix_include.rb +0 -39
@@ -1,9 +1,6 @@
|
|
1
1
|
require 'paramix'
|
2
|
-
require 'test/unit'
|
3
2
|
|
4
|
-
|
5
|
-
|
6
|
-
# -- fixture ------------------------------
|
3
|
+
describe "namespace depth does not adversly effect parametric mixins" do
|
7
4
|
|
8
5
|
module N
|
9
6
|
module M
|
@@ -25,14 +22,13 @@ class TC_Paramix_Namespace < Test::Unit::TestCase
|
|
25
22
|
end
|
26
23
|
end
|
27
24
|
|
28
|
-
# -- tests --------------------------------
|
29
25
|
|
30
|
-
|
31
|
-
|
26
|
+
it "should" do
|
27
|
+
Q::I.new.f == "mosh"
|
32
28
|
end
|
33
29
|
|
34
|
-
|
35
|
-
|
30
|
+
it "should" do
|
31
|
+
Q::E.f.should == "many"
|
36
32
|
end
|
37
33
|
|
38
34
|
end
|
metadata
CHANGED
@@ -1,98 +1,92 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: paramix
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 2
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
version: 2.0.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.0.1
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Thomas Sawyer
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
12
|
+
date: 2011-10-23 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: detroit
|
16
|
+
requirement: &10137240 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *10137240
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: qed
|
27
|
+
requirement: &10135940 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *10135940
|
21
36
|
description: Parametric Mixins provides parameters for mixin modules.
|
22
|
-
email:
|
37
|
+
email:
|
38
|
+
- transfire@gmail.com
|
23
39
|
executables: []
|
24
|
-
|
25
40
|
extensions: []
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
41
|
+
extra_rdoc_files:
|
42
|
+
- HISTORY.rdoc
|
43
|
+
- QED.rdoc
|
44
|
+
- COPYING.rdoc
|
45
|
+
- README.md
|
46
|
+
files:
|
47
|
+
- .ruby
|
48
|
+
- .yardopts
|
49
|
+
- lib/paramix/version.rb
|
30
50
|
- lib/paramix.rb
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
34
|
-
-
|
35
|
-
-
|
36
|
-
-
|
37
|
-
-
|
38
|
-
-
|
39
|
-
- meta/repository
|
40
|
-
- meta/resources/homepage
|
41
|
-
- meta/resources/repository
|
42
|
-
- meta/summary
|
43
|
-
- meta/title
|
44
|
-
- meta/version
|
45
|
-
- test/nested/test_nested_both.rb
|
46
|
-
- test/nested/test_nested_bottom.rb
|
47
|
-
- test/nested/test_nested_moot.rb
|
48
|
-
- test/nested/test_nested_simple.rb
|
49
|
-
- test/nested/test_nested_top.rb
|
50
|
-
- test/test_paramix_callback.rb
|
51
|
-
- test/test_paramix_extend.rb
|
52
|
-
- test/test_paramix_include.rb
|
53
|
-
- test/test_paramix_namespace.rb
|
51
|
+
- qed/01_basic.rdoc
|
52
|
+
- qed/02_general.rdoc
|
53
|
+
- qed/03_battery.rdoc
|
54
|
+
- spec/nested_spec.rb
|
55
|
+
- spec/paramix_dynamic_spec.rb
|
56
|
+
- spec/paramix_extend_spec.rb
|
57
|
+
- spec/paramix_include_spec.rb
|
58
|
+
- spec/paramix_namespace_spec.rb
|
54
59
|
- HISTORY.rdoc
|
55
|
-
-
|
56
|
-
- README.
|
57
|
-
-
|
58
|
-
has_rdoc: true
|
60
|
+
- QED.rdoc
|
61
|
+
- README.md
|
62
|
+
- COPYING.rdoc
|
59
63
|
homepage: http://rubyworks.github.com/paramix
|
60
64
|
licenses: []
|
61
|
-
|
62
65
|
post_install_message:
|
63
|
-
rdoc_options:
|
64
|
-
|
65
|
-
- Paramix API
|
66
|
-
require_paths:
|
66
|
+
rdoc_options: []
|
67
|
+
require_paths:
|
67
68
|
- lib
|
68
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
requirements:
|
77
|
-
- -
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
|
80
|
-
- 0
|
81
|
-
version: "0"
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ! '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
82
81
|
requirements: []
|
83
|
-
|
84
|
-
|
85
|
-
rubygems_version: 1.3.6.pre.3
|
82
|
+
rubyforge_project:
|
83
|
+
rubygems_version: 1.8.10
|
86
84
|
signing_key:
|
87
85
|
specification_version: 3
|
88
86
|
summary: Parametric Mixins
|
89
|
-
test_files:
|
90
|
-
-
|
91
|
-
-
|
92
|
-
-
|
93
|
-
-
|
94
|
-
-
|
95
|
-
- test/test_paramix_callback.rb
|
96
|
-
- test/test_paramix_extend.rb
|
97
|
-
- test/test_paramix_include.rb
|
98
|
-
- test/test_paramix_namespace.rb
|
87
|
+
test_files:
|
88
|
+
- spec/paramix_extend_spec.rb
|
89
|
+
- spec/paramix_namespace_spec.rb
|
90
|
+
- spec/paramix_dynamic_spec.rb
|
91
|
+
- spec/paramix_include_spec.rb
|
92
|
+
- spec/nested_spec.rb
|
data/LICENSE
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
The MIT License
|
2
|
-
|
3
|
-
Copyright (c) 2009 Peter Vanbroekhoven & Thomas Sawyer
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
7
|
-
in the Software without restriction, including without limitation the rights
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
10
|
-
furnished to do so, subject to the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
THE SOFTWARE.
|
22
|
-
|
23
|
-
|
data/README.rdoc
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
= Paramix
|
2
|
-
|
3
|
-
* home: http://rubyworks.github.com/paramix
|
4
|
-
* work: http://github.com/rubyworks/paramix
|
5
|
-
|
6
|
-
|
7
|
-
== DESCRIPTION
|
8
|
-
|
9
|
-
Parametric Mixins provides an easy means to "functionalize" modules.
|
10
|
-
The module can then be differentiated upon usage according to the
|
11
|
-
parameters provided.
|
12
|
-
|
13
|
-
|
14
|
-
== RELEASE NOTES
|
15
|
-
|
16
|
-
Please see HISTORY.rdoc file.
|
17
|
-
|
18
|
-
|
19
|
-
== EXAMPLE
|
20
|
-
|
21
|
-
Here is a simple example that uses a a parameter
|
22
|
-
to define a method and another parameter to define
|
23
|
-
it's return value.
|
24
|
-
|
25
|
-
module M
|
26
|
-
include Paramix::Parametric
|
27
|
-
|
28
|
-
paramaterized do |params|
|
29
|
-
define_method params[:name] do
|
30
|
-
params[:value]
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
class X
|
36
|
-
include M[:name=>'foo', :value='bar']
|
37
|
-
end
|
38
|
-
|
39
|
-
X.new.foo #=> 'bar'
|
40
|
-
|
41
|
-
|
42
|
-
== COPYRIGHTS
|
43
|
-
|
44
|
-
Copyright (c) 2006,2010 Thomas Sawyer
|
45
|
-
|
46
|
-
This program is ditributed unser the terms of the MIT license.
|
47
|
-
|
48
|
-
See LICENSE file for details.
|
49
|
-
|
data/Syckfile
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
---
|
2
|
-
announce:
|
3
|
-
service : Email
|
4
|
-
file : ~
|
5
|
-
subject : ~
|
6
|
-
mailto : ruby-talk@ruby-lang.org
|
7
|
-
active : true
|
8
|
-
|
9
|
-
grancher:
|
10
|
-
service: grancher
|
11
|
-
active: true
|
12
|
-
|
13
|
-
box:
|
14
|
-
service: Box
|
15
|
-
types : [gem, tar]
|
16
|
-
active : true
|
17
|
-
|
18
|
-
mast:
|
19
|
-
service: Mast
|
20
|
-
include: [bin, demo, lib, meta, test, "[A-Z]*"]
|
21
|
-
exclude: ~
|
22
|
-
active: true
|
23
|
-
|
24
|
-
rdoc:
|
25
|
-
service : RDoc
|
26
|
-
template : redfish
|
27
|
-
include : ~
|
28
|
-
exclude : ~
|
29
|
-
main : ~
|
30
|
-
extra : ~
|
31
|
-
active : true
|
32
|
-
|
33
|
-
ridoc:
|
34
|
-
service: RIDoc
|
35
|
-
include: ~
|
36
|
-
exclude: ~
|
37
|
-
active : true
|
38
|
-
|
39
|
-
notes:
|
40
|
-
service : DNotes
|
41
|
-
loadpath : ~
|
42
|
-
labels : ~
|
43
|
-
output : ~
|
44
|
-
format : ~
|
45
|
-
active : false
|
46
|
-
|
47
|
-
stats:
|
48
|
-
service : Stats
|
49
|
-
title : ~
|
50
|
-
loadpath : ~
|
51
|
-
exclude : ~
|
52
|
-
output : ~
|
53
|
-
active : true
|
54
|
-
|
55
|
-
testrb:
|
56
|
-
service : testrb
|
57
|
-
tests : ~
|
58
|
-
exclude : ~
|
59
|
-
loadpath : ~
|
60
|
-
requires : ~
|
61
|
-
live : false
|
62
|
-
active : true
|
63
|
-
|
64
|
-
syntax:
|
65
|
-
service : Syntax
|
66
|
-
loadpath : ~
|
67
|
-
exclude : ~
|
68
|
-
active : false
|
69
|
-
|
70
|
-
vclog:
|
71
|
-
service : VClog
|
72
|
-
format : html # xml, txt
|
73
|
-
layout : rel # gnu
|
74
|
-
typed : false
|
75
|
-
output : ~
|
76
|
-
active : false
|
77
|
-
|
78
|
-
|
79
|
-
#rubyforge:
|
80
|
-
# service : Rubyforge
|
81
|
-
# unixname: <%= project %>
|
82
|
-
# groupid : ~
|
83
|
-
# package : <%= package %>
|
84
|
-
# sitemap:
|
85
|
-
# doc/rdoc: <%= package %>
|
86
|
-
# active : false
|
87
|
-
|
data/meta/authors
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Thomas Sawyer
|
data/meta/collection
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
rubyworks
|
data/meta/contact
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
trans <transfire@gmail.com>
|
data/meta/created
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2006-01-01
|
data/meta/description
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Parametric Mixins provides parameters for mixin modules.
|
data/meta/homepage
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
http://rubyworks.github.com/paramix
|
data/meta/license
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
LPGLv3
|
data/meta/name
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
paramix
|
data/meta/repository
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
git://github.com/rubyworks/paramix.git
|
data/meta/resources/homepage
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
http://rubyworks.github.com/paramix
|
data/meta/resources/repository
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
git://github.com/rubyworks/paramix.git
|
data/meta/summary
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Parametric Mixins
|
data/meta/title
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Paramix
|
data/meta/version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.0.0
|
@@ -1,56 +0,0 @@
|
|
1
|
-
require 'paramix'
|
2
|
-
require 'test/unit'
|
3
|
-
|
4
|
-
class TC_Paramix_Nested_Both < Test::Unit::TestCase
|
5
|
-
|
6
|
-
# -- fixture ------------------------------
|
7
|
-
|
8
|
-
module M
|
9
|
-
include Paramix::Parametric
|
10
|
-
|
11
|
-
parameterized do |params|
|
12
|
-
public :f do
|
13
|
-
params[:p]
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
module N
|
19
|
-
include Paramix::Parametric
|
20
|
-
include M[:p=>"NMp"]
|
21
|
-
|
22
|
-
parameterized do |params|
|
23
|
-
public :g do
|
24
|
-
params[:p]
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
class I
|
30
|
-
include N[:p => "INp"]
|
31
|
-
end
|
32
|
-
|
33
|
-
class E
|
34
|
-
extend N[:p => "ENp"]
|
35
|
-
end
|
36
|
-
|
37
|
-
# -- tests --------------------------------
|
38
|
-
|
39
|
-
def test_include_f
|
40
|
-
assert_equal( "NMp", I.new.f )
|
41
|
-
end
|
42
|
-
|
43
|
-
def test_include_g
|
44
|
-
assert_equal( "INp", I.new.g )
|
45
|
-
end
|
46
|
-
|
47
|
-
def test_extend_f
|
48
|
-
assert_equal( "NMp", E.f )
|
49
|
-
end
|
50
|
-
|
51
|
-
def test_extend_g
|
52
|
-
assert_equal( "ENp", E.g )
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
56
|
-
|