vae 0.9.0 → 0.9.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: de2f275762e0dc9d57e999436934d851ebde0f017d5b04fe9ce2a5fb2c7ce121
4
- data.tar.gz: 49ad8260ca9356c246de744522007a0ead78e16565859365e7687da0e11eab86
3
+ metadata.gz: 92e2ed1ab66a2045e2a3343fa7bdf033a5da5b840affc948407376863ec1f9a5
4
+ data.tar.gz: 2794d9c0bcdae2cffd28f287887f435b07abd9b454aed6dd598cca64c3e657ca
5
5
  SHA512:
6
- metadata.gz: 0461a07291b53db820ed2be157c7674a0e5ed853c45e9d2bc38f1f6a15bc3aeb310ecb308481287f9328a596c858e13d8262eee03112009a11b947bf23cfcd8e
7
- data.tar.gz: 6c26b227a0027ead0983d53767eda9cd9ac8637814e37b27fc82755a51e5e1c882a9dc133be64c3721756571438403676f1fdbcaa65bbadac1158c8870d2a6b2
6
+ metadata.gz: ad2a3844af78872f37c640bdf55c827ca3064d9d01bd926010c1f0d35ae0b34a2756dc0e2ae8815bf6c7aee619cb2f4a0ac4348cc6521e51ff0adaf51c4c78cc
7
+ data.tar.gz: c33eb0e919353a3556a68aaf1514f45ca6e5c0c13e56493772b723fbdb3a6883303fbd4aaa019bcd2afc49d7ffb4a961486300abe09a1129b4f86d902f2654e6
data/bin/vae CHANGED
@@ -16,6 +16,7 @@ require 'net/http'
16
16
  require 'net/https'
17
17
  require 'optparse'
18
18
  require 'ptools'
19
+ require 'pty'
19
20
  require 'rest-client'
20
21
  require 'shellwords'
21
22
  require 'tempfile'
@@ -40,7 +40,10 @@ class PrintNodeServer < ProxyServer
40
40
  name: node_name,
41
41
  default_printer: default_printer,
42
42
  printers_list: printers_list,
43
- print_queue_status: print_queue_status
43
+ print_queue_status: print_queue_status,
44
+ last_job_id: @last_job_id,
45
+ last_job_success: @last_job_success,
46
+ last_job_output: @last_job_output
44
47
  }
45
48
  }.to_json
46
49
  }
@@ -60,17 +63,24 @@ class PrintNodeServer < ProxyServer
60
63
 
61
64
  def loop_action
62
65
  res = send_post
63
- if match = res.body.match(/<next-job>([^<]*)<\/next-job>/)
66
+ @last_job_success = false
67
+ @last_job_id = @last_job_output = nil
68
+ if match = res.body.match(/<next-job-id>([^<]*)<\/next-job-id>/)
69
+ @last_job_id = match[1]
70
+ end
71
+ if match = res.body.match(/<next-job-url>([^<]*)<\/next-job-url>/)
64
72
  url = match[1]
65
73
  path = "/tmp/VaePrintNode-#{rand.to_s.gsub(".", "")}.pdf"
66
74
  puts "Printing #{url} to #{path}"
67
- `chromehtml2pdf --marginLeft 0.5 --marginRight 0.5 --out "#{path}" #{Shellwords.shellescape(url)}`
75
+ puts `chromehtml2pdf --marginLeft 1 --marginRight 1 --marginTop 1 --marginBottom 1 --out "#{path}" #{Shellwords.shellescape(url)}`
68
76
  if File.exists?(path)
69
- `lp #{path}`
77
+ @last_job_output = `lp #{path}`
70
78
  Thread.new { sleep 15; FileUtils.rm(path) }
71
79
  else
72
- puts "Error: could not generate PDF!"
80
+ @last_job_output = "Error: could not generate PDF!"
73
81
  end
82
+ @last_job_success = true if @last_job_output =~ /request id/
83
+ puts @last_job_output
74
84
  end
75
85
  rescue StandardError => e
76
86
  puts e.message
@@ -58,7 +58,7 @@ class VaeLocal
58
58
  opts.banner = BANNER + "\n\nUsage: vae [options]\n starts a local development server\n vae [options] deploy\n deploys the source in Git repository or provided URL to the Vae servers\n\n If you are using the Vae Production environment features:\n vae [options] stage\n deploys the source in Git repository or provided URL to the staging environment\n vae [options] stagerelease\n deploys the source in Git repository or provided URL to the staging environment\n and releases it to the production environment\n vae [options] release\n releases the current staging environment to the production environment\n vae [options] rollback\n rolls back the production environment to a previous release\n\nAvailable Options:"
59
59
  opts.on("-u","--username <username>","Your Vae username") { |o| options[:username] = o }
60
60
  opts.on("-P","--password <password>","Your Vae password") { |o| options[:password] = o }
61
- opts.on("-p","--port <port number>","Start server on this port") { |o| options[:port] = o.to_i; raise VaeError "Port #{o.to_i} is already in use." unless VaeLocal.port_open?(o.to_i) }
61
+ opts.on("-p","--port <port number>","Start server on this port") { |o| options[:port] = o.to_i; raise VaeError, "Port #{o.to_i} is already in use." unless VaeLocal.port_open?(o.to_i) }
62
62
  opts.on("-r","--root <path to site root>","Path to the root of the local copy of your Vae site.") { |o| options[:site_root] = o }
63
63
  opts.on("-s","--site <subdomain>","Vae subdomain for this site") { |o| options[:site] = o }
64
64
  opts.on("-f","--full-stack [php|hhvm]","Run in Full Stack Mode. Optionally provide 'php' or 'hhvm' to specify your preferred PHP runtime") { |o| options[:server] = FullStack; options[:php_runtime] = o }
@@ -1 +1 @@
1
- VER = "0.9.0"
1
+ VER = "0.9.1"
@@ -0,0 +1,9 @@
1
+ let spawn = require("child_process").spawn
2
+ let args = process.argv
3
+ args.shift()
4
+ args.shift()
5
+ spawn(
6
+ "/usr/bin/env",
7
+ ["ruby", "-W0", __dirname + "/../vae"].concat(process.argv),
8
+ { stdio: [0, 1, 2] }
9
+ );
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vae
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Action Verb, LLC
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-03-21 00:00:00.000000000 Z
12
+ date: 2019-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: chunky_png
@@ -197,6 +197,7 @@ files:
197
197
  - lib/vae_local.rb
198
198
  - lib/vae_site_servlet.rb
199
199
  - lib/version.rb
200
+ - node_wrapper/vae.js
200
201
  - test/vae_test.rb
201
202
  homepage: http://docs.vaeplatform.com/vae_local
202
203
  licenses: