wunderbar 0.16.1 → 0.16.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -1
- data/lib/wunderbar/builder.rb +10 -4
- data/lib/wunderbar/version.rb +1 -1
- data/wunderbar.gemspec +2 -2
- metadata +39 -62
data/README.md
CHANGED
@@ -310,7 +310,9 @@ are sent individually and as they are produced.
|
|
310
310
|
`_.system` will run an aritrary command. Lines of output are sent across the
|
311
311
|
websocket as they are received as JSON encoded hashes with two values: `type`
|
312
312
|
is one of `stdin`, `stdout` or `stderr`; and `line` which contains the line
|
313
|
-
itself.
|
313
|
+
itself. If the command is an array, the elements of the array will be escaped
|
314
|
+
as Shell command arguments. Nested arrays may be used to hide elements from
|
315
|
+
the echoing of the command to stdin. Nil values are omitted.
|
314
316
|
|
315
317
|
Options to `_websocket` are provided as a hash:
|
316
318
|
|
data/lib/wunderbar/builder.rb
CHANGED
@@ -179,16 +179,22 @@ module Wunderbar
|
|
179
179
|
|
180
180
|
# execute a system command, echoing stdin, stdout, and stderr
|
181
181
|
def system(command, opts={})
|
182
|
-
if command.respond_to? :
|
182
|
+
if command.respond_to? :flatten
|
183
|
+
flat = command.flatten
|
184
|
+
secret = command - flat
|
183
185
|
begin
|
184
186
|
# if available, use escape as it does prettier quoting
|
185
187
|
require 'escape'
|
186
|
-
|
188
|
+
echo = Escape.shell_command(command.compact - secret)
|
189
|
+
command = Escape.shell_command(flat.compact).untaint
|
187
190
|
rescue LoadError
|
188
191
|
# std-lib function that gets the job done
|
189
192
|
require 'shellwords'
|
190
|
-
|
193
|
+
echo = Shellwords.join(command.compact - secret)
|
194
|
+
command = Shellwords.join(flat.compact).untaint
|
191
195
|
end
|
196
|
+
else
|
197
|
+
echo = command
|
192
198
|
end
|
193
199
|
|
194
200
|
require 'open3'
|
@@ -198,7 +204,7 @@ module Wunderbar
|
|
198
204
|
stdout = output_class[:stdout] || '_stdout'
|
199
205
|
stderr = output_class[:stderr] || '_stderr'
|
200
206
|
|
201
|
-
@_builder.tag! tag,
|
207
|
+
@_builder.tag! tag, echo, :class=>stdin unless opts[:echo] == false
|
202
208
|
|
203
209
|
require 'thread'
|
204
210
|
semaphore = Mutex.new
|
data/lib/wunderbar/version.rb
CHANGED
data/wunderbar.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "wunderbar"
|
5
|
-
s.version = "0.16.
|
5
|
+
s.version = "0.16.2"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Sam Ruby"]
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.files = ["wunderbar.gemspec", "README.md", "COPYING", "lib/wunderbar.rb", "lib/wunderbar", "lib/wunderbar/installation.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/server.rb", "lib/wunderbar/logger.rb", "lib/wunderbar/rack.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/websocket.rb", "lib/wunderbar/sinatra.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/rails.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/cssproxy.rb", "lib/wunderbar/version.rb"]
|
13
13
|
s.homepage = "http://github.com/rubys/wunderbar"
|
14
14
|
s.require_paths = ["lib"]
|
15
|
-
s.rubygems_version = "1.8.
|
15
|
+
s.rubygems_version = "1.8.15"
|
16
16
|
s.summary = "HTML Generator and CGI application support"
|
17
17
|
|
18
18
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,60 +1,47 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: wunderbar
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.16.2
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 16
|
9
|
-
- 1
|
10
|
-
version: 0.16.1
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Sam Ruby
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-05-17 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: builder
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &5805260 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 3
|
31
|
-
- 0
|
32
|
-
version: "3.0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.0'
|
33
22
|
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: json
|
37
23
|
prerelease: false
|
38
|
-
|
24
|
+
version_requirements: *5805260
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: json
|
27
|
+
requirement: &5804520 !ruby/object:Gem::Requirement
|
39
28
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
segments:
|
45
|
-
- 0
|
46
|
-
version: "0"
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
47
33
|
type: :runtime
|
48
|
-
|
49
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *5804520
|
36
|
+
description: ! " Wunderbar makes it easy to produce valid HTML5, wellformed XHTML,
|
37
|
+
Unicode\n (utf-8), consistently indented, readable applications. This includes\n
|
38
|
+
\ output that conforms to the Polyglot specification and the emerging\n results
|
39
|
+
from the XML Error Recovery Community Group.\n"
|
50
40
|
email: rubys@intertwingly.net
|
51
41
|
executables: []
|
52
|
-
|
53
42
|
extensions: []
|
54
|
-
|
55
43
|
extra_rdoc_files: []
|
56
|
-
|
57
|
-
files:
|
44
|
+
files:
|
58
45
|
- wunderbar.gemspec
|
59
46
|
- README.md
|
60
47
|
- COPYING
|
@@ -75,36 +62,26 @@ files:
|
|
75
62
|
- lib/wunderbar/version.rb
|
76
63
|
homepage: http://github.com/rubys/wunderbar
|
77
64
|
licenses: []
|
78
|
-
|
79
65
|
post_install_message:
|
80
66
|
rdoc_options: []
|
81
|
-
|
82
|
-
require_paths:
|
67
|
+
require_paths:
|
83
68
|
- lib
|
84
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
85
70
|
none: false
|
86
|
-
requirements:
|
87
|
-
- -
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
|
90
|
-
|
91
|
-
- 0
|
92
|
-
version: "0"
|
93
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ! '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
76
|
none: false
|
95
|
-
requirements:
|
96
|
-
- -
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
|
99
|
-
segments:
|
100
|
-
- 0
|
101
|
-
version: "0"
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
102
81
|
requirements: []
|
103
|
-
|
104
82
|
rubyforge_project:
|
105
|
-
rubygems_version: 1.8.
|
83
|
+
rubygems_version: 1.8.15
|
106
84
|
signing_key:
|
107
85
|
specification_version: 3
|
108
86
|
summary: HTML Generator and CGI application support
|
109
87
|
test_files: []
|
110
|
-
|