Class: Mate::TmProperties
- Inherits:
-
Object
- Object
- Mate::TmProperties
- Defined in:
- lib/mate/tm_properties.rb
Defined Under Namespace
Classes: Ignores
Class Method Summary collapse
Instance Method Summary collapse
- #cleanup ⇒ Object
-
#initialize(dir, options) ⇒ TmProperties
constructor
A new instance of TmProperties.
- #save ⇒ Object
Constructor Details
#initialize(dir, options) ⇒ TmProperties
Returns a new instance of TmProperties.
10 11 12 13 14 15 16 |
# File 'lib/mate/tm_properties.rb', line 10 def initialize(dir, ) @dir = Pathname(dir). @file = @dir + '.tm_properties' @lines = @file.exist? ? @file.read.split("\n") : [] @other_lines = @lines.reject{ |line| line =~ Ignores::GENERATED_R } @options = end |
Class Method Details
Instance Method Details
#cleanup ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/mate/tm_properties.rb', line 24 def cleanup if @other_lines.empty? @file.unlink if @file.exist? else write(@other_lines) end end |