Class: GemBootstrap::CLI Private

Inherits:
Object
  • Object
show all
Defined in:
lib/gem-bootstrap/cli.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

MISSING_GH_USERNAME =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'Unable to determine GitHub username, use --github-username option'
GEM_NAME_NOT_AVAILABLE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

"The gem name `%s' is not available."
RUBYGEMS_URI =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

'https://rubygems.org/api/v1/gems/%s.json'

Instance Method Summary collapse

Constructor Details

#initialize(io: Io.new) ⇒ CLI

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CLI.

Parameters:

  • io (Io) (defaults to: Io.new)


20
21
22
23
24
# File 'lib/gem-bootstrap/cli.rb', line 20

def initialize(io: Io.new)
  @io = io
  @shell = ShellHelper.new(io: io)
  @gh = GitHubHelper.new
end

Instance Method Details

#run(args) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/gem-bootstrap/cli.rb', line 26

def run(args)
  catch(:exit) do
    options = OptionParser.new.parse(args)
    config = build_config(options)
    generate_src(config)

    throw :exit, 0 if options.source?

    bundle_install(config)
    ensure_gem_name_available(config)
    setup_github_repo(config)

    0
  end
end