wunderbar 0.8.8 → 0.8.9

Sign up to get free protection for your applications and to get access to all the features.
data/demo/envdump.rb CHANGED
@@ -1,12 +1,28 @@
1
1
  require 'wunderbar'
2
2
 
3
- Wunderbar.html do
3
+ W_.html do
4
4
  _head_ do
5
5
  _title 'CGI Environment'
6
+ _style %{
7
+ table {border-spacing: 0}
8
+ th, td {padding: 0.2em 0.5em}
9
+ thead th {border-bottom: solid 1px #000}
10
+ tbody tr:nth-child(5n) td {border-bottom: solid 1px #888}
11
+ th:last-child, td:last-child {border-left: solid 1px #000}
12
+ tr:hover {background-color: #FF8}
13
+ }
6
14
  end
15
+
7
16
  _body? do
8
17
  _h1 'Environment Variables'
9
18
  _table do
19
+ _thead_ do
20
+ _tr do
21
+ _th 'Name'
22
+ _th 'Value'
23
+ end
24
+ end
25
+
10
26
  _tbody do
11
27
  ENV.sort.each do |name, value|
12
28
  _tr_ do
data/demo/helloworld.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'wunderbar'
2
2
 
3
- Wunderbar.html do
3
+ W_.html do
4
4
  _head_ do
5
5
  _title 'Greeter'
6
6
  _style %{
data/demo/wiki.rb CHANGED
@@ -11,8 +11,8 @@ Dir.chdir WIKIDATA
11
11
  flag ||= '?' if $env.REQUEST_URI.include? '?'
12
12
  file ||= 'index'
13
13
 
14
- Wunderbar.html do
15
- _head do
14
+ W_.html do
15
+ _head_ do
16
16
  _title file
17
17
  _style %{
18
18
  body {background-color: #{(flag=='?') ? '#E0D8D8' : '#FFF'}}
@@ -95,7 +95,7 @@ Wunderbar.html do
95
95
  _span 'Output', style: 'float: right; margin-right: 2em'
96
96
  end
97
97
 
98
- _form action: file, method: 'post' do
98
+ _form_ action: file, method: 'post' do
99
99
  _textarea @markup, name: 'markup', class: 'input'
100
100
  _input type: 'hidden', name: 'hash',
101
101
  value: Digest::MD5.hexdigest(@markup)
@@ -125,7 +125,7 @@ Wunderbar.html do
125
125
 
126
126
  #display
127
127
  _ << RDiscount.new(@markup).to_html
128
- _div class: 'buttons' do
128
+ _div_ class: 'buttons' do
129
129
  if !rev or rev.empty?
130
130
  _form action: "#{file}?", method: 'post' do
131
131
  _input type: 'submit', value: 'edit'
@@ -185,7 +185,7 @@ Wunderbar.html do
185
185
  end
186
186
 
187
187
  # process autosave requests
188
- Wunderbar.json do
188
+ W_.json do
189
189
  hash = Digest::MD5.hexdigest(@markup)
190
190
  if File.exist?(file) and Digest::MD5.hexdigest(File.read(file)) != @hash
191
191
  {error: "Write conflict", markup: File.read(file), hash: hash}
@@ -58,6 +58,7 @@ if install and ARGV.delete(install)
58
58
  file.puts <<-EOF.gsub(/^ {8}/,'')
59
59
  begin
60
60
  #{require}
61
+ rescue ::SystemExit => exception
61
62
  rescue ::Exception => exception
62
63
  print "Content-Type: text/plain\\r\\n\\r\\n"
63
64
  puts exception.inspect
@@ -2,7 +2,7 @@ module Wunderbar
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 8
5
- TINY = 8
5
+ TINY = 9
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/lib/wunderbar.rb CHANGED
@@ -10,3 +10,4 @@ require 'wunderbar/installation'
10
10
  require 'wunderbar/builder'
11
11
  require 'wunderbar/logger'
12
12
 
13
+ W_ = Wunderbar
data/tools/web2script.rb CHANGED
@@ -98,7 +98,7 @@ def code(element, indent='')
98
98
  end
99
99
 
100
100
  line = "#{indent}_#{element_name}#{attributes.join(',')}"
101
- line.sub! /^_/, 'Wunderbar.' if element_name == 'html' and indent.empty?
101
+ line.sub! /^_/, 'W_.' if element_name == 'html' and indent.empty?
102
102
 
103
103
  if element.children.empty?
104
104
  flow_attrs "#{indent}_#{element_name}#{attributes.pop}", attributes, indent
data/wunderbar.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "wunderbar"
5
- s.version = "0.8.8"
5
+ s.version = "0.8.9"
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
- s.date = "2012-03-18"
9
+ s.date = "2012-03-20"
10
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
12
  s.extra_rdoc_files = ["COPYING", "README.md", "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/logger.rb", "lib/wunderbar/version.rb"]
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: 47
4
+ hash: 45
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 8
10
- version: 0.8.8
9
+ - 9
10
+ version: 0.8.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sam Ruby
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-18 00:00:00 Z
18
+ date: 2012-03-20 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: builder