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, #setup_error_handling, #show_general_failure

Constructor Details

#initializeShell

Initializes a new Shell.



568
569
570
571
# File 'lib/bovem/shell.rb', line 568

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

Instance Attribute Details

#consoleConsole

Returns A console instance.

Returns:

  • (Console)

    A console instance.



550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
# File 'lib/bovem/shell.rb', line 550

class Shell
  include Lazier::I18n
  include Bovem::ShellMethods::General
  include Bovem::ShellMethods::Read
  include Bovem::ShellMethods::Write
  include Bovem::ShellMethods::Execute
  include Bovem::ShellMethods::Directories

  attr_accessor :console

  # Returns a unique instance for Shell.
  #
  # @return [Shell] A new instance.
  def self.instance
    @instance ||= Bovem::Shell.new
  end

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

Class Method Details

.instanceShell

Returns a unique instance for Shell.

Returns:

  • (Shell)

    A new instance.



563
564
565
# File 'lib/bovem/shell.rb', line 563

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