Sha256: 5e3107ee9d269aba8efe5410a7aab4a66c6e6eff9c7e8cded2fe6a6e2aac7c9f

Contents?: true

Size: 828 Bytes

Versions: 33

Compression:

Stored size: 828 Bytes

Contents

class Ey::Core::Client
  class Real
    def upload_recipes_for_environment(params={})
      file = params.delete("file")
      id   = params.delete("id")
      url  = params.delete("url")


      request(
        :body    => {"file" => Faraday::UploadIO.new(file, "application/x-gzip")},
        :headers => {"Content-Type" => "multipart/form-data" },
        :method  => :post,
        :path    => "environments/#{id}/recipes",
        :url     => url,
      )
    end
  end

  class Mock
    def upload_recipes_for_environment(params={})
      environment = find(:environments, resource_identity(params))
      environment["custom_recipes"] = "https://#{self.uuid}.s3.amazonaws.com/#{self.uuid}?X-Amz-Expires=1800"
      self.data[:environments][environment["id"]] = environment

      response(status: 204)
    end
  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
ey-core-3.2.0 lib/ey-core/requests/upload_recipes_for_environment.rb
ey-core-3.1.11 lib/ey-core/requests/upload_recipes_for_environment.rb
ey-core-3.1.10 lib/ey-core/requests/upload_recipes_for_environment.rb
ey-core-3.1.9 lib/ey-core/requests/upload_recipes_for_environment.rb
ey-core-3.1.8 lib/ey-core/requests/upload_recipes_for_environment.rb
ey-core-3.1.7 lib/ey-core/requests/upload_recipes_for_environment.rb
ey-core-3.1.6 lib/ey-core/requests/upload_recipes_for_environment.rb
ey-core-3.1.5 lib/ey-core/requests/upload_recipes_for_environment.rb
ey-core-3.1.4 lib/ey-core/requests/upload_recipes_for_environment.rb
ey-core-3.1.3 lib/ey-core/requests/upload_recipes_for_environment.rb
ey-core-3.1.2 lib/ey-core/requests/upload_recipes_for_environment.rb
ey-core-3.1.1 lib/ey-core/requests/upload_recipes_for_environment.rb
ey-core-3.1.0 lib/ey-core/requests/upload_recipes_for_environment.rb