summaryrefslogtreecommitdiff
path: root/rake_tasks
diff options
context:
space:
mode:
authorKornelius Kalnbach <murphy@rubychan.de>2013-06-13 05:31:14 +0200
committerKornelius Kalnbach <murphy@rubychan.de>2013-06-13 05:31:14 +0200
commit8e67efef5b412b16d755fb47538e24a2b6bafce0 (patch)
tree4ae1a06099c0e5605eac9ec3aca1943fb9d06b88 /rake_tasks
parent6936def023edcdd3c10be99ecb955778f537f42b (diff)
downloadcoderay-8e67efef5b412b16d755fb47538e24a2b6bafce0.tar.gz
cleanup rake tasks
Diffstat (limited to 'rake_tasks')
-rw-r--r--rake_tasks/bundler.rake6
-rw-r--r--rake_tasks/diff.rake93
-rw-r--r--rake_tasks/documentation.rake9
-rw-r--r--rake_tasks/ruby-versions.rake10
4 files changed, 0 insertions, 118 deletions
diff --git a/rake_tasks/bundler.rake b/rake_tasks/bundler.rake
deleted file mode 100644
index 8de149d..0000000
--- a/rake_tasks/bundler.rake
+++ /dev/null
@@ -1,6 +0,0 @@
-begin
- require 'bundler'
- Bundler::GemHelper.install_tasks
-rescue LoadError
- puts 'Please gem install bundler.'
-end
diff --git a/rake_tasks/diff.rake b/rake_tasks/diff.rake
deleted file mode 100644
index f0af55a..0000000
--- a/rake_tasks/diff.rake
+++ /dev/null
@@ -1,93 +0,0 @@
-# A simple differ using svn. Handles externals.
-class Differ < Hash
-
- include Rake::DSL if defined? Rake::DSL
-
- def initialize path
- @path = path
- super 0
- end
-
- def count key, value
- self[key] += value
- value
- end
-
- FORMAT = ' %-30s %8d lines, %3d changes in %2d files'
-
- def scan(path = @path)
- Dir.chdir path do
- diff_file_name = 'diff'
- if File.directory? 'diff'
- diff_file_name = 'diff.diff'
- end
- system "svn diff > #{diff_file_name}"
- if File.size? diff_file_name
- puts FORMAT %
- [
- path,
- count(:LOC, `wc -l #{diff_file_name}`.to_i),
- count(:changes, `grep ^@@ #{diff_file_name} | wc -l`.to_i),
- count(:files, `grep ^Index #{diff_file_name} | wc -l`.to_i),
- ]
- else
- rm diff_file_name
- end
- end
- end
-
- def scan_with_externals(path = @path)
- scan path
- `svn status`.scan(/^X\s*(.*)/) do |external,|
- scan external
- end
- end
-
- def clean(path = @path)
- Dir.chdir path do
- rm 'diff' if File.file? 'diff'
- rm 'diff.diff' if File.file? 'diff.diff'
- end
- end
-
- def clean_with_externals(path = @path)
- clean path
- `svn status`.scan(/^X\s*(.*)/) do |external,|
- clean external
- end
- end
-
- def differences?
- self[:LOC] > 0
- end
-
- def inspect
- FORMAT %
- [ 'Total', self[:LOC], self[:changes], self[:files] ]
- end
-
-end
-
-namespace :diff do
-
- desc 'Make a diff and print a summary'
- task :summary do
- differ = Differ.new '.'
- differ.scan_with_externals
- if differ.empty?
- puts 'No differences found.'
- else
- p differ
- end
- end
-
- desc 'Remove all diffs'
- task :clean do
- differ = Differ.new '.'
- differ.clean_with_externals
- end
-
-end
-
-desc 'Make a diff and print a summary'
-task :diff => 'diff:summary'
diff --git a/rake_tasks/documentation.rake b/rake_tasks/documentation.rake
index d555022..4f7cef7 100644
--- a/rake_tasks/documentation.rake
+++ b/rake_tasks/documentation.rake
@@ -15,18 +15,9 @@ Rake::RDocTask.new :doc do |rd|
rd.title = 'CodeRay Documentation'
rd.options << '--line-numbers' << '--tab-width' << '2'
- # rd.options << '--fmt' << ENV.fetch('format', 'html_coderay')
- # require 'pathname'
- # template = File.join ROOT, 'rake_helpers', 'coderay_rdoc_template.rb'
- # rd.template = Pathname.new(template).expand_path.to_s
rd.main = 'README_INDEX.rdoc'
rd.rdoc_files.add 'README_INDEX.rdoc'
rd.rdoc_files.add Dir['lib']
rd.rdoc_dir = 'doc'
end if defined? Rake::RDocTask
-
-desc 'Copy the documentation over to the CodeRay website'
-task :copy_doc do
- cp_r 'doc/.', '../../rails/coderay/public/doc'
-end
diff --git a/rake_tasks/ruby-versions.rake b/rake_tasks/ruby-versions.rake
deleted file mode 100644
index af408ff..0000000
--- a/rake_tasks/ruby-versions.rake
+++ /dev/null
@@ -1,10 +0,0 @@
-task 'ruby:version' do
- puts
- if defined? RUBY_DESCRIPTION
- ruby_version = RUBY_DESCRIPTION
- else
- ruby_version = "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE} patchlevel #{RUBY_PATCHLEVEL}) [#{RUBY_PLATFORM}]"
- end
- require './test/lib/term/ansicolor'
- puts Term::ANSIColor.bold(Term::ANSIColor.green(ruby_version))
-end \ No newline at end of file