Permalink
Browse files

nuke task: last fix broke nuking singular controllers. works now.

fixtures had wrong extensions, now nuking correctly.
Since fixtures are pluralized when generating a model, the
remove command has been left pluralized.

Signed-off-by: Brian Hogan / New Auburn Personal Computer Services <bphogan@gmail.com>
  • Loading branch information...
1 parent b5ad683 commit b972e08770a7d408d085c6261dbd2d15c7c6ced1 @csmosx csmosx committed with Jul 29, 2009
Showing with 11 additions and 4 deletions.
  1. +6 −0 CHANGES
  2. +5 −4 tasks/nuke.rake
View
@@ -1,3 +1,9 @@
+1.1.8
+ * nuke now assumes singular inflection for model files of given name
+ * fixtures are nuked as well
+ * now nuking test/unit/helpers tests along with the model
+ * list of deleted files now prints to command line
+ * removed usage of 'git rm' as unnecessary & did not work with files untracked by git
1.1.7
* Added support for checking coverage for model specs, controller specs, view specs, helper specs, and specs for files in the lib folder.
* copied rcov:* tasks to "test" namespace and deprecating old ones.
View
@@ -5,7 +5,7 @@ namespace :nuke do
root = t.name.gsub("nuke:", "").split(/:/)
type = root[0]
- file = root[1].classify.tableize
+ file = root[1].underscore
puts "Nuking #{type} named #{file}"
@@ -35,12 +35,12 @@ namespace :nuke do
end
def nuke_model(f)
- s = f.singularize
+ p = f.classify.tableize
+ s = p.singularize
remove "app/models/#{s}.rb"
remove "spec/models/#{s}_spec.rb"
remove "test/unit/#{s}_test.rb"
- remove "test/fixtures/#{f}.yaml" #plural
- remove "test/unit/helpers/#{f}_helper_test.rb" #plural
+ remove "test/fixtures/#{p}.yml" #plural
end
def nuke_helper(f)
@@ -52,6 +52,7 @@ namespace :nuke do
remove "app/controllers/#{f}_controller.rb"
remove "spec/controllers/#{f}_controller_spec.rb"
remove "test/functional/#{f}_controller_test.rb"
+ remove "test/unit/helpers/#{f}_helper_test.rb"
end
def remove(file)

0 comments on commit b972e08

Please sign in to comment.