Class: Bovem::Shell

Inherits:
Object
  • Object
show all
Includes:
Bovem::ShellMethods::Directories, Bovem::ShellMethods::Execute, Bovem::ShellMethods::General, Bovem::ShellMethods::Read, Bovem::ShellMethods::Write, Lazier::I18n
Defined in:
lib/bovem/shell.rb

Overview

A utility class for most common shell operation.

Instance Attribute Summary (collapse)

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from Bovem::ShellMethods::Directories

#create_directories, #within_directory

Methods included from Bovem::ShellMethods::Execute

#delete, #run

Methods included from Bovem::ShellMethods::Write

#copy, #copy_or_move, #move

Methods included from Bovem::ShellMethods::Read

#check, #find

Methods included from Bovem::ShellMethods::General

#handle_failure, #show_general_failure

Constructor Details

- (Shell) initialize

Initializes a new Shell.



559
560
561
562
# File 'lib/bovem/shell.rb', line 559

def initialize
  @console = ::Bovem::Console.instance
  self.i18n_setup(:bovem, ::File.absolute_path(::Pathname.new(::File.dirname(__FILE__)).to_s + "/../../locales/"))
end

Instance Attribute Details

- (Console) console

A console instance.

Returns:

  • (Console)

    the current value of console



541
542
543
# File 'lib/bovem/shell.rb', line 541

def console
  @console
end

Class Method Details

+ (Shell) instance

Returns a unique instance for Shell.

Returns:

  • (Shell)

    A new instance.



554
555
556
# File 'lib/bovem/shell.rb', line 554

def self.instance
  @instance ||= ::Bovem::Shell.new
end