Sha256: 4657c9f2b882f0abf631c6845b3086ddbeeff1c2263d1e0fc811e51f1e196280

Contents?: true

Size: 661 Bytes

Versions: 8

Compression:

Stored size: 661 Bytes

Contents

require 'paratrooper/system_caller'

module Paratrooper
  class PendingMigrationCheck
    attr_accessor :diff, :heroku, :match_tag_name, :system_caller

    def initialize(match_tag_name, heroku_wrapper, system_caller)
      self.heroku         = heroku_wrapper
      self.match_tag_name = match_tag_name
      self.system_caller  = system_caller
    end

    def migrations_waiting?
      call = %Q[git diff --shortstat #{last_deployed_commit} #{match_tag_name} -- db/migrate]
      self.diff = system_caller.execute(call)
      !diff.strip.empty?
    end

    def last_deployed_commit
      @last_deploy_commit ||= heroku.last_deploy_commit
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
paratrooper-2.3.0 lib/paratrooper/pending_migration_check.rb
paratrooper-2.2.0 lib/paratrooper/pending_migration_check.rb
paratrooper-2.1.0 lib/paratrooper/pending_migration_check.rb
paratrooper-2.0.0 lib/paratrooper/pending_migration_check.rb
paratrooper-2.0.0.beta2 lib/paratrooper/pending_migration_check.rb
paratrooper-2.0.0.beta1 lib/paratrooper/pending_migration_check.rb
paratrooper-1.4.2 lib/paratrooper/pending_migration_check.rb
paratrooper-1.4.1 lib/paratrooper/pending_migration_check.rb