invokr 0.9.4 → 0.9.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/invokr/dependency_injection.rb +1 -1
- data/lib/invokr/version.rb +1 -1
- data/test/dependency_injection_test.rb +2 -2
- data/test/keyword_args_test.rb +2 -2
- data/test/query_test.rb +1 -1
- data/test/test_helper.rb +2 -2
- 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: 54217bbbc58bdaa01e35ac2136a36f5692e8c9b3
|
4
|
+
data.tar.gz: 482641abbb16a1cb72e5cd4029f59ba19bf26531
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e966c7c7ddb73d96ea9bc7c2cf1d52d854b77c3c34d9f75001cc0c8b6807704ae9c09465a942f84b3919e707c82baa18a46beed6ca965acf9b8cf57671200596
|
7
|
+
data.tar.gz: d4bc38723344baf8a3ead9501865e0f1f78c06a8f740705934698eec425ee0d812b19ab314dac51f7ef09f4e51ce3e14514939fbeccda45ddac72520abdaa3e5
|
@@ -4,7 +4,7 @@ module Invokr
|
|
4
4
|
|
5
5
|
def inject obj, using
|
6
6
|
meth = case obj
|
7
|
-
when
|
7
|
+
when lambda { |obj| obj.respond_to?(:call) } then :inject_proc
|
8
8
|
when Class then :inject_klass
|
9
9
|
else raise ArgumentError, "can't inject #{obj.inspect}"
|
10
10
|
end
|
data/lib/invokr/version.rb
CHANGED
@@ -16,7 +16,7 @@ class DependencyInjectionExampleTest < Minitest::Test
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def test_injecting_a_proc
|
19
|
-
my_proc =
|
19
|
+
my_proc = lambda { |foo,bar| OpenStruct.new foo: foo, bar: bar }
|
20
20
|
|
21
21
|
obj = Invokr.inject(
|
22
22
|
my_proc,
|
@@ -47,7 +47,7 @@ class DependencyInjectionExampleTest < Minitest::Test
|
|
47
47
|
class TestObject
|
48
48
|
attr :album, :guitarist
|
49
49
|
|
50
|
-
def initialize album, guitarist
|
50
|
+
def initialize album, guitarist = 'jimmy'
|
51
51
|
@album = album
|
52
52
|
@guitarist = guitarist
|
53
53
|
end
|
data/test/keyword_args_test.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module KeywordArgsTest
|
2
2
|
class OptionalKeywordArgsTest < Minitest::Test
|
3
3
|
def setup
|
4
|
-
skip unless RUBY_VERSION >= '2.0'
|
4
|
+
skip unless RUBY_VERSION >= '2.0' and RUBY_ENGINE == 'ruby'
|
5
5
|
end
|
6
6
|
|
7
7
|
def test_overriding_optional_keyword_argument
|
@@ -48,7 +48,7 @@ module KeywordArgsTest
|
|
48
48
|
|
49
49
|
class RequiredKeywordArgsTest < Minitest::Test
|
50
50
|
def setup
|
51
|
-
skip unless RUBY_VERSION >= '2.
|
51
|
+
skip unless RUBY_VERSION >= '2.0' and RUBY_ENGINE == 'ruby'
|
52
52
|
end
|
53
53
|
|
54
54
|
def test_supplying_required_keyword_argument
|
data/test/query_test.rb
CHANGED
@@ -49,7 +49,7 @@ class QueryTest < Minitest::Test
|
|
49
49
|
|
50
50
|
def test_trimming_arguments
|
51
51
|
hsh = { album: 'junta', guitarist: 'trey', drummer: 'phish' }
|
52
|
-
assert_equal
|
52
|
+
assert_equal [:album, :guitarist], @method.trim_args(hsh).keys
|
53
53
|
end
|
54
54
|
|
55
55
|
private
|
data/test/test_helper.rb
CHANGED
@@ -43,7 +43,7 @@ module TestMethodBank
|
|
43
43
|
"#<#{name}:0xdeadbeef>"
|
44
44
|
end
|
45
45
|
|
46
|
-
if RUBY_VERSION >= '2.0'
|
46
|
+
if RUBY_VERSION >= '2.0' and RUBY_ENGINE == 'ruby'
|
47
47
|
module_eval <<-RB, __FILE__, __LINE__
|
48
48
|
def optional_keyword_argument album: 'pitcher_of_nectar'
|
49
49
|
album
|
@@ -55,7 +55,7 @@ module TestMethodBank
|
|
55
55
|
RB
|
56
56
|
end
|
57
57
|
|
58
|
-
if RUBY_VERSION >= '2.1'
|
58
|
+
if RUBY_VERSION >= '2.1' and RUBY_ENGINE == 'ruby'
|
59
59
|
module_eval <<-RB, __FILE__, __LINE__
|
60
60
|
def required_keyword_argument(album:)
|
61
61
|
album
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: invokr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ntl
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|