Sha256: 67e98293545d3598eb56af9e67d67cda32662f504b8ba3dbe7640dde016af318

Contents?: true

Size: 986 Bytes

Versions: 72

Compression:

Stored size: 986 Bytes

Contents

# Detects route to changes
class Jets::Resource::ApiGateway::RestApi::Routes::Change
  class To < Base
    def self.changed?
      new.changed?
    end

    def changed?
      deployed_routes.each do |deployed_route|
        new_route = find_comparable_route(deployed_route)
        if new_route && new_route.to != deployed_route.to
          # change in already deployed route has been detected, requires bluegreen deploy
          return true
        end
      end
      false # Reaching here means no routes have been changed in a way that requires a bluegreen deploy
    end

    # Find a route that has the same path and method. This is a comparable route
    # Then we will compare the to or controller action to see if an already
    # deployed route has been changed.
    def find_comparable_route(deployed_route)
      new_routes.find do |new_route|
        new_route.path == deployed_route.path &&
        new_route.method == deployed_route.method
      end
    end
  end
end

Version data entries

72 entries across 72 versions & 3 rubygems

Version Path
jets_bb_fork-0.0.4 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-2.1.1 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-2.1.0 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-2.0.6 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-2.0.5 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-2.0.4 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-2.0.3 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-2.0.1 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-2.0.0 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-1.9.32 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-1.9.31 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-1.9.30 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-1.9.29 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-1.9.28 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-1.9.27 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-1.9.26 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-1.9.25 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-1.9.24 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-1.9.23 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb
jets-1.9.22 lib/jets/resource/api_gateway/rest_api/routes/change/to.rb