Class: SinatraToTheMoon::CLI

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/sinatra_to_the_moon/cli.rb', line 12

def self.exit_on_failure?
  true
end

Instance Method Details

#new(app_name) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/sinatra_to_the_moon/cli.rb', line 28

def new(app_name)
  profile = selected_profile
  files = Generator.generate(
    name: app_name,
    profile: profile,
    force: options[:force],
    dry_run: options[:dry_run]
  )

  action = options[:dry_run] ? "would create" : "created"
  files.each { |file| say("#{action}  #{file}", :green) }
  say "\nReady for launch: #{launch_command(app_name, profile)}"
rescue Error => e
  raise Thor::Error, e.message
end

#versionObject



45
46
47
# File 'lib/sinatra_to_the_moon/cli.rb', line 45

def version
  say SinatraToTheMoon::VERSION
end