lob 1.6 → 1.7
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/README.md +7 -7
- data/Rakefile +3 -3
- data/examples/create_pdf.rb +1 -1
- data/examples/jobs.rb +1 -1
- data/examples/postcards.rb +2 -2
- data/lob.gemspec +1 -1
- data/spec/lob/v1/area_spec.rb +2 -2
- data/spec/lob/v1/job_spec.rb +8 -8
- data/spec/lob/v1/object_spec.rb +4 -4
- data/spec/lob/v1/postcard_spec.rb +5 -5
- 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: 5d4aeceb1ade65ead19ded055406c8bab5bca3a9
|
4
|
+
data.tar.gz: 6c299cf9833d544f30bf16aef7fba96306504cce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d33be867b0a13cafff7e9fa4f7cdd190fa39b11af000123d0607e45aa18c1a1e8e0a5aa70c3a08179312ae9e361cfd8fdb333f86a622251c491d8b572741d1e
|
7
|
+
data.tar.gz: 7ce7dd4aae901a8a37fda89d4290ff7feb8f4bacaa66618d97bc397e9722c6474e9baee3a450b14e9230535e5b836efd42db04050aa9555cee72f19e8b1b7737
|
data/README.md
CHANGED
@@ -308,7 +308,7 @@ end
|
|
308
308
|
# You can create an onject by passing the name, file url and setting ID, quantity is defaulted to 1
|
309
309
|
@lob.objects.create(
|
310
310
|
name: "Your fantistic object",
|
311
|
-
file: "https://
|
311
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf",
|
312
312
|
setting_id: "201"
|
313
313
|
)
|
314
314
|
|
@@ -408,7 +408,7 @@ You'll have to specify either the `message` option or the `back` option.
|
|
408
408
|
country: "US",
|
409
409
|
zip: 12345
|
410
410
|
}
|
411
|
-
front: "https://
|
411
|
+
front: "https://s3-us-west-2.amazonaws.com/lob-assets/postcardback.pdf",
|
412
412
|
back: File.new("/path/to/file.pdf")
|
413
413
|
)
|
414
414
|
|
@@ -432,7 +432,7 @@ You'll have to specify either the `message` option or the `back` option.
|
|
432
432
|
country: "US",
|
433
433
|
zip: 12345
|
434
434
|
}
|
435
|
-
front: "https://
|
435
|
+
front: "https://s3-us-west-2.amazonaws.com/lob-assets/postcardback.pdf",
|
436
436
|
message: "Hey Buddy, Thanks for Visiting"
|
437
437
|
)
|
438
438
|
|
@@ -560,8 +560,8 @@ You'll have to specify front, back, and either zip_codes or routes
|
|
560
560
|
# create an area request with routes
|
561
561
|
@lob.areas.create(
|
562
562
|
name: "My Area",
|
563
|
-
front: "https://
|
564
|
-
back: "https://
|
563
|
+
front: "https://s3-us-west-2.amazonaws.com/lob-assets/areafront.pdf",
|
564
|
+
back: "https://s3-us-west-2.amazonaws.com/lob-assets/areaback.pdf",
|
565
565
|
routes: ["94158-C001", "94107-C031"],
|
566
566
|
target_type: "all",
|
567
567
|
full_blled = "1"
|
@@ -570,8 +570,8 @@ You'll have to specify front, back, and either zip_codes or routes
|
|
570
570
|
# create an area request with zip_codes
|
571
571
|
@lob.areas.create(
|
572
572
|
name: "My Area",
|
573
|
-
front: "https://
|
574
|
-
back: "https://
|
573
|
+
front: "https://s3-us-west-2.amazonaws.com/lob-assets/areafront.pdf",
|
574
|
+
back: "https://s3-us-west-2.amazonaws.com/lob-assets/areaback.pdf",
|
575
575
|
zip_codes: ["95678", "94158"],
|
576
576
|
target_type: "all",
|
577
577
|
full_blled = "1"
|
data/Rakefile
CHANGED
@@ -15,9 +15,9 @@ namespace :dev do
|
|
15
15
|
task :setup do
|
16
16
|
Dir.mkdir("spec/samples") unless File.exist?("spec/samples")
|
17
17
|
files = [
|
18
|
-
{url: "https://
|
19
|
-
{url: "https://
|
20
|
-
{url: "https://
|
18
|
+
{url: "https://s3-us-west-2.amazonaws.com/lob-assets/postcardfront.pdf", name: "postcardfront.pdf"},
|
19
|
+
{url: "https://s3-us-west-2.amazonaws.com/lob-assets/postcardback.pdf", name: "postcardback.pdf"},
|
20
|
+
{url: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf", name: "test.pdf"}
|
21
21
|
]
|
22
22
|
files.each do |f|
|
23
23
|
system "curl #{f[:url]} -o spec/samples/#{f[:name]}"
|
data/examples/create_pdf.rb
CHANGED
@@ -10,7 +10,7 @@ Lob.api_key = 'test_0dc8d51e0acffcb1880e0f19c79b2f5b0cc'
|
|
10
10
|
POINTS_PER_INCH = 72 # 72 PostScript Points per Inch
|
11
11
|
|
12
12
|
pdf = Prawn::Document.new(:page_size => [4.25 * POINTS_PER_INCH, 6.25 * POINTS_PER_INCH])
|
13
|
-
pdf.image open('https://
|
13
|
+
pdf.image open('https://s3-us-west-2.amazonaws.com/lob-assets/printing_icon.png'), :position => :center
|
14
14
|
pdf.text 'Print with Lob!', :align => :center, :size => 32
|
15
15
|
|
16
16
|
pdf.render_file 'sample.pdf'
|
data/examples/jobs.rb
CHANGED
@@ -13,7 +13,7 @@ setting_id = settings[setting_index]["id"]
|
|
13
13
|
# create a file object to user later
|
14
14
|
michigan_logo = @lob.objects.create(
|
15
15
|
name: "Michigan Logo Document",
|
16
|
-
file: "https://
|
16
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/goblue.pdf",
|
17
17
|
setting_id: setting_id
|
18
18
|
)
|
19
19
|
|
data/examples/postcards.rb
CHANGED
@@ -30,6 +30,6 @@ puts @lob.postcards.create(
|
|
30
30
|
name: "John Joe",
|
31
31
|
to: to_address["id"],
|
32
32
|
from: from_address["id"],
|
33
|
-
front: "https://
|
34
|
-
back: "https://
|
33
|
+
front: "https://s3-us-west-2.amazonaws.com/lob-assets/postcardfront.pdf",
|
34
|
+
back: "https://s3-us-west-2.amazonaws.com/lob-assets/postcardback.pdf"
|
35
35
|
)
|
data/lob.gemspec
CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "lob"
|
8
|
-
spec.version = "1.
|
8
|
+
spec.version = "1.7"
|
9
9
|
spec.authors = ["Lob"]
|
10
10
|
spec.email = ["support@lob.com"]
|
11
11
|
spec.description = %q{Lob API Ruby wrapper}
|
data/spec/lob/v1/area_spec.rb
CHANGED
@@ -3,8 +3,8 @@ require "spec_helper"
|
|
3
3
|
describe Lob::V1::Area do
|
4
4
|
before :each do
|
5
5
|
@sample_area_params = {
|
6
|
-
front: "https://
|
7
|
-
back: "https://
|
6
|
+
front: "https://s3-us-west-2.amazonaws.com/lob-assets/areafront.pdf",
|
7
|
+
back: "https://s3-us-west-2.amazonaws.com/lob-assets/areaback.pdf",
|
8
8
|
routes: ["94158-C001", "94107-C031"],
|
9
9
|
}
|
10
10
|
end
|
data/spec/lob/v1/job_spec.rb
CHANGED
@@ -29,7 +29,7 @@ describe Lob::V1::Job do
|
|
29
29
|
settings_list = subject.settings.list
|
30
30
|
new_object = subject.objects.create(
|
31
31
|
name: @sample_object_params[:name],
|
32
|
-
file: "https://
|
32
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf",
|
33
33
|
setting_id: @test_setting_id
|
34
34
|
)
|
35
35
|
|
@@ -55,7 +55,7 @@ describe Lob::V1::Job do
|
|
55
55
|
settings_list = subject.settings.list
|
56
56
|
new_object = subject.objects.create(
|
57
57
|
name: @sample_object_params[:name],
|
58
|
-
file: "https://
|
58
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf",
|
59
59
|
setting_id: @test_setting_id
|
60
60
|
)
|
61
61
|
|
@@ -78,13 +78,13 @@ describe Lob::V1::Job do
|
|
78
78
|
|
79
79
|
new_object_params = {
|
80
80
|
name: @sample_object_params[:name],
|
81
|
-
file: "https://
|
81
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf",
|
82
82
|
setting_id: @test_setting_id
|
83
83
|
}
|
84
84
|
|
85
85
|
another_object_params = {
|
86
86
|
name: "Another #{@sample_object_params[:name]}",
|
87
|
-
file: "https://
|
87
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf",
|
88
88
|
setting_id: @test_setting_id
|
89
89
|
}
|
90
90
|
|
@@ -113,7 +113,7 @@ describe Lob::V1::Job do
|
|
113
113
|
|
114
114
|
another_object_params = {
|
115
115
|
name: "Another #{@sample_object_params[:name]}",
|
116
|
-
file: "https://
|
116
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf",
|
117
117
|
setting_id: @test_setting_id
|
118
118
|
}
|
119
119
|
|
@@ -142,7 +142,7 @@ describe Lob::V1::Job do
|
|
142
142
|
settings_list = subject.settings.list
|
143
143
|
new_object = subject.objects.create(
|
144
144
|
name: @sample_object_params[:name],
|
145
|
-
file: "https://
|
145
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf",
|
146
146
|
setting_id: @test_setting_id
|
147
147
|
)
|
148
148
|
|
@@ -163,7 +163,7 @@ describe Lob::V1::Job do
|
|
163
163
|
settings_list = subject.settings.list
|
164
164
|
new_object_params = {
|
165
165
|
name: @sample_object_params[:name],
|
166
|
-
file: "https://
|
166
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf",
|
167
167
|
setting_id: @test_setting_id
|
168
168
|
}
|
169
169
|
|
@@ -187,7 +187,7 @@ describe Lob::V1::Job do
|
|
187
187
|
settings_list = subject.settings.list
|
188
188
|
new_object = subject.objects.create(
|
189
189
|
name: @sample_object_params[:name],
|
190
|
-
file: "https://
|
190
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf",
|
191
191
|
setting_id: @test_setting_id
|
192
192
|
)
|
193
193
|
|
data/spec/lob/v1/object_spec.rb
CHANGED
@@ -18,7 +18,7 @@ describe Lob::V1::Object do
|
|
18
18
|
settings_list = subject.settings.list
|
19
19
|
new_object = subject.objects.create(
|
20
20
|
name: @sample_params[:name],
|
21
|
-
file: "https://
|
21
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf",
|
22
22
|
setting_id: @test_setting_id
|
23
23
|
)
|
24
24
|
|
@@ -35,7 +35,7 @@ describe Lob::V1::Object do
|
|
35
35
|
settings_list = subject.settings.list
|
36
36
|
result = subject.objects.create(
|
37
37
|
name: @sample_params[:name],
|
38
|
-
file: "https://
|
38
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf",
|
39
39
|
setting_id: @test_setting_id
|
40
40
|
)
|
41
41
|
|
@@ -64,7 +64,7 @@ describe Lob::V1::Object do
|
|
64
64
|
settings_list = subject.settings.list
|
65
65
|
new_object = subject.objects.create(
|
66
66
|
name: @sample_params[:name],
|
67
|
-
file: "https://
|
67
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf",
|
68
68
|
setting_id: @test_setting_id
|
69
69
|
)
|
70
70
|
|
@@ -81,7 +81,7 @@ describe Lob::V1::Object do
|
|
81
81
|
settings_list = subject.settings.list
|
82
82
|
new_object = subject.objects.create(
|
83
83
|
name: @sample_params[:name],
|
84
|
-
file: "https://
|
84
|
+
file: "https://s3-us-west-2.amazonaws.com/lob-assets/test.pdf",
|
85
85
|
setting_id: @test_setting_id
|
86
86
|
)
|
87
87
|
|
@@ -50,7 +50,7 @@ describe Lob::V1::Postcard do
|
|
50
50
|
name: @sample_postcard_params[:name],
|
51
51
|
to: new_address["id"],
|
52
52
|
message: @sample_postcard_params[:message],
|
53
|
-
front: "https://
|
53
|
+
front: "https://s3-us-west-2.amazonaws.com/lob-assets/postcardfront.pdf",
|
54
54
|
)
|
55
55
|
|
56
56
|
result["name"].must_equal(@sample_postcard_params[:name])
|
@@ -63,7 +63,7 @@ describe Lob::V1::Postcard do
|
|
63
63
|
name: @sample_postcard_params[:name],
|
64
64
|
to: @sample_address_params,
|
65
65
|
message: @sample_postcard_params[:message],
|
66
|
-
front: "https://
|
66
|
+
front: "https://s3-us-west-2.amazonaws.com/lob-assets/postcardfront.pdf"
|
67
67
|
)
|
68
68
|
|
69
69
|
result["name"].must_equal(@sample_postcard_params[:name])
|
@@ -79,7 +79,7 @@ describe Lob::V1::Postcard do
|
|
79
79
|
to: new_address["id"],
|
80
80
|
from: @sample_address_params,
|
81
81
|
message: @sample_postcard_params[:message],
|
82
|
-
front: "https://
|
82
|
+
front: "https://s3-us-west-2.amazonaws.com/lob-assets/postcardfront.pdf"
|
83
83
|
)
|
84
84
|
|
85
85
|
result["name"].must_equal(@sample_postcard_params[:name])
|
@@ -93,8 +93,8 @@ describe Lob::V1::Postcard do
|
|
93
93
|
result = subject.postcards.create(
|
94
94
|
name: @sample_postcard_params[:name],
|
95
95
|
to: new_address["id"],
|
96
|
-
front: "https://
|
97
|
-
back: "https://
|
96
|
+
front: "https://s3-us-west-2.amazonaws.com/lob-assets/postcardfront.pdf",
|
97
|
+
back: "https://s3-us-west-2.amazonaws.com/lob-assets/postcardback.pdf"
|
98
98
|
)
|
99
99
|
|
100
100
|
result["name"].must_equal(@sample_postcard_params[:name])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.7'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|