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.7"
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
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# File 'lib/arethusa/cli.rb', line 60
def deploy(address, directory)
@address = address
@directory = options[:commit] ? File.join(directory, short_sha) : directory
@ssh_options = options[:options]
@archive = options[:file]
@sudo = options[:sudo] ? 'sudo ' : ''
@small = options[:small]
minify if options[:minify] &! @archive
execute
say_status(:deployed, "at #{@address} - #{@directory}")
end
|
#init(namespace, name) ⇒ Object
92
93
94
95
96
97
98
99
100
101
102
103
|
# File 'lib/arethusa/cli.rb', line 92
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
79
80
81
82
83
84
85
86
87
88
89
|
# File 'lib/arethusa/cli.rb', line 79
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
|