meta_missing 0.2.0 → 0.3.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 +4 -4
- data/README.md +1 -1
- data/VERSION +1 -1
- data/lib/meta_missing.rb +4 -2
- data/meta_missing.gemspec +3 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e1e7534661e70eb500df545d48ba093c4438d78
|
4
|
+
data.tar.gz: 170949c33f4683210dc303350508c02347ce2d89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1af7a8970ff7f4fbb90971f248fa8f1f0e3e95e2f2689eb2040f0553bfe166aa83f495b5524c78c4ace7eba8254f9cd1e4e1eca63fe515a552652327dfce17e
|
7
|
+
data.tar.gz: b0b5dbecb343f74721e38ba7ddb7be42dbc938b64dcc55afb90aa3a7cbc2f9bf4168f8d2148b1b3a844f51fdf9f09da50f699ac1cba7b1eaf4949603556ab89c
|
data/README.md
CHANGED
@@ -19,7 +19,7 @@
|
|
19
19
|
> AnimalFarm.new.mecha_pony(1, 2, 3) { 4 }
|
20
20
|
> AnimalFarm.new.kitties
|
21
21
|
|
22
|
-
#=> [#<AnimalFarm:
|
22
|
+
#=> [#<AnimalFarm:0x007fbfc08c5bb8>, #<MatchData "pony">, :mecha_pony, [1, 2, 3], true, #<Proc:0x007fbfc08c5b40@(pry)>, 4]
|
23
23
|
#=> ["Meow meow meow", false]
|
24
24
|
|
25
25
|
### Contrast this with:
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/meta_missing.rb
CHANGED
@@ -33,20 +33,22 @@ module MetaMissing
|
|
33
33
|
|
34
34
|
def method_missing(name, *args, &block)
|
35
35
|
if handler = method_handlers.find { |handler| handler[:regexp] =~ name.to_s }
|
36
|
+
match = name.to_s.match(handler[:regexp])
|
37
|
+
|
36
38
|
if block_given?
|
37
39
|
class_eval do
|
38
40
|
alias_method :orig_block_given?, :block_given?
|
39
41
|
def block_given?; true; end
|
40
42
|
end
|
41
43
|
|
42
|
-
MetaMissing.bind(handler[:block], self)[
|
44
|
+
MetaMissing.bind(handler[:block], self)[match, name, *args, &block].tap do
|
43
45
|
class_eval do
|
44
46
|
alias_method :block_given?, :orig_block_given?
|
45
47
|
remove_method :orig_block_given?
|
46
48
|
end
|
47
49
|
end
|
48
50
|
else
|
49
|
-
instance_exec(
|
51
|
+
instance_exec(match, name, *args, &handler[:block])
|
50
52
|
end
|
51
53
|
else super end
|
52
54
|
end
|
data/meta_missing.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: meta_missing 0.
|
5
|
+
# stub: meta_missing 0.3.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "meta_missing"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.3.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
]
|
32
32
|
s.homepage = "http://github.com/evansenter/meta_missing"
|
33
33
|
s.licenses = ["MIT"]
|
34
|
-
s.rubygems_version = "2.
|
34
|
+
s.rubygems_version = "2.2.2"
|
35
35
|
s.summary = "Handle method_missing with ease"
|
36
36
|
|
37
37
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meta_missing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan Senter
|
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
124
|
version: '0'
|
125
125
|
requirements: []
|
126
126
|
rubyforge_project:
|
127
|
-
rubygems_version: 2.
|
127
|
+
rubygems_version: 2.2.2
|
128
128
|
signing_key:
|
129
129
|
specification_version: 4
|
130
130
|
summary: Handle method_missing with ease
|