Class: Gemmy::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/gemmy/cli.rb

Overview

Command line interface

Run from command line:

gemmy <arguments>
e.g. gemmy help

Start from code with Gemmy::CLI.run

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(arguments: nil) ⇒ Object

Start the CLI

Parameters:

  • arguments (Array<String>) (defaults to: nil)

    passed to thor, defaults to ARGV



14
15
16
17
18
19
20
21
22
23
# File 'lib/gemmy/cli.rb', line 14

def self.run(arguments: nil)
  # Store a copy of the arguments.
  # The originals are shifted so they don't intefere with gets
  arguments ||= ARGV.clone
  ARGV.clear

  # Can't make this conditional on "__FILE__ == $0"
  # Because of the way gem executables are run
  start arguments
end

Instance Method Details

#make_gem(name) ⇒ Object



30
31
32
# File 'lib/gemmy/cli.rb', line 30

def make_gem(name)
  Gemmy::Tasks::MakeGem.run(name)
end

#testObject



37
38
39
# File 'lib/gemmy/cli.rb', line 37

def test
  Gemmy::Tests.run
end

#vObject



44
45
46
# File 'lib/gemmy/cli.rb', line 44

def v
  puts Gemmy::VERSION
end