lob 2.5.0 → 2.5.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: 8e9405bed02fc2ea005d649b4563639b37a2a5d5
4
- data.tar.gz: 238e9a1101eaf3aaf8848028a350508c60358a15
3
+ metadata.gz: aeb6af163fc361fdb79c8f88e9ea9e8570349e75
4
+ data.tar.gz: 916b2af3487b3d83ea4a00be2d6e832533b0345e
5
5
  SHA512:
6
- metadata.gz: e762ca6ab03b0c90b578616270b7747ead4cc6152e73417656086d1cc09ff8b525118d3fbdc7e14851ee0463035d3d16c93d55c15a558088ae17993151ecf5fe
7
- data.tar.gz: 1651326d4d44a238bbc1ff17ab4d9d4704bd80335eb298dbaad05f5f63296ab6275bb7b66d1da146c79318779955367956b6b7bfb1c64595f1f09cd2646b2b74
6
+ metadata.gz: 4167e151a4e13a8a213114f2d44802d0a7ae515156467203f23e469d9f76b8fcae73413f179612c22f4c992151e707139d92467dabde8725b3e6be283c99ceae
7
+ data.tar.gz: e25f982538eba19b6a79017785e302e3cda7e94e24f877ed879aca61971588b34a5b2cf0999e6c0eefd417f490adb9bb1ee0b8a77fcd098e4310dd876e0c7019
@@ -1,3 +1,6 @@
1
+ ## [**2.5.1**](https://github.com/lob/lob-ruby/releases/tag/v2.5.1)
2
+ - [**#145**] (https://github.com/lob/lob-ruby/pull/145) More lenient rest-client version restriction
3
+
1
4
  ## [**2.5.0**](https://github.com/lob/lob-ruby/releases/tag/v2.5.0)
2
5
  - [**#140**] (https://github.com/lob/lob-ruby/pull/140) Adds access to response and headers
3
6
 
data/README.md CHANGED
@@ -205,7 +205,7 @@ You can also configure, TravisCI for your fork of the repository and it'll run t
205
205
 
206
206
  =======================
207
207
 
208
- Copyright © 2013 Lob.com
208
+ Copyright © 2016 Lob.com
209
209
 
210
210
  Released under the MIT License, which can be found in the repository in `LICENSE.txt`.
211
211
 
@@ -18,6 +18,9 @@ module Lob
18
18
  Lob.submit :post, check_url, options
19
19
  end
20
20
 
21
+ def destroy(check_id)
22
+ Lob.submit :delete, check_url(check_id)
23
+ end
21
24
 
22
25
  private
23
26
 
@@ -10,14 +10,18 @@ module Lob
10
10
  Lob.submit(:get, letter_url, options)
11
11
  end
12
12
 
13
- def find(job_id)
14
- Lob.submit :get, letter_url(job_id)
13
+ def find(letter_id)
14
+ Lob.submit :get, letter_url(letter_id)
15
15
  end
16
16
 
17
17
  def create(options = {})
18
18
  Lob.submit :post, letter_url, options
19
19
  end
20
20
 
21
+ def destroy(letter_id)
22
+ Lob.submit :delete, letter_url(letter_id)
23
+ end
24
+
21
25
  private
22
26
 
23
27
  def letter_url(job_id = nil)
@@ -18,6 +18,10 @@ module Lob
18
18
  Lob.submit :post, postcard_url, options
19
19
  end
20
20
 
21
+ def destroy(postcard_id)
22
+ Lob.submit :delete, postcard_url(postcard_id)
23
+ end
24
+
21
25
  private
22
26
 
23
27
  def postcard_url(postcard_id = nil)
@@ -1,3 +1,3 @@
1
1
  module Lob
2
- VERSION = "2.5.0"
2
+ VERSION = "2.5.1"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "rest-client", "~> 1.8"
21
+ spec.add_dependency "rest-client", ">= 1.8", "< 3.0"
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.3"
24
24
  spec.add_development_dependency "rake", "~> 10.4.2"
@@ -30,7 +30,7 @@ describe Lob::V1::Area do
30
30
 
31
31
  result = subject.areas.create @sample_area_params
32
32
 
33
- result["name"].must_equal @sample_area_params[:name]
33
+ result["description"].must_equal @sample_area_params[:description]
34
34
  end
35
35
 
36
36
  it "should create an area object with a single route" do
@@ -31,6 +31,7 @@ describe Lob::V1::Check do
31
31
  end
32
32
  end
33
33
 
34
+
34
35
  describe "create" do
35
36
  it "should create a check with bank account id" do
36
37
  new_address = subject.addresses.create @sample_address_params
@@ -71,4 +72,26 @@ describe Lob::V1::Check do
71
72
  end
72
73
  end
73
74
 
75
+
76
+ describe "destroy" do
77
+ it "should destroy a check" do
78
+ new_address = subject.addresses.create @sample_address_params
79
+
80
+ new_bank_account = subject.bank_accounts.create(@sample_bank_account_params)
81
+
82
+ subject.bank_accounts.verify(new_bank_account["id"], amounts: [1, 2])
83
+
84
+ new_check = subject.checks.create(
85
+ bank_account: new_bank_account["id"],
86
+ to: new_address["id"],
87
+ from: new_address["id"],
88
+ amount: 2000
89
+ )
90
+
91
+ result = subject.checks.destroy(new_check["id"])
92
+ result["id"].must_equal(new_check["id"])
93
+ result["deleted"].must_equal(true)
94
+ end
95
+ end
96
+
74
97
  end
@@ -72,4 +72,41 @@ describe Lob::V1::Letter do
72
72
  end
73
73
  end
74
74
 
75
+
76
+ describe "find" do
77
+ it "should find a letter" do
78
+ new_address = subject.addresses.create @sample_address_params
79
+
80
+ new_letter = subject.letters.create(
81
+ description: "TestLetter",
82
+ color: true,
83
+ file: "https://s3-us-west-2.amazonaws.com/lob-assets/letter-goblue.pdf",
84
+ to: new_address["id"],
85
+ from: new_address["id"]
86
+ )
87
+
88
+ result = subject.letters.find(new_letter["id"])
89
+ assert /#{new_letter["description"]}/ =~ result.to_s
90
+ end
91
+ end
92
+
93
+
94
+ describe "destroy" do
95
+ it "should destroy a letter" do
96
+ new_address = subject.addresses.create @sample_address_params
97
+
98
+ new_letter = subject.letters.create(
99
+ description: "TestLetter",
100
+ color: true,
101
+ file: "https://s3-us-west-2.amazonaws.com/lob-assets/letter-goblue.pdf",
102
+ to: new_address["id"],
103
+ from: new_address["id"]
104
+ )
105
+
106
+ result = subject.letters.destroy(new_letter["id"])
107
+ result["id"].must_equal(new_letter["id"])
108
+ result["deleted"].must_equal(true)
109
+ end
110
+ end
111
+
75
112
  end
@@ -34,51 +34,51 @@ describe Lob::V1::Postcard do
34
34
  new_address = subject.addresses.create @sample_address_params
35
35
 
36
36
  result = subject.postcards.create(
37
- name: @sample_postcard_params[:name],
37
+ description: @sample_postcard_params[:description],
38
38
  to: new_address["id"],
39
39
  message: @sample_postcard_params[:message],
40
40
  front: "https://lob.com/postcardfront.pdf",
41
41
  )
42
42
 
43
- result["name"].must_equal(@sample_postcard_params[:name])
43
+ result["description"].must_equal(@sample_postcard_params[:description])
44
44
  end
45
45
 
46
46
  it "should create a postcard with to address params" do
47
47
  result = subject.postcards.create(
48
- name: @sample_postcard_params[:name],
48
+ description: @sample_postcard_params[:description],
49
49
  to: @sample_address_params,
50
50
  message: @sample_postcard_params[:message],
51
51
  front: "https://lob.com/postcardfront.pdf"
52
52
  )
53
53
 
54
- result["name"].must_equal(@sample_postcard_params[:name])
54
+ result["description"].must_equal(@sample_postcard_params[:description])
55
55
  end
56
56
 
57
57
  it "should create a postcard with from address params" do
58
58
  new_address = subject.addresses.create @sample_address_params
59
59
 
60
60
  result = subject.postcards.create(
61
- name: @sample_postcard_params[:name],
61
+ description: @sample_postcard_params[:description],
62
62
  to: new_address["id"],
63
63
  from: @sample_address_params,
64
64
  message: @sample_postcard_params[:message],
65
65
  front: "https://lob.com/postcardfront.pdf"
66
66
  )
67
67
 
68
- result["name"].must_equal(@sample_postcard_params[:name])
68
+ result["description"].must_equal(@sample_postcard_params[:description])
69
69
  end
70
70
 
71
71
  it "should create a postcard with front and back as urls" do
72
72
  new_address = subject.addresses.create @sample_address_params
73
73
 
74
74
  result = subject.postcards.create(
75
- name: @sample_postcard_params[:name],
75
+ description: @sample_postcard_params[:description],
76
76
  to: new_address["id"],
77
77
  front: "https://lob.com/postcardfront.pdf",
78
78
  back: "https://lob.com/postcardback.pdf"
79
79
  )
80
80
 
81
- result["name"].must_equal(@sample_postcard_params[:name])
81
+ result["description"].must_equal(@sample_postcard_params[:description])
82
82
  end
83
83
 
84
84
 
@@ -86,13 +86,13 @@ describe Lob::V1::Postcard do
86
86
  new_address = subject.addresses.create @sample_address_params
87
87
 
88
88
  result = subject.postcards.create(
89
- name: @sample_postcard_params[:name],
89
+ description: @sample_postcard_params[:description],
90
90
  to: new_address["id"],
91
91
  front: File.new(File.expand_path("../../../samples/postcardfront.pdf", __FILE__)),
92
92
  back: File.new(File.expand_path("../../../samples/postcardback.pdf", __FILE__))
93
93
  )
94
94
 
95
- result["name"].must_equal(@sample_postcard_params[:name])
95
+ result["description"].must_equal(@sample_postcard_params[:description])
96
96
  end
97
97
 
98
98
  end
@@ -103,14 +103,32 @@ describe Lob::V1::Postcard do
103
103
  new_address = subject.addresses.create @sample_address_params
104
104
 
105
105
  new_postcard = subject.postcards.create(
106
- name: @sample_postcard_params[:name],
106
+ description: @sample_postcard_params[:description],
107
107
  to: new_address["id"],
108
108
  front: File.new(File.expand_path("../../../samples/postcardfront.pdf", __FILE__)),
109
109
  back: File.new(File.expand_path("../../../samples/postcardback.pdf", __FILE__))
110
110
  )
111
111
 
112
112
  result = subject.postcards.find(new_postcard["id"])
113
- result["name"].must_equal(@sample_postcard_params[:name])
113
+ result["description"].must_equal(@sample_postcard_params[:description])
114
+ end
115
+ end
116
+
117
+
118
+ describe "destroy" do
119
+ it "should destroy a postcard" do
120
+ new_address = subject.addresses.create @sample_address_params
121
+
122
+ new_postcard = subject.postcards.create(
123
+ description: @sample_postcard_params[:description],
124
+ to: new_address["id"],
125
+ front: File.new(File.expand_path("../../../samples/postcardfront.pdf", __FILE__)),
126
+ back: File.new(File.expand_path("../../../samples/postcardback.pdf", __FILE__))
127
+ )
128
+
129
+ result = subject.postcards.destroy(new_postcard["id"])
130
+ result["id"].must_equal(new_postcard["id"])
131
+ result["deleted"].must_equal(true)
114
132
  end
115
133
  end
116
134
 
metadata CHANGED
@@ -1,139 +1,145 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lob
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lob
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-16 00:00:00.000000000 Z
11
+ date: 2016-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rest-client
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - "~>"
16
+ - - '>='
18
17
  - !ruby/object:Gem::Version
19
18
  version: '1.8'
20
- type: :runtime
19
+ - - <
20
+ - !ruby/object:Gem::Version
21
+ version: '3.0'
22
+ name: rest-client
21
23
  prerelease: false
24
+ type: :runtime
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - '>='
25
28
  - !ruby/object:Gem::Version
26
29
  version: '1.8'
30
+ - - <
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
27
33
  - !ruby/object:Gem::Dependency
28
- name: bundler
29
34
  requirement: !ruby/object:Gem::Requirement
30
35
  requirements:
31
- - - "~>"
36
+ - - ~>
32
37
  - !ruby/object:Gem::Version
33
38
  version: '1.3'
34
- type: :development
39
+ name: bundler
35
40
  prerelease: false
41
+ type: :development
36
42
  version_requirements: !ruby/object:Gem::Requirement
37
43
  requirements:
38
- - - "~>"
44
+ - - ~>
39
45
  - !ruby/object:Gem::Version
40
46
  version: '1.3'
41
47
  - !ruby/object:Gem::Dependency
42
- name: rake
43
48
  requirement: !ruby/object:Gem::Requirement
44
49
  requirements:
45
- - - "~>"
50
+ - - ~>
46
51
  - !ruby/object:Gem::Version
47
52
  version: 10.4.2
48
- type: :development
53
+ name: rake
49
54
  prerelease: false
55
+ type: :development
50
56
  version_requirements: !ruby/object:Gem::Requirement
51
57
  requirements:
52
- - - "~>"
58
+ - - ~>
53
59
  - !ruby/object:Gem::Version
54
60
  version: 10.4.2
55
61
  - !ruby/object:Gem::Dependency
56
- name: minitest
57
62
  requirement: !ruby/object:Gem::Requirement
58
63
  requirements:
59
- - - "~>"
64
+ - - ~>
60
65
  - !ruby/object:Gem::Version
61
66
  version: 5.6.1
62
- type: :development
67
+ name: minitest
63
68
  prerelease: false
69
+ type: :development
64
70
  version_requirements: !ruby/object:Gem::Requirement
65
71
  requirements:
66
- - - "~>"
72
+ - - ~>
67
73
  - !ruby/object:Gem::Version
68
74
  version: 5.6.1
69
75
  - !ruby/object:Gem::Dependency
70
- name: webmock
71
76
  requirement: !ruby/object:Gem::Requirement
72
77
  requirements:
73
- - - "~>"
78
+ - - ~>
74
79
  - !ruby/object:Gem::Version
75
80
  version: '1.2'
76
- type: :development
81
+ name: webmock
77
82
  prerelease: false
83
+ type: :development
78
84
  version_requirements: !ruby/object:Gem::Requirement
79
85
  requirements:
80
- - - "~>"
86
+ - - ~>
81
87
  - !ruby/object:Gem::Version
82
88
  version: '1.2'
83
89
  - !ruby/object:Gem::Dependency
84
- name: travis-lint
85
90
  requirement: !ruby/object:Gem::Requirement
86
91
  requirements:
87
- - - "~>"
92
+ - - ~>
88
93
  - !ruby/object:Gem::Version
89
94
  version: 2.0.0
90
- type: :development
95
+ name: travis-lint
91
96
  prerelease: false
97
+ type: :development
92
98
  version_requirements: !ruby/object:Gem::Requirement
93
99
  requirements:
94
- - - "~>"
100
+ - - ~>
95
101
  - !ruby/object:Gem::Version
96
102
  version: 2.0.0
97
103
  - !ruby/object:Gem::Dependency
98
- name: coveralls
99
104
  requirement: !ruby/object:Gem::Requirement
100
105
  requirements:
101
- - - "~>"
106
+ - - ~>
102
107
  - !ruby/object:Gem::Version
103
108
  version: 0.8.1
104
- type: :development
109
+ name: coveralls
105
110
  prerelease: false
111
+ type: :development
106
112
  version_requirements: !ruby/object:Gem::Requirement
107
113
  requirements:
108
- - - "~>"
114
+ - - ~>
109
115
  - !ruby/object:Gem::Version
110
116
  version: 0.8.1
111
117
  - !ruby/object:Gem::Dependency
112
- name: simplecov
113
118
  requirement: !ruby/object:Gem::Requirement
114
119
  requirements:
115
- - - "~>"
120
+ - - ~>
116
121
  - !ruby/object:Gem::Version
117
122
  version: 0.10.0
118
- type: :development
123
+ name: simplecov
119
124
  prerelease: false
125
+ type: :development
120
126
  version_requirements: !ruby/object:Gem::Requirement
121
127
  requirements:
122
- - - "~>"
128
+ - - ~>
123
129
  - !ruby/object:Gem::Version
124
130
  version: 0.10.0
125
131
  - !ruby/object:Gem::Dependency
126
- name: pry
127
132
  requirement: !ruby/object:Gem::Requirement
128
133
  requirements:
129
- - - "~>"
134
+ - - ~>
130
135
  - !ruby/object:Gem::Version
131
136
  version: 0.10.0
132
- type: :development
137
+ name: pry
133
138
  prerelease: false
139
+ type: :development
134
140
  version_requirements: !ruby/object:Gem::Requirement
135
141
  requirements:
136
- - - "~>"
142
+ - - ~>
137
143
  - !ruby/object:Gem::Version
138
144
  version: 0.10.0
139
145
  description: Lob API Ruby wrapper
@@ -143,8 +149,8 @@ executables: []
143
149
  extensions: []
144
150
  extra_rdoc_files: []
145
151
  files:
146
- - ".gitignore"
147
- - ".travis.yml"
152
+ - .gitignore
153
+ - .travis.yml
148
154
  - CHANGELOG.md
149
155
  - Gemfile
150
156
  - LICENSE.txt
@@ -202,24 +208,24 @@ homepage: https://github.com/lob/lob-ruby
202
208
  licenses:
203
209
  - MIT
204
210
  metadata: {}
205
- post_install_message:
211
+ post_install_message:
206
212
  rdoc_options: []
207
213
  require_paths:
208
214
  - lib
209
215
  required_ruby_version: !ruby/object:Gem::Requirement
210
216
  requirements:
211
- - - ">="
217
+ - - '>='
212
218
  - !ruby/object:Gem::Version
213
219
  version: '0'
214
220
  required_rubygems_version: !ruby/object:Gem::Requirement
215
221
  requirements:
216
- - - ">="
222
+ - - '>='
217
223
  - !ruby/object:Gem::Version
218
224
  version: '0'
219
225
  requirements: []
220
- rubyforge_project:
221
- rubygems_version: 2.4.6
222
- signing_key:
226
+ rubyforge_project:
227
+ rubygems_version: 2.4.5
228
+ signing_key:
223
229
  specification_version: 4
224
230
  summary: Ruby wrapper for Lob.com API with ActiveRecord-style syntax
225
231
  test_files: