webby 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +13 -1
- data/Manifest.txt +36 -27
- data/README.txt +21 -1
- data/Rakefile +12 -8
- data/bin/webby +2 -10
- data/data/Rakefile +1 -0
- data/data/tasks/create.rake +1 -0
- data/data/tasks/deploy.rake +1 -0
- data/data/tasks/growl.rake +13 -12
- data/data/tasks/heel.rake +29 -32
- data/data/tasks/setup.rb +4 -9
- data/{website → examples/webby}/Rakefile +0 -0
- data/{website → examples/webby}/content/css/blueprint/lib/buttons.css +0 -0
- data/{website → examples/webby}/content/css/blueprint/lib/compressed.css +0 -0
- data/{website → examples/webby}/content/css/blueprint/lib/grid.css +0 -0
- data/{website → examples/webby}/content/css/blueprint/lib/img/grid.png +0 -0
- data/{website → examples/webby}/content/css/blueprint/lib/img/icons/cross.png +0 -0
- data/{website → examples/webby}/content/css/blueprint/lib/img/icons/textfield_key.png +0 -0
- data/{website → examples/webby}/content/css/blueprint/lib/img/icons/tick.png +0 -0
- data/{website → examples/webby}/content/css/blueprint/lib/reset.css +0 -0
- data/{website → examples/webby}/content/css/blueprint/lib/typography.css +0 -0
- data/{website → examples/webby}/content/css/blueprint/print.css +0 -0
- data/{website → examples/webby}/content/css/blueprint/screen.css +0 -0
- data/{website → examples/webby}/content/css/coderay.css +0 -0
- data/{website → examples/webby}/content/css/site.css +0 -0
- data/{website → examples/webby}/content/download.txt +0 -0
- data/{website → examples/webby}/content/index.txt +0 -0
- data/examples/webby/content/manual.txt +24 -0
- data/{website → examples/webby}/content/robots.txt +0 -0
- data/{website → examples/webby}/content/tips_and_tricks.txt +0 -0
- data/{website → examples/webby}/content/tutorial.txt +6 -6
- data/{website → examples/webby}/layouts/default.rhtml +0 -0
- data/{website → examples/webby}/tasks/create.rake +0 -0
- data/{website → examples/webby}/tasks/deploy.rake +0 -0
- data/{website → examples/webby}/tasks/growl.rake +12 -12
- data/{website → examples/webby}/tasks/heel.rake +28 -32
- data/{website → examples/webby}/tasks/setup.rb +3 -9
- data/{website → examples/webby}/templates/page.erb +0 -0
- data/lib/webby/file.rb +33 -1
- data/lib/webby/filters/coderay.rb +8 -2
- data/lib/webby/filters/erb.rb +11 -0
- data/lib/webby/filters/graphviz.rb +22 -8
- data/lib/webby/filters/haml.rb +16 -0
- data/lib/webby/filters/markdown.rb +10 -0
- data/lib/webby/filters/sass.rb +11 -0
- data/lib/webby/filters/textile.rb +10 -0
- data/lib/webby/filters/tidy.rb +8 -1
- data/lib/webby/filters.rb +90 -0
- data/lib/webby/helpers/tag_helper.rb +61 -0
- data/lib/webby/helpers/url_helper.rb +162 -0
- data/lib/webby/pages_db.rb +8 -9
- data/lib/webby/renderer.rb +20 -113
- data/lib/webby/resource.rb +13 -6
- data/lib/webby/utils.rb +13 -1
- data/lib/webby/webby_task.rb +7 -1
- data/lib/webby.rb +21 -17
- data/spec/spec_helper.rb +3 -9
- data/tasks/annotations.rake +30 -0
- data/tasks/doc.rake +7 -1
- data/tasks/gem.rake +6 -2
- data/tasks/manifest.rake +6 -4
- data/tasks/rubyforge.rake +1 -1
- data/tasks/setup.rb +29 -7
- data/tasks/spec.rake +8 -5
- data/tasks/website.rake +2 -2
- metadata +123 -116
- data/website/content/manual.txt +0 -60
data/History.txt
CHANGED
@@ -1,4 +1,16 @@
|
|
1
|
-
== 0.
|
1
|
+
== 0.7.0 / 2008-01-01
|
2
|
+
|
3
|
+
* 1 major enhancement
|
4
|
+
- Refactored how the filters are handled (thanks Bruce Williams)
|
5
|
+
* 2 minor enhancements
|
6
|
+
- Added helper methods for URL and tag generation
|
7
|
+
- Added rake task to delete the generated website
|
8
|
+
* 2 bug fixes
|
9
|
+
- Fixed a bug arising from the order of the logger creation
|
10
|
+
- Removed the file extension form the page defaults
|
11
|
+
(should be set in the layout or the page itself)
|
12
|
+
|
13
|
+
== 0.6.0 / 2007-12-04
|
2
14
|
|
3
15
|
* Added support for embedded graphviz images and image maps
|
4
16
|
* Tidy can be used as a filter to format HTML and check for errors
|
data/Manifest.txt
CHANGED
@@ -27,13 +27,48 @@ data/tasks/growl.rake
|
|
27
27
|
data/tasks/heel.rake
|
28
28
|
data/tasks/setup.rb
|
29
29
|
data/templates/page.erb
|
30
|
+
examples/webby/Rakefile
|
31
|
+
examples/webby/content/css/blueprint/lib/buttons.css
|
32
|
+
examples/webby/content/css/blueprint/lib/compressed.css
|
33
|
+
examples/webby/content/css/blueprint/lib/grid.css
|
34
|
+
examples/webby/content/css/blueprint/lib/img/grid.png
|
35
|
+
examples/webby/content/css/blueprint/lib/img/icons/cross.png
|
36
|
+
examples/webby/content/css/blueprint/lib/img/icons/textfield_key.png
|
37
|
+
examples/webby/content/css/blueprint/lib/img/icons/tick.png
|
38
|
+
examples/webby/content/css/blueprint/lib/reset.css
|
39
|
+
examples/webby/content/css/blueprint/lib/typography.css
|
40
|
+
examples/webby/content/css/blueprint/print.css
|
41
|
+
examples/webby/content/css/blueprint/screen.css
|
42
|
+
examples/webby/content/css/coderay.css
|
43
|
+
examples/webby/content/css/site.css
|
44
|
+
examples/webby/content/download.txt
|
45
|
+
examples/webby/content/index.txt
|
46
|
+
examples/webby/content/manual.txt
|
47
|
+
examples/webby/content/robots.txt
|
48
|
+
examples/webby/content/tips_and_tricks.txt
|
49
|
+
examples/webby/content/tutorial.txt
|
50
|
+
examples/webby/layouts/default.rhtml
|
51
|
+
examples/webby/tasks/create.rake
|
52
|
+
examples/webby/tasks/deploy.rake
|
53
|
+
examples/webby/tasks/growl.rake
|
54
|
+
examples/webby/tasks/heel.rake
|
55
|
+
examples/webby/tasks/setup.rb
|
56
|
+
examples/webby/templates/page.erb
|
30
57
|
lib/webby.rb
|
31
58
|
lib/webby/auto_builder.rb
|
32
59
|
lib/webby/builder.rb
|
33
60
|
lib/webby/file.rb
|
61
|
+
lib/webby/filters.rb
|
34
62
|
lib/webby/filters/coderay.rb
|
63
|
+
lib/webby/filters/erb.rb
|
35
64
|
lib/webby/filters/graphviz.rb
|
65
|
+
lib/webby/filters/haml.rb
|
66
|
+
lib/webby/filters/markdown.rb
|
67
|
+
lib/webby/filters/sass.rb
|
68
|
+
lib/webby/filters/textile.rb
|
36
69
|
lib/webby/filters/tidy.rb
|
70
|
+
lib/webby/helpers/tag_helper.rb
|
71
|
+
lib/webby/helpers/url_helper.rb
|
37
72
|
lib/webby/main.rb
|
38
73
|
lib/webby/pages_db.rb
|
39
74
|
lib/webby/renderer.rb
|
@@ -45,6 +80,7 @@ lib/webby/webby_task.rb
|
|
45
80
|
spec/spec.opts
|
46
81
|
spec/spec_helper.rb
|
47
82
|
spec/webby/file_spec.rb
|
83
|
+
tasks/annotations.rake
|
48
84
|
tasks/doc.rake
|
49
85
|
tasks/gem.rake
|
50
86
|
tasks/manifest.rake
|
@@ -52,30 +88,3 @@ tasks/rubyforge.rake
|
|
52
88
|
tasks/setup.rb
|
53
89
|
tasks/spec.rake
|
54
90
|
tasks/website.rake
|
55
|
-
website/Rakefile
|
56
|
-
website/content/css/blueprint/lib/buttons.css
|
57
|
-
website/content/css/blueprint/lib/compressed.css
|
58
|
-
website/content/css/blueprint/lib/grid.css
|
59
|
-
website/content/css/blueprint/lib/img/grid.png
|
60
|
-
website/content/css/blueprint/lib/img/icons/cross.png
|
61
|
-
website/content/css/blueprint/lib/img/icons/textfield_key.png
|
62
|
-
website/content/css/blueprint/lib/img/icons/tick.png
|
63
|
-
website/content/css/blueprint/lib/reset.css
|
64
|
-
website/content/css/blueprint/lib/typography.css
|
65
|
-
website/content/css/blueprint/print.css
|
66
|
-
website/content/css/blueprint/screen.css
|
67
|
-
website/content/css/coderay.css
|
68
|
-
website/content/css/site.css
|
69
|
-
website/content/download.txt
|
70
|
-
website/content/index.txt
|
71
|
-
website/content/manual.txt
|
72
|
-
website/content/robots.txt
|
73
|
-
website/content/tips_and_tricks.txt
|
74
|
-
website/content/tutorial.txt
|
75
|
-
website/layouts/default.rhtml
|
76
|
-
website/tasks/create.rake
|
77
|
-
website/tasks/deploy.rake
|
78
|
-
website/tasks/growl.rake
|
79
|
-
website/tasks/heel.rake
|
80
|
-
website/tasks/setup.rb
|
81
|
-
website/templates/page.erb
|
data/README.txt
CHANGED
@@ -71,4 +71,24 @@ Webby is not limited to producing HTML. By no means! Do you ever get tired of re
|
|
71
71
|
|
72
72
|
== LICENSE:
|
73
73
|
|
74
|
-
MIT
|
74
|
+
MIT License
|
75
|
+
Copyright (c) 2007 - 2008
|
76
|
+
|
77
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
78
|
+
a copy of this software and associated documentation files (the
|
79
|
+
'Software'), to deal in the Software without restriction, including
|
80
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
81
|
+
distribute, sub-license, and/or sell copies of the Software, and to
|
82
|
+
permit persons to whom the Software is furnished to do so, subject to
|
83
|
+
the following conditions:
|
84
|
+
|
85
|
+
The above copyright notice and this permission notice shall be
|
86
|
+
included in all copies or substantial portions of the Software.
|
87
|
+
|
88
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
89
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
90
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
91
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
92
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
93
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
94
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
# $Id$
|
1
|
+
# $Id: Rakefile 89 2008-01-02 04:42:38Z tim_pease $
|
2
2
|
|
3
|
-
load '
|
3
|
+
load 'tasks/setup.rb'
|
4
|
+
ensure_in_path 'lib'
|
4
5
|
require 'webby'
|
5
6
|
|
6
7
|
task :default => 'spec:run'
|
@@ -17,17 +18,20 @@ PROJ.rdoc_dir = 'doc/rdoc'
|
|
17
18
|
PROJ.rdoc_remote_dir = 'rdoc'
|
18
19
|
PROJ.version = Webby::VERSION
|
19
20
|
|
20
|
-
|
21
|
-
PROJ.exclude << '^
|
22
|
-
PROJ.
|
23
|
-
PROJ.
|
21
|
+
|
22
|
+
PROJ.exclude << '^examples/[^/]+/output'
|
23
|
+
PROJ.exclude << '^tasks/archive'
|
24
|
+
PROJ.exclude << '^tags$'
|
25
|
+
|
26
|
+
PROJ.rdoc_exclude << '^data'
|
27
|
+
PROJ.rdoc_exclude << '^examples'
|
24
28
|
|
25
29
|
PROJ.spec_opts << '--color'
|
26
30
|
|
27
|
-
depend_on 'directory_watcher'
|
31
|
+
depend_on 'directory_watcher'
|
28
32
|
depend_on 'heel'
|
29
33
|
depend_on 'hpricot'
|
30
|
-
depend_on 'logging', '0.
|
34
|
+
depend_on 'logging', '0.6.1'
|
31
35
|
depend_on 'rspec'
|
32
36
|
|
33
37
|
# EOF
|
data/bin/webby
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
require 'webby'
|
6
|
-
rescue LoadError
|
7
|
-
path = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
8
|
-
raise if $:.include? path
|
9
|
-
$: << path
|
10
|
-
retry
|
11
|
-
end
|
12
|
-
|
3
|
+
require File.expand_path(
|
4
|
+
File.join(File.dirname(__FILE__), '..', 'lib', 'webby'))
|
13
5
|
::Webby::Main.run ARGV
|
14
6
|
|
15
7
|
# EOF
|
data/data/Rakefile
CHANGED
data/data/tasks/create.rake
CHANGED
data/data/tasks/deploy.rake
CHANGED
data/data/tasks/growl.rake
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
:
|
8
|
-
:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
1
|
+
# $Id$
|
2
|
+
|
3
|
+
desc 'send log events to Growl (Mac OS X only)'
|
4
|
+
task :growl do
|
5
|
+
Logging::Logger['Webby'].add(Logging::Appenders::Growl.new(
|
6
|
+
"Webby",
|
7
|
+
:layout => Logging::Layouts::Pattern.new(:pattern => "%5l - Webby\000%m"),
|
8
|
+
:coalesce => true,
|
9
|
+
:separator => "\000"
|
10
|
+
))
|
11
|
+
end
|
12
|
+
|
13
|
+
# EOF
|
data/data/tasks/heel.rake
CHANGED
@@ -1,32 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
@heel_spawner
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end # HAVE_HEEL
|
31
|
-
|
32
|
-
# EOF
|
1
|
+
# $Id$
|
2
|
+
|
3
|
+
namespace :heel do
|
4
|
+
|
5
|
+
desc 'start the heel server to view website (not for Windows)'
|
6
|
+
task :start do
|
7
|
+
sh "heel --root #{SITE.output_dir} --daemonize"
|
8
|
+
end
|
9
|
+
|
10
|
+
desc 'stop the heel server'
|
11
|
+
task :stop do
|
12
|
+
sh "heel --kill"
|
13
|
+
end
|
14
|
+
|
15
|
+
task :autorun do
|
16
|
+
heel_exe = File.join(Gem.bindir, 'heel')
|
17
|
+
@heel_spawner = Spawner.new(Spawner.ruby, heel_exe, '--root', SITE.output_dir, :pause => 86_400)
|
18
|
+
@heel_spawner.start
|
19
|
+
end
|
20
|
+
|
21
|
+
task :autobuild => :autorun do
|
22
|
+
at_exit {@heel_spawner.stop if defined? @heel_spawner and not @heel_spawner.nil?}
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
task :autobuild => 'heel:autobuild'
|
28
|
+
|
29
|
+
# EOF
|
data/data/tasks/setup.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# $Id$
|
1
2
|
|
2
3
|
require 'webby'
|
3
4
|
|
@@ -11,8 +12,7 @@ SITE.template_dir = 'templates'
|
|
11
12
|
SITE.exclude = %w[tmp$ bak$ ~$ CVS \.svn]
|
12
13
|
|
13
14
|
SITE.page_defaults = {
|
14
|
-
'
|
15
|
-
'layout' => 'default'
|
15
|
+
'layout' => 'default'
|
16
16
|
}
|
17
17
|
|
18
18
|
# Items used to deploy the webiste
|
@@ -23,12 +23,7 @@ SITE.rsync_args = %w(-av --delete)
|
|
23
23
|
# Options passed to the 'tidy' program when the tidy filter is used
|
24
24
|
SITE.tidy_options = '-indent -wrap 80'
|
25
25
|
|
26
|
-
# Load
|
27
|
-
|
28
|
-
|
29
|
-
# Conditional dependencies
|
30
|
-
%w(heel).each do |lib|
|
31
|
-
Object.instance_eval {const_set "HAVE_#{lib.upcase}", try_require(lib)}
|
32
|
-
end
|
26
|
+
# Load the other rake files in the tasks folder
|
27
|
+
Dir.glob('tasks/*.rake').sort.each {|fn| import fn}
|
33
28
|
|
34
29
|
# EOF
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,24 @@
|
|
1
|
+
---
|
2
|
+
title: Manual
|
3
|
+
created_at: Wed Aug 29 08:57:00 -0600 2007
|
4
|
+
filter:
|
5
|
+
- coderay
|
6
|
+
- textile
|
7
|
+
---
|
8
|
+
h2. Installation
|
9
|
+
|
10
|
+
directory structure
|
11
|
+
|
12
|
+
* content
|
13
|
+
* output
|
14
|
+
* layouts
|
15
|
+
* templates
|
16
|
+
* lib
|
17
|
+
* tasks
|
18
|
+
|
19
|
+
resources
|
20
|
+
|
21
|
+
renderer
|
22
|
+
|
23
|
+
pages database
|
24
|
+
|
File without changes
|
File without changes
|
@@ -25,7 +25,7 @@ content/
|
|
25
25
|
layouts/
|
26
26
|
lib/
|
27
27
|
output/
|
28
|
-
|
28
|
+
rakelib/
|
29
29
|
templates/
|
30
30
|
</pre>
|
31
31
|
|
@@ -69,7 +69,7 @@ This is not the entire contents of the file, just to enough to get a feel for ho
|
|
69
69
|
|
70
70
|
The content of this page is not HTML, but it ends up that way. How? Webby uses _filters_ on the page to transform the text into HTML. The *filter* item in the meta-data tells Webby which filters to apply to the page. Two filters will be applied, "erb" and "textile" - in that order. Each filter operates on the page text (everything after the meta-data).
|
71
71
|
|
72
|
-
The erb filter (erb stands for "embedded Ruby") allows Webby to process Ruby statements found in the page text and to
|
72
|
+
The erb filter (erb stands for "embedded Ruby") allows Webby to process Ruby statements found in the page text and to substitute the output of those Ruby statements back into the page text. The Ruby statements appear between @<%= ruby_code %>@ delimiters. The meta-data found at the top of the page is made available through the @@page@ object. You can see from the index.rhtml file that the page title, "Home Page", will be substituted on the first line.
|
73
73
|
|
74
74
|
The textile filter operates on all page text. It is a human readable markup that gets converted into HTML. For example, the line @h3. Litora Sociis@ will be converted into @<h3>Litora Sociis</h3>@ by the textile filter. It is a powerful markup language that simplifies web publishing.
|
75
75
|
|
@@ -117,14 +117,14 @@ filter: erb
|
|
117
117
|
|
118
118
|
Ahhh, I love the smell of HTML in the morning!
|
119
119
|
|
120
|
-
You'll notice that the layout file has meta-data just like the content files we've been editing. The *extension* defines the filename
|
120
|
+
You'll notice that the layout file has meta-data just like the content files we've been editing. The *extension* defines the filename extension that will be appended to every file generated by this layout. Just like the content files, layouts are filtered to produce valid HTML. The current page being rendered is available in the layout using the @@page@ variable. We can see in the HTML header data that the page title will be set to the value of the @@page.title@.
|
121
121
|
|
122
|
-
|
122
|
+
The meta-data of the layout is not made available in the layout itself - just the meta-data of the content file being rendered.
|
123
123
|
|
124
|
-
Let's change the layout by removing the sidebar from every page. Find the sidebar div @<div class="column span-3 last">@. Delete that div, run rake to build the
|
124
|
+
Let's change the layout by removing the sidebar from every page. Find the sidebar div @<div class="column span-3 last">@. Delete that div, run rake to build the website again, and take a look at the site in your browser. You'll notice that both pages have been updated since both depend upon the default layout.
|
125
125
|
|
126
126
|
h2. What Now?
|
127
127
|
|
128
128
|
Let your creativity run wild!
|
129
129
|
|
130
|
-
You can read more about the features of Webby in the "manual":manual.html. There you'll discover how to reference layouts other than the default, how to create page templates for simplifying blog posts. Take a look at the "tips & tricks":tips_and_tricks.html for more ideas on
|
130
|
+
You can read more about the features of Webby in the "manual":manual.html. There you'll discover how to reference layouts other than the default, how to create page templates for simplifying blog posts. Take a look at the "tips & tricks":tips_and_tricks.html for more ideas on simplifying your web development work cycle.
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,12 +1,12 @@
|
|
1
|
-
|
2
|
-
desc 'send log events to Growl (Mac OS X only)'
|
3
|
-
task :growl do
|
4
|
-
Logging::Logger['Webby'].add(Logging::Appenders::Growl.new(
|
5
|
-
"Webby",
|
6
|
-
:layout => Logging::Layouts::Pattern.new(:pattern => "%5l - Webby\000%m"),
|
7
|
-
:coalesce => true,
|
8
|
-
:separator => "\000"
|
9
|
-
))
|
10
|
-
end
|
11
|
-
|
12
|
-
# EOF
|
1
|
+
|
2
|
+
desc 'send log events to Growl (Mac OS X only)'
|
3
|
+
task :growl do
|
4
|
+
Logging::Logger['Webby'].add(Logging::Appenders::Growl.new(
|
5
|
+
"Webby",
|
6
|
+
:layout => Logging::Layouts::Pattern.new(:pattern => "%5l - Webby\000%m"),
|
7
|
+
:coalesce => true,
|
8
|
+
:separator => "\000"
|
9
|
+
))
|
10
|
+
end
|
11
|
+
|
12
|
+
# EOF
|
@@ -1,32 +1,28 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end # HAVE_HEEL
|
31
|
-
|
32
|
-
# EOF
|
1
|
+
|
2
|
+
namespace :heel do
|
3
|
+
|
4
|
+
desc 'start the heel server to view website (not for Windows)'
|
5
|
+
task :start do
|
6
|
+
sh "heel --root #{SITE.output_dir} --daemonize"
|
7
|
+
end
|
8
|
+
|
9
|
+
desc 'stop the heel server'
|
10
|
+
task :stop do
|
11
|
+
sh "heel --kill"
|
12
|
+
end
|
13
|
+
|
14
|
+
task :autorun do
|
15
|
+
heel_exe = File.join(Gem.bindir, 'heel')
|
16
|
+
@heel_spawner = Spawner.new(Spawner.ruby, heel_exe, '--root', SITE.output_dir, :pause => 86_400)
|
17
|
+
@heel_spawner.start
|
18
|
+
end
|
19
|
+
|
20
|
+
task :autobuild => :autorun do
|
21
|
+
at_exit {@heel_spawner.stop if defined? @heel_spawner and not @heel_spawner.nil?}
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
task :autobuild => 'heel:autobuild'
|
27
|
+
|
28
|
+
# EOF
|
@@ -11,8 +11,7 @@ SITE.template_dir = 'templates'
|
|
11
11
|
SITE.exclude = %w[tmp$ bak$ ~$ CVS \.svn]
|
12
12
|
|
13
13
|
SITE.page_defaults = {
|
14
|
-
'
|
15
|
-
'layout' => 'default'
|
14
|
+
'layout' => 'default'
|
16
15
|
}
|
17
16
|
|
18
17
|
# Items used to deploy the webiste
|
@@ -23,12 +22,7 @@ SITE.rsync_args = %w(-av --delete)
|
|
23
22
|
# Options passed to the 'tidy' program when the tidy filter is used
|
24
23
|
SITE.tidy_options = '-indent -wrap 80'
|
25
24
|
|
26
|
-
# Load
|
27
|
-
|
28
|
-
|
29
|
-
# Conditional dependencies
|
30
|
-
%w(heel).each do |lib|
|
31
|
-
Object.instance_eval {const_set "HAVE_#{lib.upcase}", try_require(lib)}
|
32
|
-
end
|
25
|
+
# Load the other rake files in the tasks folder
|
26
|
+
Dir.glob('tasks/*.rake').sort.each {|fn| import fn}
|
33
27
|
|
34
28
|
# EOF
|
File without changes
|
data/lib/webby/file.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: file.rb
|
1
|
+
# $Id: file.rb 71 2007-12-13 05:45:53Z tim_pease $
|
2
2
|
|
3
3
|
require 'yaml'
|
4
4
|
|
@@ -69,6 +69,38 @@ class File < ::File
|
|
69
69
|
ensure
|
70
70
|
fd.close unless fd.nil?
|
71
71
|
end
|
72
|
+
|
73
|
+
# call-seq:
|
74
|
+
# Webby::File.dirname( filename ) => dir_name
|
75
|
+
#
|
76
|
+
# Returns all components of the _filename_ except the last one. The
|
77
|
+
# filename must be formed using forward slashes ("/") regardless of the
|
78
|
+
# separator used on the local file system.
|
79
|
+
#
|
80
|
+
def dirname( fn )
|
81
|
+
::File.dirname(fn).sub(%r/\A[^\/]+\/?/o, '')
|
82
|
+
end
|
83
|
+
|
84
|
+
# call-seq:
|
85
|
+
# Webby::File.basename( filename ) => base_name
|
86
|
+
#
|
87
|
+
# Returns the last component of the _filename_, which must be formed
|
88
|
+
# using forward slashes ("/"regardless of the separator used on the
|
89
|
+
# local file system. The suffix is removed from the filename.
|
90
|
+
#
|
91
|
+
def basename( fn )
|
92
|
+
::File.basename(fn, '.*')
|
93
|
+
end
|
94
|
+
|
95
|
+
# call-seq:
|
96
|
+
# Webby::File.extname( filename ) => ext_name
|
97
|
+
#
|
98
|
+
# Returns the extension (the portion of file name in path after the
|
99
|
+
# period). This method excludes the period from the extension name.
|
100
|
+
#
|
101
|
+
def extname( fn )
|
102
|
+
::File.extname(fn).tr('.', '')
|
103
|
+
end
|
72
104
|
end
|
73
105
|
|
74
106
|
# call-seq:
|
@@ -1,11 +1,11 @@
|
|
1
|
-
# $Id: coderay.rb
|
1
|
+
# $Id: coderay.rb 68 2007-12-09 07:45:37Z tim_pease $
|
2
2
|
|
3
3
|
require 'enumerator'
|
4
4
|
require 'hpricot'
|
5
5
|
try_require 'coderay'
|
6
6
|
|
7
7
|
module Webby
|
8
|
-
module Filters
|
8
|
+
module Filters
|
9
9
|
|
10
10
|
# The CodeRay applies syntax highlighting to source code embedded in a
|
11
11
|
# webpage. The CodeRay highlighting engine is used for the HTML markup of
|
@@ -86,6 +86,12 @@ class CodeRay
|
|
86
86
|
end
|
87
87
|
|
88
88
|
end # class CodeRay
|
89
|
+
|
90
|
+
# Render text via the CodeRay syntax highlighter library.
|
91
|
+
register :coderay do |input, cursor|
|
92
|
+
Filters::CodeRay.new(input, cursor.remaining_filters).to_html
|
93
|
+
end
|
94
|
+
|
89
95
|
end # module Filters
|
90
96
|
end # module Webby
|
91
97
|
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# $Id: erb.rb 68 2007-12-09 07:45:37Z tim_pease $
|
2
|
+
|
3
|
+
require 'erb'
|
4
|
+
|
5
|
+
# Render text via ERB using the built in ERB library.
|
6
|
+
Webby::Filters.register :erb do |input, cursor|
|
7
|
+
b = cursor.renderer.get_binding
|
8
|
+
ERB.new(input, nil, '-').result(b)
|
9
|
+
end
|
10
|
+
|
11
|
+
# EOF
|