webby 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,10 @@
1
+ == 0.8.2 / 2008-03-12
2
+
3
+ * 2 bug fixes
4
+ - Fixed an error when paginating on an index page
5
+ - Fixed an error where leading and trailing whitespace was being
6
+ stripped from syntax highlighted code blocks
7
+
1
8
  == 0.8.1 / 2008-03-09
2
9
 
3
10
  * 2 major enhancement
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 196 2008-03-09 23:03:30Z tim_pease $
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.rubyforge_name = 'webby'
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 = 'Wandering Wookie'
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.svn = true
26
- PROJ.spec_opts << '--color'
22
+ PROJ.rdoc.dir = 'doc/rdoc'
23
+ PROJ.rdoc.remote_dir = 'rdoc'
24
+ PROJ.rdoc.exclude << %w(^data ^examples)
27
25
 
28
- PROJ.ann_email[:to] << 'webby-forum@googlegroups.com'
29
- PROJ.ann_email[:server] = 'smtp.gmail.com'
30
- PROJ.ann_email[:port] = 587
26
+ PROJ.svn.path = ''
27
+ PROJ.spec.opts << '--color'
31
28
 
32
- PROJ.ann_text = <<-ANN
33
- == FUN FACT
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
- A Boeing 747's wingspan is longer than the Wright brothers first flight.
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
@@ -21,7 +21,9 @@ Let's assume that your website has a collection of articles in a folder called "
21
21
  <pre>
22
22
  ---
23
23
  title: Articles
24
- filter: erb
24
+ filter:
25
+ - erb
26
+ - textile
25
27
  ---
26
28
  h2. <%= h(@page.title) %>
27
29
 
@@ -1,4 +1,4 @@
1
- # $Id: coderay_helper.rb 193 2008-03-09 02:32:37Z tim_pease $
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].strip
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 190 2008-03-05 05:35:00Z tim_pease $
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].strip
44
+ text = buffer[pos..-1]
45
45
  if text.empty?
46
46
  buffer[pos..-1] = ''
47
47
  return
@@ -1,4 +1,4 @@
1
- # $Id: page.rb 191 2008-03-05 19:07:50Z tim_pease $
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 167 2008-02-24 00:59:54Z tim_pease $
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 195 2008-03-09 05:33:35Z tim_pease $
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.1' # :nodoc:
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.ann_file do
13
- puts "Generating #{PROJ.ann_file}"
14
- File.open(PROJ.ann_file,'w') do |fd|
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
- PROJ.ann_paragraphs.each do |p|
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 PROJ.ann_text if PROJ.ann_text
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.ann_file
38
+ task :announcement => PROJ.ann.file
38
39
 
39
40
  desc "Send an email announcement"
40
- task :email => PROJ.ann_file do
41
- from = PROJ.ann_email[:from] || PROJ.email
42
- to = Array(PROJ.ann_email[:to])
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}@#{PROJ.ann_email[:domain]}>\n\n"
53
- rfc822msg << File.read(PROJ.ann_file)
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
- PROJ.ann_email[key]
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.ann_file
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
- require 'pp'
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
- PP.pp(PROJ.send(atr.to_sym), sio, 49)
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.rubyforge_name
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.rdoc_include.join('|'))
32
- excl = PROJ.rdoc_exclude.dup.concat %w[\.rb$ ^(\.\/|\/)?ext]
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.rdoc_opts + ['--main', PROJ.rdoc_main]
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.test_file
45
- s.test_file = PROJ.test_file
44
+ if test ?f, PROJ.test.file
45
+ s.test_file = PROJ.test.file
46
46
  else
47
- s.test_files = PROJ.tests.to_a
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.annotation_tags.join('|'), :tag => true)
8
+ PROJ, PROJ.notes.tags.join('|'), :tag => true)
9
9
  end
10
10
 
11
11
  namespace :notes do
12
- PROJ.annotation_tags.each do |tag|
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.rdoc_exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
7
- PROJ.exclude << "^#{Regexp.escape(PROJ.ann_file)}$"
6
+ PROJ.rdoc.exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
7
+ PROJ.exclude << "^#{Regexp.escape(PROJ.ann.file)}$"
8
8
 
9
- PROJ.instance_variable_get(:@table).each do |key,val|
10
- next unless val.instance_of? Array
11
- next if key == :dependencies
12
- val.flatten!
13
- end
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.rdoc_main ||= PROJ.readme_file
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
- rd.main = PROJ.rdoc_main
10
- rd.rdoc_dir = PROJ.rdoc_dir
9
+ rdoc = PROJ.rdoc
10
+ rd.main = rdoc.main
11
+ rd.rdoc_dir = rdoc.dir
11
12
 
12
- incl = Regexp.new(PROJ.rdoc_include.join('|'))
13
- excl = Regexp.new(PROJ.rdoc_exclude.join('|'))
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.rubyforge_name}'s " + title if PROJ.rubyforge_name != title
24
+ title = "#{PROJ.rubyforge.name}'s " + title if PROJ.rubyforge.name != title
24
25
 
25
26
  rd.options << "-t #{title}"
26
- rd.options.concat(PROJ.rdoc_opts)
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.rubyforge_name && HAVE_RUBYFORGE
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.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\""
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.rubyforge_name, PROJ.name, PROJ.version, *files
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.rubyforge_name}/"
48
- remote_dir << PROJ.rdoc_remote_dir if PROJ.rdoc_remote_dir
49
- local_dir = PROJ.rdoc_dir
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
- PROJ = OpenStruct.new
10
-
11
- PROJ.name = nil
12
- PROJ.summary = nil
13
- PROJ.description = nil
14
- PROJ.changes = nil
15
- PROJ.authors = nil
16
- PROJ.email = nil
17
- PROJ.url = nil
18
- PROJ.version = ENV['VERSION'] || '0.0.0'
19
- PROJ.rubyforge_name = nil
20
- PROJ.exclude = %w(tmp$ bak$ ~$ CVS .svn/ ^pkg/ ^doc/)
21
- PROJ.release_name = ENV['RELEASE']
22
- PROJ.history_file = 'History.txt'
23
- PROJ.manifest_file = 'Manifest.txt'
24
- PROJ.readme_file = 'README.txt'
25
-
26
- # Rspec
27
- PROJ.specs = FileList['spec/**/*_spec.rb']
28
- PROJ.spec_opts = []
29
-
30
- # Test::Unit
31
- PROJ.tests = FileList['test/**/test_*.rb']
32
- PROJ.test_file = 'test/all.rb'
33
- PROJ.test_opts = []
34
-
35
- # Rcov
36
- PROJ.rcov_dir = 'coverage'
37
- PROJ.rcov_opts = %w[--sort coverage -T]
38
- PROJ.rcov_threshold = 90.0
39
- PROJ.rcov_threshold_exact = false
40
-
41
- # Rdoc
42
- PROJ.rdoc_opts = []
43
- PROJ.rdoc_include = %w(^lib/ ^bin/ ^ext/ .txt$)
44
- PROJ.rdoc_exclude = %w(extconf.rb$)
45
- PROJ.rdoc_main = nil
46
- PROJ.rdoc_dir = 'doc'
47
- PROJ.rdoc_remote_dir = nil
48
-
49
- # Extensions
50
- PROJ.extensions = FileList['ext/**/extconf.rb']
51
- PROJ.ruby_opts = %w(-w)
52
- PROJ.libs = []
53
- %w(lib ext).each {|dir| PROJ.libs << dir if test ?d, dir}
54
-
55
- # Gem Packaging
56
- PROJ.files = nil
57
- PROJ.executables = nil
58
- PROJ.dependencies = []
59
- PROJ.need_tar = true
60
- PROJ.need_zip = false
61
- PROJ.post_install_message = nil
62
-
63
- # File Annotations
64
- PROJ.annotation_exclude = %w(^tasks/setup.rb$)
65
- PROJ.annotation_extensions = %w(.txt .rb .erb) << ''
66
- PROJ.annotation_tags = %w(FIXME OPTIMIZE TODO)
67
-
68
- # Subversion Repository
69
- PROJ.svn = false
70
- PROJ.svn_root = nil
71
- PROJ.svn_trunk = 'trunk'
72
- PROJ.svn_tags = 'tags'
73
- PROJ.svn_branches = 'branches'
74
-
75
- # Announce
76
- PROJ.ann_file = 'announcement.txt'
77
- PROJ.ann_text = nil
78
- PROJ.ann_paragraphs = []
79
- PROJ.ann_email = {
80
- :from => nil,
81
- :to => %w(ruby-talk@ruby-lang.org),
82
- :server => 'localhost',
83
- :port => 25,
84
- :domain => ENV['HOSTNAME'],
85
- :acct => nil,
86
- :passwd => nil,
87
- :authtype => :plain
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.spec_opts
12
- t.spec_files = PROJ.specs
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.spec_opts + ['--format', 'specdoc']
20
- t.spec_files = PROJ.specs
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.spec_opts
29
- t.spec_files = PROJ.specs
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.rcov_dir
33
- t.rcov_opts = PROJ.rcov_opts + ['--exclude', 'spec']
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.rcov_threshold
38
- t.index_html = File.join(PROJ.rcov_dir, 'index.html')
39
- t.require_exact_threshold = PROJ.rcov_threshold_exact
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
- if PROJ.svn and system("svn --version 2>&1 > #{DEV_NULL}")
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.svn_root = (m.nil? ? '' : m[1])
8
+ PROJ.svn.root = (m.nil? ? '' : m[1])
10
9
  end
11
- PROJ.svn_root = File.join(PROJ.svn_root, PROJ.svn) if String === PROJ.svn
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.svn_root, PROJ.svn_tags)}/
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
- trunk = File.join(PROJ.svn_root, PROJ.svn_trunk)
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(PROJ.svn_root, PROJ.svn_tags, tag)
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 115 2008-01-27 03:36:45Z tim_pease $
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.rubyforge_name}/"
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.1
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-08 23:00:00 -07:00
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