class Feed2Email::Migrate::SplitHistoryMigration

Private Instance Methods

applicable?() click to toggle source
# File lib/feed2email/migrate/split_history_migration.rb, line 9
def applicable?
  super && pending?
end
feed_history_path(feed_uri) click to toggle source
# File lib/feed2email/migrate/split_history_migration.rb, line 13
def feed_history_path(feed_uri)
  root.join("history-#{Digest::MD5.hexdigest(feed_uri)}.yml")
end
filename() click to toggle source
# File lib/feed2email/migrate/split_history_migration.rb, line 17
def filename
  'history.yml'
end
migrate() click to toggle source
# File lib/feed2email/migrate/split_history_migration.rb, line 21
def migrate
  data.each do |feed_uri, entries|
    open(feed_history_path(feed_uri), 'w') {|f| f.write(entries.to_yaml) }
  end
end
pending?() click to toggle source
# File lib/feed2email/migrate/split_history_migration.rb, line 27
def pending?
  Dir[root.join('history-*.yml')].empty?
end