mzl 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mzl/thing.rb +2 -2
- data/lib/mzl/version.rb +1 -1
- data/spec/mzl_spec.rb +4 -0
- metadata +3 -3
data/lib/mzl/thing.rb
CHANGED
@@ -79,12 +79,12 @@ module Mzl
|
|
79
79
|
end
|
80
80
|
|
81
81
|
# instance method not class method!
|
82
|
-
def new(&block)
|
82
|
+
def new(*args, &block)
|
83
83
|
# we will need ourselves later
|
84
84
|
_self = self
|
85
85
|
|
86
86
|
# create an instance of subject
|
87
|
-
instance = subject.respond_to?(:mzl_orig_new) ? subject.mzl_orig_new : subject.new
|
87
|
+
instance = subject.respond_to?(:mzl_orig_new) ? subject.mzl_orig_new(*args) : subject.new(*args)
|
88
88
|
instance = block_given? ? exec(instance, &block) : instance
|
89
89
|
|
90
90
|
# Give the instance a mzl thing (_self)
|
data/lib/mzl/version.rb
CHANGED
data/spec/mzl_spec.rb
CHANGED
@@ -79,6 +79,10 @@ describe 'Class' do
|
|
79
79
|
klass.mzl.new.should be_a(klass)
|
80
80
|
end
|
81
81
|
|
82
|
+
it 'passes parameters to the original .new method' do
|
83
|
+
String.mzl.new("hello").should == "hello"
|
84
|
+
end
|
85
|
+
|
82
86
|
it 'sets self to the instance' do
|
83
87
|
catch(:instance) do
|
84
88
|
klass.mzl.new do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mzl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -49,7 +49,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
49
49
|
version: '0'
|
50
50
|
segments:
|
51
51
|
- 0
|
52
|
-
hash:
|
52
|
+
hash: 3004095836719219579
|
53
53
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
54
54
|
none: false
|
55
55
|
requirements:
|
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
58
|
version: '0'
|
59
59
|
segments:
|
60
60
|
- 0
|
61
|
-
hash:
|
61
|
+
hash: 3004095836719219579
|
62
62
|
requirements: []
|
63
63
|
rubyforge_project:
|
64
64
|
rubygems_version: 1.8.24
|