Class: InDir
- Inherits:
-
Object
- Object
- InDir
- Defined in:
- lib/ruby_make_script/utils.rb
Instance Method Summary collapse
- #enter ⇒ Object
- #exit ⇒ Object
-
#initialize(path, err = true) ⇒ InDir
constructor
A new instance of InDir.
Constructor Details
#initialize(path, err = true) ⇒ InDir
Returns a new instance of InDir.
89 90 91 92 |
# File 'lib/ruby_make_script/utils.rb', line 89 def initialize(path, err=true) @path = path @err = err end |
Instance Method Details
#enter ⇒ Object
94 95 96 97 98 99 100 101 |
# File 'lib/ruby_make_script/utils.rb', line 94 def enter @orig = Dir.pwd if @err cd @path else cd? @path end end |
#exit ⇒ Object
103 104 105 106 107 108 109 |
# File 'lib/ruby_make_script/utils.rb', line 103 def exit if @err cd @orig else cd? @orig end end |