prawn-labels 1.2.3 → 1.2.4

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: 575dd5884bc8e3243dd8dc3d319873d6a86262c2
4
- data.tar.gz: 28f9f9657c8ef8d557b5e57698abb66b90f83ff5
3
+ metadata.gz: b4da2f699180b8a2ebed9c5bec09c08badc9a17e
4
+ data.tar.gz: 77e4373ac6877a89588d6656e375bf297d7b41c6
5
5
  SHA512:
6
- metadata.gz: eb33c27699f05430dd3ee6d824d55bea4df86b41fe8cd819ca5a7f208bf664b1d927d164418ac89d673bb3cc8138664db7fffcdbcea1586119801002f1f33c7c
7
- data.tar.gz: 32b79f8de736385e5f2a7873de00f0bbe9e25d6dce88fa0e31af569218295f32a999d2a474672d64275ea0b749012bfc6fff7f277023dd97cc671b965a0d4ddc
6
+ metadata.gz: f5faf2a8bbad11d2c91482cbfc99fb581a9e452a7e925f6659def6bbd3beaab5ecbc47f1d7a601932e7b1e1dcee4f15c541ccb38292867c57465491b6a6cb241
7
+ data.tar.gz: 9fc2dd0d0c2ef332e2496ac0cba388809faf79cc5ff4febad219c98000997974bbc023be195bd7198b4116ea1f63478952d91b3fef294ced9c37a956a878c3b8
data/COPYING CHANGED
@@ -55,7 +55,7 @@ patent must be licensed for everyone's free use or not licensed at all.
55
55
 
56
56
  The precise terms and conditions for copying, distribution and
57
57
  modification follow.
58
-
58
+
59
59
  GNU GENERAL PUBLIC LICENSE
60
60
  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
61
 
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
110
110
  License. (Exception: if the Program itself is interactive but
111
111
  does not normally print such an announcement, your work based on
112
112
  the Program is not required to print an announcement.)
113
-
113
+
114
114
  These requirements apply to the modified work as a whole. If
115
115
  identifiable sections of that work are not derived from the Program,
116
116
  and can be reasonably considered independent and separate works in
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
168
168
  access to copy the source code from the same place counts as
169
169
  distribution of the source code, even though third parties are not
170
170
  compelled to copy the source along with the object code.
171
-
171
+
172
172
  4. You may not copy, modify, sublicense, or distribute the Program
173
173
  except as expressly provided under this License. Any attempt
174
174
  otherwise to copy, modify, sublicense or distribute the Program is
@@ -225,7 +225,7 @@ impose that choice.
225
225
 
226
226
  This section is intended to make thoroughly clear what is believed to
227
227
  be a consequence of the rest of this License.
228
-
228
+
229
229
  8. If the distribution and/or use of the Program is restricted in
230
230
  certain countries either by patents or by copyrighted interfaces, the
231
231
  original copyright holder who places the Program under this License
@@ -278,7 +278,7 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
278
  POSSIBILITY OF SUCH DAMAGES.
279
279
 
280
280
  END OF TERMS AND CONDITIONS
281
-
281
+
282
282
  How to Apply These Terms to Your New Programs
283
283
 
284
284
  If you develop a new program, and you want it to be of the greatest
@@ -337,4 +337,4 @@ This General Public License does not permit incorporating your program into
337
337
  proprietary programs. If your program is a subroutine library, you may
338
338
  consider it more useful to permit linking proprietary applications with the
339
339
  library. If this is what you want to do, use the GNU Library General
340
- Public License instead of this License.
340
+ Public License instead of this License.
data/README.md CHANGED
@@ -37,16 +37,22 @@ This creates a document with a name from the names array in each label. The labe
37
37
 
38
38
  For a full list of examples, take a look in the `examples` folder.
39
39
 
40
- ### Render a PDF file and send to browser
40
+ ### Generating labels in a Rails controller
41
41
 
42
42
  ```ruby
43
- labels = Prawn::Labels.render(names, :type => "Avery5160") do |pdf, name|
44
- pdf.text name
43
+ class LabelsController < ApplicationController
44
+ def fancy_labels
45
+ labels = Prawn::Labels.render(names, :type => "Avery5160") do |pdf, name|
46
+ pdf.text name
47
+ end
48
+
49
+ send_data labels, :filename => "names.pdf", :type => "application/pdf"
50
+ end
45
51
  end
46
-
47
- send_data labels, :filename => "names.pdf", :type => "application/pdf"
48
52
  ```
49
53
 
54
+ Notice here we use the `render` method rather than `generate`.
55
+
50
56
  ### Scale text to fit label
51
57
 
52
58
  ```ruby
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require "rubygems/package_task"
4
4
  spec = Gem::Specification.load "prawn-labels.gemspec"
5
5
 
6
6
  Gem::PackageTask.new(spec) do |pkg|
7
-
7
+
8
8
  end
9
9
 
10
10
  desc "Run a console with Prawn/Labels loaded"
@@ -48,9 +48,9 @@ module Prawn
48
48
  type["paper_size"] ||= "A4"
49
49
  type["top_margin"] ||= 36
50
50
  type["left_margin"] ||= 36
51
-
51
+
52
52
  options[:document] ||= {}
53
-
53
+
54
54
  options.merge!(:vertical_text => true) if type["vertical_text"]
55
55
 
56
56
  @document = Document.new options[:document].merge(
@@ -59,7 +59,7 @@ module Prawn
59
59
  :bottom_margin => type["bottom_margin"],
60
60
  :left_margin => type["left_margin"],
61
61
  :right_margin => type["right_margin"])
62
-
62
+
63
63
  generate_grid @type
64
64
 
65
65
  data.each_with_index do |record, index|
@@ -7,7 +7,7 @@
7
7
  Avery7160:
8
8
  paper_size: A4
9
9
  top_margin: 43.9
10
- bottom_margin: 0
10
+ bottom_margin: 43.9
11
11
  left_margin: 19.843
12
12
  right_margin: 19.843
13
13
  columns: 3
@@ -23,5 +23,5 @@ END_DESC
23
23
  spec.email = ["jordan.byron@gmail.com"]
24
24
  spec.rubyforge_project = "prawn-labels"
25
25
 
26
- spec.add_dependency 'prawn', ['>= 1.0.0', '~> 2.0.0']
26
+ spec.add_dependency 'prawn', ['>= 1.0.0', '< 3.0.0']
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prawn-labels
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.3
4
+ version: 1.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Byron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-23 00:00:00.000000000 Z
11
+ date: 2016-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prawn
@@ -17,9 +17,9 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.0.0
20
- - - "~>"
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 2.0.0
22
+ version: 3.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,9 +27,9 @@ dependencies:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.0.0
30
- - - "~>"
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 2.0.0
32
+ version: 3.0.0
33
33
  description: |2
34
34
  Prawn/Labels takes the guess work out of generating labels using Prawn
35
35
  email: