Class: Strata::CLI::Main

Inherits:
Thor
  • Object
show all
Extended by:
Helpers::DescriptionHelper
Includes:
AgentMode, Guard, Output
Defined in:
lib/strata/cli/main.rb

Constant Summary

Constants included from Output

Output::THEME

Constants included from Guard

Guard::ALLOWED_COMMANDS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers::DescriptionHelper

long_desc_from_file

Methods included from AgentMode

#agent_mode?, included, #reject_agent_mode!

Methods included from Output

format, pastel, print_error, #print_error, print_hint, #print_hint, print_info, #print_info, print_status, #print_status, print_success, #print_success, print_warning, #print_warning, shell_for, thor_color

Methods included from Guard

#invoke_command

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/strata/cli/main.rb', line 24

def self.exit_on_failure?
  true
end

Instance Method Details

#adaptersObject



59
60
61
62
# File 'lib/strata/cli/main.rb', line 59

def adapters
  out = " SUPPORTED ADAPTERS: \n\t#{DWH.adapters.keys.join("\n\t")}"
  print_info(out)
end

#init(project_name = nil) ⇒ Object



42
43
44
45
46
47
48
49
# File 'lib/strata/cli/main.rb', line 42

def init(project_name = nil)
  unless project_name || options[:source]
    raise Strata::CommandError, "PROJECT_NAME is required when not using --source option."
  end

  print_status(:created, (project_name || "project from source").to_s, type: :info)
  invoke Generators::Project, [project_name], options
end

#tutorialObject



54
55
56
# File 'lib/strata/cli/main.rb', line 54

def tutorial
  invoke Generators::Tutorial, [], options
end

#versionObject



29
30
31
# File 'lib/strata/cli/main.rb', line 29

def version
  say VERSION
end