lib/volt/cli/generate.rb in volt-0.8.27.beta3 vs lib/volt/cli/generate.rb in volt-0.8.27.beta4

- old
+ new

@@ -16,9 +16,24 @@ component_folder = Dir.pwd + "/app/#{name}" @component_name = name directory('component', component_folder, component_name: name) end + + desc 'gem GEM', 'Creates a component gem where you can share a component' + method_option :bin, type: :boolean, default: false, aliases: '-b', banner: 'Generate a binary for your library.' + method_option :test, type: :string, lazy_default: 'rspec', aliases: '-t', banner: "Generate a test directory for your library: 'rspec' is the default, but 'minitest' is also supported." + method_option :edit, type: :string, aliases: '-e', + lazy_default: [ENV['BUNDLER_EDITOR'], ENV['VISUAL'], ENV['EDITOR']].find { |e| !e.nil? && !e.empty? }, + required: false, banner: '/path/to/your/editor', + desc: 'Open generated gemspec in the specified editor (defaults to $EDITOR or $BUNDLER_EDITOR)' + + def gem(name) + require 'volt/cli/new_gem' + + NewGem.new(self, name, options) + end + def self.source_root File.expand_path(File.join(File.dirname(__FILE__), '../../../templates')) end end