lib/ronin/gen/generators/library.rb in ronin-gen-1.0.0.pre1 vs lib/ronin/gen/generators/library.rb in ronin-gen-1.0.0.pre2

- old
+ new

@@ -59,12 +59,19 @@ class_option :version, :type => :string, :default => DEFAULT_VERSION class_option :author, :type => :string, :default => DEFAULT_AUTHOR class_option :email, :type => :string, :default => DEFAULT_EMAIL class_option :homepage, :type => :string, :default => DEFAULT_HOMEPAGE - class_option :commands, :type => :array, :default => [] - class_option :generators, :type => :array, :default => [] + + class_option :commands, :type => :array, + :default => [], + :banner => 'NAME [...]' + + class_option :generators, :type => :array, + :default => [], + :banner => 'NAME [...]' + class_option :no_git, :type => :boolean def setup @name = (options[:name] || File.basename(self.path)) @dir_name = @name.gsub(/^ronin[-_]/,'') @@ -85,11 +92,11 @@ # # Generates top-level files. # def generate unless options[:no_git] - run("git init #{self.destination_root}") + run "git init #{self.destination_root}" end erb File.join('ronin','gen','library','Gemfile.erb'), 'Gemfile' cp File.join('ronin','gen','library','Rakefile'), 'Rakefile' @@ -154,10 +161,10 @@ end # # Generates any optional commands for the library. # - def command_line + def commands unless options[:commands].empty? mkdir COMMANDS_DIR options[:commands].each do |name| @command_file = name.downcase.gsub(/[_-]+/,'_')