gocardless 1.3.2 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/gocardless.gemspec +1 -1
- data/lib/gocardless/client.rb +2 -2
- data/lib/gocardless/version.rb +1 -1
- data/spec/client_spec.rb +7 -0
- metadata +4 -4
data/CHANGELOG.md
CHANGED
data/gocardless.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require File.expand_path('../lib/gocardless/version', __FILE__)
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
|
-
gem.add_runtime_dependency 'oauth2', '~> 0.7
|
4
|
+
gem.add_runtime_dependency 'oauth2', '~> 0.7'
|
5
5
|
gem.add_runtime_dependency 'multi_json', '~> 1.0'
|
6
6
|
|
7
7
|
gem.add_development_dependency 'rspec', '~> 2.6'
|
data/lib/gocardless/client.rb
CHANGED
@@ -30,8 +30,8 @@ module GoCardless
|
|
30
30
|
|
31
31
|
def initialize(args = {})
|
32
32
|
Utils.symbolize_keys! args
|
33
|
-
@app_id = args
|
34
|
-
@app_secret = args
|
33
|
+
@app_id = args.fetch(:app_id) { ENV['GOCARDLESS_APP_ID'] }
|
34
|
+
@app_secret = args.fetch(:app_secret) { ENV['GOCARDLESS_APP_SECRET'] }
|
35
35
|
raise ClientError.new("You must provide an app_id") unless @app_id
|
36
36
|
raise ClientError.new("You must provide an app_secret") unless @app_secret
|
37
37
|
|
data/lib/gocardless/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -37,6 +37,13 @@ describe GoCardless::Client do
|
|
37
37
|
end.should raise_exception(GoCardless::ClientError)
|
38
38
|
end
|
39
39
|
|
40
|
+
it "does not raise an error if the credentials are provided as environment variables" do
|
41
|
+
ENV.expects(:[]).with('GOCARDLESS_APP_ID').returns(@app_id)
|
42
|
+
ENV.expects(:[]).with('GOCARDLESS_APP_SECRET').returns(@app_secret)
|
43
|
+
|
44
|
+
GoCardless::Client.new
|
45
|
+
end
|
46
|
+
|
40
47
|
it "sets a merchant id if it's given" do
|
41
48
|
client = GoCardless::Client.new({
|
42
49
|
:app_id => @app_id,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gocardless
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-10-
|
13
|
+
date: 2012-10-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: oauth2
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.7
|
22
|
+
version: '0.7'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,7 +27,7 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - ~>
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0.7
|
30
|
+
version: '0.7'
|
31
31
|
- !ruby/object:Gem::Dependency
|
32
32
|
name: multi_json
|
33
33
|
requirement: !ruby/object:Gem::Requirement
|