peachy 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,7 @@ require File.join(File.dirname(__FILE__), 'peachy/convention_checks')
8
8
  require File.join(File.dirname(__FILE__), 'peachy/string_styler')
9
9
  require File.join(File.dirname(__FILE__), 'peachy/method_name')
10
10
  require File.join(File.dirname(__FILE__), 'peachy/method_mask')
11
+ require File.join(File.dirname(__FILE__), 'peachy/mimic')
11
12
  require File.join(File.dirname(__FILE__), 'peachy/morph_into_array')
12
13
  require File.join(File.dirname(__FILE__), 'peachy/my_meta_class')
13
14
  require File.join(File.dirname(__FILE__), 'peachy/xml_node')
@@ -0,0 +1,7 @@
1
+ module Peachy
2
+ module Mimic
3
+ def method_missing method_name, *args, &block
4
+ @mimicked.send(method_name, *args, &block)
5
+ end
6
+ end
7
+ end
@@ -10,13 +10,8 @@ module Peachy
10
10
  end
11
11
 
12
12
  def mimic object_to_mimic
13
- eval_on_singleton_class do
14
- # NetBeans complains about this syntax, but it's fine.
15
- define_method(:method_missing) do |method_name, *args, &block|
16
- puts "[Peachy::Proxy] #{node_name} can only do '#{method_name}' with '#{args}' if an Array can. You see, really, #{node_name} is an array now." if Peachy.whiny?
17
- return object_to_mimic.send(method_name, *args, &block)
18
- end
19
- end
13
+ @mimicked = object_to_mimic
14
+ eval_on_singleton_class { include Mimic }
20
15
  end
21
16
 
22
17
  def morph_into_array to_add_to_array, method_to_invoke, *args, &block
@@ -1,6 +1,5 @@
1
1
  module Peachy
2
2
  class Proxy
3
- alias_method :original_method_missing, :method_missing
4
3
  extend MethodMask
5
4
  include ConventionChecks, MorphIntoArray, MyMetaClass, XmlNode
6
5
 
@@ -69,7 +68,7 @@ module Peachy
69
68
  end
70
69
 
71
70
  # standard method_missing for any other call with arguments or a block
72
- original_method_missing method_name, args if args.any? or block_given?
71
+ super if args.any? or block_given?
73
72
 
74
73
  # try to create a method for the element
75
74
  child_proxy = generate_method_for_xml(MethodName.new(method_name))
@@ -1,3 +1,3 @@
1
1
  module Peachy
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 0
9
- version: 0.3.0
8
+ - 1
9
+ version: 0.3.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - NJ Pearman
@@ -35,6 +35,7 @@ files:
35
35
  - lib/peachy/convention_checks.rb
36
36
  - lib/peachy/childless_proxy_with_attributes.rb
37
37
  - lib/peachy/method_name.rb
38
+ - lib/peachy/mimic.rb
38
39
  - lib/peachy/method_mask.rb
39
40
  - lib/peachy/proxy_factory.rb
40
41
  - lib/peachy/simple_content.rb
@@ -92,10 +93,8 @@ required_ruby_version: !ruby/object:Gem::Requirement
92
93
  - - ">="
93
94
  - !ruby/object:Gem::Version
94
95
  segments:
95
- - 1
96
- - 8
97
- - 7
98
- version: 1.8.7
96
+ - 0
97
+ version: "0"
99
98
  required_rubygems_version: !ruby/object:Gem::Requirement
100
99
  requirements:
101
100
  - - ">="