webby 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +15 -0
- data/Manifest.txt +21 -15
- data/Rakefile +4 -2
- data/data/content/css/blueprint/compressed/print.css +76 -0
- data/data/content/css/blueprint/compressed/screen.css +696 -0
- data/data/content/css/blueprint/lib/forms.css +45 -0
- data/data/content/css/blueprint/lib/grid.css +95 -51
- data/data/content/css/blueprint/lib/grid.png +0 -0
- data/data/content/css/blueprint/lib/ie.css +30 -0
- data/data/content/css/blueprint/lib/reset.css +11 -12
- data/data/content/css/blueprint/lib/typography.css +69 -114
- data/data/content/css/blueprint/plugins/buttons/Readme +31 -0
- data/data/content/css/blueprint/{lib → plugins/buttons}/buttons.css +17 -32
- data/data/content/css/blueprint/{lib/img → plugins/buttons}/icons/cross.png +0 -0
- data/data/content/css/blueprint/{lib/img/icons/textfield_key.png → plugins/buttons/icons/key.png} +0 -0
- data/data/content/css/blueprint/{lib/img → plugins/buttons}/icons/tick.png +0 -0
- data/data/content/css/blueprint/plugins/css-classes/Readme +14 -0
- data/data/content/css/blueprint/plugins/css-classes/css-classes.css +24 -0
- data/data/content/css/blueprint/plugins/fancy-type/Readme +22 -0
- data/data/content/css/blueprint/plugins/fancy-type/fancy-type-compressed.css +5 -0
- data/data/content/css/blueprint/plugins/fancy-type/fancy-type.css +74 -0
- data/data/content/css/blueprint/print.css +35 -46
- data/data/content/css/blueprint/screen.css +10 -18
- data/data/content/css/site.css +8 -0
- data/data/content/index.txt +2 -2
- data/data/layouts/default.rhtml +4 -4
- data/data/templates/page.erb +3 -3
- data/examples/webby/content/css/blueprint/print.css +58 -61
- data/examples/webby/content/css/blueprint/screen.css +696 -30
- data/examples/webby/content/css/site.css +63 -45
- data/examples/webby/content/index.txt +2 -2
- data/examples/webby/content/manual.txt +366 -15
- data/examples/webby/content/script/jquery.corner.js +152 -0
- data/examples/webby/content/script/jquery.js +31 -0
- data/examples/webby/content/tips_and_tricks.txt +2 -2
- data/examples/webby/content/tutorial.txt +5 -5
- data/examples/webby/layouts/default.rhtml +19 -10
- data/examples/webby/templates/page.erb +5 -3
- data/lib/webby.rb +25 -3
- data/lib/webby/filters/basepath.rb +97 -0
- data/lib/webby/filters/coderay.rb +2 -2
- data/lib/webby/filters/graphviz.rb +10 -10
- data/lib/webby/filters/haml.rb +3 -7
- data/lib/webby/filters/outline.rb +194 -0
- data/lib/webby/helpers/tag_helper.rb +14 -13
- data/lib/webby/helpers/url_helper.rb +84 -13
- data/lib/webby/pages_db.rb +15 -8
- data/lib/webby/renderer.rb +2 -2
- data/lib/webby/resource.rb +6 -6
- data/lib/webby/utils.rb +17 -1
- data/lib/webby/webby_task.rb +20 -7
- data/tasks/annotations.rake +1 -1
- data/tasks/doc.rake +2 -2
- data/tasks/gem.rake +3 -3
- data/tasks/manifest.rake +5 -2
- data/tasks/post_load.rake +18 -0
- data/tasks/rubyforge.rake +1 -1
- data/tasks/setup.rb +56 -11
- data/tasks/spec.rake +4 -1
- data/tasks/svn.rake +44 -0
- data/tasks/website.rake +2 -2
- metadata +33 -18
- data/data/content/css/blueprint/lib/compressed.css +0 -137
- data/data/content/css/blueprint/lib/img/grid.png +0 -0
- data/examples/webby/content/css/blueprint/lib/buttons.css +0 -112
- data/examples/webby/content/css/blueprint/lib/compressed.css +0 -137
- data/examples/webby/content/css/blueprint/lib/grid.css +0 -149
- data/examples/webby/content/css/blueprint/lib/img/grid.png +0 -0
- data/examples/webby/content/css/blueprint/lib/img/icons/cross.png +0 -0
- data/examples/webby/content/css/blueprint/lib/img/icons/textfield_key.png +0 -0
- data/examples/webby/content/css/blueprint/lib/img/icons/tick.png +0 -0
- data/examples/webby/content/css/blueprint/lib/reset.css +0 -40
- data/examples/webby/content/css/blueprint/lib/typography.css +0 -161
data/lib/webby/pages_db.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: pages_db.rb
|
1
|
+
# $Id: pages_db.rb 119 2008-01-29 04:26:27Z wbruce $
|
2
2
|
|
3
3
|
module Webby
|
4
4
|
|
@@ -98,9 +98,17 @@ class PagesDB
|
|
98
98
|
opts = Hash === args.last ? args.pop : {}
|
99
99
|
find_all = args.include? :all
|
100
100
|
|
101
|
-
|
102
|
-
|
103
|
-
|
101
|
+
search = if (dir = opts.delete(:in_directory))
|
102
|
+
strategy = if opts.delete(:recursive)
|
103
|
+
lambda { |key| key =~ /^#{Regexp.escape(dir)}(?:\/|$)/ }
|
104
|
+
else
|
105
|
+
lambda { |key| key == dir }
|
106
|
+
end
|
107
|
+
matching_keys = @db.keys.select(&strategy)
|
108
|
+
raise RuntimeError, "unknown directory '#{dir}'" if matching_keys.empty?
|
109
|
+
matching_keys.map { |key| @db[key] }.flatten
|
110
|
+
else
|
111
|
+
self
|
104
112
|
end
|
105
113
|
|
106
114
|
block ||= lambda do |page|
|
@@ -111,18 +119,17 @@ class PagesDB
|
|
111
119
|
end
|
112
120
|
found
|
113
121
|
end
|
114
|
-
|
122
|
+
|
115
123
|
ary = []
|
116
|
-
search = dir ? @db[dir] : self
|
117
124
|
search.each do |page|
|
118
125
|
if block.call(page)
|
119
126
|
ary << page
|
120
127
|
break unless find_all
|
121
128
|
end
|
122
129
|
end
|
123
|
-
|
130
|
+
|
124
131
|
return ary if find_all
|
125
|
-
return ary.first
|
132
|
+
return ary.first
|
126
133
|
end
|
127
134
|
|
128
135
|
# call-seq:
|
data/lib/webby/renderer.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: renderer.rb
|
1
|
+
# $Id: renderer.rb 112 2008-01-26 05:31:48Z tim_pease $
|
2
2
|
|
3
3
|
require 'erb'
|
4
4
|
try_require 'bluecloth'
|
@@ -110,7 +110,7 @@ class Renderer
|
|
110
110
|
# continues until all _items_ have been paginated.
|
111
111
|
#
|
112
112
|
# Calling this method creates a <code>@pager</code> object that can be
|
113
|
-
# accessed from the
|
113
|
+
# accessed from the page. The <code>@pager</code> contains information
|
114
114
|
# about the next page, the current page number, the previous page, and the
|
115
115
|
# number of items in the current page.
|
116
116
|
#
|
data/lib/webby/resource.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: resource.rb
|
1
|
+
# $Id: resource.rb 102 2008-01-19 23:13:55Z tim_pease $
|
2
2
|
|
3
3
|
module Webby
|
4
4
|
|
@@ -121,7 +121,7 @@ class Resource
|
|
121
121
|
# filename. The extension is determined by looking at the following:
|
122
122
|
#
|
123
123
|
# * this resource's meta-data for an 'extension' property
|
124
|
-
# * the meta-data of this resource's layout for an 'extension'
|
124
|
+
# * the meta-data of this resource's layout for an 'extension' property
|
125
125
|
# * the extension of this resource file
|
126
126
|
#
|
127
127
|
def extension
|
@@ -144,16 +144,16 @@ class Resource
|
|
144
144
|
# resource is dirty and in need of rendering.
|
145
145
|
#
|
146
146
|
# The destination for any resource can be overridden by explicitly setting
|
147
|
-
# the 'destination'
|
147
|
+
# the 'destination' property in the resource's meta-data.
|
148
148
|
#
|
149
149
|
def destination
|
150
150
|
return @dest if defined? @dest and @dest
|
151
151
|
return @dest = ::Webby.cairn if is_layout?
|
152
152
|
|
153
153
|
@dest = if @mdata.has_key? 'destination' then @mdata['destination']
|
154
|
-
else File.join(dir, filename) end
|
154
|
+
else ::File.join(dir, filename) end
|
155
155
|
|
156
|
-
@dest = File.join(::Webby.site.output_dir, @dest)
|
156
|
+
@dest = ::File.join(::Webby.site.output_dir, @dest)
|
157
157
|
@dest << @number.to_s if @number
|
158
158
|
|
159
159
|
ext = extension
|
@@ -259,7 +259,7 @@ class Resource
|
|
259
259
|
|
260
260
|
# if this file's mtime is larger than the destination file's
|
261
261
|
# mtime, then we are dirty
|
262
|
-
dirty = @mtime > File.mtime(destination)
|
262
|
+
dirty = @mtime > ::File.mtime(destination)
|
263
263
|
return dirty if is_static? or dirty
|
264
264
|
|
265
265
|
# check to see if the layout is dirty, and it it is then we
|
data/lib/webby/utils.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: utils.rb
|
1
|
+
# $Id: utils.rb 121 2008-01-29 04:55:28Z tim_pease $
|
2
2
|
|
3
3
|
module Enumerable
|
4
4
|
def injecting( initial )
|
@@ -33,4 +33,20 @@ class Hash
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
class String
|
37
|
+
def underscore
|
38
|
+
self.
|
39
|
+
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
|
40
|
+
gsub(/([a-z\d])([A-Z])/,'\1_\2').
|
41
|
+
tr(" -", "__").
|
42
|
+
downcase
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
class Time
|
47
|
+
def to_y
|
48
|
+
self.to_yaml.slice(4..-1).strip
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
36
52
|
# EOF
|
data/lib/webby/webby_task.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id: webby_task.rb
|
1
|
+
# $Id: webby_task.rb 106 2008-01-25 04:58:49Z tim_pease $
|
2
2
|
|
3
3
|
begin
|
4
4
|
require 'rake'
|
@@ -43,7 +43,7 @@ class WebbyTask < TaskLib
|
|
43
43
|
yield self if block_given?
|
44
44
|
|
45
45
|
# load any user defined libraries
|
46
|
-
glob = File.join(FileUtils.pwd, 'lib', '**', '*.rb')
|
46
|
+
glob = ::File.join(FileUtils.pwd, 'lib', '**', '*.rb')
|
47
47
|
Dir.glob(glob).sort.each {|fn| require fn}
|
48
48
|
|
49
49
|
# create the Webby rake tasks
|
@@ -54,18 +54,22 @@ class WebbyTask < TaskLib
|
|
54
54
|
# Defines the :build and :rebuild tasks
|
55
55
|
#
|
56
56
|
def define_build_tasks
|
57
|
+
task :configure_basepath do
|
58
|
+
::Webby.site.base = ENV['BASE'] if ENV.has_key?('BASE')
|
59
|
+
end
|
60
|
+
|
57
61
|
desc "build the website"
|
58
|
-
task :build do |t|
|
62
|
+
task :build => :configure_basepath do |t|
|
59
63
|
::Webby::Builder.run
|
60
64
|
end
|
61
65
|
|
62
66
|
desc "rebuild the website"
|
63
|
-
task :rebuild do |t|
|
67
|
+
task :rebuild => :configure_basepath do |t|
|
64
68
|
::Webby::Builder.run :rebuild => true
|
65
69
|
end
|
66
70
|
|
67
71
|
desc "continuously build the website"
|
68
|
-
task :autobuild do |t|
|
72
|
+
task :autobuild => :configure_basepath do |t|
|
69
73
|
::Webby::AutoBuilder.run
|
70
74
|
end
|
71
75
|
|
@@ -88,8 +92,17 @@ class WebbyTask < TaskLib
|
|
88
92
|
raise "Usage: rake #{t.name} path" unless ARGV.length == 2
|
89
93
|
|
90
94
|
page = t.application.top_level_tasks.pop
|
91
|
-
|
92
|
-
|
95
|
+
name = ::Webby::File.basename(page)
|
96
|
+
ext = ::Webby::File.extname(page)
|
97
|
+
dir = ::Webby::File.dirname(page)
|
98
|
+
|
99
|
+
if ::Webby.site.create_mode == 'directory'
|
100
|
+
page = ::File.join(::Webby.site.content_dir, name, 'index')
|
101
|
+
page << '.' << (ext.empty? ? 'txt' : ext)
|
102
|
+
else
|
103
|
+
page = ::File.join(::Webby.site.content_dir, page)
|
104
|
+
page << '.txt' if ext.empty?
|
105
|
+
end
|
93
106
|
|
94
107
|
::Webby::Builder.create page, :from => template
|
95
108
|
end # task
|
data/tasks/annotations.rake
CHANGED
data/tasks/doc.rake
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id
|
1
|
+
# $Id$
|
2
2
|
|
3
3
|
require 'rake/rdoctask'
|
4
4
|
|
@@ -7,7 +7,6 @@ namespace :doc do
|
|
7
7
|
desc 'Generate RDoc documentation'
|
8
8
|
Rake::RDocTask.new do |rd|
|
9
9
|
rd.main = PROJ.rdoc_main
|
10
|
-
rd.options << '-d' if !WIN32 and `which dot` =~ %r/\/dot/
|
11
10
|
rd.rdoc_dir = PROJ.rdoc_dir
|
12
11
|
|
13
12
|
incl = Regexp.new(PROJ.rdoc_include.join('|'))
|
@@ -24,6 +23,7 @@ namespace :doc do
|
|
24
23
|
title = "#{PROJ.rubyforge_name}'s " + title if PROJ.rubyforge_name != title
|
25
24
|
|
26
25
|
rd.options << "-t #{title}"
|
26
|
+
rd.options.concat(PROJ.rdoc_opts)
|
27
27
|
end
|
28
28
|
|
29
29
|
desc 'Generate ri locally for testing'
|
data/tasks/gem.rake
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id
|
1
|
+
# $Id$
|
2
2
|
|
3
3
|
require 'rake/gempackagetask'
|
4
4
|
|
@@ -69,12 +69,12 @@ namespace :gem do
|
|
69
69
|
|
70
70
|
desc 'Install the gem'
|
71
71
|
task :install => [:clobber, :package] do
|
72
|
-
sh "#{SUDO} #{GEM} install pkg/#{PROJ.spec.
|
72
|
+
sh "#{SUDO} #{GEM} install pkg/#{PROJ.spec.full_name}"
|
73
73
|
end
|
74
74
|
|
75
75
|
desc 'Uninstall the gem'
|
76
76
|
task :uninstall do
|
77
|
-
sh "#{SUDO} #{GEM} uninstall -v '#{PROJ.version}' #{PROJ.name}"
|
77
|
+
sh "#{SUDO} #{GEM} uninstall -v '#{PROJ.version}' -x #{PROJ.name}"
|
78
78
|
end
|
79
79
|
|
80
80
|
end # namespace :gem
|
data/tasks/manifest.rake
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id
|
1
|
+
# $Id$
|
2
2
|
|
3
3
|
require 'find'
|
4
4
|
|
@@ -36,6 +36,9 @@ namespace :manifest do
|
|
36
36
|
files << fn unless test ?f, fn
|
37
37
|
File.open(fn, 'w') {|fp| fp.puts files.sort}
|
38
38
|
end
|
39
|
-
end
|
39
|
+
end # namespace :manifest
|
40
|
+
|
41
|
+
desc 'Alias to manifest:check'
|
42
|
+
task :manifest => 'manifest:check'
|
40
43
|
|
41
44
|
# EOF
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# $Id$
|
2
|
+
|
3
|
+
# This file does not define any rake tasks. It is used to load some project
|
4
|
+
# settings if they are not defined by the user.
|
5
|
+
|
6
|
+
unless PROJ.changes
|
7
|
+
PROJ.changes = paragraphs_of('History.txt', 0..1).join("\n\n")
|
8
|
+
end
|
9
|
+
|
10
|
+
unless PROJ.description
|
11
|
+
PROJ.description = paragraphs_of('README.txt', 'description').join("\n\n")
|
12
|
+
end
|
13
|
+
|
14
|
+
unless PROJ.summary
|
15
|
+
PROJ.summary = PROJ.description.split('.').first
|
16
|
+
end
|
17
|
+
|
18
|
+
# EOF
|
data/tasks/rubyforge.rake
CHANGED
@@ -45,7 +45,7 @@ namespace :doc do
|
|
45
45
|
|
46
46
|
host = "#{config['username']}@rubyforge.org"
|
47
47
|
remote_dir = "/var/www/gforge-projects/#{PROJ.rubyforge_name}/"
|
48
|
-
remote_dir << PROJ.rdoc_remote_dir
|
48
|
+
remote_dir << PROJ.rdoc_remote_dir if PROJ.rdoc_remote_dir
|
49
49
|
local_dir = PROJ.rdoc_dir
|
50
50
|
|
51
51
|
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
data/tasks/setup.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id
|
1
|
+
# $Id$
|
2
2
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'rake'
|
@@ -16,7 +16,7 @@ PROJ.email = nil
|
|
16
16
|
PROJ.url = nil
|
17
17
|
PROJ.version = ENV['VERSION'] || '0.0.0'
|
18
18
|
PROJ.rubyforge_name = nil
|
19
|
-
PROJ.exclude = %w(tmp$ bak$ ~$ CVS
|
19
|
+
PROJ.exclude = %w(tmp$ bak$ ~$ CVS .svn/ ^pkg/ ^doc/)
|
20
20
|
|
21
21
|
# Rspec
|
22
22
|
PROJ.specs = FileList['spec/**/*_spec.rb']
|
@@ -32,8 +32,8 @@ PROJ.rcov_opts = ['--sort', 'coverage', '-T']
|
|
32
32
|
|
33
33
|
# Rdoc
|
34
34
|
PROJ.rdoc_opts = []
|
35
|
-
PROJ.rdoc_include = %w(^lib ^bin ^ext txt$)
|
36
|
-
PROJ.rdoc_exclude = %w(extconf
|
35
|
+
PROJ.rdoc_include = %w(^lib/ ^bin/ ^ext/ .txt$)
|
36
|
+
PROJ.rdoc_exclude = %w(extconf.rb$ ^Manifest.txt$)
|
37
37
|
PROJ.rdoc_main = 'README.txt'
|
38
38
|
PROJ.rdoc_dir = 'doc'
|
39
39
|
PROJ.rdoc_remote_dir = nil
|
@@ -60,8 +60,17 @@ PROJ.need_zip = false
|
|
60
60
|
PROJ.annotation_exclude = []
|
61
61
|
PROJ.annotation_extensions = %w(.txt .rb .erb) << ''
|
62
62
|
|
63
|
+
# Subversion Repository
|
64
|
+
PROJ.svn = false
|
65
|
+
PROJ.svn_root = nil
|
66
|
+
PROJ.svn_trunk = 'trunk'
|
67
|
+
PROJ.svn_tags = 'tags'
|
68
|
+
PROJ.svn_branches = 'branches'
|
69
|
+
|
63
70
|
# Load the other rake files in the tasks folder
|
64
|
-
Dir.glob('tasks/*.rake').sort
|
71
|
+
rakefiles = Dir.glob('tasks/*.rake').sort
|
72
|
+
rakefiles.unshift(rakefiles.delete('tasks/post_load.rake')).compact!
|
73
|
+
import(*rakefiles)
|
65
74
|
|
66
75
|
# Setup some constants
|
67
76
|
WIN32 = %r/win32/ =~ RUBY_PLATFORM unless defined? WIN32
|
@@ -108,8 +117,28 @@ end
|
|
108
117
|
# changes = paragraphs_of('History.txt', 0..1).join("\n\n")
|
109
118
|
# summary, *description = paragraphs_of('README.txt', 3, 3..8)
|
110
119
|
#
|
111
|
-
def paragraphs_of(path, *paragraphs)
|
112
|
-
|
120
|
+
def paragraphs_of( path, *paragraphs )
|
121
|
+
title = String === paragraphs.first ? paragraphs.shift : nil
|
122
|
+
ary = File.read(path).delete("\r").split(/\n\n+/)
|
123
|
+
|
124
|
+
result = if title
|
125
|
+
tmp, matching = [], false
|
126
|
+
rgxp = %r/^=+\s*#{Regexp.escape(title)}/i
|
127
|
+
paragraphs << (0..-1) if paragraphs.empty?
|
128
|
+
|
129
|
+
ary.each do |val|
|
130
|
+
if val =~ rgxp
|
131
|
+
break if matching
|
132
|
+
matching = true
|
133
|
+
rgxp = %r/^=+/i
|
134
|
+
elsif matching
|
135
|
+
tmp << val
|
136
|
+
end
|
137
|
+
end
|
138
|
+
tmp
|
139
|
+
else ary end
|
140
|
+
|
141
|
+
result.values_at(*paragraphs)
|
113
142
|
end
|
114
143
|
|
115
144
|
# Adds the given gem _name_ to the current project's dependency list. An
|
@@ -123,11 +152,13 @@ def depend_on( name, version = nil )
|
|
123
152
|
PROJ.dependencies << (version.nil? ? [name] : [name, ">= #{version}"])
|
124
153
|
end
|
125
154
|
|
126
|
-
# Adds the given
|
155
|
+
# Adds the given arguments to the include path if they are not already there
|
127
156
|
#
|
128
|
-
def ensure_in_path(
|
129
|
-
|
130
|
-
|
157
|
+
def ensure_in_path( *args )
|
158
|
+
args.each do |path|
|
159
|
+
path = File.expand_path(path)
|
160
|
+
$:.unshift(path) if test(?d, path) and not $:.include?(path)
|
161
|
+
end
|
131
162
|
end
|
132
163
|
|
133
164
|
# Find a rake task using the task name and remove any description text. This
|
@@ -141,4 +172,18 @@ def remove_desc_for_task( names )
|
|
141
172
|
end
|
142
173
|
end
|
143
174
|
|
175
|
+
# Change working directories to _dir_, call the _block_ of code, and then
|
176
|
+
# change back to the original working directory (the current directory when
|
177
|
+
# this method was called).
|
178
|
+
#
|
179
|
+
def in_directory( dir, &block )
|
180
|
+
curdir = pwd
|
181
|
+
begin
|
182
|
+
cd dir
|
183
|
+
return block.call
|
184
|
+
ensure
|
185
|
+
cd curdir
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
144
189
|
# EOF
|
data/tasks/spec.rake
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# $Id
|
1
|
+
# $Id$
|
2
2
|
|
3
3
|
if HAVE_SPEC_RAKE_SPECTASK
|
4
4
|
|
@@ -8,12 +8,14 @@ namespace :spec do
|
|
8
8
|
Spec::Rake::SpecTask.new(:run) do |t|
|
9
9
|
t.spec_opts = PROJ.spec_opts
|
10
10
|
t.spec_files = PROJ.specs
|
11
|
+
t.libs += PROJ.libs
|
11
12
|
end
|
12
13
|
|
13
14
|
desc 'Run all specs with text output'
|
14
15
|
Spec::Rake::SpecTask.new(:specdoc) do |t|
|
15
16
|
t.spec_opts = PROJ.spec_opts + ['--format', 'specdoc']
|
16
17
|
t.spec_files = PROJ.specs
|
18
|
+
t.libs += PROJ.libs
|
17
19
|
end
|
18
20
|
|
19
21
|
if HAVE_RCOV
|
@@ -21,6 +23,7 @@ namespace :spec do
|
|
21
23
|
Spec::Rake::SpecTask.new(:rcov) do |t|
|
22
24
|
t.spec_opts = PROJ.spec_opts
|
23
25
|
t.spec_files = PROJ.specs
|
26
|
+
t.libs += PROJ.libs
|
24
27
|
t.rcov = true
|
25
28
|
t.rcov_opts = PROJ.rcov_opts + ['--exclude', 'spec']
|
26
29
|
end
|
data/tasks/svn.rake
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# $Id$
|
2
|
+
|
3
|
+
|
4
|
+
if PROJ.svn and system("svn --version 2>&1 > #{DEV_NULL}")
|
5
|
+
|
6
|
+
unless PROJ.svn_root
|
7
|
+
info = %x/svn info ./
|
8
|
+
m = %r/^Repository Root:\s+(.*)$/.match(info)
|
9
|
+
PROJ.svn_root = (m.nil? ? '' : m[1])
|
10
|
+
end
|
11
|
+
PROJ.svn_root = File.join(PROJ.svn_root, PROJ.svn) if String === PROJ.svn
|
12
|
+
|
13
|
+
namespace :svn do
|
14
|
+
|
15
|
+
desc 'Show tags from the SVN repository'
|
16
|
+
task :show_tags do |t|
|
17
|
+
tags = %x/svn list #{File.join(PROJ.svn_root, PROJ.svn_tags)}/
|
18
|
+
tags.gsub!(%r/\/$/, '')
|
19
|
+
puts tags
|
20
|
+
end
|
21
|
+
|
22
|
+
desc 'Create a new tag in the SVN repository'
|
23
|
+
task :create_tag do |t|
|
24
|
+
v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
|
25
|
+
abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
|
26
|
+
|
27
|
+
trunk = File.join(PROJ.svn_root, PROJ.svn_trunk)
|
28
|
+
tag = "%s-%s" % [PROJ.name, PROJ.version]
|
29
|
+
tag = File.join(PROJ.svn_root, PROJ.svn_tags, tag)
|
30
|
+
msg = "Creating tag for #{PROJ.name} version #{PROJ.version}"
|
31
|
+
|
32
|
+
puts "Creating SVN tag '#{tag}'"
|
33
|
+
unless system "svn cp -m '#{msg}' #{trunk} #{tag}"
|
34
|
+
abort "Tag creation failed"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
end # namespace :svn
|
39
|
+
|
40
|
+
task 'gem:release' => 'svn:create_tag'
|
41
|
+
|
42
|
+
end # if PROJ.svn
|
43
|
+
|
44
|
+
# EOF
|