Class: DeepTest::Distributed::ShellEnvironment

Inherits:
Object
  • Object
show all
Defined in:
lib/deep_test/distributed/shell_environment.rb

Defined Under Namespace

Classes: SourceFileList

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeShellEnvironment

Returns a new instance of ShellEnvironment.



11
12
13
# File 'lib/deep_test/distributed/shell_environment.rb', line 11

def initialize
  @source_file_lists = []
end

Class Method Details

.like_loginObject



4
5
6
7
8
9
# File 'lib/deep_test/distributed/shell_environment.rb', line 4

def self.
   = new
  .include_first '/etc/profile'
  .include_first '~/.profile', '~/.bash_profile',  '~/.bashrc'
  
end

Instance Method Details

#==(other) ⇒ Object



23
24
25
# File 'lib/deep_test/distributed/shell_environment.rb', line 23

def ==(other)
  source_file_lists == other.source_file_lists
end

#include_first(*filenames) ⇒ Object



15
16
17
# File 'lib/deep_test/distributed/shell_environment.rb', line 15

def include_first(*filenames)
  source_file_lists << SourceFileList.new(filenames)
end

#to_sObject



19
20
21
# File 'lib/deep_test/distributed/shell_environment.rb', line 19

def to_s
  source_file_lists.join(" && ")
end