wunderbar 0.8.12 → 0.8.13

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/demo/wiki.html CHANGED
@@ -48,6 +48,8 @@ typically <code>www-data</code> on Unix or <code>www</code> on Mac OS/X.</li>
48
48
  AddHandler cgi-script .cgi
49
49
  </code></pre>
50
50
 
51
+ <blockquote><p>Optionally configure <a href="http://httpd.apache.org/docs/2.4/howto/auth.html">Authentication</a> for multiple users.</p></blockquote>
52
+
51
53
  <p>Install scripts:</p>
52
54
 
53
55
  <ul>
@@ -61,6 +63,8 @@ document root</li>
61
63
  <pre><code> ruby wiki.rb --install=/var/www/wikiname.cgi --WIKIDATA="/full/path/to/data/directory"
62
64
  </code></pre>
63
65
 
66
+ <blockquote><p>Optionally tailor the setting of the $EMAIL variable in the script. The current default logic is based on a Unix like operating system (such as Linux, Mac OS/X) with users having email addresses on this machine. Replace as needed.</p></blockquote>
67
+
64
68
  <p>Access your wiki:</p>
65
69
 
66
70
  <pre><code> http://localhost/wikiname/
data/demo/wiki.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  #!/usr/bin/ruby
2
2
  require 'wunderbar'
3
3
  require 'rdiscount'
4
- require 'shellwords'
5
4
  require 'digest/md5'
6
5
 
7
6
  Dir.chdir WIKIDATA
@@ -49,7 +48,13 @@ W_.html do
49
48
  _p 'Nothing changed'
50
49
  else
51
50
  _.system "git add #{file}"
52
- _.system "git commit -m #{@comment.shellescape} #{file}"
51
+
52
+ commit = %w(git commit)
53
+ commit << '--author' << $EMAIL if defined? $EMAIL and $EMAIL
54
+ commit << '--message' << @comment
55
+ commit << file
56
+
57
+ _.system commit
53
58
  end
54
59
  end
55
60
  end
@@ -198,3 +203,12 @@ end
198
203
  __END__
199
204
  # Customize where the wiki data is stored
200
205
  WIKIDATA = '/full/path/to/data/directory'
206
+
207
+ # git author e-mail address override
208
+ require 'etc'
209
+ begin
210
+ name = Etc.getpwnam($USER).gecos.split(',').first
211
+ $EMAIL = "#{name} <#{$USER}@#{$env.SERVER_NAME}>"
212
+ $EMAIL = nil if %w(www-data _www).include?($USER)
213
+ rescue
214
+ end
@@ -103,6 +103,18 @@ module Wunderbar
103
103
 
104
104
  # execute a system command, echoing stdin, stdout, and stderr
105
105
  def system(command, opts={})
106
+ if command.respond_to? :join
107
+ begin
108
+ # if available, use escape as it does prettier quoting
109
+ require 'escape'
110
+ command = Escape.shell_command(command)
111
+ rescue LoadError
112
+ # std-lib function that gets the job done
113
+ require 'shellwords'
114
+ command = Shellwords.join(command)
115
+ end
116
+ end
117
+
106
118
  require 'open3'
107
119
  tag = opts[:tag] || 'pre'
108
120
  output_class = opts[:class] || {}
@@ -2,7 +2,7 @@ module Wunderbar
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 8
5
- TINY = 12
5
+ TINY = 13
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
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.12"
5
+ s.version = "0.8.13"
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-23"
9
+ s.date = "2012-03-24"
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/cssproxy.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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wunderbar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.12
4
+ version: 0.8.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-23 00:00:00.000000000Z
12
+ date: 2012-03-24 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: builder
16
- requirement: &20890340 !ruby/object:Gem::Requirement
16
+ requirement: &13219860 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *20890340
24
+ version_requirements: *13219860
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: json
27
- requirement: &20889580 !ruby/object:Gem::Requirement
27
+ requirement: &13219000 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *20889580
35
+ version_requirements: *13219000
36
36
  description: ! " Provides a number of globals, helper methods, and monkey patches
37
37
  which\n simplify the generation of HTML and the development of CGI scripts.\n"
38
38
  email: rubys@intertwingly.net