affirm-ruby 1.0.1 → 1.0.2
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 +4 -4
- data/.gitignore +0 -1
- data/CHANGELOG.md +10 -3
- data/Gemfile.lock +63 -0
- data/lib/affirm/configuration.rb +5 -1
- data/lib/affirm/version.rb +1 -1
- data/spec/configuration_spec.rb +26 -8
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 75f00bc3a582dc20c2d068be57bb5f571caec14b
|
|
4
|
+
data.tar.gz: 186f8b964197d9f1e7c7b94a281cc9bb8173c57e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3ece5ca35597861f646df237b9787e86fcac149a52649380d903ee2d923106d0235eb9568b557e2b5f208ee94a107bde5c64bd08beba18bfe9980abb052306fe
|
|
7
|
+
data.tar.gz: 68d39fb65589c1df8977d2f53795675a3f1d05c8c55b4fceea8c806ff45a84b776a1757154ac7ee8761fdc45317b2f8b6e35098af4f32d7cbd5b865ab2e5c3ef
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -4,9 +4,15 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [1.0.2][] (2015-07-28)
|
|
8
|
+
|
|
9
|
+
Fixes:
|
|
10
|
+
|
|
11
|
+
- Allow environment setting with string
|
|
12
|
+
|
|
7
13
|
## [1.0.1][] (2015-07-10)
|
|
8
14
|
|
|
9
|
-
|
|
15
|
+
Fixes:
|
|
10
16
|
|
|
11
17
|
- compatible with faraday_middleware 0.10.0
|
|
12
18
|
|
|
@@ -14,5 +20,6 @@ Features:
|
|
|
14
20
|
|
|
15
21
|
- Initial release
|
|
16
22
|
|
|
17
|
-
[Unreleased]: https://github.com/spectator/affirm/compare/v1.0.
|
|
18
|
-
[1.0.
|
|
23
|
+
[Unreleased]: https://github.com/spectator/affirm/compare/v1.0.2...HEAD
|
|
24
|
+
[1.0.2]: https://github.com/spectator/affirm/compare/v1.0.1...v1.0.2
|
|
25
|
+
[1.0.1]: https://github.com/spectator/affirm/compare/v1.0.0...v1.0.1
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
affirm-ruby (1.0.2)
|
|
5
|
+
faraday (~> 0.9.1)
|
|
6
|
+
faraday_middleware (~> 0.10.0)
|
|
7
|
+
virtus (~> 1.0, >= 1.0.0)
|
|
8
|
+
|
|
9
|
+
GEM
|
|
10
|
+
remote: https://rubygems.org/
|
|
11
|
+
specs:
|
|
12
|
+
axiom-types (0.1.1)
|
|
13
|
+
descendants_tracker (~> 0.0.4)
|
|
14
|
+
ice_nine (~> 0.11.0)
|
|
15
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
|
16
|
+
byebug (5.0.0)
|
|
17
|
+
columnize (= 0.9.0)
|
|
18
|
+
coercible (1.0.0)
|
|
19
|
+
descendants_tracker (~> 0.0.1)
|
|
20
|
+
columnize (0.9.0)
|
|
21
|
+
descendants_tracker (0.0.4)
|
|
22
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
|
23
|
+
diff-lcs (1.2.5)
|
|
24
|
+
equalizer (0.0.11)
|
|
25
|
+
faraday (0.9.1)
|
|
26
|
+
multipart-post (>= 1.2, < 3)
|
|
27
|
+
faraday_middleware (0.10.0)
|
|
28
|
+
faraday (>= 0.7.4, < 0.10)
|
|
29
|
+
ice_nine (0.11.1)
|
|
30
|
+
multipart-post (2.0.0)
|
|
31
|
+
rake (10.4.2)
|
|
32
|
+
rspec (3.3.0)
|
|
33
|
+
rspec-core (~> 3.3.0)
|
|
34
|
+
rspec-expectations (~> 3.3.0)
|
|
35
|
+
rspec-mocks (~> 3.3.0)
|
|
36
|
+
rspec-core (3.3.1)
|
|
37
|
+
rspec-support (~> 3.3.0)
|
|
38
|
+
rspec-expectations (3.3.0)
|
|
39
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
40
|
+
rspec-support (~> 3.3.0)
|
|
41
|
+
rspec-mocks (3.3.1)
|
|
42
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
43
|
+
rspec-support (~> 3.3.0)
|
|
44
|
+
rspec-support (3.3.0)
|
|
45
|
+
thread_safe (0.3.5)
|
|
46
|
+
virtus (1.0.5)
|
|
47
|
+
axiom-types (~> 0.1)
|
|
48
|
+
coercible (~> 1.0)
|
|
49
|
+
descendants_tracker (~> 0.0, >= 0.0.3)
|
|
50
|
+
equalizer (~> 0.0, >= 0.0.9)
|
|
51
|
+
|
|
52
|
+
PLATFORMS
|
|
53
|
+
ruby
|
|
54
|
+
|
|
55
|
+
DEPENDENCIES
|
|
56
|
+
affirm-ruby!
|
|
57
|
+
bundler (~> 1.7)
|
|
58
|
+
byebug
|
|
59
|
+
rake (~> 10.0)
|
|
60
|
+
rspec (~> 3.3.0)
|
|
61
|
+
|
|
62
|
+
BUNDLED WITH
|
|
63
|
+
1.10.5
|
data/lib/affirm/configuration.rb
CHANGED
|
@@ -2,7 +2,7 @@ module Affirm
|
|
|
2
2
|
class Configuration
|
|
3
3
|
attr_accessor :public_api_key
|
|
4
4
|
attr_accessor :private_api_key
|
|
5
|
-
|
|
5
|
+
attr_reader :environment
|
|
6
6
|
|
|
7
7
|
ENDPOINTS = {
|
|
8
8
|
production: "api.affirm.com",
|
|
@@ -13,6 +13,10 @@ module Affirm
|
|
|
13
13
|
@environment = :production
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
+
def environment=(env)
|
|
17
|
+
@environment = env.to_sym
|
|
18
|
+
end
|
|
19
|
+
|
|
16
20
|
def endpoint
|
|
17
21
|
"https://#{ENDPOINTS[environment]}"
|
|
18
22
|
end
|
data/lib/affirm/version.rb
CHANGED
data/spec/configuration_spec.rb
CHANGED
|
@@ -54,18 +54,36 @@ RSpec.describe Affirm::Configuration do
|
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
context "when environment is set to sandbox" do
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
context "via string" do
|
|
58
|
+
before do
|
|
59
|
+
Affirm.configure do |config|
|
|
60
|
+
config.environment = 'sandbox'
|
|
61
|
+
end
|
|
60
62
|
end
|
|
61
|
-
end
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
it "sets environment to sandbox" do
|
|
65
|
+
expect(Affirm.configuration.environment).to eq(:sandbox)
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
it "sets endpoint to sandbox" do
|
|
69
|
+
expect(Affirm.configuration.endpoint).to eq("https://sandbox.affirm.com")
|
|
70
|
+
end
|
|
65
71
|
end
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
context "via symbol" do
|
|
74
|
+
before do
|
|
75
|
+
Affirm.configure do |config|
|
|
76
|
+
config.environment = :sandbox
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
it "sets environment to sandbox" do
|
|
81
|
+
expect(Affirm.configuration.environment).to eq(:sandbox)
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
it "sets endpoint to sandbox" do
|
|
85
|
+
expect(Affirm.configuration.endpoint).to eq("https://sandbox.affirm.com")
|
|
86
|
+
end
|
|
69
87
|
end
|
|
70
88
|
end
|
|
71
89
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: affirm-ruby
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yury Velikanau
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2015-07-
|
|
12
|
+
date: 2015-07-28 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: faraday
|
|
@@ -71,6 +71,7 @@ files:
|
|
|
71
71
|
- ".travis.yml"
|
|
72
72
|
- CHANGELOG.md
|
|
73
73
|
- Gemfile
|
|
74
|
+
- Gemfile.lock
|
|
74
75
|
- LICENSE.txt
|
|
75
76
|
- README.md
|
|
76
77
|
- Rakefile
|