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 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
- = cgi-spa: Common Gateway Interface for Single Page Applications
1
+ = Wunderbar: Common Gateway Interface for Single Page Applications
2
2
 
3
- CGI-SPA provides a number of globals, helper methods, and monkey patches which
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 Builder"
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 development of generation of HTML and other artifacts for
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{/cgi-spa/}
167
+ next if frame =~ %r{/wunderbar/}
168
168
  next if frame =~ %r{/gems/.*/builder/}
169
169
  text += "\n #{frame}"
170
170
  end
@@ -2,7 +2,7 @@ module Wunderbar
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 8
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/lib/wunderbar.rb ADDED
@@ -0,0 +1,11 @@
1
+ require 'cgi'
2
+ require 'builder'
3
+ require 'json'
4
+
5
+ require 'wunderbar/environment'
6
+ require 'wunderbar/cgi-methods'
7
+ require 'wunderbar/html-methods'
8
+ require 'wunderbar/job-control'
9
+ require 'wunderbar/installation'
10
+ require 'wunderbar/builder'
11
+
@@ -1,6 +1,6 @@
1
1
  require 'test/unit'
2
2
  require 'rubygems'
3
- require 'cgi-spa'
3
+ require 'wunderbar'
4
4
 
5
5
  class HtmlMarkupTest < Test::Unit::TestCase
6
6
  def setup
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.0"
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 development of generation of HTML and other artifacts for\n CGI scripts.\n"
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/cgi-spa.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/cgi-spa.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"]
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 Builder"
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: 63
4
+ hash: 61
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 0
10
- version: 0.8.0
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 development of generation of HTML and other artifacts for\n CGI scripts.\n"
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/cgi-spa.rb
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/cgi-spa.rb
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 Builder
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
@@ -1,11 +0,0 @@
1
- require 'cgi'
2
- require 'builder'
3
- require 'json'
4
-
5
- require 'cgi-spa/environment'
6
- require 'cgi-spa/cgi-methods'
7
- require 'cgi-spa/html-methods'
8
- require 'cgi-spa/job-control'
9
- require 'cgi-spa/installation'
10
- require 'cgi-spa/builder'
11
-