Class: Arethusa::CLI
- Inherits:
-
Thor
- Object
- Thor
- Arethusa::CLI
show all
- Includes:
- Thor::Actions
- Defined in:
- lib/arethusa/cli.rb,
lib/arethusa/cli/version.rb,
lib/arethusa/cli/generator.rb,
lib/arethusa/cli/subcommand.rb,
lib/arethusa/cli/transformer.rb,
lib/arethusa/cli/helpers/name_handler.rb,
lib/arethusa/cli/helpers/directories_and_files.rb
Defined Under Namespace
Modules: Helpers
Classes: Generator, Subcommand, Transformer
Constant Summary
collapse
- VERSION =
"0.1.17"
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.source_root ⇒ Object
16
17
18
|
# File 'lib/arethusa/cli.rb', line 16
def self.source_root
File.join(File.dirname(__FILE__), 'cli')
end
|
Instance Method Details
#build ⇒ Object
26
27
28
29
30
31
32
|
# File 'lib/arethusa/cli.rb', line 26
def build
minify if options[:minify]
empty_directory('deployment')
@filename = "#{tar_name}#{ending}"
create_tgz
say_status(:built, archive_path)
end
|
#deploy(address, directory) ⇒ Object
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
# File 'lib/arethusa/cli.rb', line 67
def deploy(address, directory)
@address = address
@directory = options[:commit] ? File.join(directory, short_sha).strip : directory
@ssh_options = options[:options]
@archive = options[:file]
@environment = options[:environment]
if options[:sudo]
@sudo = true
@user = @address.split('@').first
end
@small = options[:small]
minify if options[:minify] &! @archive
create_deploy_directory
execute
use_deployment_helper if @environment
say_status(:deployed, "at #{@address} - #{@directory}")
end
|
#init(namespace, name) ⇒ Object
107
108
109
110
111
112
113
114
115
116
117
118
|
# File 'lib/arethusa/cli.rb', line 107
def init(namespace, name)
@name = name
@namespace = namespace
inside namespaced_name do
init_git
create_folder_hierarchy
create_templates
initial_commit
install
end
end
|
#merge(file) ⇒ Object
94
95
96
97
98
99
100
101
102
103
104
|
# File 'lib/arethusa/cli.rb', line 94
def merge(file)
@conf = read_conf(file)
@conf_dir = options[:base_path] || config_dir
traverse_and_include(@conf)
if options[:minify]
puts @conf.to_json
else
puts JSON.pretty_generate(@conf, indent: ' ')
end
end
|
#version ⇒ Object
35
36
37
|
# File 'lib/arethusa/cli.rb', line 35
def version
puts Arethusa::CLI::VERSION
end
|