webby 0.8.2 → 0.8.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. data/History.txt +20 -0
  2. data/Manifest.txt +46 -2
  3. data/Rakefile +4 -3
  4. data/bin/webby +1 -1
  5. data/data/Rakefile +0 -1
  6. data/data/content/css/blueprint/plugins/buttons/icons/cross.png +0 -0
  7. data/data/content/css/blueprint/plugins/buttons/icons/key.png +0 -0
  8. data/data/content/css/blueprint/plugins/buttons/icons/tick.png +0 -0
  9. data/data/content/s5/blank.gif +0 -0
  10. data/data/content/s5/bodybg.gif +0 -0
  11. data/data/content/s5/framing.css +23 -0
  12. data/data/content/s5/iepngfix.htc +42 -0
  13. data/data/content/s5/opera.css +7 -0
  14. data/data/content/s5/outline.css +15 -0
  15. data/data/content/s5/pretty.css +86 -0
  16. data/data/content/s5/print.css +1 -0
  17. data/data/content/s5/s5-core.css +9 -0
  18. data/data/content/s5/slides.css +3 -0
  19. data/data/content/s5/slides.js +553 -0
  20. data/data/lib/breadcrumbs.rb +0 -0
  21. data/data/tasks/blog.rake +71 -0
  22. data/data/tasks/build.rake +27 -0
  23. data/data/tasks/create.rake +19 -1
  24. data/data/tasks/deploy.rake +2 -2
  25. data/data/tasks/setup.rb +4 -1
  26. data/data/templates/atom_feed.erb +20 -13
  27. data/data/templates/page.erb +1 -1
  28. data/data/templates/presentation.erb +40 -0
  29. data/examples/presentation/Rakefile +14 -0
  30. data/examples/presentation/content/_sample_code.txt +10 -0
  31. data/examples/presentation/content/css/uv/twilight.css +137 -0
  32. data/examples/presentation/content/index.txt +63 -0
  33. data/examples/presentation/content/s5/blank.gif +0 -0
  34. data/examples/presentation/content/s5/bodybg.gif +0 -0
  35. data/examples/presentation/content/s5/framing.css +23 -0
  36. data/examples/presentation/content/s5/iepngfix.htc +42 -0
  37. data/examples/presentation/content/s5/opera.css +7 -0
  38. data/examples/presentation/content/s5/outline.css +15 -0
  39. data/examples/presentation/content/s5/pretty.css +86 -0
  40. data/examples/presentation/content/s5/print.css +1 -0
  41. data/examples/presentation/content/s5/s5-core.css +9 -0
  42. data/examples/presentation/content/s5/slides.css +3 -0
  43. data/examples/presentation/content/s5/slides.js +553 -0
  44. data/examples/presentation/layouts/presentation.rhtml +43 -0
  45. data/examples/presentation/tasks/blog.rake +71 -0
  46. data/examples/presentation/tasks/build.rake +27 -0
  47. data/examples/presentation/tasks/create.rake +22 -0
  48. data/examples/presentation/tasks/deploy.rake +22 -0
  49. data/examples/presentation/tasks/growl.rake +12 -0
  50. data/examples/presentation/tasks/heel.rake +28 -0
  51. data/examples/presentation/tasks/setup.rb +17 -0
  52. data/examples/presentation/tasks/validate.rake +19 -0
  53. data/examples/presentation/templates/_partial.erb +13 -0
  54. data/examples/presentation/templates/presentation.erb +40 -0
  55. data/examples/webby/Rakefile +3 -2
  56. data/examples/webby/content/css/blueprint/screen.css +1 -1
  57. data/examples/webby/content/css/coderay.css +0 -15
  58. data/examples/webby/content/css/site.css +18 -13
  59. data/examples/webby/content/css/uv/twilight.css +137 -0
  60. data/examples/webby/content/index.txt +6 -10
  61. data/examples/webby/content/manual/index.txt +83 -122
  62. data/examples/webby/content/reference/index.txt +161 -16
  63. data/examples/webby/content/script/jquery.js +1 -1
  64. data/examples/webby/content/tips_and_tricks/index.txt +1 -1
  65. data/examples/webby/content/tutorial/index.txt +1 -1
  66. data/examples/webby/layouts/default.rhtml +2 -7
  67. data/examples/webby/tasks/blog.rake +71 -0
  68. data/examples/webby/tasks/build.rake +27 -0
  69. data/examples/webby/tasks/create.rake +19 -1
  70. data/examples/webby/tasks/deploy.rake +2 -2
  71. data/examples/webby/tasks/setup.rb +4 -20
  72. data/examples/webby/templates/page.erb +1 -1
  73. data/lib/webby.rb +30 -5
  74. data/lib/webby/auto_builder.rb +0 -2
  75. data/lib/webby/builder.rb +51 -5
  76. data/lib/webby/filters.rb +3 -3
  77. data/lib/webby/filters/basepath.rb +7 -7
  78. data/lib/webby/filters/erb.rb +0 -2
  79. data/lib/webby/filters/haml.rb +0 -2
  80. data/lib/webby/filters/markdown.rb +0 -2
  81. data/lib/webby/filters/outline.rb +43 -2
  82. data/lib/webby/filters/sass.rb +0 -2
  83. data/lib/webby/filters/slides.rb +56 -0
  84. data/lib/webby/filters/textile.rb +0 -2
  85. data/lib/webby/filters/tidy.rb +0 -2
  86. data/lib/webby/helpers.rb +0 -2
  87. data/lib/webby/helpers/capture_helper.rb +141 -0
  88. data/lib/webby/helpers/coderay_helper.rb +5 -16
  89. data/lib/webby/helpers/graphviz_helper.rb +6 -18
  90. data/lib/webby/helpers/tag_helper.rb +0 -2
  91. data/lib/webby/helpers/tex_img_helper.rb +5 -16
  92. data/lib/webby/helpers/ultraviolet_helper.rb +11 -22
  93. data/lib/webby/helpers/url_helper.rb +2 -4
  94. data/lib/webby/link_validator.rb +0 -2
  95. data/lib/webby/main.rb +0 -2
  96. data/lib/webby/renderer.rb +163 -37
  97. data/lib/webby/resources.rb +0 -2
  98. data/lib/webby/resources/db.rb +37 -27
  99. data/lib/webby/resources/file.rb +0 -2
  100. data/lib/webby/resources/layout.rb +0 -2
  101. data/lib/webby/resources/page.rb +4 -9
  102. data/lib/webby/resources/partial.rb +1 -3
  103. data/lib/webby/resources/resource.rb +10 -2
  104. data/lib/webby/resources/static.rb +0 -2
  105. data/lib/webby/stelan/mktemp.rb +0 -2
  106. data/lib/webby/stelan/spawner.rb +0 -2
  107. data/lib/webby/utils.rb +0 -2
  108. data/spec/spec_helper.rb +1 -4
  109. data/spec/webby/helpers/capture_helper_spec.rb +56 -0
  110. data/spec/webby/resources/file_spec.rb +0 -1
  111. data/tasks/ann.rake +7 -4
  112. data/tasks/bones.rake +2 -2
  113. data/tasks/gem.rake +26 -14
  114. data/tasks/notes.rake +11 -5
  115. data/tasks/post_load.rake +4 -2
  116. data/tasks/rdoc.rake +4 -2
  117. data/tasks/rubyforge.rake +3 -3
  118. data/tasks/setup.rb +24 -9
  119. data/tasks/spec.rake +1 -1
  120. data/tasks/website.rake +1 -1
  121. metadata +51 -7
  122. data/lib/webby/webby_task.rb +0 -134
  123. data/tasks/svn.rake +0 -45
@@ -1,5 +1,3 @@
1
- # $Id: partial.rb 167 2008-02-24 00:59:54Z tim_pease $
2
-
3
1
  require Webby.libpath(*%w[webby resources resource])
4
2
 
5
3
  module Webby::Resources
@@ -10,7 +8,7 @@ module Webby::Resources
10
8
  # correspond directly to an output file.
11
9
  #
12
10
  # Partials can contain YAML meta-data at the top of the file. This
13
- # information is only used to determin the filters to apply to the
11
+ # information is only used to determine the filters to apply to the
14
12
  # partial. If there is no meta-data, then the partial text is used "as is"
15
13
  # without any processing by the Webby rendering engine.
16
14
  #
@@ -1,5 +1,3 @@
1
- # $Id: resource.rb 198 2008-03-10 15:25:55Z tim_pease $
2
-
3
1
  unless defined? Webby::Resources::Resource
4
2
 
5
3
  module Webby::Resources
@@ -70,6 +68,16 @@ class Resource
70
68
  @path <=> other.path
71
69
  end
72
70
 
71
+ # call-seq:
72
+ # resource[key] => value or nil
73
+ #
74
+ # Returns the value associated with the given meta-data key. Key is
75
+ # usually a string.
76
+ #
77
+ def []( key )
78
+ @mdata[key]
79
+ end
80
+
73
81
  # call-seq:
74
82
  # method_missing( symbol [, *args, &block] ) => result
75
83
  #
@@ -1,5 +1,3 @@
1
- # $Id: static.rb 167 2008-02-24 00:59:54Z tim_pease $
2
-
3
1
  require Webby.libpath(*%w[webby resources resource])
4
2
 
5
3
  module Webby::Resources
@@ -1,5 +1,3 @@
1
- # $Id: mktemp.rb 176 2008-02-29 00:00:53Z tim_pease $
2
-
3
1
  # :stopdoc:
4
2
  # Skeleton module for the 'mktemp' routine.
5
3
  #
@@ -1,5 +1,3 @@
1
- # $Id: spawner.rb 157 2008-02-20 17:41:00Z tim_pease $
2
-
3
1
  require 'rbconfig'
4
2
  require 'thread'
5
3
  require 'tempfile'
@@ -1,5 +1,3 @@
1
- # $Id: utils.rb 157 2008-02-20 17:41:00Z tim_pease $
2
-
3
1
  # :stopdoc:
4
2
  module Enumerable
5
3
  def injecting( initial )
@@ -1,5 +1,3 @@
1
- # $Id: spec_helper.rb 155 2008-02-17 00:48:30Z tim_pease $
2
-
3
1
  # Equivalent to a header guard in C/C++
4
2
  # Used to prevent the spec helper from being loaded more than once
5
3
  unless defined? WEBBY_SPEC_HELPER
@@ -9,8 +7,7 @@ require 'rubygems'
9
7
  require 'fileutils'
10
8
 
11
9
  require File.expand_path(
12
- File.join(File.dirname(__FILE__), '..', 'lib', 'webby'))
13
-
10
+ File.join(File.dirname(__FILE__), %w[.. lib webby]))
14
11
 
15
12
  end # unless defined?
16
13
 
@@ -0,0 +1,56 @@
1
+
2
+ require ::File.expand_path(
3
+ ::File.join(::File.dirname(__FILE__), %w[.. .. spec_helper]))
4
+
5
+ # ---------------------------------------------------------------------------
6
+ describe Webby::Helpers::CaptureHelper do
7
+ CFN = ::File.expand_path(::File.join(::File.dirname(__FILE__), '..', '..', 'capture_for_yaml.txt'))
8
+ CLINES = [
9
+ "--- ",
10
+ "filter: ",
11
+ " - erb ",
12
+ "--- ",
13
+ "Hello world!",
14
+ "<% content_for :sidebar do %>",
15
+ "I'm sidebar content.",
16
+ "<% end %>"
17
+ ]
18
+
19
+ before :all do
20
+ ::File.open(CFN,'w') {|fd| fd.write CLINES.join("\n") }
21
+ end
22
+
23
+ before :each do
24
+ @renderman = Webby::Renderer.new(
25
+ Webby::Resources::Page.new(CFN))
26
+ @page_content = @renderman.render_page
27
+ end
28
+
29
+ after :all do
30
+ ::FileUtils.rm_f(CFN)
31
+ end
32
+
33
+ it 'should not "leak" any content to containing page' do
34
+ @page_content.should_not be_nil
35
+ @page_content.should eql("Hello world!\n")
36
+ end
37
+
38
+ it "should return the stored content for the given key" do
39
+ @renderman.content_for(:sidebar).should_not be_nil
40
+ @renderman.content_for(:sidebar).should eql("\nI'm sidebar content.\n") # Note: Leading newline
41
+ end
42
+
43
+ it "should report if content is associated with a given key" do
44
+ @renderman.content_for?(:sidebar).should == true
45
+ @renderman.content_for?(:header).should == false
46
+ end
47
+
48
+ it "should clear content associated with a given key" do
49
+ @renderman.content_for?(:sidebar).should == true
50
+ @renderman.delete_content_for(:sidebar)
51
+ @renderman.content_for?(:sidebar).should == false
52
+ end
53
+
54
+ end
55
+
56
+ # EOF
@@ -1,4 +1,3 @@
1
- # $Id: file_spec.rb 167 2008-02-24 00:59:54Z tim_pease $
2
1
 
3
2
  require ::File.join(::File.dirname(__FILE__), %w[.. .. spec_helper])
4
3
 
@@ -1,4 +1,4 @@
1
- # $Id: ann.rake 200 2008-03-12 16:05:17Z tim_pease $
1
+ # $Id$
2
2
 
3
3
  begin
4
4
  require 'bones/smtp_tls'
@@ -9,13 +9,16 @@ require 'time'
9
9
 
10
10
  namespace :ann do
11
11
 
12
+ # A prerequisites task that all other tasks depend upon
13
+ task :prereqs
14
+
12
15
  file PROJ.ann.file do
13
16
  ann = PROJ.ann
14
17
  puts "Generating #{ann.file}"
15
18
  File.open(ann.file,'w') do |fd|
16
19
  fd.puts("#{PROJ.name} version #{PROJ.version}")
17
20
  fd.puts(" by #{Array(PROJ.authors).first}") if PROJ.authors
18
- fd.puts(" #{PROJ.url}") if PROJ.url
21
+ fd.puts(" #{PROJ.url}") if PROJ.url.valid?
19
22
  fd.puts(" (the \"#{PROJ.release_name}\" release)") if PROJ.release_name
20
23
  fd.puts
21
24
  fd.puts("== DESCRIPTION")
@@ -35,10 +38,10 @@ namespace :ann do
35
38
  end
36
39
 
37
40
  desc "Create an announcement file"
38
- task :announcement => PROJ.ann.file
41
+ task :announcement => ['ann:prereqs', PROJ.ann.file]
39
42
 
40
43
  desc "Send an email announcement"
41
- task :email => PROJ.ann.file do
44
+ task :email => ['ann:prereqs', PROJ.ann.file] do
42
45
  ann = PROJ.ann
43
46
  from = ann.email[:from] || PROJ.email
44
47
  to = Array(ann.email[:to])
@@ -1,4 +1,4 @@
1
- # $Id: bones.rake 200 2008-03-12 16:05:17Z tim_pease $
1
+ # $Id$
2
2
 
3
3
  if HAVE_BONES
4
4
 
@@ -6,7 +6,7 @@ namespace :bones do
6
6
 
7
7
  desc 'Show the PROJ open struct'
8
8
  task :debug do |t|
9
- atr = if ARGV.length == 2
9
+ atr = if t.application.top_level_tasks.length == 2
10
10
  t.application.top_level_tasks.pop
11
11
  end
12
12
 
@@ -1,10 +1,10 @@
1
- # $Id: gem.rake 200 2008-03-12 16:05:17Z tim_pease $
1
+ # $Id$
2
2
 
3
3
  require 'rake/gempackagetask'
4
4
 
5
5
  namespace :gem do
6
6
 
7
- PROJ.gem.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
@@ -12,7 +12,6 @@ namespace :gem do
12
12
  s.email = PROJ.email
13
13
  s.homepage = Array(PROJ.url).first
14
14
  s.rubyforge_project = PROJ.rubyforge.name
15
- s.post_install_message = PROJ.gem.post_install_message
16
15
 
17
16
  s.description = PROJ.description
18
17
 
@@ -46,32 +45,45 @@ namespace :gem do
46
45
  else
47
46
  s.test_files = PROJ.test.files.to_a
48
47
  end
49
- end
48
+
49
+ # Do any extra stuff the user wants
50
+ PROJ.gem.extras.each do |msg, val|
51
+ case val
52
+ when Proc
53
+ val.call(s.send(msg))
54
+ else
55
+ s.send "#{msg}=", val
56
+ end
57
+ end
58
+ end # Gem::Specification.new
59
+
60
+ # A prerequisites task that all other tasks depend upon
61
+ task :prereqs
50
62
 
51
63
  desc 'Show information about the gem'
52
- task :debug do
53
- puts PROJ.gem.spec.to_ruby
64
+ task :debug => 'gem:prereqs' do
65
+ puts PROJ.gem._spec.to_ruby
54
66
  end
55
67
 
56
68
  pkg = Rake::PackageTask.new(PROJ.name, PROJ.version) do |pkg|
57
69
  pkg.need_tar = PROJ.gem.need_tar
58
70
  pkg.need_zip = PROJ.gem.need_zip
59
- pkg.package_files += PROJ.gem.spec.files
71
+ pkg.package_files += PROJ.gem._spec.files
60
72
  end
61
73
  Rake::Task['gem:package'].instance_variable_set(:@full_comment, nil)
62
74
 
63
- gem_file = if PROJ.gem.spec.platform == Gem::Platform::RUBY
75
+ gem_file = if PROJ.gem._spec.platform == Gem::Platform::RUBY
64
76
  "#{pkg.package_name}.gem"
65
77
  else
66
- "#{pkg.package_name}-#{PROJ.gem.spec.platform}.gem"
78
+ "#{pkg.package_name}-#{PROJ.gem._spec.platform}.gem"
67
79
  end
68
80
 
69
81
  desc "Build the gem file #{gem_file}"
70
- task :package => "#{pkg.package_dir}/#{gem_file}"
82
+ task :package => ['gem:prereqs', "#{pkg.package_dir}/#{gem_file}"]
71
83
 
72
- file "#{pkg.package_dir}/#{gem_file}" => [pkg.package_dir] + PROJ.gem.spec.files do
84
+ file "#{pkg.package_dir}/#{gem_file}" => [pkg.package_dir] + PROJ.gem._spec.files do
73
85
  when_writing("Creating GEM") {
74
- Gem::Builder.new(PROJ.gem.spec).build
86
+ Gem::Builder.new(PROJ.gem._spec).build
75
87
  verbose(true) {
76
88
  mv gem_file, "#{pkg.package_dir}/#{gem_file}"
77
89
  }
@@ -80,14 +92,14 @@ namespace :gem do
80
92
 
81
93
  desc 'Install the gem'
82
94
  task :install => [:clobber, :package] do
83
- sh "#{SUDO} #{GEM} install pkg/#{PROJ.gem.spec.full_name}"
95
+ sh "#{SUDO} #{GEM} install --no-update-sources pkg/#{PROJ.gem._spec.full_name}"
84
96
  end
85
97
 
86
98
  desc 'Uninstall the gem'
87
99
  task :uninstall do
88
100
  installed_list = Gem.source_index.find_name(PROJ.name)
89
101
  if installed_list and installed_list.collect { |s| s.version.to_s}.include?(PROJ.version) then
90
- sh "#{SUDO} #{GEM} uninstall -v '#{PROJ.version}' -i -x #{PROJ.name}"
102
+ sh "#{SUDO} #{GEM} uninstall --version '#{PROJ.version}' --ignore-dependencies --executables #{PROJ.name}"
91
103
  end
92
104
  end
93
105
 
@@ -1,18 +1,24 @@
1
- # $Id: notes.rake 200 2008-03-12 16:05:17Z tim_pease $
1
+ # $Id$
2
2
 
3
3
  if HAVE_BONES
4
4
 
5
5
  desc "Enumerate all annotations"
6
- task :notes do
6
+ task :notes do |t|
7
+ id = if t.application.top_level_tasks.length > 1
8
+ t.application.top_level_tasks.slice!(1..-1).join(' ')
9
+ end
7
10
  Bones::AnnotationExtractor.enumerate(
8
- PROJ, PROJ.notes.tags.join('|'), :tag => true)
11
+ PROJ, PROJ.notes.tags.join('|'), id, :tag => true)
9
12
  end
10
13
 
11
14
  namespace :notes do
12
15
  PROJ.notes.tags.each do |tag|
13
16
  desc "Enumerate all #{tag} annotations"
14
- task tag.downcase.to_sym do
15
- Bones::AnnotationExtractor.enumerate(PROJ, tag)
17
+ task tag.downcase.to_sym do |t|
18
+ id = if t.application.top_level_tasks.length > 1
19
+ t.application.top_level_tasks.slice!(1..-1).join(' ')
20
+ end
21
+ Bones::AnnotationExtractor.enumerate(PROJ, tag, id)
16
22
  end
17
23
  end
18
24
  end
@@ -1,10 +1,12 @@
1
- # $Id: post_load.rake 200 2008-03-12 16:05:17Z tim_pease $
1
+ # $Id$
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
6
  PROJ.rdoc.exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
7
- PROJ.exclude << "^#{Regexp.escape(PROJ.ann.file)}$"
7
+ PROJ.exclude << ["^#{Regexp.escape(PROJ.ann.file)}$",
8
+ "^#{Regexp.escape(PROJ.rdoc.dir)}/",
9
+ "^#{Regexp.escape(PROJ.rcov.dir)}/"]
8
10
 
9
11
  flatten_arrays = lambda do |this,os|
10
12
  os.instance_variable_get(:@table).each do |key,val|
@@ -1,4 +1,4 @@
1
- # $Id: rdoc.rake 200 2008-03-12 16:05:17Z tim_pease $
1
+ # $Id$
2
2
 
3
3
  require 'rake/rdoctask'
4
4
 
@@ -21,7 +21,9 @@ namespace :doc do
21
21
  rd.rdoc_files.push(*files)
22
22
 
23
23
  title = "#{PROJ.name}-#{PROJ.version} Documentation"
24
- title = "#{PROJ.rubyforge.name}'s " + title if PROJ.rubyforge.name != title
24
+
25
+ rf_name = PROJ.rubyforge.name
26
+ title = "#{rf_name}'s " + title if rf_name.valid? and rf_name != title
25
27
 
26
28
  rd.options << "-t #{title}"
27
29
  rd.options.concat(rdoc.opts)
@@ -1,6 +1,6 @@
1
- # $Id: rubyforge.rake 200 2008-03-12 16:05:17Z tim_pease $
1
+ # $Id$
2
2
 
3
- if PROJ.rubyforge.name && HAVE_RUBYFORGE
3
+ if PROJ.rubyforge.name.valid? && HAVE_RUBYFORGE
4
4
 
5
5
  require 'rubyforge'
6
6
  require 'rake/contrib/sshpublisher'
@@ -10,7 +10,7 @@ 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.gem.spec.full_name}"
13
+ pkg = "pkg/#{PROJ.gem._spec.full_name}"
14
14
 
15
15
  if $DEBUG then
16
16
  puts "release_id = rf.add_release #{PROJ.rubyforge.name.inspect}, #{PROJ.name.inspect}, #{PROJ.version.inspect}, \"#{pkg}.tgz\""
@@ -1,4 +1,4 @@
1
- # $Id: setup.rb 200 2008-03-12 16:05:17Z tim_pease $
1
+ # $Id$
2
2
 
3
3
  require 'rubygems'
4
4
  require 'rake'
@@ -16,9 +16,9 @@ PROJ = OpenStruct.new(
16
16
  :changes => nil,
17
17
  :authors => nil,
18
18
  :email => nil,
19
- :url => nil,
19
+ :url => "\000",
20
20
  :version => ENV['VERSION'] || '0.0.0',
21
- :exclude => %w(tmp$ bak$ ~$ CVS .svn/ ^pkg/ ^doc/),
21
+ :exclude => %w(tmp$ bak$ ~$ CVS \.svn/ \.git/ ^pkg/),
22
22
  :release_name => ENV['RELEASE'],
23
23
 
24
24
  # System Defaults
@@ -53,12 +53,12 @@ PROJ = OpenStruct.new(
53
53
  :files => nil,
54
54
  :need_tar => true,
55
55
  :need_zip => false,
56
- :post_install_message => nil
56
+ :extras => {}
57
57
  ),
58
58
 
59
59
  # File Annotations
60
60
  :notes => OpenStruct.new(
61
- :exclude => %w(^tasks/setup.rb$),
61
+ :exclude => %w(^tasks/setup\.rb$),
62
62
  :extensions => %w(.txt .rb .erb) << '',
63
63
  :tags => %w(FIXME OPTIMIZE TODO)
64
64
  ),
@@ -74,8 +74,8 @@ PROJ = OpenStruct.new(
74
74
  # Rdoc
75
75
  :rdoc => OpenStruct.new(
76
76
  :opts => [],
77
- :include => %w(^lib/ ^bin/ ^ext/ .txt$),
78
- :exclude => %w(extconf.rb$),
77
+ :include => %w(^lib/ ^bin/ ^ext/ \.txt$),
78
+ :exclude => %w(extconf\.rb$),
79
79
  :main => nil,
80
80
  :dir => 'doc',
81
81
  :remote_dir => nil
@@ -83,7 +83,7 @@ PROJ = OpenStruct.new(
83
83
 
84
84
  # Rubyforge
85
85
  :rubyforge => OpenStruct.new(
86
- :name => nil
86
+ :name => "\000"
87
87
  ),
88
88
 
89
89
  # Rspec
@@ -95,7 +95,7 @@ PROJ = OpenStruct.new(
95
95
  # Subversion Repository
96
96
  :svn => OpenStruct.new(
97
97
  :root => nil,
98
- :path => nil,
98
+ :path => '',
99
99
  :trunk => 'trunk',
100
100
  :tags => 'tags',
101
101
  :branches => 'branches'
@@ -130,6 +130,7 @@ def quiet( &block )
130
130
  ensure
131
131
  STDOUT.reopen io.first
132
132
  STDERR.reopen io.last
133
+ $stdout, $stderr = STDOUT, STDERR
133
134
  end
134
135
 
135
136
  DIFF = if WIN32 then 'diff.exe'
@@ -156,6 +157,10 @@ GEM = WIN32 ? 'gem.bat' : 'gem'
156
157
  Object.instance_eval {const_set "HAVE_#{lib.tr('/','_').upcase}", false}
157
158
  end
158
159
  end
160
+ HAVE_SVN = (Dir.entries(Dir.pwd).include?('.svn') and
161
+ system("svn --version 2>&1 > #{DEV_NULL}"))
162
+ HAVE_GIT = (Dir.entries(Dir.pwd).include?('.git') and
163
+ system("git --version 2>&1 > #{DEV_NULL}"))
159
164
 
160
165
  # Reads a file at +path+ and spits out an array of the +paragraphs+
161
166
  # specified.
@@ -250,4 +255,14 @@ def manifest_files
250
255
  files.sort!
251
256
  end
252
257
 
258
+ # We need a "valid" method thtat determines if a string is suitable for use
259
+ # in the gem specification.
260
+ #
261
+ class Object
262
+ def valid?
263
+ return !(self.empty? or self == "\000") if self.respond_to?(:to_str)
264
+ return false
265
+ end
266
+ end
267
+
253
268
  # EOF