Class: Squareone::Cli

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/squareone/cli.rb', line 27

def self.exit_on_failure?
  true
end

Instance Method Details

#new(path) ⇒ Object

Raises:

  • (Error)


16
17
18
19
20
21
22
23
24
25
# File 'lib/squareone/cli.rb', line 16

def new(path)
  project_root = File.expand_path(path)
  raise Error, set_color("ERROR: #{path} already exists.", :red) if File.exist?(path)

  say set_color("Creating project #{path}...", :green)

  generator = Squareone::Generator.new
  generator.destination_root = project_root
  generator.invoke_all
end

#versionObject

Display gem USAGE: squareone -v



9
10
11
# File 'lib/squareone/cli.rb', line 9

def version
  say "squareone #{Squareone::VERSION}"
end