Skip to content

Commit

Permalink
Ensure config/defaults.reek is rebuilt when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrutherford committed Mar 7, 2009
1 parent 61952aa commit bdf5c21
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 0 additions & 2 deletions tasks/deployment.rake
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,3 @@ task :check_version do
exit
end
end

task 'package' => 'cruise'
14 changes: 10 additions & 4 deletions tasks/develop.rake
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,24 @@ require 'reek/smells/smells'
require 'yaml'

CONFIG_DIR = 'config'
CONFIG_FILE = "#{CONFIG_DIR}/defaults.reek"

CLOBBER.include(CONFIG_DIR)

directory CONFIG_DIR

desc 'creates the default config file'
task 'mkconfig' => [CONFIG_DIR] do
file CONFIG_FILE => [CONFIG_DIR] do
config = {}
Reek::SmellConfig::SMELL_CLASSES.each do |klass|
config[klass.name.split(/::/)[-1]] = klass.default_config
end
File.open("#{CONFIG_DIR}/defaults.reek", 'w') { |f| YAML.dump(config, f) }
$stderr.puts "Creating #{CONFIG_FILE}"
File.open(CONFIG_FILE, 'w') { |f| YAML.dump(config, f) }
end

task CONFIG_FILE => FileList['lib/reek/smells']

namespace 'git' do

task 'github' do
Expand All @@ -32,6 +36,8 @@ namespace 'git' do
end

desc 'runs the unit and integration tests'
task 'cruise' => %w{clobber mkconfig rspec:all}
task 'cruise' => ['clobber', 'rspec:all']

task 'spec' => ['mkconfig']
task 'rspec:fast' => [CONFIG_FILE]
task 'rspec:all' => [CONFIG_FILE]
task 'reek' => [CONFIG_FILE]

0 comments on commit bdf5c21

Please sign in to comment.