paid 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/paid/api_method.rb +1 -1
- data/lib/paid/customer.rb +2 -0
- data/lib/paid/util.rb +4 -10
- data/test/paid/util_test.rb +9 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c03ae50890b4b36e541545e4797b65843bbc6aef
|
4
|
+
data.tar.gz: c8ee27b708d7c643ad5fe61523a25a24d5811fc6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3886539e183a60039b4fce8b1f86212071ed929677aaffbee77a953d60c4d7f5be4c43776ffa75201552c7f535fe89d55518bf964a7ddf70253cf3565c9ccc0
|
7
|
+
data.tar.gz: 3321adcd1cdb2d4357fc3826f4cd40b5f980e6518969422f1656fcb787688b0d28fab7b9b3a806a9bca9c5ccbfadefef5058fc4175959d999ef10efe431e094d
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.6
|
data/lib/paid/api_method.rb
CHANGED
@@ -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
|
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)
|
data/lib/paid/customer.rb
CHANGED
data/lib/paid/util.rb
CHANGED
@@ -34,17 +34,11 @@ module Paid
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def self.constantize(str, prefix=false)
|
37
|
-
|
38
|
-
|
39
|
-
str
|
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
|
data/test/paid/util_test.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2015-05-22 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|