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 +4 -4
- data/COPYING +6 -6
- data/README.md +11 -5
- data/Rakefile +1 -1
- data/lib/prawn/labels.rb +3 -3
- data/lib/prawn/types.yaml +1 -1
- data/prawn-labels.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4da2f699180b8a2ebed9c5bec09c08badc9a17e
|
4
|
+
data.tar.gz: 77e4373ac6877a89588d6656e375bf297d7b41c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
###
|
40
|
+
### Generating labels in a Rails controller
|
41
41
|
|
42
42
|
```ruby
|
43
|
-
|
44
|
-
|
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
data/lib/prawn/labels.rb
CHANGED
@@ -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|
|
data/lib/prawn/types.yaml
CHANGED
data/prawn-labels.gemspec
CHANGED
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.
|
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:
|
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:
|
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:
|
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:
|