paid 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 65e900787b83f75b846196fecdb69237d62b0589
4
- data.tar.gz: 24bb5a3e1fc9a76999a3f564c3e96ada3775eccd
3
+ metadata.gz: c03ae50890b4b36e541545e4797b65843bbc6aef
4
+ data.tar.gz: c8ee27b708d7c643ad5fe61523a25a24d5811fc6
5
5
  SHA512:
6
- metadata.gz: a4f8867d3fb20e5c60c25567dce61582d2e9dacc414d51b322b9268b9d10eec303411bc9cd7f009ccade522dd4c13eef69d1c2364cef3d1cd7d44aa251ee4499
7
- data.tar.gz: 4f1527d795fc15174d2a14eb48c06398f733ca9a88004c1e8a95324ebd4184bbc92d5f58229406319024b733100c7048017513e1d354e525613896a1b6f3ca38
6
+ metadata.gz: b3886539e183a60039b4fce8b1f86212071ed929677aaffbee77a953d60c4d7f5be4c43776ffa75201552c7f535fe89d55518bf964a7ddf70253cf3565c9ccc0
7
+ data.tar.gz: 3321adcd1cdb2d4357fc3826f4cd40b5f980e6518969422f1656fcb787688b0d28fab7b9b3a806a9bca9c5ccbfadefef5058fc4175959d999ef10efe431e094d
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.5
1
+ 1.0.6
@@ -28,7 +28,7 @@ module Paid
28
28
  response = Requester.request(method, url, params, headers)
29
29
  @response_body = response.body
30
30
  @response_code = response.code
31
- rescue Exception => e
31
+ rescue StandardError => e
32
32
  @response_body = e.http_body if e.respond_to?(:http_body)
33
33
  @response_code = e.http_code if e.respond_to?(:http_code)
34
34
  @error = compose_error(e)
@@ -16,6 +16,8 @@ module Paid
16
16
  attr_accessor :allow_wire
17
17
  attr_accessor :allow_check
18
18
  attr_accessor :allow_credit_card
19
+ attr_accessor :auto_generate
20
+ attr_accessor :auto_issue
19
21
  attr_accessor :terms
20
22
  attr_accessor :billing_type
21
23
  attr_accessor :billing_cycle
@@ -34,17 +34,11 @@ module Paid
34
34
  end
35
35
 
36
36
  def self.constantize(str, prefix=false)
37
- str = str.to_s
38
- begin
39
- str.split('::').reduce(Module, :const_get)
40
- rescue NameError => e
41
- if prefix
42
- raise e
43
- else
44
- p = "#{self.name}".split("::").first
45
- constantize("#{p}::#{str}", true)
46
- end
37
+ p = "#{self.name}".split("::").first
38
+ if "#{str}".split("::").first != p
39
+ str = "#{p}::#{str}"
47
40
  end
41
+ str.split('::').reduce(Module, :const_get)
48
42
  end
49
43
 
50
44
  end
@@ -1,6 +1,10 @@
1
1
  require File.expand_path('../../test_helper', __FILE__)
2
2
 
3
+ class TestObj; end
4
+
3
5
  module Paid
6
+ class TestObj; end
7
+
4
8
  class UtilTest < ::Test::Unit::TestCase
5
9
  context '#symbolize_keys' do
6
10
  should "convert keys to symbols" do
@@ -46,6 +50,11 @@ module Paid
46
50
  should 'convert :APIResource to the class object' do
47
51
  assert_equal(APIResource, Util.constantize(:APIResource))
48
52
  end
53
+
54
+ should 'scope the class in the Paid namespace' do
55
+ assert_not_equal(::TestObj, Util.constantize(:TestObj))
56
+ assert_equal(Paid::TestObj, Util.constantize(:TestObj))
57
+ end
49
58
  end
50
59
  end
51
60
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paid
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Calhoun
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-05-21 00:00:00.000000000 Z
12
+ date: 2015-05-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client