TwP-webby 0.9.4 → 0.9.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +21 -3
- data/Rakefile +11 -5
- data/examples/blog/content/css/blueprint/ie.css +26 -0
- data/examples/blog/content/css/blueprint/plugins/buttons/icons/cross.png +0 -0
- data/examples/blog/content/css/blueprint/plugins/buttons/icons/key.png +0 -0
- data/examples/blog/content/css/blueprint/plugins/buttons/icons/tick.png +0 -0
- data/examples/blog/content/css/blueprint/plugins/buttons/readme.txt +32 -0
- data/examples/blog/content/css/blueprint/plugins/buttons/screen.css +97 -0
- data/examples/blog/content/css/blueprint/plugins/fancy-type/readme.txt +14 -0
- data/examples/blog/content/css/blueprint/plugins/fancy-type/screen.css +71 -0
- data/examples/blog/content/css/blueprint/plugins/link-icons/icons/doc.png +0 -0
- data/examples/blog/content/css/blueprint/plugins/link-icons/icons/email.png +0 -0
- data/examples/blog/content/css/blueprint/plugins/link-icons/icons/external.png +0 -0
- data/examples/blog/content/css/blueprint/plugins/link-icons/icons/feed.png +0 -0
- data/examples/blog/content/css/blueprint/plugins/link-icons/icons/im.png +0 -0
- data/examples/blog/content/css/blueprint/plugins/link-icons/icons/pdf.png +0 -0
- data/examples/blog/content/css/blueprint/plugins/link-icons/icons/visited.png +0 -0
- data/examples/blog/content/css/blueprint/plugins/link-icons/icons/xls.png +0 -0
- data/examples/blog/content/css/blueprint/plugins/link-icons/readme.txt +18 -0
- data/examples/blog/content/css/blueprint/plugins/link-icons/screen.css +40 -0
- data/examples/blog/content/css/blueprint/plugins/rtl/readme.txt +10 -0
- data/examples/blog/content/css/blueprint/plugins/rtl/screen.css +109 -0
- data/examples/blog/content/css/blueprint/print.css +30 -0
- data/examples/blog/content/css/blueprint/screen.css +251 -0
- data/examples/blog/content/css/blueprint/src/forms.css +49 -0
- data/examples/blog/content/css/blueprint/src/grid.css +212 -0
- data/examples/blog/content/css/blueprint/src/grid.png +0 -0
- data/examples/blog/content/css/blueprint/src/ie.css +59 -0
- data/examples/blog/content/css/blueprint/src/print.css +85 -0
- data/examples/blog/content/css/blueprint/src/reset.css +38 -0
- data/examples/blog/content/css/blueprint/src/typography.css +105 -0
- data/examples/blog/content/css/coderay.css +111 -0
- data/examples/blog/content/css/site.css +67 -0
- data/examples/blog/layouts/default.txt +61 -0
- data/examples/blog/tasks/blog.rake +1 -2
- data/examples/presentation/Sitefile +2 -2
- data/examples/tumblog/tasks/tumblog.rake +1 -2
- data/examples/webby/Sitefile +2 -2
- data/examples/webby/content/release-notes/rel-0-9-4/index.txt +33 -0
- data/examples/webby/content/sitemap.txt +2 -2
- data/examples/webby/content/user-manual/index.txt +3 -3
- data/lib/webby.rb +24 -101
- data/lib/webby/apps/generator.rb +2 -2
- data/lib/webby/apps/main.rb +32 -61
- data/lib/webby/config.rb +178 -0
- data/lib/webby/filters.rb +2 -0
- data/lib/webby/filters/haml.rb +13 -0
- data/lib/webby/filters/sass.rb +14 -0
- data/lib/webby/filters/slides.rb +2 -2
- data/lib/webby/filters/tidy.rb +5 -0
- data/lib/webby/helpers/coderay_helper.rb +27 -3
- data/lib/webby/helpers/graphviz_helper.rb +20 -3
- data/lib/webby/helpers/tex_img_helper.rb +25 -5
- data/lib/webby/helpers/ultraviolet_helper.rb +19 -5
- data/lib/webby/renderer.rb +9 -6
- data/lib/webby/resources.rb +2 -1
- data/lib/webby/resources/page.rb +4 -1
- data/lib/webby/tasks/create.rake +1 -4
- data/spec/data/site/tasks/tumblog.rake +5 -1
- data/spec/spec_helper.rb +1 -1
- data/spec/webby/apps/generator_spec.rb +36 -3
- data/spec/webby/apps/main_spec.rb +2 -1
- data/spec/webby/filters/basepath_spec.rb +2 -2
- data/spec/webby/helpers/capture_helper_spec.rb +1 -1
- data/spec/webby/resources/db_spec.rb +24 -24
- data/spec/webby/resources/layout_spec.rb +1 -1
- data/spec/webby/resources/page_spec.rb +8 -2
- data/spec/webby/resources/resource_spec.rb +1 -1
- data/spec/webby/resources_spec.rb +1 -1
- metadata +60 -23
- data/Manifest.txt +0 -233
@@ -0,0 +1,61 @@
|
|
1
|
+
---
|
2
|
+
extension: html
|
3
|
+
filter: erb
|
4
|
+
---
|
5
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
6
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
7
|
+
|
8
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
|
9
|
+
<head>
|
10
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
11
|
+
<title><%= @page.title %></title>
|
12
|
+
<meta name="author" content="<%= @page.author %>" />
|
13
|
+
|
14
|
+
<!--- Blueprint CSS Framework -->
|
15
|
+
<link rel="stylesheet" href="/css/blueprint/screen.css" type="text/css" media="screen, projection">
|
16
|
+
<link rel="stylesheet" href="/css/blueprint/print.css" type="text/css" media="print">
|
17
|
+
<!--[if IE]>
|
18
|
+
<link rel="stylesheet" href="/css/blueprint/ie.css" type="text/css" media="screen, projection">
|
19
|
+
<![endif]-->
|
20
|
+
|
21
|
+
<!-- CodeRay syntax highlighting CSS -->
|
22
|
+
<link rel="stylesheet" href="/css/coderay.css" type="text/css" />
|
23
|
+
|
24
|
+
<!-- Homepage CSS -->
|
25
|
+
<link rel="stylesheet" href="/css/site.css" type="text/css" media="screen, projection" />
|
26
|
+
</head>
|
27
|
+
<body>
|
28
|
+
|
29
|
+
<div class="container">
|
30
|
+
|
31
|
+
<div class="column span-20 prepend-2 append-2 first last" id="header">
|
32
|
+
<p class="title">A New Website</p>
|
33
|
+
<hr>
|
34
|
+
</div>
|
35
|
+
|
36
|
+
<div class="column span-15 prepend-2 first">
|
37
|
+
<%= @content %>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<div class="column span-5 append-2 last">
|
41
|
+
<h4>Sidebar</h4>
|
42
|
+
<p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras ornare mattis nunc. Mauris venenatis, pede sed aliquet vehicula, lectus tellus pulvinar neque, non cursus sem nisi vel augue. </p>
|
43
|
+
|
44
|
+
<div class="box">
|
45
|
+
<p class="last">Mauris a lectus. Aliquam erat volutpat. Phasellus ultrices mi a sapien. Nunc rutrum egestas lorem. Duis ac sem sagittis elit tincidunt gravida.</p>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<p class="quiet">Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras ornare mattis nunc. Mauris venenatis, pede sed aliquet vehicula, lectus tellus pulvinar neque, non cursus sem nisi vel augue.</p>
|
49
|
+
|
50
|
+
<h5>Incremental leading</h5>
|
51
|
+
<p class="incr">Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras ornare mattis nunc. Mauris venenatis, pede sed aliquet vehicula, lectus tellus pulvinar neque, non cursus sem nisi vel augue. sed aliquet vehicula, lectus tellus.</p>
|
52
|
+
</div>
|
53
|
+
|
54
|
+
<div class="column span-20 prepend-2 append-2 first last" id="footer">
|
55
|
+
<hr />
|
56
|
+
<p>This website was created with <a href="http://webby.rubyforge.org">Webby</a></p>
|
57
|
+
</div>
|
58
|
+
|
59
|
+
</div>
|
60
|
+
</body>
|
61
|
+
</html>
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
namespace :blog do
|
3
2
|
|
4
3
|
# iterate over all the files in the "templates/blog" folder and create a
|
@@ -20,7 +19,7 @@ namespace :blog do
|
|
20
19
|
page = File.join(dir, File.basename(page))
|
21
20
|
page = Webby::Builder.create(page, :from => template,
|
22
21
|
:locals => {:title => title, :directory => dir})
|
23
|
-
|
22
|
+
Webby.exec_editor(page)
|
24
23
|
end
|
25
24
|
end # each
|
26
25
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
namespace :tumblog do
|
3
2
|
|
4
3
|
# iterate over all the files in the "templates/tumblog" folder and create a
|
@@ -21,7 +20,7 @@ namespace :tumblog do
|
|
21
20
|
page = File.join(dir, File.basename(page))
|
22
21
|
page = Webby::Builder.create(page, :from => template,
|
23
22
|
:locals => {:title => title, :directory => dir})
|
24
|
-
|
23
|
+
Webby.exec_editor(page)
|
25
24
|
end
|
26
25
|
end # each
|
27
26
|
|
data/examples/webby/Sitefile
CHANGED
@@ -9,8 +9,8 @@ SITE.host = 'rubyforge.org'
|
|
9
9
|
SITE.remote_dir = '/var/www/gforge-projects/webby/'
|
10
10
|
SITE.create_mode = 'directory'
|
11
11
|
|
12
|
-
SITE.uv
|
13
|
-
SITE.uv
|
12
|
+
SITE.uv.theme = 'twilight'
|
13
|
+
SITE.uv.line_numbers = true
|
14
14
|
|
15
15
|
task :autobuild => :growl
|
16
16
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
---
|
2
|
+
title: Release 0.9.4
|
3
|
+
created_at: 2009-04-05 22:20:34.784199 -06:00
|
4
|
+
filter:
|
5
|
+
- erb
|
6
|
+
- textile
|
7
|
+
release_name: Supertaculous
|
8
|
+
---
|
9
|
+
h2. <%= h(@page.title) %>
|
10
|
+
|
11
|
+
Release 0.9.4 adds several new features and fixes a few bugs. The biggest new feature is the ability to display all the available Webby options along with a description of each.
|
12
|
+
|
13
|
+
* 6 minor enhancements
|
14
|
+
** Added a Maruku filter (thanks to Martyn Loughran)
|
15
|
+
** Updated to version 0.8.0 of Blueprint css
|
16
|
+
** Better handling of errors generated by filters
|
17
|
+
** Modified how the editor is spawned when creating pages
|
18
|
+
** URLs for index pages now have a trailing slash
|
19
|
+
** Configuration options now have nice descriptions: @webby --options@
|
20
|
+
* 7 bug fixes
|
21
|
+
** Fixed haml & sass option handling [Alex Brem]
|
22
|
+
** Work around for a parsing bug in the rdiscount gem (markdown handling)
|
23
|
+
** Editor launching now handles switches passed to the editor
|
24
|
+
** When a page fails to render, it no longer writes an empty file to the output folder (thereby overwriting the last good page)
|
25
|
+
** Pagination bug
|
26
|
+
** Presentation slides were not being found when headers had attributes
|
27
|
+
** The blog template now has all the CSS files
|
28
|
+
|
29
|
+
h3. Webby Options
|
30
|
+
|
31
|
+
Using the power of the "command line" all the available Webby options can be viewed using the @webby --options@ command. This will show the option and a brief description along with the current value the option is set to. Options are only shown if the supporting gem is installed. For example, if you do not have the UltraViolet syntax highlighting gem installed you will not see the @uv@ options.
|
32
|
+
|
33
|
+
These options are set in your Sitefile, and they control default settings and how pages are rendered.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
---
|
2
2
|
#
|
3
|
-
# Define the following in your
|
3
|
+
# Define the following in your Sitefile or some
|
4
4
|
# other location which will be accessed by tasks/setup.rb
|
5
5
|
#
|
6
6
|
# SITE.site_root = "http://webby.rubyforge.org"
|
@@ -28,4 +28,4 @@ filter:
|
|
28
28
|
<% end -%>
|
29
29
|
</url>
|
30
30
|
<% end -%>
|
31
|
-
</urlset>
|
31
|
+
</urlset>
|
@@ -364,7 +364,7 @@ The basepath filter only works on HTML/XHTML text, and therefore, it should be o
|
|
364
364
|
<div class="label">Usage</div>
|
365
365
|
<div class="desc">
|
366
366
|
|
367
|
-
Include "basepath" in the filter list of your layout(s). Specify the new base path to use either as a command line argument or as an option configured in the
|
367
|
+
Include "basepath" in the filter list of your layout(s). Specify the new base path to use either as a command line argument or as an option configured in the _Sitefile_. The base path specified on the command line takes precedence over the base path specified in the Sitefile.
|
368
368
|
|
369
369
|
<pre style="margin-bottom:0">
|
370
370
|
$ webby rebuild BASE='http://your.website.com/path/to/your/site'
|
@@ -374,7 +374,7 @@ $ webby rebuild BASE='http://your.website.com/path/to/your/site'
|
|
374
374
|
<div class="label">Options</div>
|
375
375
|
<div class="desc">
|
376
376
|
|
377
|
-
Options can be passed to the basepath filter by specifying them in the project
|
377
|
+
Options can be passed to the basepath filter by specifying them in the project _Sitefile_.
|
378
378
|
|
379
379
|
<pre style="margin-bottom:0">
|
380
380
|
SITE.xpaths << '/html/body//img[@usemap]'
|
@@ -403,7 +403,7 @@ Include "tidy" as the last item in the filter list of your layout(s).
|
|
403
403
|
<div class="label">Options</div>
|
404
404
|
<div class="desc">
|
405
405
|
|
406
|
-
Options can be passed to the tidy program by specifying them in the project
|
406
|
+
Options can be passed to the tidy program by specifying them in the project _Sitefile_. These are the command line options that will be passed to the tidy program when it is run.
|
407
407
|
|
408
408
|
<pre style="margin-bottom:0">
|
409
409
|
SITE.tidy_options = '-indent -wrap 80'
|
data/lib/webby.rb
CHANGED
@@ -2,15 +2,19 @@
|
|
2
2
|
# Used to prevent the spec helper from being loaded more than once
|
3
3
|
unless defined? ::Webby
|
4
4
|
|
5
|
-
|
6
|
-
require 'logging'
|
7
|
-
require '
|
5
|
+
begin
|
6
|
+
require 'logging'
|
7
|
+
require 'loquacious'
|
8
|
+
rescue LoadError
|
9
|
+
retry if require 'rubygems'
|
10
|
+
raise
|
11
|
+
end
|
8
12
|
require 'date'
|
9
13
|
|
10
14
|
module Webby
|
11
15
|
|
12
16
|
# :stopdoc:
|
13
|
-
VERSION = '0.9.4' # :nodoc:
|
17
|
+
VERSION = '0.9.4.1' # :nodoc:
|
14
18
|
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
15
19
|
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
16
20
|
YAML_SEP = '---'
|
@@ -19,99 +23,13 @@ module Webby
|
|
19
23
|
class Error < StandardError; end # :nodoc:
|
20
24
|
|
21
25
|
# call-seq:
|
22
|
-
# Webby.site =>
|
26
|
+
# Webby.site => configuration
|
23
27
|
#
|
24
|
-
# Returns
|
25
|
-
#
|
26
|
-
# site specific Rakefile.
|
28
|
+
# Returns the configuration parameters for the Webby site. These defaults
|
29
|
+
# should be overridden as needed in the site specific Rakefile.
|
27
30
|
#
|
28
31
|
def self.site
|
29
|
-
|
30
|
-
@site = OpenStruct.new(
|
31
|
-
:output_dir => 'output',
|
32
|
-
:content_dir => 'content',
|
33
|
-
:layout_dir => 'layouts',
|
34
|
-
:template_dir => 'templates',
|
35
|
-
:exclude => %w(tmp$ bak$ ~$ CVS \.svn),
|
36
|
-
:page_defaults => {
|
37
|
-
'layout' => 'default'
|
38
|
-
},
|
39
|
-
:find_by => 'title',
|
40
|
-
:base => nil,
|
41
|
-
:create_mode => 'page',
|
42
|
-
:blog_dir => 'blog',
|
43
|
-
:tumblog_dir => 'tumblog',
|
44
|
-
|
45
|
-
# Items for running the embedded webserver
|
46
|
-
:use_web_server => true,
|
47
|
-
:web_port => 4331,
|
48
|
-
|
49
|
-
# Items used to deploy the website
|
50
|
-
:user => ENV['USER'] || ENV['USERNAME'],
|
51
|
-
:host => 'example.com',
|
52
|
-
:remote_dir => '/not/a/valid/dir',
|
53
|
-
:rsync_args => %w(-av),
|
54
|
-
|
55
|
-
# Global options for HAML and SASS
|
56
|
-
:haml_options => {},
|
57
|
-
:sass_options => {},
|
58
|
-
|
59
|
-
# Options passed to the 'tidy' program when the tidy filter is used
|
60
|
-
:tidy_options => '-indent -wrap 80',
|
61
|
-
|
62
|
-
# List of valid URIs (these automatically pass validation)
|
63
|
-
:valid_uris => [],
|
64
|
-
|
65
|
-
# Options for coderay processing
|
66
|
-
:coderay => {
|
67
|
-
:lang => :ruby,
|
68
|
-
:line_numbers => nil,
|
69
|
-
:line_number_start => 1,
|
70
|
-
:bold_every => 10,
|
71
|
-
:tab_width => 8
|
72
|
-
},
|
73
|
-
|
74
|
-
# Options for graphviz processing
|
75
|
-
:graphviz => {
|
76
|
-
:path => nil,
|
77
|
-
:cmd => 'dot',
|
78
|
-
:type => 'png'
|
79
|
-
},
|
80
|
-
|
81
|
-
# Options for tex2img processing
|
82
|
-
:tex2img => {
|
83
|
-
:path => nil,
|
84
|
-
:type => 'png',
|
85
|
-
:bg => 'white',
|
86
|
-
:fg => 'black',
|
87
|
-
:resolution => '150x150'
|
88
|
-
},
|
89
|
-
|
90
|
-
# Options for ultraviolet syntax highlighting
|
91
|
-
:uv => {
|
92
|
-
:lang => 'ruby',
|
93
|
-
:line_numbers => false,
|
94
|
-
:theme => 'mac_classic'
|
95
|
-
},
|
96
|
-
|
97
|
-
# XPath identifiers used by the basepath filter
|
98
|
-
:xpaths => %w(
|
99
|
-
/html/head//base[@href]
|
100
|
-
/html/head//link[@href]
|
101
|
-
//script[@src]
|
102
|
-
/html/body[@background]
|
103
|
-
/html/body//a[@href]
|
104
|
-
/html/body//object[@data]
|
105
|
-
/html/body//img[@src]
|
106
|
-
/html/body//area[@href]
|
107
|
-
/html/body//form[@action]
|
108
|
-
/html/body//input[@src]
|
109
|
-
)
|
110
|
-
# other possible XPaths to include for base path substitution
|
111
|
-
# /html/body//object[@usemap]
|
112
|
-
# /html/body//img[@usemap]
|
113
|
-
# /html/body//input[@usemap]
|
114
|
-
)
|
32
|
+
Loquacious.configuration_for :webby
|
115
33
|
end
|
116
34
|
|
117
35
|
# call-seq
|
@@ -126,16 +44,21 @@ module Webby
|
|
126
44
|
end
|
127
45
|
|
128
46
|
# call-seq:
|
129
|
-
# Webby.
|
47
|
+
# Webby.exec_editor( *args )
|
130
48
|
#
|
131
|
-
#
|
132
|
-
#
|
49
|
+
# Calls the editor set in the Sitefile or in the environment variables
|
50
|
+
# WEBBY_EDITOR or EDITOR (in that order). This method will do nothing if
|
51
|
+
# the editor has not been set.
|
133
52
|
#
|
134
|
-
def self.
|
135
|
-
|
53
|
+
def self.exec_editor( *args )
|
54
|
+
unless defined? @editor
|
55
|
+
@editor = (site.editor.nil? or site.editor.empty?) ? nil : site.editor
|
56
|
+
@editor = @editor.split if @editor
|
57
|
+
end
|
58
|
+
return if @editor.nil?
|
136
59
|
|
137
|
-
|
138
|
-
|
60
|
+
args = [@editor, args].flatten
|
61
|
+
exec(*args)
|
139
62
|
end
|
140
63
|
|
141
64
|
# call-seq:
|
data/lib/webby/apps/generator.rb
CHANGED
@@ -190,7 +190,7 @@ class Generator
|
|
190
190
|
src = template / file
|
191
191
|
dst = site / file
|
192
192
|
|
193
|
-
if test(?e, dst)
|
193
|
+
if test(?e, dst)
|
194
194
|
if identical?(src, dst)
|
195
195
|
identical(dst)
|
196
196
|
return
|
@@ -229,7 +229,7 @@ class Generator
|
|
229
229
|
def site_files
|
230
230
|
exclude = %r/tmp$|bak$|~$|CVS|\.svn/o
|
231
231
|
|
232
|
-
rgxp = %r/\A#{template}\/?/
|
232
|
+
rgxp = %r/\A#{template}\/?/
|
233
233
|
paths = Hash.new {|h,k| h[k] = []}
|
234
234
|
|
235
235
|
Find.find(template) do |p|
|
data/lib/webby/apps/main.rb
CHANGED
@@ -19,6 +19,7 @@ class Main
|
|
19
19
|
def initialize
|
20
20
|
@stdout = $stdout
|
21
21
|
@cmd_line_options = {}
|
22
|
+
@command = %w[rake]
|
22
23
|
end
|
23
24
|
|
24
25
|
# Runs the main webby application. The command line arguments are passed
|
@@ -30,7 +31,7 @@ class Main
|
|
30
31
|
|
31
32
|
parse args
|
32
33
|
init args
|
33
|
-
|
34
|
+
self.__send__(*@command)
|
34
35
|
end
|
35
36
|
|
36
37
|
# Parse the command line _args_ for options and commands to invoke.
|
@@ -46,6 +47,10 @@ class Main
|
|
46
47
|
next unless desired_opts.include?(options.first)
|
47
48
|
opts.on(*options)
|
48
49
|
end
|
50
|
+
opts.on('-o', '--options [PATTERN]',
|
51
|
+
'Show configuration options (matching optional pattern), then exit.') { |value|
|
52
|
+
@command = [:show_options, value]
|
53
|
+
}
|
49
54
|
|
50
55
|
opts.separator ''
|
51
56
|
opts.separator 'autobuild options:'
|
@@ -115,6 +120,32 @@ class Main
|
|
115
120
|
app.top_level
|
116
121
|
end
|
117
122
|
|
123
|
+
# Print the available configuration options.
|
124
|
+
#
|
125
|
+
def show_options( attribute = nil )
|
126
|
+
app.init 'webby'
|
127
|
+
app.load_rakefile
|
128
|
+
|
129
|
+
desc = <<-__
|
130
|
+
The following options can be used to control Webby functionality.
|
131
|
+
Options are configured in the 'Sitefile'. A few examples are shown below:
|
132
|
+
|
|
133
|
+
| SITE.create_mode = 'directory'
|
134
|
+
| SITE.base = 'http://www.example.com'
|
135
|
+
| SITE.uv.theme = 'twilight'
|
136
|
+
|
|
137
|
+
=======< OPTIONS >=======
|
138
|
+
|
|
139
|
+
__
|
140
|
+
|
141
|
+
@stdout.puts desc.gutter!
|
142
|
+
help = Loquacious.help_for(
|
143
|
+
:webby, :io => @stdout, :colorize => ENV.key?('TERM')
|
144
|
+
)
|
145
|
+
help.show attribute, :values => true
|
146
|
+
@stdout.puts
|
147
|
+
end
|
148
|
+
|
118
149
|
# Return the Rake application object.
|
119
150
|
#
|
120
151
|
def app
|
@@ -195,64 +226,4 @@ class Main
|
|
195
226
|
end # class Main
|
196
227
|
end # module Webby::Apps
|
197
228
|
|
198
|
-
# :stopdoc:
|
199
|
-
# Monkey patches so that rake displays the correct application name in the
|
200
|
-
# help messages.
|
201
|
-
#
|
202
|
-
class Rake::Application
|
203
|
-
def display_prerequisites
|
204
|
-
tasks.each do |t|
|
205
|
-
puts "#{name} #{t.name}"
|
206
|
-
t.prerequisites.each { |pre| puts " #{pre}" }
|
207
|
-
end
|
208
|
-
end
|
209
|
-
|
210
|
-
def display_tasks_and_comments
|
211
|
-
displayable_tasks = tasks.select { |t|
|
212
|
-
t.comment && t.name =~ options.show_task_pattern
|
213
|
-
}
|
214
|
-
if options.full_description
|
215
|
-
displayable_tasks.each do |t|
|
216
|
-
puts "#{name} #{t.name_with_args}"
|
217
|
-
t.full_comment.split("\n").each do |line|
|
218
|
-
puts " #{line}"
|
219
|
-
end
|
220
|
-
puts
|
221
|
-
end
|
222
|
-
else
|
223
|
-
width = displayable_tasks.collect { |t| t.name_with_args.length }.max || 10
|
224
|
-
max_column = truncate_output? ? terminal_width - name.size - width - 7 : nil
|
225
|
-
displayable_tasks.each do |t|
|
226
|
-
printf "#{name} %-#{width}s # %s\n",
|
227
|
-
t.name_with_args, max_column ? truncate(t.comment, max_column) : t.comment
|
228
|
-
end
|
229
|
-
end
|
230
|
-
end
|
231
|
-
|
232
|
-
# Provide standard execption handling for the given block.
|
233
|
-
def standard_exception_handling
|
234
|
-
begin
|
235
|
-
yield
|
236
|
-
rescue SystemExit => ex
|
237
|
-
# Exit silently with current status
|
238
|
-
exit(ex.status)
|
239
|
-
rescue SystemExit, OptionParser::InvalidOption => ex
|
240
|
-
# Exit silently
|
241
|
-
exit(1)
|
242
|
-
rescue Exception => ex
|
243
|
-
# Exit with error message
|
244
|
-
$stderr.puts "#{name} aborted!"
|
245
|
-
$stderr.puts ex.message
|
246
|
-
if options.trace
|
247
|
-
$stderr.puts ex.backtrace.join("\n")
|
248
|
-
else
|
249
|
-
$stderr.puts ex.backtrace.find {|str| str =~ /#{@rakefile}/ } || ""
|
250
|
-
$stderr.puts "(See full trace by running task with --trace)"
|
251
|
-
end
|
252
|
-
exit(1)
|
253
|
-
end
|
254
|
-
end
|
255
|
-
end # class Rake::Application
|
256
|
-
# :startdoc:
|
257
|
-
|
258
229
|
# EOF
|