direction 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf0d1561e0306c26af0ec8f3edf6e47c76b16efe
4
- data.tar.gz: a02622d5f95b89ac8d00a32bd7e461ac9350f690
3
+ metadata.gz: 99cab337abb6c620be8fe3226ced09dab0d5da77
4
+ data.tar.gz: d986a770755c0e04e05d14781ea6c6aa59b98d40
5
5
  SHA512:
6
- metadata.gz: d0fe301a31181cf872d9551225e355b20fb1fa205c95f23379fb1b2364910677b0e52d315cb828baffc1ea228ff23e1878a63bcd0e9b52615e2b379dc4c8bea4
7
- data.tar.gz: e32e256f3cdba9bb51b2cf49736cc44ba66b816f9337e090c97da7fef2d151438a409ef2309c93fb81de06d8578e9e4ffcdbdaf4e53f30e5f88ed2918cb37350
6
+ metadata.gz: 86177cffdf52eea6125884f34ab68e91f1cc445f6e8484dce645c63f20397f994c61bffa2159033f1595f64888f999885eb9d8dd7cc51c23af41a37b3c858dea
7
+ data.tar.gz: 3a0d61725e295c362273c653a4901e0226e1a64648c733aeff0e46cb2534c0852d213e87ea393ea2f5ccb38b4676b3de430708d14c31d7add889169054b91bfb
@@ -1,3 +1,3 @@
1
1
  module Direction
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/direction.rb CHANGED
@@ -20,12 +20,12 @@ module Direction
20
20
  Array(key).map do |command_name|
21
21
  method_defs.unshift %{
22
22
  def #{command_name}(*args, &block)
23
- #{value}.__send__(:#{command_name})
23
+ #{value}.__send__(:#{command_name}, *args, &block)
24
24
  self
25
25
  end
26
26
  }
27
27
  end
28
28
  end
29
- self.class_eval method_defs.join(' ')
29
+ self.class_eval method_defs.join(' '), __FILE__, __LINE__
30
30
  end
31
31
  end
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  class Person
4
4
  extend Direction
5
- command :make_me_a_sandwich => :@friend
5
+ command [:make_me_a_sandwich, :cook] => :@friend
6
6
  attr_accessor :friend
7
7
  end
8
8
 
@@ -10,6 +10,10 @@ class Friend
10
10
  def make_me_a_sandwich
11
11
  Menu.record "I made a sandwich!"
12
12
  end
13
+
14
+ def cook(what)
15
+ Menu.record what
16
+ end
13
17
  end
14
18
 
15
19
  module Menu
@@ -42,4 +46,10 @@ describe Direction do
42
46
  it 'returns the original receiver' do
43
47
  assert_equal person, person.make_me_a_sandwich
44
48
  end
49
+
50
+ it 'forwards additional arguments' do
51
+ assert_equal [], Menu.list
52
+ person.cook('yum')
53
+ assert_includes Menu.list, "yum"
54
+ end
45
55
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: direction
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - "'Jim Gay'"
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-07 00:00:00.000000000 Z
11
+ date: 2014-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler