-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conflicts: spec/spec_helpers.rb
- Loading branch information
Showing
57 changed files
with
1,038 additions
and
620 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
doc | ||
doc | ||
pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,126 +1,8 @@ | ||
require 'rake' | ||
require 'rake/testtask' | ||
require 'hanna/rdoctask' | ||
require 'spec/rake/spectask' | ||
require 'spec/rake/verify_rcov' | ||
require 'rake/contrib/rubyforgepublisher' | ||
|
||
Rake::TestTask.new do |t| | ||
t.libs << "test" | ||
t.test_files = FileList['test/**/*test*.rb'] | ||
t.verbose = true | ||
Dir.glob("rake_tasks/**/*.rb").each do |file| | ||
require file | ||
end | ||
|
||
desc 'Default: run unit tests.' | ||
desc 'Default: run unit tests (specs + tests).' | ||
task :default => [:spec, :test] | ||
|
||
# Create specs + Rake Task | ||
|
||
def doc_directory | ||
"doc" | ||
end | ||
|
||
desc 'Generate documentation for the fixture_replacement plugin.' | ||
Rake::RDocTask.new(:rdoc_without_analytics) do |rdoc| | ||
rdoc.rdoc_dir = doc_directory | ||
rdoc.title = 'FixtureReplacement' | ||
rdoc.options << '--line-numbers' << '--inline-source' | ||
|
||
rdoc.options << '--webcvs=http://github.com/smtlaissezfaire/fixturereplacement/tree/master/' | ||
|
||
[ | ||
"README.rdoc", | ||
"CHANGELOG.rdoc", | ||
"GPL_LICENSE", | ||
"MIT_LICENSE", | ||
"contributions.rdoc", | ||
"philosophy_and_bugs.rdoc", | ||
"lib/**/*.rb" | ||
].each do |file| | ||
rdoc.rdoc_files.include(file) | ||
end | ||
end | ||
|
||
task :rdoc => [:rdoc_without_analytics] do | ||
google_analytics = File.read(File.dirname(__FILE__) + "/etc/google_analytics") | ||
rdoc_index = File.dirname(__FILE__) + "/#{doc_directory}/index.html" | ||
|
||
contents = File.read(rdoc_index) | ||
contents.gsub!("</head>", "#{google_analytics}\n</head>") | ||
|
||
File.open(rdoc_index, "r+") do |file| | ||
file.write(contents) | ||
end | ||
end | ||
|
||
task :rerdoc => [:clobber_rdoc, :rdoc] | ||
task :clobber_rdoc => [:clobber_rdoc_without_analytics] | ||
|
||
desc 'Run the specs' | ||
Spec::Rake::SpecTask.new do |t| | ||
t.warning = false | ||
t.spec_opts = ["--color"] | ||
end | ||
|
||
desc 'Publish the website, building the docs first' | ||
task :publish_website => [:build_docs] do | ||
publisher = Rake::SshDirPublisher.new( | ||
"[email protected]", | ||
"/var/www/gforge-projects/replacefixtures/", | ||
"doc" | ||
) | ||
publisher.upload | ||
end | ||
|
||
def create_doc_directory | ||
unless File.exists?(doc_directory) | ||
`mkdir doc` | ||
end | ||
end | ||
|
||
task :create_doc_directory do | ||
create_doc_directory | ||
end | ||
|
||
desc "Create the html specdoc" | ||
Spec::Rake::SpecTask.new(:specdoc => :create_doc_directory) do |t| | ||
t.spec_opts = ["--format", "html:doc/specdoc.html"] | ||
end | ||
|
||
desc 'Create the specdoc + rdoc' | ||
task :build_docs => [:rerdoc, :specdoc, :rcov, :flog_to_disk] | ||
|
||
desc "Run all examples with RCov" | ||
Spec::Rake::SpecTask.new(:rcov) do |t| | ||
t.rcov = true | ||
t.rcov_opts = ['--exclude', 'spec', '--exclude', 'gems'] | ||
t.rcov_dir = "doc/rcov" | ||
end | ||
|
||
desc "Feel the pain of my code, and submit a refactoring patch" | ||
task :flog do | ||
puts %x(find lib | grep ".rb$" | xargs flog) | ||
end | ||
|
||
task :flog_to_disk => :create_doc_directory do | ||
puts "Flogging..." | ||
%x(find lib | grep ".rb$" | xargs flog > doc/flog.txt) | ||
puts "Done Flogging...\n" | ||
end | ||
|
||
def sloc | ||
`sloccount #{File.dirname(__FILE__)}/lib` | ||
end | ||
|
||
desc "Output sloccount report. You'll need sloccount installed." | ||
task :sloc do | ||
puts "Counting lines of code" | ||
puts sloc | ||
end | ||
|
||
desc "Write sloccount report" | ||
task :output_sloc => :create_doc_directory do | ||
File.open(File.dirname(__FILE__) + "/doc/lines_of_code.txt", "w") do |f| | ||
f << sloc | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
<script type="text/javascript"> | ||
_uacct = "UA-3080808-2"; | ||
urchinTracker(); | ||
</script> | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.