ripar 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a368f23a0b937bf21305f5267722f443ede2e71f
4
- data.tar.gz: cbc4f90137156069b8c59e3aeaf91f43ff4702ef
3
+ metadata.gz: 6b01bc5af736ac56ae5e2bb456fe291fad402f36
4
+ data.tar.gz: 00546f076c94b527597006ae6b1b0a38d706277e
5
5
  SHA512:
6
- metadata.gz: 27d5c711a65ce3f83eb3316e1b9f65675ab76532b6ea0a242419f86939f5703e0f84d501bf86e874e5ac9abd420bcde70ebacbb59885a4af7e1b1ad33f93d327
7
- data.tar.gz: 6dcd0917641a94ed792dfd608cdf1106d94543184bfd21be1aec954835c02616f1cb866ebda1cbc57338a63022a0da83906b9bb3d3e62e1573ae77038c3bd970
6
+ metadata.gz: 10398f5c038672aad9ef581aea3711ee85fee643388f7f064606b24b613bf1c166d7c63ab04a140b16066c989d174bf24b2122316644ecd399d5eef02b82c744
7
+ data.tar.gz: 807a2d4a65fcae43460ccf2380a9dc2ccfc33b88fe72c795173ebce957681b611c52e3dc46038635359f6f9b042b566d32163be95c6e91adbff753117a3418c9
@@ -68,7 +68,7 @@ class Ripar::Roller < BasicObject
68
68
  # no point in using respond_to_missing?, because that's part of Object#respond_to,
69
69
  # not BasicObject
70
70
  def respond_to?( meth, include_all = false )
71
- @riven.respond_to?(meth, include_all) || __methods__.include?(meth)
71
+ @riven.respond_to?(meth, include_all) || __methods__(include_all).include?(meth) || __singleton_methods__(include_all).include?(meth)
72
72
  end
73
73
 
74
74
  # make sure this BasicObject plays nicely in pry
@@ -85,6 +85,7 @@ class Ripar::Roller < BasicObject
85
85
  # include useful methods from Kernel, but rename
86
86
  define_method :__class__, ::Kernel.instance_method(:class)
87
87
  define_method :__object_id__, ::Kernel.instance_method(:object_id)
88
+ define_method :__singleton_methods__, ::Kernel.instance_method(:singleton_methods)
88
89
 
89
90
  protected
90
91
 
@@ -100,8 +101,7 @@ protected
100
101
  end
101
102
 
102
103
  private
103
-
104
- def __methods__
105
- self.__class__.instance_methods
104
+ def __methods__( include_all = true )
105
+ self.__class__.instance_methods include_all
106
106
  end
107
107
  end
@@ -1,3 +1,3 @@
1
1
  module Ripar
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -267,4 +267,24 @@ describe Ripar::Roller do
267
267
  collection.roller.riven.object_id.should_not == collection.object_id
268
268
  end
269
269
  end
270
+
271
+ describe '#respond_to?' do
272
+ it 'forwarded methods' do
273
+ rlr = collection.roller
274
+ rlr.should respond_to(:to_a)
275
+ end
276
+
277
+ it 'Roller methods' do
278
+ rlr = collection.roller
279
+ rlr.should respond_to(:riven)
280
+ end
281
+
282
+ it 'singleton methods' do
283
+ rlr = collection.roller
284
+ class << rlr
285
+ def bergle; riven end
286
+ end
287
+ rlr.should respond_to(:bergle)
288
+ end
289
+ end
270
290
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ripar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Anderson