balanced 1.1.0 → 1.1.1

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: 5a7c70ad40d3145fa342b15bf08330a63d377a3f
4
- data.tar.gz: 2b1ef00672901e32b9a74d6f326673b971495213
3
+ metadata.gz: 219dbbd5adfbc85b25a89851e6d81149b7c6c885
4
+ data.tar.gz: 021828832cf8d9b233f41ad9c13578dbe5f21399
5
5
  SHA512:
6
- metadata.gz: 253351b491ff59782bd0a00ac0777ff403f5556da6d997bf4846714ae1c004bf26e184af476fd574905474ad038beb10f087e89d3bb596ec81b85fc3c6327878
7
- data.tar.gz: a41466771abd2205cd54484877dda3588b4622cf4828ff73415db1103ff01893f58a1d921ae0c1a0bf6539f681ef9efdc58bb6e6899497e83bae8649938c59d9
6
+ metadata.gz: fbd91388524f30395916d87f33a8c8c2377473d996feb38780a99a92f0ffb337debdb2563abe4e483d05425854bd2c1f6e6b8262d904f8e582ba050be8cd6aa7
7
+ data.tar.gz: a6a2da990d5941e291c98e8db187acaf2346f2c1c0cc3112846ab31a9a7738b67102b4d174922675402984ee38a80efb6fe5c0a62404a0aec8e5f3aaf2e46d56
@@ -2,6 +2,8 @@ language: ruby
2
2
  bundler_args: --without development
3
3
  script: "bundle exec rake spec"
4
4
  rvm:
5
+ - 1.8.7
5
6
  - 1.9.2
6
7
  - 1.9.3
7
8
  - 2.0.0
9
+ - 2.1.1
@@ -1,3 +1,8 @@
1
+ ## 1.1.1
2
+
3
+ * Fix nil fetch exception
4
+ * Remove balanced-specific subdirectories from the global $LOAD_PATH
5
+
1
6
  ## 1.1.0
2
7
 
3
8
  * Push to card support
@@ -1,5 +1,3 @@
1
- $:.unshift File.join(File.dirname(__FILE__), "balanced", "resources")
2
- $:.unshift File.join(File.dirname(__FILE__), "balanced", "response")
3
1
 
4
2
  require 'uri'
5
3
  require 'balanced/version' unless defined? Balanced::VERSION
@@ -2,7 +2,7 @@ require 'logger'
2
2
  require 'uri'
3
3
  require 'faraday'
4
4
  require 'faraday_middleware'
5
- require 'balanced_exception_middleware'
5
+ require 'balanced/response/balanced_exception_middleware'
6
6
 
7
7
 
8
8
  module Balanced
@@ -1,19 +1,18 @@
1
- $:.unshift(File.join(File.dirname(__FILE__), 'balanced', 'resources'))
2
- require 'resource'
3
- require 'hypermedia'
4
- require 'funding_instrument'
5
- require 'api_key'
6
- require 'bank_account'
7
- require 'card'
8
- require 'credit'
9
- require 'debit'
10
- require 'card_hold'
11
- require 'marketplace'
12
- require 'refund'
13
- require 'reversal'
14
- require 'callback'
15
- require 'dispute'
16
- require 'event'
17
- require 'customer'
18
- require 'order'
19
- require 'transfer'
1
+ require 'balanced/resources/resource'
2
+ require 'balanced/resources/hypermedia'
3
+ require 'balanced/resources/funding_instrument'
4
+ require 'balanced/resources/api_key'
5
+ require 'balanced/resources/bank_account'
6
+ require 'balanced/resources/card'
7
+ require 'balanced/resources/credit'
8
+ require 'balanced/resources/debit'
9
+ require 'balanced/resources/card_hold'
10
+ require 'balanced/resources/marketplace'
11
+ require 'balanced/resources/refund'
12
+ require 'balanced/resources/reversal'
13
+ require 'balanced/resources/callback'
14
+ require 'balanced/resources/dispute'
15
+ require 'balanced/resources/event'
16
+ require 'balanced/resources/customer'
17
+ require 'balanced/resources/order'
18
+ require 'balanced/resources/transfer'
@@ -259,6 +259,7 @@ module Balanced
259
259
  def fetch(*arguments)
260
260
  if arguments.nil? ||
261
261
  arguments.empty? ||
262
+ arguments[0].nil? ||
262
263
  arguments[0].empty?
263
264
  raise Balanced::NotFound
264
265
  end
@@ -1,3 +1,3 @@
1
1
  module Balanced
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
@@ -29,4 +29,14 @@ describe Balanced::Resource do
29
29
  new_ak.should be_instance_of(Balanced::ApiKey)
30
30
  end
31
31
  end
32
+
33
+ describe 'fetch' do
34
+ it 'raises a Balanced::NotFound exception when called with no arguments' do
35
+ expect { @ak.fetch() }.to raise_exception(Balanced::NotFound)
36
+ end
37
+
38
+ it 'raises a Balanced::NotFound exception when called with a nil first argument' do
39
+ expect { @ak.fetch(nil) }.to raise_exception(Balanced::NotFound)
40
+ end
41
+ end
32
42
  end
@@ -0,0 +1,8 @@
1
+ require 'spec_helper'
2
+
3
+ describe Balanced, "resources" do
4
+ it "doesn't add library-specific directories to the global $LOAD_PATH" do
5
+ basedir = File.expand_path( File.dirname(__FILE__) + '/../..' )
6
+ $LOAD_PATH.should_not include(basedir + '/lib/balanced/resources')
7
+ end
8
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: balanced
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Balanced
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-23 00:00:00.000000000 Z
11
+ date: 2014-07-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -331,6 +331,7 @@ files:
331
331
  - spec/balanced/resources/marketplace_spec.rb
332
332
  - spec/balanced/resources/order_spec.rb
333
333
  - spec/balanced/resources/resource_spec.rb
334
+ - spec/balanced/resources_spec.rb
334
335
  - spec/balanced/response/balanced_exception_middleware_spec.rb
335
336
  - spec/balanced_spec.rb
336
337
  - spec/client_spec.rb
@@ -374,6 +375,7 @@ test_files:
374
375
  - spec/balanced/resources/marketplace_spec.rb
375
376
  - spec/balanced/resources/order_spec.rb
376
377
  - spec/balanced/resources/resource_spec.rb
378
+ - spec/balanced/resources_spec.rb
377
379
  - spec/balanced/response/balanced_exception_middleware_spec.rb
378
380
  - spec/balanced_spec.rb
379
381
  - spec/client_spec.rb