wunderbar 0.8.0 → 0.8.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.
- data/Manifest +0 -13
- data/README +2 -2
- data/Rakefile +4 -3
- data/lib/wunderbar/cgi-methods.rb +16 -0
- data/lib/wunderbar/environment.rb +0 -19
- data/lib/wunderbar/html-methods.rb +1 -1
- data/lib/wunderbar/version.rb +1 -1
- data/lib/wunderbar.rb +11 -0
- data/test/test_html_markup.rb +1 -1
- data/wunderbar.gemspec +5 -5
- metadata +7 -7
- data/lib/cgi-spa.rb +0 -11
data/Manifest
CHANGED
@@ -1,13 +0,0 @@
|
|
1
|
-
COPYING
|
2
|
-
README
|
3
|
-
Rakefile
|
4
|
-
lib/cgi-spa.rb
|
5
|
-
lib/wunderbar/builder.rb
|
6
|
-
lib/wunderbar/cgi-methods.rb
|
7
|
-
lib/wunderbar/environment.rb
|
8
|
-
lib/wunderbar/html-methods.rb
|
9
|
-
lib/wunderbar/installation.rb
|
10
|
-
lib/wunderbar/job-control.rb
|
11
|
-
lib/wunderbar/version.rb
|
12
|
-
test/test_html_markup.rb
|
13
|
-
Manifest
|
data/README
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
=
|
1
|
+
= Wunderbar: Common Gateway Interface for Single Page Applications
|
2
2
|
|
3
|
-
|
3
|
+
Wunder provides a number of globals, helper methods, and monkey patches which
|
4
4
|
simplify the development of single page applications in the form of CGI
|
5
5
|
scripts.
|
6
6
|
|
data/Rakefile
CHANGED
@@ -4,12 +4,13 @@ require 'echoe'
|
|
4
4
|
|
5
5
|
require File.expand_path(File.dirname(__FILE__) + "/lib/wunderbar/version")
|
6
6
|
|
7
|
+
mkdir_p 'pkg' unless File.exist? 'pkg'
|
8
|
+
|
7
9
|
Echoe.new('wunderbar', Wunderbar::VERSION::STRING) do |p|
|
8
|
-
p.summary = "CGI
|
10
|
+
p.summary = "HTML Generator and CGI application support"
|
9
11
|
p.description = <<-EOF
|
10
12
|
Provides a number of globals, helper methods, and monkey patches which
|
11
|
-
simplify the
|
12
|
-
CGI scripts.
|
13
|
+
simplify the generation of HTML and the development of CGI scripts.
|
13
14
|
EOF
|
14
15
|
p.url = "http://github.com/rubys/wunderbar"
|
15
16
|
p.author = "Sam Ruby"
|
@@ -115,3 +115,19 @@ end
|
|
115
115
|
def $cgi.post! &block
|
116
116
|
html!(&block) if $HTTP_POST
|
117
117
|
end
|
118
|
+
|
119
|
+
# canonical interface
|
120
|
+
module Wunderbar
|
121
|
+
def self.html(*args, &block)
|
122
|
+
$cgi.html!(*args, &block)
|
123
|
+
end
|
124
|
+
|
125
|
+
def self.json(*args, &block)
|
126
|
+
$cgi.json!(*args, &block)
|
127
|
+
end
|
128
|
+
|
129
|
+
def self.text(*args, &block)
|
130
|
+
$cgi.text!(*args, &block)
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
@@ -1,6 +1,3 @@
|
|
1
|
-
# safety first!
|
2
|
-
$SAFE = 1 unless $UNSAFE or $SAFE > 1
|
3
|
-
|
4
1
|
# explicit request types
|
5
2
|
$HTTP_GET = ARGV.delete('--html')
|
6
3
|
$HTTP_POST = ARGV.delete('--post')
|
@@ -14,20 +11,6 @@ ARGV.delete('--prompt') or ARGV.delete('--offline')
|
|
14
11
|
|
15
12
|
# standard objects
|
16
13
|
$cgi = CGI.new
|
17
|
-
|
18
|
-
def $cgi.validate(validations)
|
19
|
-
$SAFE = 1
|
20
|
-
$cgi.params.each do |key, values|
|
21
|
-
next unless validations.include? key
|
22
|
-
values.each do |value|
|
23
|
-
unless value =~ validations[key]
|
24
|
-
raise SecurityError.new("CGI parameter #{key} doesn't match #{validations[key]}")
|
25
|
-
end
|
26
|
-
value.untaint
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
14
|
$param = $cgi.params
|
32
15
|
$x = Builder::XmlMarkup.new :indent => 2
|
33
16
|
|
@@ -87,8 +70,6 @@ $USER = ENV['REMOTE_USER'] || ENV['USER'] ||
|
|
87
70
|
`getent passwd #{Process.uid}`.split(':').first
|
88
71
|
end
|
89
72
|
|
90
|
-
$USER = $USER.dup.untaint if $USER =~ /^\w+$/
|
91
|
-
|
92
73
|
ENV['REMOTE_USER'] ||= $USER
|
93
74
|
|
94
75
|
$HOME = ENV['HOME'] || File.expand_path('~' + $USER)
|
@@ -164,7 +164,7 @@ class HtmlMarkup
|
|
164
164
|
rescue ::Exception => exception
|
165
165
|
text = exception.inspect
|
166
166
|
exception.backtrace.each do |frame|
|
167
|
-
next if frame =~ %r{/
|
167
|
+
next if frame =~ %r{/wunderbar/}
|
168
168
|
next if frame =~ %r{/gems/.*/builder/}
|
169
169
|
text += "\n #{frame}"
|
170
170
|
end
|
data/lib/wunderbar/version.rb
CHANGED
data/lib/wunderbar.rb
ADDED
data/test/test_html_markup.rb
CHANGED
data/wunderbar.gemspec
CHANGED
@@ -2,21 +2,21 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "wunderbar"
|
5
|
-
s.version = "0.8.
|
5
|
+
s.version = "0.8.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Sam Ruby"]
|
9
9
|
s.date = "2012-02-02"
|
10
|
-
s.description = " Provides a number of globals, helper methods, and monkey patches which\n simplify the
|
10
|
+
s.description = " Provides a number of globals, helper methods, and monkey patches which\n simplify the generation of HTML and the development of CGI scripts.\n"
|
11
11
|
s.email = "rubys@intertwingly.net"
|
12
|
-
s.extra_rdoc_files = ["COPYING", "README", "lib/
|
13
|
-
s.files = ["COPYING", "README", "Rakefile", "lib/
|
12
|
+
s.extra_rdoc_files = ["COPYING", "README", "lib/wunderbar.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/installation.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/version.rb"]
|
13
|
+
s.files = ["COPYING", "README", "Rakefile", "lib/wunderbar.rb", "lib/wunderbar/builder.rb", "lib/wunderbar/cgi-methods.rb", "lib/wunderbar/environment.rb", "lib/wunderbar/html-methods.rb", "lib/wunderbar/installation.rb", "lib/wunderbar/job-control.rb", "lib/wunderbar/version.rb", "test/test_html_markup.rb", "Manifest", "wunderbar.gemspec"]
|
14
14
|
s.homepage = "http://github.com/rubys/wunderbar"
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Wunderbar", "--main", "README"]
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
s.rubyforge_project = "wunderbar"
|
18
18
|
s.rubygems_version = "1.8.15"
|
19
|
-
s.summary = "CGI
|
19
|
+
s.summary = "HTML Generator and CGI application support"
|
20
20
|
s.test_files = ["test/test_html_markup.rb"]
|
21
21
|
|
22
22
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wunderbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 61
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 8
|
9
|
-
-
|
10
|
-
version: 0.8.
|
9
|
+
- 1
|
10
|
+
version: 0.8.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sam Ruby
|
@@ -45,7 +45,7 @@ dependencies:
|
|
45
45
|
version: "0"
|
46
46
|
type: :runtime
|
47
47
|
version_requirements: *id002
|
48
|
-
description: " Provides a number of globals, helper methods, and monkey patches which\n simplify the
|
48
|
+
description: " Provides a number of globals, helper methods, and monkey patches which\n simplify the generation of HTML and the development of CGI scripts.\n"
|
49
49
|
email: rubys@intertwingly.net
|
50
50
|
executables: []
|
51
51
|
|
@@ -54,7 +54,7 @@ extensions: []
|
|
54
54
|
extra_rdoc_files:
|
55
55
|
- COPYING
|
56
56
|
- README
|
57
|
-
- lib/
|
57
|
+
- lib/wunderbar.rb
|
58
58
|
- lib/wunderbar/builder.rb
|
59
59
|
- lib/wunderbar/cgi-methods.rb
|
60
60
|
- lib/wunderbar/environment.rb
|
@@ -66,7 +66,7 @@ files:
|
|
66
66
|
- COPYING
|
67
67
|
- README
|
68
68
|
- Rakefile
|
69
|
-
- lib/
|
69
|
+
- lib/wunderbar.rb
|
70
70
|
- lib/wunderbar/builder.rb
|
71
71
|
- lib/wunderbar/cgi-methods.rb
|
72
72
|
- lib/wunderbar/environment.rb
|
@@ -115,6 +115,6 @@ rubyforge_project: wunderbar
|
|
115
115
|
rubygems_version: 1.8.15
|
116
116
|
signing_key:
|
117
117
|
specification_version: 3
|
118
|
-
summary: CGI
|
118
|
+
summary: HTML Generator and CGI application support
|
119
119
|
test_files:
|
120
120
|
- test/test_html_markup.rb
|
data/lib/cgi-spa.rb
DELETED