Created
January 27, 2015 21:39
-
-
Save naag/0ada5e7cf852e05bf4b7 to your computer and use it in GitHub Desktop.
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
class Foo < Thor::Group | |
include Thor::Actions | |
# Define arguments and options | |
argument :name | |
class_option :test_framework, :default => :test_unit | |
def self.source_root | |
File.dirname(__FILE__) | |
end | |
#def create_lib_file | |
# template('templates/newgem.tt', "#{name}/lib/#{name}.rb") | |
#end | |
def create_test_file | |
test = options[:test_framework] == "rspec" ? :spec : :test | |
create_file "#{name}/#{test}/#{name}_#{test}.rb" | |
end | |
def copy_licence | |
if yes?("Use MIT license?") | |
# Make a copy of the MITLICENSE file at the source root | |
# copy_file "MITLICENSE", "#{name}/MITLICENSE" | |
else | |
say "Shame on you…", :red | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment