Skip to content

Commit

Permalink
Remove #download and #read
Browse files Browse the repository at this point in the history
These methods have become obsolete in newer versions of Shrine, as
they can both be implemented in terms of #open.
  • Loading branch information
janko committed Jun 21, 2017
1 parent 324eb4a commit 8449560
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
8 changes: 0 additions & 8 deletions lib/shrine/storage/fog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,10 @@ def upload(io, id, **upload_options)
end
end

def download(id)
Down.download(url(id))
end

def open(id)
Down.open(url(id))
end

def read(id)
get(id).body
end

def exists?(id)
!!head(id)
end
Expand Down
2 changes: 1 addition & 1 deletion shrine-fog.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |gem|
gem.files = Dir["README.md", "LICENSE.txt", "lib/**/*.rb", "*.gemspec"]
gem.require_path = "lib"

gem.add_dependency "shrine", "~> 2.0"
gem.add_dependency "shrine", "~> 2.2"
gem.add_dependency "down", ">= 2.3.3"

gem.add_development_dependency "rake"
Expand Down
3 changes: 2 additions & 1 deletion test/fog_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require "test_helper"
require "shrine/storage/linter"
require "uri"
require "down"

describe Shrine::Storage::Fog do
def fog(**options)
Expand Down Expand Up @@ -35,7 +36,7 @@ def fog(**options)
describe "#upload" do
it "assigns the content type" do
@fog.upload(fakeio, "foo", shrine_metadata: {"mime_type" => "image/jpeg"})
tempfile = @fog.download("foo")
tempfile = Down.download(@fog.url("foo"))

assert_equal "image/jpeg", tempfile.content_type
end
Expand Down

0 comments on commit 8449560

Please sign in to comment.