class Danger::DangerfileGem
Public Class Methods
Source
# File lib/danger/commands/dangerfile/gem.rb, line 7 def self.description <<-DESC Creates a scaffold for the development of a new gem based Dangerfile named `NAME` according to the best practices. DESC end
Source
# File lib/danger/commands/dangerfile/gem.rb, line 18 def initialize(argv) @name = argv.shift_argument prefix = "dangerfile" + "-" unless @name.nil? || @name.empty? || @name.start_with?(prefix) @name = prefix + @name.dup end @template_url = argv.shift_argument super end
Calls superclass method
Public Instance Methods
Source
# File lib/danger/commands/dangerfile/gem.rb, line 37 def run runner = CLAide::TemplateRunner.new(@name, "https://github.com/danger/dangerfile-gem-template") runner.clone_template runner.configure_template end
Source
# File lib/danger/commands/dangerfile/gem.rb, line 28 def validate! super if @name.nil? || @name.empty? help! "A name for the plugin is required." end help! "The plugin name cannot contain spaces." if @name =~ /\s/ end
Calls superclass method