webby 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/Manifest.txt +2 -2
- data/Rakefile +19 -14
- data/examples/webby/content/tips_and_tricks/index.txt +3 -1
- data/lib/webby/helpers/coderay_helper.rb +2 -2
- data/lib/webby/helpers/ultraviolet_helper.rb +2 -2
- data/lib/webby/resources/page.rb +15 -1
- data/lib/webby/resources/resource.rb +1 -4
- data/lib/webby.rb +2 -2
- data/tasks/ann.rake +16 -14
- data/tasks/bones.rake +6 -25
- data/tasks/gem.rake +24 -34
- data/tasks/{annotations.rake → notes.rake} +3 -3
- data/tasks/post_load.rake +16 -11
- data/tasks/{doc.rake → rdoc.rake} +9 -8
- data/tasks/rubyforge.rake +11 -11
- data/tasks/setup.rb +108 -82
- data/tasks/spec.rake +13 -14
- data/tasks/svn.rake +11 -10
- data/tasks/website.rake +2 -2
- metadata +4 -4
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -100,12 +100,12 @@ spec/spec.opts
|
|
100
100
|
spec/spec_helper.rb
|
101
101
|
spec/webby/resources/file_spec.rb
|
102
102
|
tasks/ann.rake
|
103
|
-
tasks/annotations.rake
|
104
103
|
tasks/bones.rake
|
105
|
-
tasks/doc.rake
|
106
104
|
tasks/gem.rake
|
107
105
|
tasks/manifest.rake
|
106
|
+
tasks/notes.rake
|
108
107
|
tasks/post_load.rake
|
108
|
+
tasks/rdoc.rake
|
109
109
|
tasks/rubyforge.rake
|
110
110
|
tasks/setup.rb
|
111
111
|
tasks/spec.rake
|
data/Rakefile
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: Rakefile
|
1
|
+
# $Id: Rakefile 202 2008-03-12 16:41:30Z tim_pease $
|
2
2
|
|
3
3
|
load 'tasks/setup.rb'
|
4
4
|
|
@@ -13,29 +13,34 @@ PROJ.authors = 'Tim Pease'
|
|
13
13
|
PROJ.email = 'tim.pease@gmail.com'
|
14
14
|
PROJ.url = 'http://webby.rubyforge.org/'
|
15
15
|
PROJ.description = paragraphs_of('README.txt', 3).join("\n\n")
|
16
|
-
PROJ.
|
17
|
-
PROJ.rdoc_dir = 'doc/rdoc'
|
18
|
-
PROJ.rdoc_remote_dir = 'rdoc'
|
16
|
+
PROJ.rubyforge.name = 'webby'
|
19
17
|
PROJ.version = Webby::VERSION
|
20
|
-
PROJ.release_name = '
|
18
|
+
PROJ.release_name = 'Little Bugger'
|
21
19
|
|
22
20
|
PROJ.exclude << %w(^examples/[^/]+/output ^tasks/archive ^tags$)
|
23
|
-
PROJ.rdoc_exclude << %w(^data ^examples)
|
24
21
|
|
25
|
-
PROJ.
|
26
|
-
PROJ.
|
22
|
+
PROJ.rdoc.dir = 'doc/rdoc'
|
23
|
+
PROJ.rdoc.remote_dir = 'rdoc'
|
24
|
+
PROJ.rdoc.exclude << %w(^data ^examples)
|
27
25
|
|
28
|
-
PROJ.
|
29
|
-
PROJ.
|
30
|
-
PROJ.ann_email[:port] = 587
|
26
|
+
PROJ.svn.path = ''
|
27
|
+
PROJ.spec.opts << '--color'
|
31
28
|
|
32
|
-
PROJ.
|
33
|
-
|
29
|
+
PROJ.ann.email[:to] << 'webby-forum@googlegroups.com'
|
30
|
+
PROJ.ann.email[:server] = 'smtp.gmail.com'
|
31
|
+
PROJ.ann.email[:port] = 587
|
34
32
|
|
35
|
-
|
33
|
+
PROJ.ann.text = <<-ANN
|
34
|
+
== FUN FACT
|
36
35
|
|
36
|
+
La Paz, the capital city of Bolivia, is the highest capital in the
|
37
|
+
world at over 17,000 feet (5,181 m).
|
38
|
+
|
37
39
|
== POST SCRIPT
|
38
40
|
|
41
|
+
Visit the Webby forum to chat with other Webby-Heads:
|
42
|
+
http://groups.google.com/group/webby-forum
|
43
|
+
|
39
44
|
Blessings,
|
40
45
|
TwP
|
41
46
|
ANN
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: coderay_helper.rb
|
1
|
+
# $Id: coderay_helper.rb 199 2008-03-11 18:54:45Z tim_pease $
|
2
2
|
|
3
3
|
if try_require 'coderay'
|
4
4
|
require 'enumerator'
|
@@ -37,7 +37,7 @@ module CodeRayHelper
|
|
37
37
|
pos = buffer.length
|
38
38
|
block.call(*args)
|
39
39
|
|
40
|
-
text = buffer[pos..-1]
|
40
|
+
text = buffer[pos..-1]
|
41
41
|
if text.empty?
|
42
42
|
buffer[pos..-1] = ''
|
43
43
|
return
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: ultraviolet_helper.rb
|
1
|
+
# $Id: ultraviolet_helper.rb 199 2008-03-11 18:54:45Z tim_pease $
|
2
2
|
|
3
3
|
# This code was provided by Guillaume Carbonneau -- http://radr.ca/
|
4
4
|
# Many thanks for his support of Webby!
|
@@ -41,7 +41,7 @@ module UltraVioletHelper
|
|
41
41
|
pos = buffer.length
|
42
42
|
block.call(*args)
|
43
43
|
|
44
|
-
text = buffer[pos..-1]
|
44
|
+
text = buffer[pos..-1]
|
45
45
|
if text.empty?
|
46
46
|
buffer[pos..-1] = ''
|
47
47
|
return
|
data/lib/webby/resources/page.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: page.rb
|
1
|
+
# $Id: page.rb 198 2008-03-10 15:25:55Z tim_pease $
|
2
2
|
|
3
3
|
require Webby.libpath(*%w[webby resources resource])
|
4
4
|
|
@@ -44,6 +44,20 @@ class Page < Resource
|
|
44
44
|
renderer.render_page
|
45
45
|
end
|
46
46
|
|
47
|
+
# call-seq
|
48
|
+
# url => string or nil
|
49
|
+
#
|
50
|
+
# Returns a string suitable for use as a URL linking to this page. Nil
|
51
|
+
# is returned for layouts.
|
52
|
+
#
|
53
|
+
def url
|
54
|
+
return @url if defined? @url and @url
|
55
|
+
|
56
|
+
@url = destination.sub(::Webby.site.output_dir, '')
|
57
|
+
@url = File.dirname(@url) if filename == 'index' and number.nil?
|
58
|
+
@url
|
59
|
+
end
|
60
|
+
|
47
61
|
# call-seq:
|
48
62
|
# page.number = Integer
|
49
63
|
#
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: resource.rb
|
1
|
+
# $Id: resource.rb 198 2008-03-10 15:25:55Z tim_pease $
|
2
2
|
|
3
3
|
unless defined? Webby::Resources::Resource
|
4
4
|
|
@@ -121,10 +121,7 @@ class Resource
|
|
121
121
|
#
|
122
122
|
def url
|
123
123
|
return @url if defined? @url and @url
|
124
|
-
|
125
124
|
@url = destination.sub(::Webby.site.output_dir, '')
|
126
|
-
@url = File.dirname(@url) if filename == 'index'
|
127
|
-
@url
|
128
125
|
end
|
129
126
|
|
130
127
|
# :stopdoc:
|
data/lib/webby.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: webby.rb
|
1
|
+
# $Id: webby.rb 198 2008-03-10 15:25:55Z tim_pease $
|
2
2
|
|
3
3
|
# Equivalent to a header guard in C/C++
|
4
4
|
# Used to prevent the spec helper from being loaded more than once
|
@@ -20,7 +20,7 @@ Logging::Appender.stdout.layout = Logging::Layouts::Pattern.new(
|
|
20
20
|
module Webby
|
21
21
|
|
22
22
|
# :stopdoc:
|
23
|
-
VERSION = '0.8.
|
23
|
+
VERSION = '0.8.2' # :nodoc:
|
24
24
|
LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
|
25
25
|
PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
|
26
26
|
# :startdoc:
|
data/tasks/ann.rake
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id$
|
1
|
+
# $Id: ann.rake 200 2008-03-12 16:05:17Z tim_pease $
|
2
2
|
|
3
3
|
begin
|
4
4
|
require 'bones/smtp_tls'
|
@@ -9,9 +9,10 @@ require 'time'
|
|
9
9
|
|
10
10
|
namespace :ann do
|
11
11
|
|
12
|
-
file PROJ.
|
13
|
-
|
14
|
-
|
12
|
+
file PROJ.ann.file do
|
13
|
+
ann = PROJ.ann
|
14
|
+
puts "Generating #{ann.file}"
|
15
|
+
File.open(ann.file,'w') do |fd|
|
15
16
|
fd.puts("#{PROJ.name} version #{PROJ.version}")
|
16
17
|
fd.puts(" by #{Array(PROJ.authors).first}") if PROJ.authors
|
17
18
|
fd.puts(" #{PROJ.url}") if PROJ.url
|
@@ -23,23 +24,24 @@ namespace :ann do
|
|
23
24
|
fd.puts
|
24
25
|
fd.puts(PROJ.changes.sub(%r/^.*$/, '== CHANGES'))
|
25
26
|
fd.puts
|
26
|
-
|
27
|
+
ann.paragraphs.each do |p|
|
27
28
|
fd.puts "== #{p.upcase}"
|
28
29
|
fd.puts
|
29
30
|
fd.puts paragraphs_of(PROJ.readme_file, p).join("\n\n")
|
30
31
|
fd.puts
|
31
32
|
end
|
32
|
-
fd.puts
|
33
|
+
fd.puts ann.text if ann.text
|
33
34
|
end
|
34
35
|
end
|
35
36
|
|
36
37
|
desc "Create an announcement file"
|
37
|
-
task :announcement => PROJ.
|
38
|
+
task :announcement => PROJ.ann.file
|
38
39
|
|
39
40
|
desc "Send an email announcement"
|
40
|
-
task :email => PROJ.
|
41
|
-
|
42
|
-
|
41
|
+
task :email => PROJ.ann.file do
|
42
|
+
ann = PROJ.ann
|
43
|
+
from = ann.email[:from] || PROJ.email
|
44
|
+
to = Array(ann.email[:to])
|
43
45
|
|
44
46
|
### build a mail header for RFC 822
|
45
47
|
rfc822msg = "From: #{from}\n"
|
@@ -49,11 +51,11 @@ namespace :ann do
|
|
49
51
|
rfc822msg << "\n"
|
50
52
|
rfc822msg << "Date: #{Time.new.rfc822}\n"
|
51
53
|
rfc822msg << "Message-Id: "
|
52
|
-
rfc822msg << "<#{"%.8f" % Time.now.to_f}@#{
|
53
|
-
rfc822msg << File.read(
|
54
|
+
rfc822msg << "<#{"%.8f" % Time.now.to_f}@#{ann.email[:domain]}>\n\n"
|
55
|
+
rfc822msg << File.read(ann.file)
|
54
56
|
|
55
57
|
params = [:server, :port, :domain, :acct, :passwd, :authtype].map do |key|
|
56
|
-
|
58
|
+
ann.email[key]
|
57
59
|
end
|
58
60
|
|
59
61
|
params[3] = PROJ.email if params[3].nil?
|
@@ -71,6 +73,6 @@ end # namespace :ann
|
|
71
73
|
desc 'Alias to ann:announcement'
|
72
74
|
task :ann => 'ann:announcement'
|
73
75
|
|
74
|
-
CLOBBER << PROJ.
|
76
|
+
CLOBBER << PROJ.ann.file
|
75
77
|
|
76
78
|
# EOF
|
data/tasks/bones.rake
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
# $Id$
|
1
|
+
# $Id: bones.rake 200 2008-03-12 16:05:17Z tim_pease $
|
2
2
|
|
3
|
-
|
4
|
-
require 'stringio'
|
3
|
+
if HAVE_BONES
|
5
4
|
|
6
5
|
namespace :bones do
|
7
6
|
|
@@ -10,31 +9,13 @@ namespace :bones do
|
|
10
9
|
atr = if ARGV.length == 2
|
11
10
|
t.application.top_level_tasks.pop
|
12
11
|
end
|
13
|
-
sio = StringIO.new
|
14
|
-
sep = "\n" + ' '*27
|
15
|
-
fmt = "%23s => %s"
|
16
12
|
|
17
|
-
if atr
|
18
|
-
|
19
|
-
sio.seek 0
|
20
|
-
val = sio.read
|
21
|
-
val = val.split("\n").join(sep)
|
22
|
-
|
23
|
-
puts fmt % [atr, val]
|
24
|
-
else
|
25
|
-
h = PROJ.instance_variable_get(:@table)
|
26
|
-
h.keys.map {|k| k.to_s}.sort.each do |k|
|
27
|
-
sio.truncate 0
|
28
|
-
PP.pp(h[k.to_sym], sio, 49)
|
29
|
-
sio.seek 0
|
30
|
-
val = sio.read
|
31
|
-
val = val.split("\n").join(sep)
|
32
|
-
|
33
|
-
puts fmt % [k, val]
|
34
|
-
end
|
35
|
-
end
|
13
|
+
if atr then Bones::Debug.show_attr(PROJ, atr)
|
14
|
+
else Bones::Debug.show PROJ end
|
36
15
|
end
|
37
16
|
|
38
17
|
end # namespace :bones
|
39
18
|
|
19
|
+
end # HAVE_BONES
|
20
|
+
|
40
21
|
# EOF
|
data/tasks/gem.rake
CHANGED
@@ -1,87 +1,77 @@
|
|
1
|
-
# $Id$
|
1
|
+
# $Id: gem.rake 200 2008-03-12 16:05:17Z tim_pease $
|
2
2
|
|
3
3
|
require 'rake/gempackagetask'
|
4
4
|
|
5
5
|
namespace :gem do
|
6
6
|
|
7
|
-
PROJ.spec = Gem::Specification.new do |s|
|
7
|
+
PROJ.gem.spec = Gem::Specification.new do |s|
|
8
8
|
s.name = PROJ.name
|
9
9
|
s.version = PROJ.version
|
10
10
|
s.summary = PROJ.summary
|
11
11
|
s.authors = Array(PROJ.authors)
|
12
12
|
s.email = PROJ.email
|
13
13
|
s.homepage = Array(PROJ.url).first
|
14
|
-
s.rubyforge_project = PROJ.
|
15
|
-
s.post_install_message = PROJ.post_install_message
|
14
|
+
s.rubyforge_project = PROJ.rubyforge.name
|
15
|
+
s.post_install_message = PROJ.gem.post_install_message
|
16
16
|
|
17
17
|
s.description = PROJ.description
|
18
18
|
|
19
|
-
PROJ.dependencies.each do |dep|
|
19
|
+
PROJ.gem.dependencies.each do |dep|
|
20
20
|
s.add_dependency(*dep)
|
21
21
|
end
|
22
22
|
|
23
|
-
s.files = PROJ.files
|
24
|
-
s.executables = PROJ.executables.map {|fn| File.basename(fn)}
|
25
|
-
s.extensions = PROJ.files.grep %r/extconf\.rb$/
|
23
|
+
s.files = PROJ.gem.files
|
24
|
+
s.executables = PROJ.gem.executables.map {|fn| File.basename(fn)}
|
25
|
+
s.extensions = PROJ.gem.files.grep %r/extconf\.rb$/
|
26
26
|
|
27
27
|
s.bindir = 'bin'
|
28
28
|
dirs = Dir["{#{PROJ.libs.join(',')}}"]
|
29
29
|
s.require_paths = dirs unless dirs.empty?
|
30
30
|
|
31
|
-
incl = Regexp.new(PROJ.
|
32
|
-
excl = PROJ.
|
31
|
+
incl = Regexp.new(PROJ.rdoc.include.join('|'))
|
32
|
+
excl = PROJ.rdoc.exclude.dup.concat %w[\.rb$ ^(\.\/|\/)?ext]
|
33
33
|
excl = Regexp.new(excl.join('|'))
|
34
|
-
rdoc_files = PROJ.files.find_all do |fn|
|
34
|
+
rdoc_files = PROJ.gem.files.find_all do |fn|
|
35
35
|
case fn
|
36
36
|
when excl; false
|
37
37
|
when incl; true
|
38
38
|
else false end
|
39
39
|
end
|
40
|
-
s.rdoc_options = PROJ.
|
40
|
+
s.rdoc_options = PROJ.rdoc.opts + ['--main', PROJ.rdoc.main]
|
41
41
|
s.extra_rdoc_files = rdoc_files
|
42
42
|
s.has_rdoc = true
|
43
43
|
|
44
|
-
if test ?f, PROJ.
|
45
|
-
s.test_file = PROJ.
|
44
|
+
if test ?f, PROJ.test.file
|
45
|
+
s.test_file = PROJ.test.file
|
46
46
|
else
|
47
|
-
s.test_files = PROJ.
|
47
|
+
s.test_files = PROJ.test.files.to_a
|
48
48
|
end
|
49
|
-
|
50
|
-
# Do any extra stuff the user wants
|
51
|
-
# spec_extras.each do |msg, val|
|
52
|
-
# case val
|
53
|
-
# when Proc
|
54
|
-
# val.call(s.send(msg))
|
55
|
-
# else
|
56
|
-
# s.send "#{msg}=", val
|
57
|
-
# end
|
58
|
-
# end
|
59
49
|
end
|
60
50
|
|
61
51
|
desc 'Show information about the gem'
|
62
52
|
task :debug do
|
63
|
-
puts PROJ.spec.to_ruby
|
53
|
+
puts PROJ.gem.spec.to_ruby
|
64
54
|
end
|
65
55
|
|
66
56
|
pkg = Rake::PackageTask.new(PROJ.name, PROJ.version) do |pkg|
|
67
|
-
pkg.need_tar = PROJ.need_tar
|
68
|
-
pkg.need_zip = PROJ.need_zip
|
69
|
-
pkg.package_files += PROJ.spec.files
|
57
|
+
pkg.need_tar = PROJ.gem.need_tar
|
58
|
+
pkg.need_zip = PROJ.gem.need_zip
|
59
|
+
pkg.package_files += PROJ.gem.spec.files
|
70
60
|
end
|
71
61
|
Rake::Task['gem:package'].instance_variable_set(:@full_comment, nil)
|
72
62
|
|
73
|
-
gem_file = if PROJ.spec.platform == Gem::Platform::RUBY
|
63
|
+
gem_file = if PROJ.gem.spec.platform == Gem::Platform::RUBY
|
74
64
|
"#{pkg.package_name}.gem"
|
75
65
|
else
|
76
|
-
"#{pkg.package_name}-#{PROJ.spec.platform}.gem"
|
66
|
+
"#{pkg.package_name}-#{PROJ.gem.spec.platform}.gem"
|
77
67
|
end
|
78
68
|
|
79
69
|
desc "Build the gem file #{gem_file}"
|
80
70
|
task :package => "#{pkg.package_dir}/#{gem_file}"
|
81
71
|
|
82
|
-
file "#{pkg.package_dir}/#{gem_file}" => [pkg.package_dir] + PROJ.spec.files do
|
72
|
+
file "#{pkg.package_dir}/#{gem_file}" => [pkg.package_dir] + PROJ.gem.spec.files do
|
83
73
|
when_writing("Creating GEM") {
|
84
|
-
Gem::Builder.new(PROJ.spec).build
|
74
|
+
Gem::Builder.new(PROJ.gem.spec).build
|
85
75
|
verbose(true) {
|
86
76
|
mv gem_file, "#{pkg.package_dir}/#{gem_file}"
|
87
77
|
}
|
@@ -90,7 +80,7 @@ namespace :gem do
|
|
90
80
|
|
91
81
|
desc 'Install the gem'
|
92
82
|
task :install => [:clobber, :package] do
|
93
|
-
sh "#{SUDO} #{GEM} install pkg/#{PROJ.spec.full_name}"
|
83
|
+
sh "#{SUDO} #{GEM} install pkg/#{PROJ.gem.spec.full_name}"
|
94
84
|
end
|
95
85
|
|
96
86
|
desc 'Uninstall the gem'
|
@@ -1,15 +1,15 @@
|
|
1
|
-
# $Id$
|
1
|
+
# $Id: notes.rake 200 2008-03-12 16:05:17Z tim_pease $
|
2
2
|
|
3
3
|
if HAVE_BONES
|
4
4
|
|
5
5
|
desc "Enumerate all annotations"
|
6
6
|
task :notes do
|
7
7
|
Bones::AnnotationExtractor.enumerate(
|
8
|
-
PROJ, PROJ.
|
8
|
+
PROJ, PROJ.notes.tags.join('|'), :tag => true)
|
9
9
|
end
|
10
10
|
|
11
11
|
namespace :notes do
|
12
|
-
PROJ.
|
12
|
+
PROJ.notes.tags.each do |tag|
|
13
13
|
desc "Enumerate all #{tag} annotations"
|
14
14
|
task tag.downcase.to_sym do
|
15
15
|
Bones::AnnotationExtractor.enumerate(PROJ, tag)
|
data/tasks/post_load.rake
CHANGED
@@ -1,16 +1,21 @@
|
|
1
|
-
# $Id$
|
1
|
+
# $Id: post_load.rake 200 2008-03-12 16:05:17Z tim_pease $
|
2
2
|
|
3
3
|
# This file does not define any rake tasks. It is used to load some project
|
4
4
|
# settings if they are not defined by the user.
|
5
5
|
|
6
|
-
PROJ.
|
7
|
-
PROJ.exclude << "^#{Regexp.escape(PROJ.
|
6
|
+
PROJ.rdoc.exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
|
7
|
+
PROJ.exclude << "^#{Regexp.escape(PROJ.ann.file)}$"
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
9
|
+
flatten_arrays = lambda do |this,os|
|
10
|
+
os.instance_variable_get(:@table).each do |key,val|
|
11
|
+
next if key == :dependencies
|
12
|
+
case val
|
13
|
+
when Array; val.flatten!
|
14
|
+
when OpenStruct; this.call(this,val)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
flatten_arrays.call(flatten_arrays,PROJ)
|
14
19
|
|
15
20
|
PROJ.changes ||= paragraphs_of(PROJ.history_file, 0..1).join("\n\n")
|
16
21
|
|
@@ -18,15 +23,15 @@ PROJ.description ||= paragraphs_of(PROJ.readme_file, 'description').join("\n\n")
|
|
18
23
|
|
19
24
|
PROJ.summary ||= PROJ.description.split('.').first
|
20
25
|
|
21
|
-
PROJ.files ||=
|
26
|
+
PROJ.gem.files ||=
|
22
27
|
if test(?f, PROJ.manifest_file)
|
23
28
|
files = File.readlines(PROJ.manifest_file).map {|fn| fn.chomp.strip}
|
24
29
|
files.delete ''
|
25
30
|
files
|
26
31
|
else [] end
|
27
32
|
|
28
|
-
PROJ.executables ||= PROJ.files.find_all {|fn| fn =~ %r/^bin/}
|
33
|
+
PROJ.gem.executables ||= PROJ.gem.files.find_all {|fn| fn =~ %r/^bin/}
|
29
34
|
|
30
|
-
PROJ.
|
35
|
+
PROJ.rdoc.main ||= PROJ.readme_file
|
31
36
|
|
32
37
|
# EOF
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id$
|
1
|
+
# $Id: rdoc.rake 200 2008-03-12 16:05:17Z tim_pease $
|
2
2
|
|
3
3
|
require 'rake/rdoctask'
|
4
4
|
|
@@ -6,12 +6,13 @@ namespace :doc do
|
|
6
6
|
|
7
7
|
desc 'Generate RDoc documentation'
|
8
8
|
Rake::RDocTask.new do |rd|
|
9
|
-
|
10
|
-
rd.
|
9
|
+
rdoc = PROJ.rdoc
|
10
|
+
rd.main = rdoc.main
|
11
|
+
rd.rdoc_dir = rdoc.dir
|
11
12
|
|
12
|
-
incl = Regexp.new(
|
13
|
-
excl = Regexp.new(
|
14
|
-
files = PROJ.files.find_all do |fn|
|
13
|
+
incl = Regexp.new(rdoc.include.join('|'))
|
14
|
+
excl = Regexp.new(rdoc.exclude.join('|'))
|
15
|
+
files = PROJ.gem.files.find_all do |fn|
|
15
16
|
case fn
|
16
17
|
when excl; false
|
17
18
|
when incl; true
|
@@ -20,10 +21,10 @@ namespace :doc do
|
|
20
21
|
rd.rdoc_files.push(*files)
|
21
22
|
|
22
23
|
title = "#{PROJ.name}-#{PROJ.version} Documentation"
|
23
|
-
title = "#{PROJ.
|
24
|
+
title = "#{PROJ.rubyforge.name}'s " + title if PROJ.rubyforge.name != title
|
24
25
|
|
25
26
|
rd.options << "-t #{title}"
|
26
|
-
rd.options.concat(
|
27
|
+
rd.options.concat(rdoc.opts)
|
27
28
|
end
|
28
29
|
|
29
30
|
desc 'Generate ri locally for testing'
|
data/tasks/rubyforge.rake
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# $Id$
|
1
|
+
# $Id: rubyforge.rake 200 2008-03-12 16:05:17Z tim_pease $
|
2
2
|
|
3
|
-
if PROJ.
|
3
|
+
if PROJ.rubyforge.name && HAVE_RUBYFORGE
|
4
4
|
|
5
5
|
require 'rubyforge'
|
6
6
|
require 'rake/contrib/sshpublisher'
|
@@ -10,11 +10,11 @@ namespace :gem do
|
|
10
10
|
task :release => [:clobber, :package] do |t|
|
11
11
|
v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
|
12
12
|
abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
|
13
|
-
pkg = "pkg/#{PROJ.spec.full_name}"
|
13
|
+
pkg = "pkg/#{PROJ.gem.spec.full_name}"
|
14
14
|
|
15
15
|
if $DEBUG then
|
16
|
-
puts "release_id = rf.add_release #{PROJ.
|
17
|
-
puts "rf.add_file #{PROJ.
|
16
|
+
puts "release_id = rf.add_release #{PROJ.rubyforge.name.inspect}, #{PROJ.name.inspect}, #{PROJ.version.inspect}, \"#{pkg}.tgz\""
|
17
|
+
puts "rf.add_file #{PROJ.rubyforge.name.inspect}, #{PROJ.name.inspect}, release_id, \"#{pkg}.gem\""
|
18
18
|
end
|
19
19
|
|
20
20
|
rf = RubyForge.new
|
@@ -26,12 +26,12 @@ namespace :gem do
|
|
26
26
|
c['release_changes'] = PROJ.changes if PROJ.changes
|
27
27
|
c['preformatted'] = true
|
28
28
|
|
29
|
-
files = [(PROJ.need_tar ? "#{pkg}.tgz" : nil),
|
30
|
-
(PROJ.need_zip ? "#{pkg}.zip" : nil),
|
29
|
+
files = [(PROJ.gem.need_tar ? "#{pkg}.tgz" : nil),
|
30
|
+
(PROJ.gem.need_zip ? "#{pkg}.zip" : nil),
|
31
31
|
"#{pkg}.gem"].compact
|
32
32
|
|
33
33
|
puts "Releasing #{PROJ.name} v. #{PROJ.version}"
|
34
|
-
rf.add_release PROJ.
|
34
|
+
rf.add_release PROJ.rubyforge.name, PROJ.name, PROJ.version, *files
|
35
35
|
end
|
36
36
|
end # namespace :gem
|
37
37
|
|
@@ -44,9 +44,9 @@ namespace :doc do
|
|
44
44
|
)
|
45
45
|
|
46
46
|
host = "#{config['username']}@rubyforge.org"
|
47
|
-
remote_dir = "/var/www/gforge-projects/#{PROJ.
|
48
|
-
remote_dir << PROJ.
|
49
|
-
local_dir = PROJ.
|
47
|
+
remote_dir = "/var/www/gforge-projects/#{PROJ.rubyforge.name}/"
|
48
|
+
remote_dir << PROJ.rdoc.remote_dir if PROJ.rdoc.remote_dir
|
49
|
+
local_dir = PROJ.rdoc.dir
|
50
50
|
|
51
51
|
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
52
52
|
end
|
data/tasks/setup.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id$
|
1
|
+
# $Id: setup.rb 200 2008-03-12 16:05:17Z tim_pease $
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'rake'
|
@@ -6,92 +6,117 @@ require 'rake/clean'
|
|
6
6
|
require 'fileutils'
|
7
7
|
require 'ostruct'
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
PROJ
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
:
|
86
|
-
|
87
|
-
|
88
|
-
|
9
|
+
class OpenStruct; undef :gem; end
|
10
|
+
|
11
|
+
PROJ = OpenStruct.new(
|
12
|
+
# Project Defaults
|
13
|
+
:name => nil,
|
14
|
+
:summary => nil,
|
15
|
+
:description => nil,
|
16
|
+
:changes => nil,
|
17
|
+
:authors => nil,
|
18
|
+
:email => nil,
|
19
|
+
:url => nil,
|
20
|
+
:version => ENV['VERSION'] || '0.0.0',
|
21
|
+
:exclude => %w(tmp$ bak$ ~$ CVS .svn/ ^pkg/ ^doc/),
|
22
|
+
:release_name => ENV['RELEASE'],
|
23
|
+
|
24
|
+
# System Defaults
|
25
|
+
:ruby_opts => %w(-w),
|
26
|
+
:libs => [],
|
27
|
+
:history_file => 'History.txt',
|
28
|
+
:manifest_file => 'Manifest.txt',
|
29
|
+
:readme_file => 'README.txt',
|
30
|
+
|
31
|
+
# Announce
|
32
|
+
:ann => OpenStruct.new(
|
33
|
+
:file => 'announcement.txt',
|
34
|
+
:text => nil,
|
35
|
+
:paragraphs => [],
|
36
|
+
:email => {
|
37
|
+
:from => nil,
|
38
|
+
:to => %w(ruby-talk@ruby-lang.org),
|
39
|
+
:server => 'localhost',
|
40
|
+
:port => 25,
|
41
|
+
:domain => ENV['HOSTNAME'],
|
42
|
+
:acct => nil,
|
43
|
+
:passwd => nil,
|
44
|
+
:authtype => :plain
|
45
|
+
}
|
46
|
+
),
|
47
|
+
|
48
|
+
# Gem Packaging
|
49
|
+
:gem => OpenStruct.new(
|
50
|
+
:dependencies => [],
|
51
|
+
:executables => nil,
|
52
|
+
:extensions => FileList['ext/**/extconf.rb'],
|
53
|
+
:files => nil,
|
54
|
+
:need_tar => true,
|
55
|
+
:need_zip => false,
|
56
|
+
:post_install_message => nil
|
57
|
+
),
|
58
|
+
|
59
|
+
# File Annotations
|
60
|
+
:notes => OpenStruct.new(
|
61
|
+
:exclude => %w(^tasks/setup.rb$),
|
62
|
+
:extensions => %w(.txt .rb .erb) << '',
|
63
|
+
:tags => %w(FIXME OPTIMIZE TODO)
|
64
|
+
),
|
65
|
+
|
66
|
+
# Rcov
|
67
|
+
:rcov => OpenStruct.new(
|
68
|
+
:dir => 'coverage',
|
69
|
+
:opts => %w[--sort coverage -T],
|
70
|
+
:threshold => 90.0,
|
71
|
+
:threshold_exact => false
|
72
|
+
),
|
73
|
+
|
74
|
+
# Rdoc
|
75
|
+
:rdoc => OpenStruct.new(
|
76
|
+
:opts => [],
|
77
|
+
:include => %w(^lib/ ^bin/ ^ext/ .txt$),
|
78
|
+
:exclude => %w(extconf.rb$),
|
79
|
+
:main => nil,
|
80
|
+
:dir => 'doc',
|
81
|
+
:remote_dir => nil
|
82
|
+
),
|
83
|
+
|
84
|
+
# Rubyforge
|
85
|
+
:rubyforge => OpenStruct.new(
|
86
|
+
:name => nil
|
87
|
+
),
|
88
|
+
|
89
|
+
# Rspec
|
90
|
+
:spec => OpenStruct.new(
|
91
|
+
:files => FileList['spec/**/*_spec.rb'],
|
92
|
+
:opts => []
|
93
|
+
),
|
94
|
+
|
95
|
+
# Subversion Repository
|
96
|
+
:svn => OpenStruct.new(
|
97
|
+
:root => nil,
|
98
|
+
:path => nil,
|
99
|
+
:trunk => 'trunk',
|
100
|
+
:tags => 'tags',
|
101
|
+
:branches => 'branches'
|
102
|
+
),
|
103
|
+
|
104
|
+
# Test::Unit
|
105
|
+
:test => OpenStruct.new(
|
106
|
+
:files => FileList['test/**/test_*.rb'],
|
107
|
+
:file => 'test/all.rb',
|
108
|
+
:opts => []
|
109
|
+
)
|
110
|
+
)
|
89
111
|
|
90
112
|
# Load the other rake files in the tasks folder
|
91
113
|
rakefiles = Dir.glob('tasks/*.rake').sort
|
92
114
|
rakefiles.unshift(rakefiles.delete('tasks/post_load.rake')).compact!
|
93
115
|
import(*rakefiles)
|
94
116
|
|
117
|
+
# Setup the project libraries
|
118
|
+
%w(lib ext).each {|dir| PROJ.libs << dir if test ?d, dir}
|
119
|
+
|
95
120
|
# Setup some constants
|
96
121
|
WIN32 = %r/djgpp|(cyg|ms|bcc)win|mingw/ =~ RUBY_PLATFORM unless defined? WIN32
|
97
122
|
|
@@ -120,6 +145,7 @@ SUDO = if WIN32 then ''
|
|
120
145
|
end
|
121
146
|
|
122
147
|
RCOV = WIN32 ? 'rcov.bat' : 'rcov'
|
148
|
+
RDOC = WIN32 ? 'rdoc.bat' : 'rdoc'
|
123
149
|
GEM = WIN32 ? 'gem.bat' : 'gem'
|
124
150
|
|
125
151
|
%w(rcov spec/rake/spectask rubyforge bones facets/ansicode).each do |lib|
|
@@ -169,7 +195,7 @@ def depend_on( name, version = nil )
|
|
169
195
|
spec = Gem.source_index.find_name(name).last
|
170
196
|
version = spec.version.to_s if version.nil? and !spec.nil?
|
171
197
|
|
172
|
-
PROJ.dependencies << case version
|
198
|
+
PROJ.gem.dependencies << case version
|
173
199
|
when nil; [name]
|
174
200
|
when %r/^\d/; [name, ">= #{version}"]
|
175
201
|
else [name, version] end
|
data/tasks/spec.rake
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id$
|
1
|
+
# $Id: spec.rake 200 2008-03-12 16:05:17Z tim_pease $
|
2
2
|
|
3
3
|
if HAVE_SPEC_RAKE_SPECTASK
|
4
4
|
require 'spec/rake/verify_rcov'
|
@@ -8,16 +8,16 @@ namespace :spec do
|
|
8
8
|
desc 'Run all specs with basic output'
|
9
9
|
Spec::Rake::SpecTask.new(:run) do |t|
|
10
10
|
t.ruby_opts = PROJ.ruby_opts
|
11
|
-
t.spec_opts = PROJ.
|
12
|
-
t.spec_files = PROJ.
|
11
|
+
t.spec_opts = PROJ.spec.opts
|
12
|
+
t.spec_files = PROJ.spec.files
|
13
13
|
t.libs += PROJ.libs
|
14
14
|
end
|
15
15
|
|
16
16
|
desc 'Run all specs with text output'
|
17
17
|
Spec::Rake::SpecTask.new(:specdoc) do |t|
|
18
18
|
t.ruby_opts = PROJ.ruby_opts
|
19
|
-
t.spec_opts = PROJ.
|
20
|
-
t.spec_files = PROJ.
|
19
|
+
t.spec_opts = PROJ.spec.opts + ['--format', 'specdoc']
|
20
|
+
t.spec_files = PROJ.spec.files
|
21
21
|
t.libs += PROJ.libs
|
22
22
|
end
|
23
23
|
|
@@ -25,21 +25,22 @@ namespace :spec do
|
|
25
25
|
desc 'Run all specs with RCov'
|
26
26
|
Spec::Rake::SpecTask.new(:rcov) do |t|
|
27
27
|
t.ruby_opts = PROJ.ruby_opts
|
28
|
-
t.spec_opts = PROJ.
|
29
|
-
t.spec_files = PROJ.
|
28
|
+
t.spec_opts = PROJ.spec.opts
|
29
|
+
t.spec_files = PROJ.spec.files
|
30
30
|
t.libs += PROJ.libs
|
31
31
|
t.rcov = true
|
32
|
-
t.rcov_dir = PROJ.
|
33
|
-
t.rcov_opts = PROJ.
|
32
|
+
t.rcov_dir = PROJ.rcov.dir
|
33
|
+
t.rcov_opts = PROJ.rcov.opts + ['--exclude', 'spec']
|
34
34
|
end
|
35
35
|
|
36
36
|
RCov::VerifyTask.new(:verify) do |t|
|
37
|
-
t.threshold = PROJ.
|
38
|
-
t.index_html = File.join(PROJ.
|
39
|
-
t.require_exact_threshold = PROJ.
|
37
|
+
t.threshold = PROJ.rcov.threshold
|
38
|
+
t.index_html = File.join(PROJ.rcov.dir, 'index.html')
|
39
|
+
t.require_exact_threshold = PROJ.rcov.threshold_exact
|
40
40
|
end
|
41
41
|
|
42
42
|
task :verify => :rcov
|
43
|
+
remove_desc_for_task %w(spec:clobber_rcov)
|
43
44
|
end
|
44
45
|
|
45
46
|
end # namespace :spec
|
@@ -49,8 +50,6 @@ task :spec => 'spec:run'
|
|
49
50
|
|
50
51
|
task :clobber => 'spec:clobber_rcov' if HAVE_RCOV
|
51
52
|
|
52
|
-
remove_desc_for_task %w(spec:clobber_rcov)
|
53
|
-
|
54
53
|
end # if HAVE_SPEC_RAKE_SPECTASK
|
55
54
|
|
56
55
|
# EOF
|
data/tasks/svn.rake
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
# $Id$
|
1
|
+
# $Id: svn.rake 200 2008-03-12 16:05:17Z tim_pease $
|
2
2
|
|
3
|
+
if PROJ.svn.path and system("svn --version 2>&1 > #{DEV_NULL}")
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
unless PROJ.svn_root
|
5
|
+
unless PROJ.svn.root
|
7
6
|
info = %x/svn info ./
|
8
7
|
m = %r/^Repository Root:\s+(.*)$/.match(info)
|
9
|
-
PROJ.
|
8
|
+
PROJ.svn.root = (m.nil? ? '' : m[1])
|
10
9
|
end
|
11
|
-
PROJ.
|
10
|
+
PROJ.svn.root = File.join(PROJ.svn.root, PROJ.svn.path) unless PROJ.svn.path.empty?
|
12
11
|
|
13
12
|
namespace :svn do
|
14
13
|
|
15
14
|
desc 'Show tags from the SVN repository'
|
16
15
|
task :show_tags do |t|
|
17
|
-
tags = %x/svn list #{File.join(PROJ.
|
16
|
+
tags = %x/svn list #{File.join(PROJ.svn.root, PROJ.svn.tags)}/
|
18
17
|
tags.gsub!(%r/\/$/, '')
|
18
|
+
tags = tags.split("\n").sort {|a,b| b <=> a}
|
19
19
|
puts tags
|
20
20
|
end
|
21
21
|
|
@@ -24,9 +24,10 @@ namespace :svn do
|
|
24
24
|
v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
|
25
25
|
abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
|
26
26
|
|
27
|
-
|
27
|
+
svn = PROJ.svn
|
28
|
+
trunk = File.join(svn.root, svn.trunk)
|
28
29
|
tag = "%s-%s" % [PROJ.name, PROJ.version]
|
29
|
-
tag = File.join(
|
30
|
+
tag = File.join(svn.root, svn.tags, tag)
|
30
31
|
msg = "Creating tag for #{PROJ.name} version #{PROJ.version}"
|
31
32
|
|
32
33
|
puts "Creating SVN tag '#{tag}'"
|
@@ -39,6 +40,6 @@ end # namespace :svn
|
|
39
40
|
|
40
41
|
task 'gem:release' => 'svn:create_tag'
|
41
42
|
|
42
|
-
end # if PROJ.svn
|
43
|
+
end # if PROJ.svn.path
|
43
44
|
|
44
45
|
# EOF
|
data/tasks/website.rake
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: website.rake
|
1
|
+
# $Id: website.rake 201 2008-03-12 16:16:09Z tim_pease $
|
2
2
|
|
3
3
|
namespace :website do
|
4
4
|
|
@@ -26,7 +26,7 @@ namespace :website do
|
|
26
26
|
)
|
27
27
|
|
28
28
|
host = "#{config['username']}@rubyforge.org"
|
29
|
-
remote_dir = "/var/www/gforge-projects/#{PROJ.
|
29
|
+
remote_dir = "/var/www/gforge-projects/#{PROJ.rubyforge.name}/"
|
30
30
|
|
31
31
|
sh "rsync --delete -rulptzCF doc/ #{host}:#{remote_dir}"
|
32
32
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Pease
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-03-
|
12
|
+
date: 2008-03-12 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -179,12 +179,12 @@ files:
|
|
179
179
|
- spec/spec_helper.rb
|
180
180
|
- spec/webby/resources/file_spec.rb
|
181
181
|
- tasks/ann.rake
|
182
|
-
- tasks/annotations.rake
|
183
182
|
- tasks/bones.rake
|
184
|
-
- tasks/doc.rake
|
185
183
|
- tasks/gem.rake
|
186
184
|
- tasks/manifest.rake
|
185
|
+
- tasks/notes.rake
|
187
186
|
- tasks/post_load.rake
|
187
|
+
- tasks/rdoc.rake
|
188
188
|
- tasks/rubyforge.rake
|
189
189
|
- tasks/setup.rb
|
190
190
|
- tasks/spec.rake
|