labelary 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +2 -0
- data/lib/labelary.rb +6 -0
- data/lib/labelary/configuration.rb +1 -1
- data/lib/labelary/label.rb +5 -1
- data/lib/labelary/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bfb976fe9132ddc1eda91ea59e492fae1a1cb1e5bdb248ef5774283a16a71297
|
4
|
+
data.tar.gz: d134dbbf2459083fc595c77b0c1e83098137721cd49664139d6517b1617bef39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d672c17592334da9b00dfc46e8e9517201a832685f44f0d19a17a03905eb2fb968740c463c7c833e0e8436ad84d9361b7f05925d35cb97a1e2da39de261d235
|
7
|
+
data.tar.gz: 8f9188b15884b2937de8de875538cac97696ebb876cc78dc290b319f501a53d307d252615228f9d15e9e1f59a2bf7e34ed75781cfd2947f83345bd550666905f
|
data/README.md
CHANGED
@@ -87,6 +87,8 @@ You also need to configure fonts.
|
|
87
87
|
Labelary::Label.render zpl: '^XA^A@,,,E:TT0003M_.FNT^FDHello World^FS^XZ', font: File.read('./swiss-721-font/77849_002.ZSU')
|
88
88
|
```
|
89
89
|
|
90
|
+
There is also a helper method, `Labelary.font` to grab your configured font string.
|
91
|
+
|
90
92
|
### ZPL Encoding Images
|
91
93
|
|
92
94
|
Pass in an image (or an IO object) and it's mime type and you'll get back a ZPL encoded version.
|
data/lib/labelary.rb
CHANGED
data/lib/labelary/label.rb
CHANGED
@@ -20,11 +20,15 @@ module Labelary
|
|
20
20
|
|
21
21
|
# http://labelary.com/service.html
|
22
22
|
def render
|
23
|
-
payload =
|
23
|
+
payload = font_string + @zpl
|
24
24
|
response = Labelary::Client.connection.post "/v1/printers/#{@dpmm}dpmm/labels/#{@width}x#{@height}/#{@index}/", payload, { Accept: @content_type }
|
25
25
|
return response.body
|
26
26
|
end
|
27
27
|
|
28
|
+
def font_string
|
29
|
+
@font.present? ? @font.to_s : ''
|
30
|
+
end
|
31
|
+
|
28
32
|
private
|
29
33
|
|
30
34
|
def config
|
data/lib/labelary/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: labelary
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Coleman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -121,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
123
|
rubyforge_project:
|
124
|
-
rubygems_version: 2.
|
124
|
+
rubygems_version: 2.7.6
|
125
125
|
signing_key:
|
126
126
|
specification_version: 4
|
127
127
|
summary: Ruby Gem to interact with the Labelary.com ZPL Web Service
|