bones 1.3.5 → 2.0.0

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.
@@ -1,7 +1,6 @@
1
1
  # $Id$
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
@@ -1,87 +1,89 @@
1
- # $Id$
1
+ # $Id: gem.rake 585 2008-04-07 20:15:39Z 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
16
15
 
17
16
  s.description = PROJ.description
18
17
 
19
- PROJ.dependencies.each do |dep|
18
+ PROJ.gem.dependencies.each do |dep|
20
19
  s.add_dependency(*dep)
21
20
  end
22
21
 
23
- s.files = PROJ.files
24
- s.executables = PROJ.executables.map {|fn| File.basename(fn)}
25
- s.extensions = PROJ.files.grep %r/extconf\.rb$/
22
+ s.files = PROJ.gem.files
23
+ s.executables = PROJ.gem.executables.map {|fn| File.basename(fn)}
24
+ s.extensions = PROJ.gem.files.grep %r/extconf\.rb$/
26
25
 
27
26
  s.bindir = 'bin'
28
27
  dirs = Dir["{#{PROJ.libs.join(',')}}"]
29
28
  s.require_paths = dirs unless dirs.empty?
30
29
 
31
- incl = Regexp.new(PROJ.rdoc_include.join('|'))
32
- excl = PROJ.rdoc_exclude.dup.concat %w[\.rb$ ^(\.\/|\/)?ext]
30
+ incl = Regexp.new(PROJ.rdoc.include.join('|'))
31
+ excl = PROJ.rdoc.exclude.dup.concat %w[\.rb$ ^(\.\/|\/)?ext]
33
32
  excl = Regexp.new(excl.join('|'))
34
- rdoc_files = PROJ.files.find_all do |fn|
33
+ rdoc_files = PROJ.gem.files.find_all do |fn|
35
34
  case fn
36
35
  when excl; false
37
36
  when incl; true
38
37
  else false end
39
38
  end
40
- s.rdoc_options = PROJ.rdoc_opts + ['--main', PROJ.rdoc_main]
39
+ s.rdoc_options = PROJ.rdoc.opts + ['--main', PROJ.rdoc.main]
41
40
  s.extra_rdoc_files = rdoc_files
42
41
  s.has_rdoc = true
43
42
 
44
- if test ?f, PROJ.test_file
45
- s.test_file = PROJ.test_file
43
+ if test ?f, PROJ.test.file
44
+ s.test_file = PROJ.test.file
46
45
  else
47
- s.test_files = PROJ.tests.to_a
46
+ s.test_files = PROJ.test.files.to_a
48
47
  end
49
48
 
50
49
  # 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
- end
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
60
62
 
61
63
  desc 'Show information about the gem'
62
- task :debug do
63
- puts PROJ.spec.to_ruby
64
+ task :debug => 'gem:prereqs' do
65
+ puts PROJ.gem._spec.to_ruby
64
66
  end
65
67
 
66
68
  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
69
+ pkg.need_tar = PROJ.gem.need_tar
70
+ pkg.need_zip = PROJ.gem.need_zip
71
+ pkg.package_files += PROJ.gem._spec.files
70
72
  end
71
73
  Rake::Task['gem:package'].instance_variable_set(:@full_comment, nil)
72
74
 
73
- gem_file = if PROJ.spec.platform == Gem::Platform::RUBY
75
+ gem_file = if PROJ.gem._spec.platform == Gem::Platform::RUBY
74
76
  "#{pkg.package_name}.gem"
75
77
  else
76
- "#{pkg.package_name}-#{PROJ.spec.platform}.gem"
78
+ "#{pkg.package_name}-#{PROJ.gem._spec.platform}.gem"
77
79
  end
78
80
 
79
81
  desc "Build the gem file #{gem_file}"
80
- task :package => "#{pkg.package_dir}/#{gem_file}"
82
+ task :package => ['gem:prereqs', "#{pkg.package_dir}/#{gem_file}"]
81
83
 
82
- file "#{pkg.package_dir}/#{gem_file}" => [pkg.package_dir] + PROJ.spec.files do
84
+ file "#{pkg.package_dir}/#{gem_file}" => [pkg.package_dir] + PROJ.gem._spec.files do
83
85
  when_writing("Creating GEM") {
84
- Gem::Builder.new(PROJ.spec).build
86
+ Gem::Builder.new(PROJ.gem._spec).build
85
87
  verbose(true) {
86
88
  mv gem_file, "#{pkg.package_dir}/#{gem_file}"
87
89
  }
@@ -90,14 +92,14 @@ namespace :gem do
90
92
 
91
93
  desc 'Install the gem'
92
94
  task :install => [:clobber, :package] do
93
- sh "#{SUDO} #{GEM} install pkg/#{PROJ.spec.full_name}"
95
+ sh "#{SUDO} #{GEM} install --no-update-sources pkg/#{PROJ.gem._spec.full_name}"
94
96
  end
95
97
 
96
98
  desc 'Uninstall the gem'
97
99
  task :uninstall do
98
100
  installed_list = Gem.source_index.find_name(PROJ.name)
99
101
  if installed_list and installed_list.collect { |s| s.version.to_s}.include?(PROJ.version) then
100
- sh "#{SUDO} #{GEM} uninstall -v '#{PROJ.version}' -i -x #{PROJ.name}"
102
+ sh "#{SUDO} #{GEM} uninstall -v '#{PROJ.version}' -I -x #{PROJ.name}"
101
103
  end
102
104
  end
103
105
 
@@ -0,0 +1,28 @@
1
+ # $Id$
2
+
3
+ if HAVE_BONES
4
+
5
+ desc "Enumerate all annotations"
6
+ task :notes do |t|
7
+ id = if ARGV.length > 1
8
+ t.application.top_level_tasks.slice!(1..-1).join(' ')
9
+ end
10
+ Bones::AnnotationExtractor.enumerate(
11
+ PROJ, PROJ.notes.tags.join('|'), id, :tag => true)
12
+ end
13
+
14
+ namespace :notes do
15
+ PROJ.notes.tags.each do |tag|
16
+ desc "Enumerate all #{tag} annotations"
17
+ task tag.downcase.to_sym do |t|
18
+ id = if ARGV.length > 1
19
+ t.application.top_level_tasks.slice!(1..-1).join(' ')
20
+ end
21
+ Bones::AnnotationExtractor.enumerate(PROJ, tag, id)
22
+ end
23
+ end
24
+ end
25
+
26
+ end # if HAVE_BONES
27
+
28
+ # EOF
@@ -3,14 +3,19 @@
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)}$"
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
6
+ PROJ.rdoc.exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
7
+ PROJ.exclude << "^#{Regexp.escape(PROJ.ann.file)}$"
8
+
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 584 2008-04-07 19:46:38Z 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,12 @@ 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
+
25
+ rf_name = PROJ.rubyforge.name
26
+ title = "#{rf_name}'s " + title if rf_name.valid? and rf_name != title
24
27
 
25
28
  rd.options << "-t #{title}"
26
- rd.options.concat(PROJ.rdoc_opts)
29
+ rd.options.concat(rdoc.opts)
27
30
  end
28
31
 
29
32
  desc 'Generate ri locally for testing'
@@ -1,6 +1,6 @@
1
- # $Id$
1
+ # $Id: rubyforge.rake 590 2008-04-07 20:52:22Z tim_pease $
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,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
@@ -1,4 +1,4 @@
1
- # $Id$
1
+ # $Id: setup.rb 584 2008-04-07 19:46:38Z 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}
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 => "\000",
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
+ :extras => {}
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 => "\000"
87
+ ),
54
88
 
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
- }
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 => '',
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
 
@@ -105,6 +130,7 @@ def quiet( &block )
105
130
  ensure
106
131
  STDOUT.reopen io.first
107
132
  STDERR.reopen io.last
133
+ $stdout, $stderr = STDOUT, STDERR
108
134
  end
109
135
 
110
136
  DIFF = if WIN32 then 'diff.exe'
@@ -120,6 +146,7 @@ SUDO = if WIN32 then ''
120
146
  end
121
147
 
122
148
  RCOV = WIN32 ? 'rcov.bat' : 'rcov'
149
+ RDOC = WIN32 ? 'rdoc.bat' : 'rdoc'
123
150
  GEM = WIN32 ? 'gem.bat' : 'gem'
124
151
 
125
152
  %w(rcov spec/rake/spectask rubyforge bones facets/ansicode).each do |lib|
@@ -130,6 +157,8 @@ GEM = WIN32 ? 'gem.bat' : 'gem'
130
157
  Object.instance_eval {const_set "HAVE_#{lib.tr('/','_').upcase}", false}
131
158
  end
132
159
  end
160
+ HAVE_SVN = (Dir.entries(Dir.pwd).include?('.svn') and
161
+ system("svn --version 2>&1 > #{DEV_NULL}"))
133
162
 
134
163
  # Reads a file at +path+ and spits out an array of the +paragraphs+
135
164
  # specified.
@@ -169,7 +198,7 @@ def depend_on( name, version = nil )
169
198
  spec = Gem.source_index.find_name(name).last
170
199
  version = spec.version.to_s if version.nil? and !spec.nil?
171
200
 
172
- PROJ.dependencies << case version
201
+ PROJ.gem.dependencies << case version
173
202
  when nil; [name]
174
203
  when %r/^\d/; [name, ">= #{version}"]
175
204
  else [name, version] end
@@ -224,4 +253,14 @@ def manifest_files
224
253
  files.sort!
225
254
  end
226
255
 
256
+ # We need a "valid" method thtat determines if a string is suitable for use
257
+ # in the gem specification.
258
+ #
259
+ class Object
260
+ def valid?
261
+ return !(self.empty? or self == "\000") if self.respond_to?(:to_str)
262
+ return false
263
+ end
264
+ end
265
+
227
266
  # EOF