cupsffi 0.1.5 → 0.1.6
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/lib/cupsffi/lib.rb +1 -1
- data/lib/cupsffi/printer.rb +7 -1
- data/lib/cupsffi/version.rb +1 -1
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dc42d5733faba1d922a1bb2049ffb676891d825
|
4
|
+
data.tar.gz: adf32d3a751973533fb46eda8fd9f004d50aba9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffced75bf023e694075a312097dba31f28a42078a56c685bcf0d71cbd2dd62d34a6257e6cb42c7b318af3d723bebe286dc39e5de6f68d98ae4d7b35fb1490944
|
7
|
+
data.tar.gz: 3f48bdcdea3b8427b1362cba31932fbc3c60c1e5abc953698d860f5c3b74911bed7d6387b5b3e8c2f112b6b50e51ba035b1292f26fa56ebfdcddd88720141b67
|
data/lib/cupsffi/lib.rb
CHANGED
@@ -245,7 +245,7 @@ module CupsFFI
|
|
245
245
|
# - length of data
|
246
246
|
# Returns
|
247
247
|
# - HttpStatus
|
248
|
-
attach_function 'cupsWriteRequestData', [:pointer, :
|
248
|
+
attach_function 'cupsWriteRequestData', [:pointer, :pointer, :size_t], HttpStatus
|
249
249
|
|
250
250
|
# Parameters
|
251
251
|
# - pointer to http connection to server or CUPS_HTTP_DEFAULT
|
data/lib/cupsffi/printer.rb
CHANGED
@@ -165,13 +165,19 @@ class CupsPrinter
|
|
165
165
|
raise last_error
|
166
166
|
end
|
167
167
|
|
168
|
+
# Copy the data into a char pointer to allow null bytes
|
169
|
+
data_pointer = FFI::MemoryPointer.new(:char, data.bytesize)
|
170
|
+
data_pointer.put_bytes(0, data)
|
171
|
+
|
168
172
|
http_status = CupsFFI::cupsStartDocument(@connection, @name,
|
169
173
|
job_id, 'my doc', mime_type, 1)
|
170
174
|
|
171
|
-
http_status = CupsFFI::cupsWriteRequestData(@connection,
|
175
|
+
http_status = CupsFFI::cupsWriteRequestData(@connection, data_pointer, data.bytesize)
|
172
176
|
|
173
177
|
ipp_status = CupsFFI::cupsFinishDocument(@connection, @name)
|
174
178
|
|
179
|
+
data_pointer.free
|
180
|
+
|
175
181
|
unless ipp_status == :ipp_ok
|
176
182
|
CupsFFI::cupsFreeOptions(num_options, options_pointer) unless options_pointer.nil?
|
177
183
|
raise ipp_status.to_s
|
data/lib/cupsffi/version.rb
CHANGED
metadata
CHANGED
@@ -1,31 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cupsffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Ehresman
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: ffi
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
16
15
|
requirements:
|
17
16
|
- - ">="
|
18
17
|
- !ruby/object:Gem::Version
|
19
18
|
version: '0'
|
20
|
-
|
19
|
+
name: ffi
|
21
20
|
prerelease: false
|
21
|
+
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
description: Simple wrapper around libcups to give CUPS printing capabilities to Ruby
|
28
|
-
apps.
|
27
|
+
description: Simple wrapper around libcups to give CUPS printing capabilities to Ruby apps.
|
29
28
|
email:
|
30
29
|
- nehresma@gmail.com
|
31
30
|
executables: []
|
@@ -47,7 +46,7 @@ files:
|
|
47
46
|
homepage: https://github.com/nehresma/cupsffi
|
48
47
|
licenses: []
|
49
48
|
metadata: {}
|
50
|
-
post_install_message:
|
49
|
+
post_install_message:
|
51
50
|
rdoc_options: []
|
52
51
|
require_paths:
|
53
52
|
- lib
|
@@ -63,8 +62,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
62
|
version: '0'
|
64
63
|
requirements: []
|
65
64
|
rubyforge_project: cupsffi
|
66
|
-
rubygems_version: 2.
|
67
|
-
signing_key:
|
65
|
+
rubygems_version: 2.6.8
|
66
|
+
signing_key:
|
68
67
|
specification_version: 4
|
69
68
|
summary: FFI wrapper around libcups
|
70
69
|
test_files: []
|