class GGem::CLI::GenerateCommand

Public Instance Methods

help() click to toggle source
# File lib/ggem/cli/commands.rb, line 136
def help
  "Usage: ggem generate [options] GEM-NAME\n\n" \
  "Options: #{@clirb}\n" \
  "Description:\n" \
  "  #{summary}"
end
run(argv, *args) click to toggle source
Calls superclass method
# File lib/ggem/cli/commands.rb, line 115
def run(argv, *args)
  super

  begin
    require "ggem/gem"
    path = GGem::Gem.new(Dir.pwd, @clirb.args.first).save!.path
    @stdout.puts "created gem in #{path}"
  rescue GGem::Gem::NoNameError => ex
    error = ArgumentError.new("GEM-NAME must be provided")
    error.set_backtrace(ex.backtrace)
    raise error
  end

  @repo = GGem::GitRepo.new(path)
  notify("initialized gem git repo"){ @repo.run_init_cmd }
end
summary() click to toggle source
# File lib/ggem/cli/commands.rb, line 132
def summary
  "Create a gem given a GEM-NAME"
end