Browse files

Renaming to report_card

  • Loading branch information...
1 parent 8e77abc commit 67f00297b98f7ff869bf0c32ca9dc9419ed0ae88 @qrush qrush committed Jul 8, 2009
View
7 README.textile
@@ -1,12 +1,11 @@
-h1. Pythagoras
+h1. report_card
Automatic building and reporting to campfire of metrics with metric_fu through integrity.
h2. Features
* Generates an entire metric_fu site for you based on your integrity projects
* Notifies campfire of metric stats given that they have changed since the last run
-* Calculates the hypotenuse of a triangle
h2. Requirements
@@ -22,15 +21,15 @@ It's probably best to do this on a cron job.
h2. Setup
-Have a config.yml file in your pythagoras directory with the following info:
+Have a config.yml file in your report_card directory with the following info:
<pre>
# This is the path to integrity's config.yml file.
integrity_config: /home/ci/integrity/config.yml
# Where you want the site to be placed that metric_fu creates
-site: /home/ci/pythagoras/_site
+site: /home/ci/report_card/_site
# A regular expression for project names you wish to ignore
ignore: '[^shoulda]|1\.9'
View
10 Rakefile
@@ -5,17 +5,17 @@ task :default => :test
desc "Generate metrics"
task :generate do
- require 'lib/pythagoras'
- Pythagoras.run
+ require 'lib/report_card'
+ ReportCard.run
end
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
- gem.name = "pythagoras"
+ gem.name = "report_card"
gem.summary = %Q{Automatic building and reporting of metrics with metric_fu through integrity}
gem.email = "nick@quaran.to"
- gem.homepage = "http://github.com/thoughtbot/pythagoras"
+ gem.homepage = "http://github.com/thoughtbot/report_card"
gem.authors = ["Nick Quaranto"]
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
@@ -54,7 +54,7 @@ Rake::RDocTask.new do |rdoc|
end
rdoc.rdoc_dir = 'rdoc'
- rdoc.title = "pythagoras #{version}"
+ rdoc.title = "report_card #{version}"
rdoc.rdoc_files.include('README*')
rdoc.rdoc_files.include('lib/**/*.rb')
end
View
6 lib/pythagoras.rb → lib/report_card.rb
@@ -3,9 +3,9 @@
require 'tinder'
$:.unshift(File.dirname(__FILE__))
-require 'pythagoras/runner'
+require 'report_card/runner'
-module Pythagoras
+module ReportCard
CONFIG_FILE = "config.yml"
def self.run
@@ -14,7 +14,7 @@ def self.run
ignore = config['ignore'] ? Regexp.new(config['ignore']) : /[^\w\d\s]+/
Integrity::Project.all.each do |project|
- Pythagoras::Runner.new(project, config).run if project.name !~ ignore
+ ReportCard::Runner.new(project, config).run if project.name !~ ignore
end
end
View
2 lib/pythagoras/runner.rb → lib/report_card/runner.rb
@@ -1,4 +1,4 @@
-module Pythagoras
+module ReportCard
class Runner
attr_reader :project, :config, :scores, :old_scores
View
30 test/pythagoras_test.rb → test/report_card_test.rb
@@ -1,10 +1,10 @@
require 'test_helper'
-class PythagorasTest < Test::Unit::TestCase
- context "running pythagoras" do
+class ReportCardTest < Test::Unit::TestCase
+ context "running report_card" do
setup do
@config = {'integrity_config' => '/path/to/integrity/config.yml'}
- stub(Pythagoras).config { @config }
+ stub(ReportCard).config { @config }
@project = Integrity::Project.new
end
@@ -14,8 +14,8 @@ class PythagorasTest < Test::Unit::TestCase
mock(Integrity).new(@config['integrity_config'])
mock(Integrity::Project).all.mock!.each.yields(@project)
- mock(Pythagoras::Runner).new(@project, @config).mock!.run
- Pythagoras.run
+ mock(ReportCard::Runner).new(@project, @config).mock!.run
+ ReportCard.run
end
should "not run if project name is ignored" do
@@ -24,8 +24,8 @@ class PythagorasTest < Test::Unit::TestCase
mock(Integrity).new(@config['integrity_config'])
mock(Integrity::Project).all.mock!.each.yields(@project)
- mock(Pythagoras::Runner).new(@project, @config).never
- Pythagoras.run
+ mock(ReportCard::Runner).new(@project, @config).never
+ ReportCard.run
end
end
@@ -35,29 +35,29 @@ class PythagorasTest < Test::Unit::TestCase
end
should "load if file exists" do
- mock(File).exist?(Pythagoras::CONFIG_FILE) { true }
- mock(YAML).load_file(Pythagoras::CONFIG_FILE) { @config }
- assert_equal @config, Pythagoras.config
+ mock(File).exist?(ReportCard::CONFIG_FILE) { true }
+ mock(YAML).load_file(ReportCard::CONFIG_FILE) { @config }
+ assert_equal @config, ReportCard.config
end
should "not load if file does not exist" do
- mock(File).exist?(Pythagoras::CONFIG_FILE) { false }
- mock(YAML).load_file(Pythagoras::CONFIG_FILE).never
+ mock(File).exist?(ReportCard::CONFIG_FILE) { false }
+ mock(YAML).load_file(ReportCard::CONFIG_FILE).never
mock(Kernel).abort(anything)
- Pythagoras.config
+ ReportCard.config
end
end
context "setting up" do
setup do
@config = {'site' => '/path/to/site'}
- stub(Pythagoras).config { @config }
+ stub(ReportCard).config { @config }
end
should "move files from the template over" do
mock(FileUtils).mkdir_p(@config['site'])
mock(FileUtils).cp(is_a(Array), @config['site'])
- Pythagoras.setup
+ ReportCard.setup
end
end
end
View
2 test/runner_test.rb
@@ -6,7 +6,7 @@ class RunnerTest < Test::Unit::TestCase
@project = Integrity::Project.new(:name => "awesome")
@config = {'url' => 'http://metrics.thoughtbot.com',
'site' => '/path/to/site'}
- @runner = Pythagoras::Runner.new(@project, @config)
+ @runner = ReportCard::Runner.new(@project, @config)
stub(STDERR).puts(anything)
end
View
2 test/test_helper.rb
@@ -11,7 +11,7 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
-require 'pythagoras'
+require 'report_card'
class Test::Unit::TestCase
include RR::Adapters::TestUnit

0 comments on commit 67f0029

Please sign in to comment.