Sha256: 649db775291c65a3a6982014f57ab6dbcea40ec2c7038642eeb839e133f09cf6

Contents?: true

Size: 764 Bytes

Versions: 14

Compression:

Stored size: 764 Bytes

Contents

# frozen_string_literal: true

module RedminePluginsHelper
  class StatusMigrations
    def initialize
      run
    end

    private

    def run
      local_versions.each do |plugin, timestamps|
        timestamps.each do |timestamp|
          m = migrated_version?(plugin, timestamp) ? 'up' : 'down'
          puts "#{m}\t#{plugin}\t#{timestamp}" # rubocop:disable Rails/Output
        end
      end
    end

    def migrated_version?(plugin, timestamp)
      db_versions.key?(plugin) &&
        db_versions[plugin].include?(timestamp)
    end

    def local_versions
      @local_versions ||= ::RedminePluginsHelper::Migrations.local_versions
    end

    def db_versions
      @db_versions ||= ::RedminePluginsHelper::Migrations.db_versions
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
redmine_plugins_helper-0.13.2 lib/redmine_plugins_helper/status_migrations.rb
redmine_plugins_helper-0.13.1 lib/redmine_plugins_helper/status_migrations.rb
redmine_plugins_helper-0.13.0 lib/redmine_plugins_helper/status_migrations.rb
redmine_plugins_helper-0.12.2 lib/redmine_plugins_helper/status_migrations.rb
redmine_plugins_helper-0.12.1 lib/redmine_plugins_helper/status_migrations.rb
redmine_plugins_helper-0.12.0 lib/redmine_plugins_helper/status_migrations.rb
redmine_plugins_helper-0.11.0 lib/redmine_plugins_helper/status_migrations.rb
redmine_plugins_helper-0.10.0 lib/redmine_plugins_helper/status_migrations.rb
redmine_plugins_helper-0.9.4 lib/redmine_plugins_helper/status_migrations.rb
redmine_plugins_helper-0.9.3 lib/redmine_plugins_helper/status_migrations.rb
redmine_plugins_helper-0.9.2 lib/redmine_plugins_helper/status_migrations.rb
redmine_plugins_helper-0.9.1 lib/redmine_plugins_helper/status_migrations.rb
redmine_plugins_helper-0.9.0 lib/redmine_plugins_helper/status_migrations.rb
redmine_plugins_helper-0.8.2 lib/redmine_plugins_helper/status_migrations.rb