Class: Arli::Commands::Base
- Inherits:
-
Object
- Object
- Arli::Commands::Base
show all
- Includes:
- Helpers::Output
- Defined in:
- lib/arli/commands/base.rb
Constant Summary
Helpers::Output::CHAR_FAILURE, Helpers::Output::CHAR_SUCCESS
Instance Attribute Summary collapse
Instance Method Summary
collapse
#___, #__p, #__pf, #__pt, #abort?, #action_fail, #action_ok, #backup?, #cursor, #debug, #debug?, disable!, enable!, enabled?, #error, #fuck, #header, #hr, #indent_cursor, #info, #ok, #overwrite?, #print_action_failure, #print_action_starting, #print_action_success, #print_target_dir, #quiet?, #raise_invalid_arli_command!, #report_exception, #verbose?
Constructor Details
#initialize(config: Arli.config) ⇒ Base
Returns a new instance of Base.
16
17
18
19
|
# File 'lib/arli/commands/base.rb', line 16
def initialize(config: Arli.config)
self.config = config
setup
end
|
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
14
15
16
|
# File 'lib/arli/commands/base.rb', line 14
def config
@config
end
|
#name ⇒ Object
Returns the value of attribute name.
14
15
16
|
# File 'lib/arli/commands/base.rb', line 14
def name
@name
end
|
Instance Method Details
#library_path ⇒ Object
29
30
31
|
# File 'lib/arli/commands/base.rb', line 29
def library_path
config.libraries.path
end
|
#params ⇒ Object
47
48
49
|
# File 'lib/arli/commands/base.rb', line 47
def params
''
end
|
#run(*args) ⇒ Object
42
43
44
45
|
# File 'lib/arli/commands/base.rb', line 42
def run(*args)
raise Arli::Errors::AbstractMethodCalled,
'This method must be implemented in subclasses'
end
|
#runtime ⇒ Object
21
22
23
|
# File 'lib/arli/commands/base.rb', line 21
def runtime
config.runtime
end
|
#setup ⇒ Object
37
38
39
40
|
# File 'lib/arli/commands/base.rb', line 37
def setup
FileUtils.mkdir_p(library_path) unless Dir.exist?(library_path)
FileUtils.mkdir_p(temp_path) unless Dir.exist?(temp_path)
end
|
#temp_path ⇒ Object
33
34
35
|
# File 'lib/arli/commands/base.rb', line 33
def temp_path
config.libraries.temp_dir
end
|