Class: Migreazy::Source::TextFile

Inherits:
Migreazy::Source show all
Defined in:
lib/migreazy.rb

Instance Attribute Summary

Attributes inherited from Migreazy::Source

#migrations

Instance Method Summary collapse

Methods inherited from Migreazy::Source

new_from_command_line_arg

Constructor Details

#initialize(file) ⇒ TextFile



144
145
146
147
148
149
150
151
152
153
# File 'lib/migreazy.rb', line 144

def initialize(file)
  @file = File.expand_path(file)
  @migrations = []
  File.read(@file).each_line do |line|
    line.chomp!
    if line.to_i.to_s == line
      @migrations << line
    end
  end
end

Instance Method Details

#descriptionObject



155
156
157
# File 'lib/migreazy.rb', line 155

def description
  "File #{@file}"
end