Class: CFTools::SpaceTime
- Inherits:
-
CF::CLI
- Object
- CF::CLI
- CFTools::SpaceTime
- Defined in:
- lib/tools-cf-plugin/spacetime.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.io_from_input ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/tools-cf-plugin/spacetime.rb', line 8 def self.io_from_input proc do |name| if name == "-" $stdin else File.open(File.(name)) end end end |
.pattern_from_input ⇒ Object
18 19 20 21 22 |
# File 'lib/tools-cf-plugin/spacetime.rb', line 18 def self.pattern_from_input proc do |pat| Regexp.new(pat) end end |
Instance Method Details
#precondition ⇒ Object
6 |
# File 'lib/tools-cf-plugin/spacetime.rb', line 6 def precondition; end |
#spacetime ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/tools-cf-plugin/spacetime.rb', line 31 def spacetime io = input[:input] pattern = input[:pattern] scale = input[:scale] prev_time = nil io.each do |entry| prev_time = space_line( entry, pattern, scale, prev_time) end end |