diff options
author | murphy <murphy@rubychan.de> | 2006-07-10 00:32:57 +0000 |
---|---|---|
committer | murphy <murphy@rubychan.de> | 2006-07-10 00:32:57 +0000 |
commit | 9f4c7ab7553f9be7c9d14da0ba7462ad746c2f5d (patch) | |
tree | 686ee95cc9010314278846936476d1cf0bf04353 /rake_tasks | |
parent | 42436798565c36a7d9582fcf587946d273083ab1 (diff) | |
download | coderay-9f4c7ab7553f9be7c9d14da0ba7462ad746c2f5d.tar.gz |
Big re-indenting - no more tabs!
Diffstat (limited to 'rake_tasks')
-rw-r--r-- | rake_tasks/benchmark.rake | 2 | ||||
-rw-r--r-- | rake_tasks/documentation.rake | 62 | ||||
-rw-r--r-- | rake_tasks/example.rake | 40 | ||||
-rw-r--r-- | rake_tasks/gem.rake | 210 | ||||
-rw-r--r-- | rake_tasks/rubyforge.rake | 24 | ||||
-rw-r--r-- | rake_tasks/statistic.rake | 24 | ||||
-rw-r--r-- | rake_tasks/test.rake | 16 |
7 files changed, 189 insertions, 189 deletions
diff --git a/rake_tasks/benchmark.rake b/rake_tasks/benchmark.rake index 3046fc7..73a34d9 100644 --- a/rake_tasks/benchmark.rake +++ b/rake_tasks/benchmark.rake @@ -1,6 +1,6 @@ desc 'Do a benchmark'
task :benchmark do
- system 'ruby -wIlib bench\bench.rb ruby html 0'
+ system 'ruby -wIlib bench\bench.rb ruby html 0'
end
task :bench => :benchmark
diff --git a/rake_tasks/documentation.rake b/rake_tasks/documentation.rake index 36722fc..8906f43 100644 --- a/rake_tasks/documentation.rake +++ b/rake_tasks/documentation.rake @@ -1,43 +1,43 @@ require 'rake/rdoctask'
def set_rdoc_info rd, small = false
- rd.main = 'README'
- rd.title = "CodeRay Documentation"
- rd.options << '--line-numbers' << '--inline-source' << '--tab-width' << '2'
- rd.options << '--fmt' << ENV.fetch('format', 'html_coderay')
- rd.options << '--all'
- rd.template = ENV.fetch('template', 'rake_helpers/coderay_rdoc_template.rb')
- rd.rdoc_files.add *EXTRA_FILES.in(ROOT)
- rd.rdoc_files.add *Dir[File.join(LIB_ROOT, "#{'**/' unless small}*.rb")]
+ rd.main = 'README'
+ rd.title = "CodeRay Documentation"
+ rd.options << '--line-numbers' << '--inline-source' << '--tab-width' << '2'
+ rd.options << '--fmt' << ENV.fetch('format', 'html_coderay')
+ rd.options << '--all'
+ rd.template = ENV.fetch('template', 'rake_helpers/coderay_rdoc_template.rb')
+ rd.rdoc_files.add *EXTRA_FILES.in(ROOT)
+ rd.rdoc_files.add *Dir[File.join(LIB_ROOT, "#{'**/' unless small}*.rb")]
end
namespace :doc do
- desc 'Generate documentation for CodeRay'
- Rake::RDocTask.new :all do |rd|
- set_rdoc_info rd
- rd.rdoc_dir = 'doc/all'
- end
+ desc 'Generate documentation for CodeRay'
+ Rake::RDocTask.new :all do |rd|
+ set_rdoc_info rd
+ rd.rdoc_dir = 'doc/all'
+ end
- desc 'Generate test documentation for CodeRay (faster)'
- Rake::RDocTask.new :small do |rd|
- set_rdoc_info rd, true
- rd.rdoc_dir = 'doc/small'
- end
+ desc 'Generate test documentation for CodeRay (faster)'
+ Rake::RDocTask.new :small do |rd|
+ set_rdoc_info rd, true
+ rd.rdoc_dir = 'doc/small'
+ end
- desc 'Upload rdoc to ' + FTP_DOMAIN
- task :upload => :all do
- gn 'Uploading documentation:'
- Dir.chdir 'doc/all' do
- cYcnus_ftp do |ftp|
- uploader = uploader_for ftp
- ftp.chdir FTP_CODERAY_DIR
- ftp.chdir 'doc'
- Dir['**/*.*'].each &uploader
- end
- end
- gn 'Documentation uploaded.'
- end
+ desc 'Upload rdoc to ' + FTP_DOMAIN
+ task :upload => :all do
+ gn 'Uploading documentation:'
+ Dir.chdir 'doc/all' do
+ cYcnus_ftp do |ftp|
+ uploader = uploader_for ftp
+ ftp.chdir FTP_CODERAY_DIR
+ ftp.chdir 'doc'
+ Dir['**/*.*'].each &uploader
+ end
+ end
+ gn 'Documentation uploaded.'
+ end
end
diff --git a/rake_tasks/example.rake b/rake_tasks/example.rake index fa7e1ec..e461264 100644 --- a/rake_tasks/example.rake +++ b/rake_tasks/example.rake @@ -1,25 +1,25 @@ namespace :example do
- desc 'Generate an example output'
- task :make do
- system 'ruby -wIlib ../hidden/highlight.rb -1 -L -I lib lib/coderay/**/'
- end
+ desc 'Generate an example output'
+ task :make do
+ system 'ruby -wIlib ../hidden/highlight.rb -1 -L -I lib lib/coderay/**/'
+ end
- desc 'Upload example to ' + FTP_DOMAIN
- task :upload => :make do
- gn 'Highlighting self...'
- gd
- gn 'Uploading example:'
- cYcnus_ftp do |ftp|
- ftp.chdir FTP_CODERAY_DIR
- uploader = proc do |l, r|
- g 'Uploading %s to %s...' % [l, r]
- ftp.putbinaryfile l, r
- gd
- end
- uploader.call 'highlighted/all_in_one.html', 'example.html'
- end
- gn 'Example uploaded.'
- end
+ desc 'Upload example to ' + FTP_DOMAIN
+ task :upload => :make do
+ gn 'Highlighting self...'
+ gd
+ gn 'Uploading example:'
+ cYcnus_ftp do |ftp|
+ ftp.chdir FTP_CODERAY_DIR
+ uploader = proc do |l, r|
+ g 'Uploading %s to %s...' % [l, r]
+ ftp.putbinaryfile l, r
+ gd
+ end
+ uploader.call 'highlighted/all_in_one.html', 'example.html'
+ end
+ gn 'Example uploaded.'
+ end
end
diff --git a/rake_tasks/gem.rake b/rake_tasks/gem.rake index e6fcb31..172169e 100644 --- a/rake_tasks/gem.rake +++ b/rake_tasks/gem.rake @@ -1,114 +1,114 @@ require 'rake/gempackagetask.rb'
def gemspec
- Gem::Specification.new do |s|
- # Basic Information
- s.name = s.rubyforge_project = 'coderay'
- s.version = '0'
-
- s.platform = Gem::Platform::RUBY
- s.requirements = ['strscan']
- s.date = Time.now.strftime '%Y-%m-%d'
- s.has_rdoc = true
- s.rdoc_options = '-SNw2', '-mREADME', '-a', '-t CodeRay Documentation'
- s.extra_rdoc_files = EXTRA_FILES.in('./')
-
- # Description
- s.summary = <<-EOF
- CodeRay is a fast syntax highlighter engine for many languages.
- EOF
- s.description = <<-EOF
- CodeRay is a Ruby library for syntax highlighting.
- I try to make CodeRay easy to use and intuitive, but at the same time
- fully featured, complete, fast and efficient.
-
- Usage is simple:
- require 'coderay'
- code = 'some %q(weird (Ruby) can\'t shock) me!'
- puts CodeRay.scan(code, :ruby).html
- EOF
-
- # Files
- s.require_path = 'lib'
- s.autorequire = 'coderay'
- s.executables = [ 'coderay' ]
-
- s.files = nil # defined later
-
- # Credits
- s.author = 'murphy'
- s.email = 'murphy@cYcnus.de'
- s.homepage = 'http://coderay.rubychan.de'
- end
+ Gem::Specification.new do |s|
+ # Basic Information
+ s.name = s.rubyforge_project = 'coderay'
+ s.version = '0'
+
+ s.platform = Gem::Platform::RUBY
+ s.requirements = ['strscan']
+ s.date = Time.now.strftime '%Y-%m-%d'
+ s.has_rdoc = true
+ s.rdoc_options = '-SNw2', '-mREADME', '-a', '-t CodeRay Documentation'
+ s.extra_rdoc_files = EXTRA_FILES.in('./')
+
+ # Description
+ s.summary = <<-EOF
+ CodeRay is a fast syntax highlighter engine for many languages.
+ EOF
+ s.description = <<-EOF
+ CodeRay is a Ruby library for syntax highlighting.
+ I try to make CodeRay easy to use and intuitive, but at the same time
+ fully featured, complete, fast and efficient.
+
+ Usage is simple:
+ require 'coderay'
+ code = 'some %q(weird (Ruby) can\'t shock) me!'
+ puts CodeRay.scan(code, :ruby).html
+ EOF
+
+ # Files
+ s.require_path = 'lib'
+ s.autorequire = 'coderay'
+ s.executables = [ 'coderay' ]
+
+ s.files = nil # defined later
+
+ # Credits
+ s.author = 'murphy'
+ s.email = 'murphy@cYcnus.de'
+ s.homepage = 'http://coderay.rubychan.de'
+ end
end
namespace :gem do
- gemtask = Rake::GemPackageTask.new(gemspec) do |pkg|
- pkg.need_zip = true
- pkg.need_tar = true
- end
-
- desc 'Create the gem again'
- task :make => [:make_gemspec, :clean, :gem, :prepare_server]
-
- desc 'Delete previously created Gems'
- task :clean do
- Dir['pkg/*.gem'].each { |g| rm g }
- end
-
- desc 'Find out the current CodeRay version'
- task :get_version do
- unless $version
- $: << './lib'
- require 'coderay'
- $version = CodeRay::Version
- end
- puts 'Current Version: %s' % $version
- #$version.sub!(/\.(\d+)\./) { minor = $1; ".#{minor.to_i}." }
- $version << '.' << (`svn info`[/Revision: (\d+)/,1])
- end
-
- task :make_gemspec => :get_version do
- candidates = Dir['./lib/**/*.rb'] +
- Dir['./demo/*.rb'] +
- # Dir['./bin/*'] +
- # Dir['./demo/bench/*'] +
- # Dir['./test/*'] +
- %w( ./README ./LICENSE)
- s = gemtask.gem_spec
- s.files = candidates #.delete_if { |item| item[/(?:CVS|rdoc)|~$/] }
- gemtask.version = s.version = $version
- end
-
- GEMDIR = 'gem_server/gems'
- task :prepare_server => :get_version do
- $gemfile = "coderay-#$version.gem"
- Dir[GEMDIR + '/*.gem'].each { |g| rm g }
- cp "pkg/#$gemfile", GEMDIR
- system 'ruby -S generate_yaml_index.rb -d gem_server'
- end
-
- desc 'Upload gemfile to ' + FTP_DOMAIN
- task :upload => :make do
- gn 'Uploading gem:'
- cYcnus_ftp do |ftp|
- Dir.chdir 'gem_server' do
- uploader = uploader_for ftp
- ftp.chdir FTP_CODERAY_DIR
- %w(yaml yaml.Z).each &uploader
- Dir.chdir 'gems' do
- ftp.chdir 'gems'
- uploader.call $gemfile
- end
- end
- end
- gn 'Gem successfully uploaded.'
- end
-
- desc 'Build the Gem and install it locally'
- task :install => :make do
- system "ruby -S gem install --no-rdoc pkg/#{$gemfile}"
- end
+ gemtask = Rake::GemPackageTask.new(gemspec) do |pkg|
+ pkg.need_zip = true
+ pkg.need_tar = true
+ end
+
+ desc 'Create the gem again'
+ task :make => [:make_gemspec, :clean, :gem, :prepare_server]
+
+ desc 'Delete previously created Gems'
+ task :clean do
+ Dir['pkg/*.gem'].each { |g| rm g }
+ end
+
+ desc 'Find out the current CodeRay version'
+ task :get_version do
+ unless $version
+ $: << './lib'
+ require 'coderay'
+ $version = CodeRay::Version
+ end
+ puts 'Current Version: %s' % $version
+ #$version.sub!(/\.(\d+)\./) { minor = $1; ".#{minor.to_i}." }
+ $version << '.' << (`svn info`[/Revision: (\d+)/,1])
+ end
+
+ task :make_gemspec => :get_version do
+ candidates = Dir['./lib/**/*.rb'] +
+ Dir['./demo/*.rb'] +
+ # Dir['./bin/*'] +
+ # Dir['./demo/bench/*'] +
+ # Dir['./test/*'] +
+ %w( ./README ./LICENSE)
+ s = gemtask.gem_spec
+ s.files = candidates #.delete_if { |item| item[/(?:CVS|rdoc)|~$/] }
+ gemtask.version = s.version = $version
+ end
+
+ GEMDIR = 'gem_server/gems'
+ task :prepare_server => :get_version do
+ $gemfile = "coderay-#$version.gem"
+ Dir[GEMDIR + '/*.gem'].each { |g| rm g }
+ cp "pkg/#$gemfile", GEMDIR
+ system 'ruby -S generate_yaml_index.rb -d gem_server'
+ end
+
+ desc 'Upload gemfile to ' + FTP_DOMAIN
+ task :upload => :make do
+ gn 'Uploading gem:'
+ cYcnus_ftp do |ftp|
+ Dir.chdir 'gem_server' do
+ uploader = uploader_for ftp
+ ftp.chdir FTP_CODERAY_DIR
+ %w(yaml yaml.Z).each &uploader
+ Dir.chdir 'gems' do
+ ftp.chdir 'gems'
+ uploader.call $gemfile
+ end
+ end
+ end
+ gn 'Gem successfully uploaded.'
+ end
+
+ desc 'Build the Gem and install it locally'
+ task :install => :make do
+ system "ruby -S gem install --no-rdoc pkg/#{$gemfile}"
+ end
end
diff --git a/rake_tasks/rubyforge.rake b/rake_tasks/rubyforge.rake index 3a21bbf..dd86c14 100644 --- a/rake_tasks/rubyforge.rake +++ b/rake_tasks/rubyforge.rake @@ -1,18 +1,18 @@ RUBYFORGE_TRUNK_DIR = 'L:/rubyforge/trunk/coderay/trunk'
namespace :rubyforge do
-
- desc 'Export trunk to Rubyforge working copy via SVN'
- task :export do
- system 'svn st'
- puts 'Exporting changelog.'
- system 'svn log > ../changelog.txt'
- system "svn export #{`svn info`[/URL: (.*)/,1]}/ #{RUBYFORGE_TRUNK_DIR} --force"
- cp '../changelog.txt', "#{RUBYFORGE_TRUNK_DIR}/.."
- Dir.chdir RUBYFORGE_TRUNK_DIR do
- system "svn st"
- end
- end
+
+ desc 'Export trunk to Rubyforge working copy via SVN'
+ task :export do
+ system 'svn st'
+ puts 'Exporting changelog.'
+ system 'svn log > ../changelog.txt'
+ system "svn export #{`svn info`[/URL: (.*)/,1]}/ #{RUBYFORGE_TRUNK_DIR} --force"
+ cp '../changelog.txt', "#{RUBYFORGE_TRUNK_DIR}/.."
+ Dir.chdir RUBYFORGE_TRUNK_DIR do
+ system "svn st"
+ end
+ end
end
diff --git a/rake_tasks/statistic.rake b/rake_tasks/statistic.rake index eb49493..4923ed1 100644 --- a/rake_tasks/statistic.rake +++ b/rake_tasks/statistic.rake @@ -1,15 +1,15 @@ desc 'Report code statistics (LOC) from the application'
task :stats do
- require 'rake_helpers/code_statistics'
- CodeStatistics.new(
- ['Main', 'lib'],
- ['CodeRay', 'lib/{.,coderay}/'],
- [' Scanners', 'lib/coderay/scanners/**'],
- [' Encoders', 'lib/coderay/encoders/**'],
- [' Helpers', 'lib/coderay/helpers/**'],
- [' Styles', 'lib/coderay/styles/**'],
- ['Test', 'test'],
- [' Test Data', 'test/*/**', /\.in\./, false],
- ['Demo Tests', 'demo/**']
- ).print
+ require 'rake_helpers/code_statistics'
+ CodeStatistics.new(
+ ['Main', 'lib'],
+ ['CodeRay', 'lib/{.,coderay}/'],
+ [' Scanners', 'lib/coderay/scanners/**'],
+ [' Encoders', 'lib/coderay/encoders/**'],
+ [' Helpers', 'lib/coderay/helpers/**'],
+ [' Styles', 'lib/coderay/styles/**'],
+ ['Test', 'test'],
+ [' Test Data', 'test/*/**', /\.in\./, false],
+ ['Demo Tests', 'demo/**']
+ ).print
end
diff --git a/rake_tasks/test.rake b/rake_tasks/test.rake index 9a60c6b..0808edb 100644 --- a/rake_tasks/test.rake +++ b/rake_tasks/test.rake @@ -1,13 +1,13 @@ namespace :test do
- desc 'Test CodeRay Demos'
- task :demos do
- system 'ruby -wd ./demo/suite.rb'
- end
+ desc 'Test CodeRay Demos'
+ task :demos do
+ system 'ruby -wd ./demo/suite.rb'
+ end
- desc 'Test CodeRay'
- task :scanners do
- system 'ruby -w ./test/suite.rb'
- end
+ desc 'Test CodeRay'
+ task :scanners do
+ system 'ruby -w ./test/suite.rb'
+ end
end
task :test => 'test:scanners'
|