Class: AstroboaCLI::Command::Base

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/astroboa-cli/command/base.rb

Direct Known Subclasses

Help, Model, Repository, Server, Service, Version

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Util

#ask, #astroboa_running?, #check_if_running_with_sudo, #create_postgresql_db, #delete_file_content_between_regex, #delete_file_lines, #dir_writable?, #display, #drop_postgresql_db, #error, #extract_archive_command, #fail, #format_with_bang, #gem_available?, #get_password, #get_postgresql_config, #get_server_conf_file, #get_server_configuration, #has_executable, #has_executable_with_version, #has_version_in_grep, #jruby_ok?, #jruby_version_ok?, #linux?, #load_pg_library, #longest, #mac_os_x?, #output_with_bang, #postgres_connectivity?, #process_os_command, #render_template_to_file, #repository?, #repository_in_repos_config?, #repository_in_server_config?, #ruby_ok?, #ruby_version_ok?, #running_with_sudo?, #runs_with_jruby?, #save_server_configuration, #shell, #strip_text_nodes, #unzip_file, #windows?, #write_xml

Constructor Details

#initialize(args = [], options = {}) ⇒ Base

Returns a new instance of Base.



46
47
48
49
50
51
52
53
54
55
56
# File 'lib/astroboa-cli/command/base.rb', line 46

def initialize(args=[], options={})
  @args = args
  @options = options
  
  @log_file = '/tmp/astroboa-cli-log.txt'
  @log = Logger.new(@log_file)
  @log.level = Logger::INFO
  
  # Check if the proper version of ruby is running
  ruby_ok?
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



41
42
43
# File 'lib/astroboa-cli/command/base.rb', line 41

def args
  @args
end

#logObject (readonly)

Returns the value of attribute log.



43
44
45
# File 'lib/astroboa-cli/command/base.rb', line 43

def log
  @log
end

#log_fileObject (readonly)

Returns the value of attribute log_file.



44
45
46
# File 'lib/astroboa-cli/command/base.rb', line 44

def log_file
  @log_file
end

#optionsObject (readonly)

Returns the value of attribute options.



42
43
44
# File 'lib/astroboa-cli/command/base.rb', line 42

def options
  @options
end

Class Method Details

.namespaceObject



37
38
39
# File 'lib/astroboa-cli/command/base.rb', line 37

def self.namespace
  self.to_s.split("::").last.downcase
end