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 CHANGED
@@ -1,3 +1,8 @@
1
+ ## 1.4.0 - October 29, 2012
2
+
3
+ - Allow app id and secret to be set with environment variables
4
+ - Relax the oauth dependency
5
+
1
6
  ## 1.3.2 - October 01, 2012
2
7
 
3
8
  - Fix filtering on sub resource methods, e.g. `merchant.bills(source_id: 'x')`
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.1'
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'
@@ -30,8 +30,8 @@ module GoCardless
30
30
 
31
31
  def initialize(args = {})
32
32
  Utils.symbolize_keys! args
33
- @app_id = args[:app_id]
34
- @app_secret = args[:app_secret]
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
 
@@ -1,3 +1,3 @@
1
1
  module GoCardless
2
- VERSION = '1.3.2'.freeze
2
+ VERSION = '1.4.0'.freeze
3
3
  end
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.3.2
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-01 00:00:00.000000000 Z
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.1
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.1
30
+ version: '0.7'
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: multi_json
33
33
  requirement: !ruby/object:Gem::Requirement