Class: Bovem::Shell

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, #move

Methods included from Bovem::ShellMethods::Read

#check, #find

Constructor Details

#initializeShell

Initializes a new Shell.



520
521
522
523
# File 'lib/bovem/shell.rb', line 520

def initialize
  @console = Bovem::Console.instance
  @i18n = Bovem::I18n.new(root: "bovem.shell", path: Bovem::Application::LOCALE_ROOT)
end

Instance Attribute Details

#consoleConsole

Returns A console instance.

Returns:

  • (Console)

    A console instance.



502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/bovem/shell.rb', line 502

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

  attr_accessor :console
  attr_reader :i18n

  # 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 = Bovem::I18n.new(root: "bovem.shell", path: Bovem::Application::LOCALE_ROOT)
  end
end

#i18nI18n (readonly)

Returns A i18n helper.

Returns:

  • (I18n)

    A i18n helper.



502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/bovem/shell.rb', line 502

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

  attr_accessor :console
  attr_reader :i18n

  # 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 = Bovem::I18n.new(root: "bovem.shell", path: Bovem::Application::LOCALE_ROOT)
  end
end

Class Method Details

.instanceShell

Returns a unique instance for Shell.

Returns:

  • (Shell)

    A new instance.



515
516
517
# File 'lib/bovem/shell.rb', line 515

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