Rakefile in mspire-0.3.9 vs Rakefile in mspire-0.4.2
- old
+ new
@@ -15,11 +15,11 @@
$dependencies = %w(libjtp)
$tfiles_large = 'test_files_large'
changelog = "changelog.txt"
-core_files = FL["INSTALL", "README", "Rakefile", "LICENSE", changelog, "release_notes.txt", "{lib,bin,script,specs,tutorial,test_files}/**/*"]
+core_files = FL["INSTALL", "README", "README.rdoc", "Rakefile", "LICENSE", changelog, "release_notes.txt", "{lib,bin,script,specs,tutorial,test_files}/**/*"]
big_dist_files = core_files + FL["test_files_large/**/*"]
dist_files = core_files
# dist_files = big_dist_files
@@ -41,11 +41,11 @@
def move_and_add_webgen_header(file, newfile, src_dir, heading)
string = IO.read file
with_header = heading + string
File.open(newfile, 'w') {|v| v.print with_header }
- FileUtils.mv newfile, src_dir
+ FileUtils.mv newfile, src_dir, :force => true
end
desc "copy top level files into doc/src"
task :cp_top_level_docs do
string = "---
@@ -53,31 +53,44 @@
inMenu: true
directoryName: mspire
---\n"
src = "doc/src"
move_and_add_webgen_header('README', 'index.page', src, string.sub('TITLE', 'Home'))
- move_and_add_webgen_header('INSTALL', 'install.page', src, string.sub('TITLE', 'Install'))
+ move_and_add_webgen_header('INSTALL', 'index.page', src + '/install', string.sub('TITLE', 'Install').sub('mspire', 'Install').sub("inMenu: true\n", ''))
end
-desc "create and upload docs to server"
-task :upload_docs => :html_docs do
+desc "upload docs (doc/output) to server"
+task :upload_docs do
sh "scp -i ~/.ssh/rubyforge_key -r doc/output/* jtprince@rubyforge.org:/var/www/gforge-projects/mspire/"
end
+# best to use webgen 0.3.8 right now
+# to get working (may not require all these steps):
+# gem install RedCloth
+# gem install BlueCloth
+# soft link the bluecloth binary into path
desc "creates docs in doc/html"
task :html_docs => [:cp_top_level_docs] do
FileUtils.cd 'doc' do
sh "webgen"
end
+ FileUtils.cp 'doc/src/archive/t2x', 'doc/output/archive/t2x'
end
-rdoc_options = ['--main', 'README', '--title', NAME]
-rdoc_extra_includes = ["README", "INSTALL", "LICENSE"]
+desc "does html_docs and rdoc and puts rdoc inside html_docs"
+task :all_docs => [:html_docs, :rdoc] do
+ FileUtils.mv 'html', 'doc/output/rdoc'
+end
+#rdoc_options = ['--main', 'README', '--title', NAME]
+rdoc_options = ['--main', 'README.rdoc', '--title', NAME]
+#rdoc_extra_includes = ["README", "INSTALL", "LICENSE"]
+rdoc_extra_includes = ['README.rdoc']
+
Rake::RDocTask.new do |rd|
- rd.main = "README"
- rd.rdoc_files.include rdoc_extra_includes
+ rd.main = "README.rdoc"
+ rd.rdoc_files.include("lib/**/*.rb", *rdoc_extra_includes )
rd.options.push( *rdoc_options )
end
###############################################
# TESTS
@@ -122,22 +135,33 @@
desc "Run all specs"
Spec::Rake::SpecTask.new('spec') do |t|
Rake::Task[:ensure_gem_is_uninstalled].invoke
Rake::Task[:ensure_dependencies].invoke
Rake::Task[:ensure_large_testfiles].invoke
- t.libs = ['lib']
+ t.libs =
+ if !ENV['LIB'].nil?
+ [ENV['LIB']]
+ else
+ ['lib']
+ end
#t.ruby_opts = ['-I', 'lib']
t.spec_files = FileList['specs/**/*_spec.rb']
end
desc "Run all specs"
Spec::Rake::SpecTask.new('specl') do |t|
Rake::Task[:ensure_gem_is_uninstalled].invoke
Rake::Task[:ensure_dependencies].invoke
Rake::Task[:ensure_large_testfiles].invoke
t.spec_files = FileList['specs/**/*_spec.rb']
- t.libs = ['lib']
+ t.libs =
+ if !ENV['LIB'].nil?
+ [ENV['LIB']]
+ else
+ ['lib']
+ end
+ #t.libs = ['lib']
#t.ruby_opts = ['-I', 'lib']
t.spec_opts = ['--format', 'specdoc' ]
end
desc "Run all specs with RCov"
@@ -145,11 +169,16 @@
Rake::Task[:ensure_gem_is_uninstalled].invoke
Rake::Task[:ensure_dependencies].invoke
Rake::Task[:ensure_large_testfiles].invoke
t.spec_files = FileList['specs/**/*_spec.rb']
t.rcov = true
- t.libs = ['lib']
+ t.libs =
+ if !ENV['LIB'].nil?
+ [ENV['LIB']]
+ else
+ ['lib']
+ end
#t.ruby_opts = ['-I', 'lib']
t.rcov_opts = ['--exclude', 'specs']
end
task :speci => [:ensure_gem_is_uninstalled, :ensure_dependencies, :ensure_large_testfiles] do
@@ -158,13 +187,19 @@
if ENV['SPECM']
files_to_run = files_to_run.select do |file|
file.include?(ENV['SPECM'])
end
end
+ lib =
+ if !ENV['LIB'].nil?
+ ENV['LIB']
+ else
+ 'lib'
+ end
files_to_run.each do |spc|
puts "------ SPEC=#{spc} ------"
- system "ruby -I lib -S spec #{spc} --format specdoc"
+ system "ruby -I #{lib} -S spec #{spc} --format specdoc"
end
end
#Spec::Rake::SpecTask.new(:spec) do |t|
# uninstall_gem
@@ -236,11 +271,12 @@
s.authors = ["John Prince"]
s.files = dist_files
s.rdoc_options = rdoc_options
s.extra_rdoc_files = rdoc_extra_includes
s.executables = FL["bin/*"].map {|file| File.basename(file) }
- s.add_dependency('libjtp', '~> 0.2.13')
+ s.add_dependency('libjtp', '~> 0.2.14')
s.add_dependency('axml', '~> 0.0.0')
+ s.add_dependency('arrayclass', '~> 0.1.0')
s.requirements << '"libxml" is the prefered xml parser right now. libxml, xmlparser, REXML and regular expressions are used as fallback in some routines.'
s.requirements << 'some plotting functions will not be available without the "gnuplot" gem (and underlying gnuplot binary)'
s.requirements << 'the "t2x" binary (in archive) or readw.exe is required to convert .RAW files to mzXML in some applications'
s.requirements << '"rake" is useful for development'
s.requirements << '"webgen (with gems redcloth and bluecloth) is necessary to build web pages'