Skip to content

Commit

Permalink
Added shame task to the Rakefile.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://rubyforge.org/var/svn/rake/trunk@577 5af023f1-ac1a-0410-98d6-829a145c37ef
  • Loading branch information
jimweirich committed Oct 26, 2006
1 parent e3a5073 commit 05a9e50
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* Added rake_extension to handle detection of extension collisions.
* Added test for noop, bad_option and verbose flags to sh command.
* Removed dependency on internal fu_xxx functions from FileUtils.
* Added a 'shame' task to the Rakefile.

== Version 0.7.1

Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ rd = Rake::RDocTask.new("rdoc") { |rdoc|
rdoc.rdoc_dir = 'html'
# rdoc.template = 'kilmer'
# rdoc.template = 'css2'
rdoc.template = '/home/jim/working/rubyforge/rake/doc/jamis.rb'
rdoc.template = 'doc/jamis.rb'
rdoc.title = "Rake -- Ruby Make"
rdoc.options << '--line-numbers' << '--inline-source' <<
'--main' << 'README' <<
Expand Down Expand Up @@ -345,7 +345,7 @@ task :update_version => [:prerelease] do
if ENV['RELTEST']
announce "Release Task Testing, skipping commiting of new version"
else
sh %{cvs commit -m "Updated to version #{PKG_VERSION}" lib/rake.rb}
sh %{cvs commit -m "Updated to version #{PKG_VERSION}" lib/rake.rb} # "
end
end
end
Expand Down
18 changes: 18 additions & 0 deletions doc/rakefile.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,24 @@ resolve in different locations.
# "one:run" => "one:run"
# "one:two:run" => "one:two:run"

== FileLists

FileLists are the way Rake manages lists of files. You can treat a
FileList as an array of strings for the most part, but FileLists
support some additional operations.

=== Creating a FileList

Creating a file list is easy. Just give it the list of file names:

fl = FileList['file1.rb', file2.rb']

Or give it a glob pattern:

fl = FileList['*.rb']



== Odds and Ends

=== do/end verses { }
Expand Down
19 changes: 19 additions & 0 deletions rakelib/shame.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env ruby
# -*- ruby -*-

begin
require 'rbosax'
require 'code_statistics'

task :shame do
stats = CodeStatistics.new(['Rake', 'lib'], ['Unit tests', 'test'])
code = stats.send :calculate_code
tests = stats.send :calculate_tests
ichat = OSA.app('ichat')
msg = "Rake Code To Test Ratio: 1:#{sprintf("%.1f", tests.to_f/code)}"
ichat.status_message = msg
$stderr.puts %|iChat status set to: #{msg.inspect}|
end
rescue LoadError
end

0 comments on commit 05a9e50

Please sign in to comment.