thorsson_cups 0.0.18 → 0.0.20

Sign up to get free protection for your applications and to get access to all the features.
data/ext/cups.c CHANGED
@@ -53,13 +53,17 @@ int printer_exists(VALUE printer){
53
53
  */
54
54
  static VALUE job_init(int argc, VALUE* argv, VALUE self)
55
55
  {
56
- VALUE filename, printer, job_options;
56
+ VALUE filename, printer, job_options, job_id;
57
57
 
58
- rb_scan_args(argc, argv, "12", &filename, &printer, &job_options);
58
+ rb_scan_args(argc, argv, "12", &filename, &printer, &job_options, &job_id);
59
59
 
60
60
  rb_iv_set(self, "@filename", filename);
61
61
  rb_iv_set(self, "@url_path", rb_str_new2(cupsServer()));
62
62
 
63
+ if(!NIL_P(job_id)) {
64
+ rv_iv_set(self, "@job_id", NUM2INT(job_id));
65
+ }
66
+
63
67
  if (NIL_P(job_options)) {
64
68
  rb_iv_set(self, "@job_options", rb_hash_new());
65
69
  } else {
@@ -117,7 +121,7 @@ static VALUE cups_print(VALUE self)
117
121
  char *target = RSTRING_PTR(printer); // Target printer string
118
122
  char *url = RSTRING_PTR(url_path); // Server URL address
119
123
  int port = 631; // Default CUPS port
120
-
124
+
121
125
  VALUE job_options = rb_iv_get(self, "@job_options");
122
126
 
123
127
  // Create an array of the keys from the job_options hash
@@ -413,14 +417,17 @@ static VALUE cups_get_jobs(VALUE self, VALUE printer)
413
417
 
414
418
  /*
415
419
  * call-seq:
416
- * Cups.cancel_print(cups_id) -> true or false
420
+ * Cups.cancel_print(cups_id, printer_name) -> true or false
417
421
  *
418
422
  * Cancel the print job. Returns true if successful, false otherwise.
419
423
  */
420
424
  static VALUE cups_cancel_print(int argc, VALUE* argv, VALUE self)
421
425
  {
422
426
  VALUE printer, job_id;
423
- rb_scan_args(argc, argv, "12", &job_id, &printer);
427
+ rb_scan_args(argc, argv, "20", &job_id, &printer);
428
+
429
+ VALUE url_path = cupsServer();
430
+ char *url = RSTRING_PTR(url_path);
424
431
 
425
432
  if (NIL_P(job_id)) {
426
433
  return Qfalse; // If @job_id is nil
data/ext/extconf.rb CHANGED
File without changes
data/ext/ruby_cups.h CHANGED
File without changes
File without changes
File without changes
data/test/cups_test.rb CHANGED
File without changes
data/test/sample.txt CHANGED
File without changes
File without changes
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 18
9
- version: 0.0.18
8
+ - 20
9
+ version: 0.0.20
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ivan Turkovic
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-12-09 00:00:00 +01:00
18
+ date: 2011-01-11 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -31,13 +31,13 @@ extra_rdoc_files: []
31
31
 
32
32
  files:
33
33
  - test/cups_test.rb
34
- - test/sample_blank.txt
35
34
  - test/sample.txt
35
+ - test/sample_blank.txt
36
36
  - ext/cups.c
37
37
  - ext/ruby_cups.h
38
38
  - ext/extconf.rb
39
- - lib/cups/printer/printer.rb
40
39
  - lib/cups/print_job/transient.rb
40
+ - lib/cups/printer/printer.rb
41
41
  has_rdoc: true
42
42
  homepage: https://github.com/Thorsson/cups
43
43
  licenses: []