conduit 0.6.0 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/conduit/storage/file.rb +1 -1
- data/lib/conduit/util.rb +11 -4
- data/lib/conduit/version.rb +1 -1
- data/spec/classes/core/action_spec.rb +2 -2
- data/spec/classes/core/driver_spec.rb +5 -5
- data/spec/classes/core/parser_spec.rb +1 -1
- data/spec/classes/util_spec.rb +23 -0
- metadata +27 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7095e2ddf14cea0d459266e69bbad1d13b70ffac
|
4
|
+
data.tar.gz: 9979ccfad3d33a3d776332bbca66fe7b12821d4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00e364f6c550713c25580d61aba432e0f2c6e7cdfbfabe1545ee0e8bee16d5d494a3c49632afab2ad1a557094df6474eb824be7d964d02b443d3ec7a103aad85
|
7
|
+
data.tar.gz: 1f3bda3cb4d84c2ac152fe731b5b5b069ee0b3321106c72d87c5c00bd3e00a83a21e791321d4cd1067a1cb2d69b1d8bc4bf07d08b8facb10a4134e996696c0ad
|
data/lib/conduit/storage/file.rb
CHANGED
data/lib/conduit/util.rb
CHANGED
@@ -7,11 +7,18 @@ module Conduit
|
|
7
7
|
# => Conduit::Driver::Fusion::Purchase
|
8
8
|
#
|
9
9
|
def self.find_driver(*args)
|
10
|
-
|
11
|
-
Conduit::Driver.const_get(driver)
|
10
|
+
find_driver!(*args)
|
12
11
|
rescue NameError
|
13
|
-
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.find_driver!(*args)
|
15
|
+
driver = args.map(&:to_s).map(&:camelize).join('::')
|
16
|
+
Conduit::Driver.const_get(driver)
|
17
|
+
rescue NameError => error
|
18
|
+
message = "Unable to find driver with arguments: #{args.join ','}. " +
|
19
|
+
"Expected #{error.name} to be implemented"
|
20
|
+
raise NameError.new(message)
|
14
21
|
end
|
15
22
|
|
16
23
|
end
|
17
|
-
end
|
24
|
+
end
|
data/lib/conduit/version.rb
CHANGED
@@ -16,13 +16,13 @@ shared_examples_for Conduit::Core::Action do
|
|
16
16
|
|
17
17
|
describe '.requirements' do
|
18
18
|
it 'returns an array of required attributes' do
|
19
|
-
subject.class.requirements.should ==
|
19
|
+
subject.class.requirements.should == [:foo, :bar, :baz].to_set
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
describe '.attributes' do
|
24
24
|
it 'returns an array of known attributes' do
|
25
|
-
subject.class.requirements.should ==
|
25
|
+
subject.class.requirements.should == [:foo, :bar, :baz].to_set
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
@@ -5,31 +5,31 @@ shared_examples_for Conduit::Core::Driver do
|
|
5
5
|
context 'without an instance' do
|
6
6
|
describe '.credentials' do
|
7
7
|
it 'returns an array of required credentials' do
|
8
|
-
subject.credentials.should ==
|
8
|
+
subject.credentials.should == [:username, :password].to_set
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
describe '.actions' do
|
13
13
|
it 'returns an array of known action' do
|
14
|
-
subject.actions.should ==
|
14
|
+
subject.actions.should == [:foo].to_set
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
18
18
|
describe '.permitted_attributes' do
|
19
19
|
it 'returns the union of required and optional attributes' do
|
20
|
-
subject.permitted_attributes.should ==
|
20
|
+
subject.permitted_attributes.should == [:subdomain, :mock].to_set
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
24
|
describe 'required_attributes' do
|
25
25
|
it 'should return only the required attributes' do
|
26
|
-
subject.required_attributes.should eql
|
26
|
+
subject.required_attributes.should eql [:subdomain].to_set
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
describe 'optional_attributes' do
|
31
31
|
it 'should return only the optional attributes' do
|
32
|
-
subject.optional_attributes.should eql
|
32
|
+
subject.optional_attributes.should eql [:mock].to_set
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
@@ -16,7 +16,7 @@ shared_examples_for Conduit::Core::Parser do
|
|
16
16
|
context 'with an instance' do
|
17
17
|
describe '#attributes' do
|
18
18
|
it 'returns an array of known attributes' do
|
19
|
-
subject.attributes.should ==
|
19
|
+
subject.attributes.should == [:foo, :bar, :baz].to_set
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'defines a method for foo' do
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Conduit::Util do
|
4
|
+
describe 'find_driver' do
|
5
|
+
it 'should find MyDriver' do
|
6
|
+
driver = Conduit::Util.find_driver(:my_driver)
|
7
|
+
driver.should_not be_nil
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'should not throw exception for missing driver' do
|
11
|
+
driver = Conduit::Util.find_driver(:missing)
|
12
|
+
driver.should be_nil
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
describe 'find_driver!' do
|
17
|
+
it 'should throw NameError if it driver not found' do
|
18
|
+
lambda do
|
19
|
+
Conduit::Util.find_driver!(:not_really_there)
|
20
|
+
end.should raise_error(NameError)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
metadata
CHANGED
@@ -1,125 +1,125 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conduit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Kelley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-05-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: aws-sdk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: excon
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: tilt
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: shoulda-matchers
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec-its
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: nokogiri
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: rspec
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
description:
|
@@ -129,6 +129,8 @@ executables: []
|
|
129
129
|
extensions: []
|
130
130
|
extra_rdoc_files: []
|
131
131
|
files:
|
132
|
+
- Rakefile
|
133
|
+
- lib/conduit.rb
|
132
134
|
- lib/conduit/api_response.rb
|
133
135
|
- lib/conduit/configuration.rb
|
134
136
|
- lib/conduit/connection_error.rb
|
@@ -138,17 +140,16 @@ files:
|
|
138
140
|
- lib/conduit/core/parser.rb
|
139
141
|
- lib/conduit/core/render.rb
|
140
142
|
- lib/conduit/drivers/keep
|
143
|
+
- lib/conduit/storage.rb
|
141
144
|
- lib/conduit/storage/aws.rb
|
142
145
|
- lib/conduit/storage/file.rb
|
143
|
-
- lib/conduit/storage.rb
|
144
146
|
- lib/conduit/time_out.rb
|
145
147
|
- lib/conduit/util.rb
|
146
148
|
- lib/conduit/version.rb
|
147
|
-
- lib/conduit.rb
|
148
|
-
- Rakefile
|
149
149
|
- spec/classes/core/action_spec.rb
|
150
150
|
- spec/classes/core/driver_spec.rb
|
151
151
|
- spec/classes/core/parser_spec.rb
|
152
|
+
- spec/classes/util_spec.rb
|
152
153
|
- spec/spec_helper.rb
|
153
154
|
- spec/support/helper.rb
|
154
155
|
- spec/support/my_driver/actions/foo.rb
|
@@ -167,17 +168,17 @@ require_paths:
|
|
167
168
|
- lib
|
168
169
|
required_ruby_version: !ruby/object:Gem::Requirement
|
169
170
|
requirements:
|
170
|
-
- -
|
171
|
+
- - ">="
|
171
172
|
- !ruby/object:Gem::Version
|
172
173
|
version: '0'
|
173
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
174
175
|
requirements:
|
175
|
-
- -
|
176
|
+
- - ">="
|
176
177
|
- !ruby/object:Gem::Version
|
177
178
|
version: '0'
|
178
179
|
requirements: []
|
179
180
|
rubyforge_project:
|
180
|
-
rubygems_version: 2.
|
181
|
+
rubygems_version: 2.4.6
|
181
182
|
signing_key:
|
182
183
|
specification_version: 4
|
183
184
|
summary: Conduit is an interface for debit platforms.
|
@@ -185,6 +186,7 @@ test_files:
|
|
185
186
|
- spec/classes/core/action_spec.rb
|
186
187
|
- spec/classes/core/driver_spec.rb
|
187
188
|
- spec/classes/core/parser_spec.rb
|
189
|
+
- spec/classes/util_spec.rb
|
188
190
|
- spec/spec_helper.rb
|
189
191
|
- spec/support/helper.rb
|
190
192
|
- spec/support/my_driver/actions/foo.rb
|
@@ -194,3 +196,4 @@ test_files:
|
|
194
196
|
- spec/support/my_driver/views/layout.erb
|
195
197
|
- spec/support/xml/xml_request.xml
|
196
198
|
- spec/support/xml/xml_response.xml
|
199
|
+
has_rdoc:
|