lib/shuhari/app.rb in shuhari-0.1.0 vs lib/shuhari/app.rb in shuhari-0.1.1
- old
+ new
@@ -4,47 +4,52 @@
module Shuhari
class App < Thor
include Thor::Actions
include ProjectGeneration
- desc 'new [NAME]', 'Create a new Kata project'
+ if File.exists?('shuhari.yml')
- method_option :rspec, :type => :boolean, :aliases => '-r',
- :desc => 'Test using RSpec', :default => true
+ desc 'empty', 'Restart the Kata with empty mind and project'
+ def empty
+ @name = load_setting(:project_name)
+ @framework = load_setting(:test_framework)
+ clean_project
+ setup_source_paths
+ setup_code
+ end
- method_option :minitest, :type => :boolean, :aliases => '-m',
- :desc => 'Test using Minitest::Unit'
+ else
- method_option :minitest_spec, :type => :boolean, :aliases => '-s',
- :desc => 'Test using Minitest::Spec'
+ desc 'new [NAME]', 'Create a new Kata project'
- method_option :testunit, :type => :boolean, :aliases => '-t',
- :desc => 'Test using Test::Unit'
+ method_option :rspec, :type => :boolean, :aliases => '-r',
+ :desc => 'Test using RSpec', :default => true
- method_option :cucumber, :type => :boolean, :aliases => '-c',
- :desc => 'Test using Cucumber'
+ method_option :minitest, :type => :boolean, :aliases => '-m',
+ :desc => 'Test using Minitest::Unit'
- if Platform.unix?
- method_option :gemset, :type => :boolean, :aliases => '-g',
- :desc => 'Create .rvmrc to use a gemset', :default => Platform.rvm?
- end
+ method_option :minitest_spec, :type => :boolean, :aliases => '-s',
+ :desc => 'Test using Minitest::Spec'
- def new(name=nil)
- @name = name || ask('Project Name:')
- setup_source_paths
- inside snake_name, :verbose => true do
- self.destination_root = '.'
- create_project
+ method_option :testunit, :type => :boolean, :aliases => '-t',
+ :desc => 'Test using Test::Unit'
+
+ method_option :cucumber, :type => :boolean, :aliases => '-c',
+ :desc => 'Test using Cucumber'
+
+ if Platform.unix?
+ method_option :gemset, :type => :boolean, :aliases => '-g',
+ :desc => 'Create .rvmrc to use a gemset', :default => Platform.rvm?
end
- end
- desc 'empty', 'Restart the Kata with empty mind and project'
- def empty
- @name = load_setting(:project_name)
- @framework = load_setting(:test_framework)
- clean_project
- setup_source_paths
- setup_code
+ def new(name=nil)
+ @name = name || ask('Project Name:')
+ setup_source_paths
+ inside snake_name, :verbose => true do
+ self.destination_root = '.'
+ create_project
+ end
+ end
end
protected
def load_setting(name)