refile 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of refile might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: efeeacf3670d33b7a4c22cdb6f55cdddba524a0b
4
- data.tar.gz: 8e4f7bc973f1347606a251d9a15a7f3983f04e13
3
+ metadata.gz: 1f88d8e0859054884b85f7fc478d6e93ddf05d84
4
+ data.tar.gz: f48b85dfeb3f29e91dd1b7871c5d74216bc95eda
5
5
  SHA512:
6
- metadata.gz: 01f6f2eb954e55add137dc351da2829295a7de8a6e5290bbad27f70b05c039f3b3db4e84adf6b9c44a415d305b2fbb28a74f6c8eec55fb09c386a9e270ba7708
7
- data.tar.gz: f20d8cc03bbced04056c291cb06620af4a257e1ad582b9e4a594a14137e0d9abbeb2b9b2c7109a76f0bc4c99dd4385530c43074fce728cafb7530a6bd2f81c74
6
+ metadata.gz: af3a13531db636c5b4c611911a7d03cced2c43c2f8c4edf4a4f300f4de55b90e7b86cf173d6c5f1c69cbc672de59d248014ac593cd1e9b5ea1e14f727035f921
7
+ data.tar.gz: 73f3e4a8c8503f3445313bb363900ff394edb8ce974267cb0c491bc3552c273d910be64e6d546afcf4162a1bef447d8bdd4759280712dcbe9ab9ecf9bd06e2bc
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 0.5.1
2
+
3
+ Release date: 2015-01-11
4
+
5
+ - [FIXED] Set content type from extension properly
6
+ - [FIXED] Support animated GIFs when changing format
7
+
1
8
  # 0.5.0
2
9
 
3
10
  Release date: 2015-01-09
data/lib/refile/app.rb CHANGED
@@ -96,7 +96,7 @@ module Refile
96
96
 
97
97
  filename = request.path.split("/").last
98
98
 
99
- send_file path, filename: filename, disposition: "inline"
99
+ send_file path, filename: filename, disposition: "inline", type: ::File.extname(request.path)
100
100
  end
101
101
 
102
102
  def backend
@@ -16,7 +16,7 @@ module Refile
16
16
  # @param [String] format the format to convert to
17
17
  # @return [void]
18
18
  def convert(img, format)
19
- img.format(format.to_s.downcase)
19
+ img.format(format.to_s.downcase, nil)
20
20
  end
21
21
 
22
22
  # Resize the image to fit within the specified dimensions while retaining
@@ -130,7 +130,7 @@ module Refile
130
130
  # @return [File] the processed file
131
131
  def call(file, *args, format: nil)
132
132
  img = ::MiniMagick::Image.new(file.path)
133
- img.format(format.to_s.downcase) if format
133
+ img.format(format.to_s.downcase, nil) if format
134
134
  send(@method, img, *args)
135
135
 
136
136
  ::File.open(img.path, "rb")
@@ -1,3 +1,3 @@
1
1
  module Refile
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -17,6 +17,16 @@ describe Refile::App do
17
17
  expect(last_response.body).to eq("hello")
18
18
  end
19
19
 
20
+ it "sets appropriate content type from extension" do
21
+ file = Refile.store.upload(StringIO.new("hello"))
22
+
23
+ get "/store/#{file.id}/hello.html"
24
+
25
+ expect(last_response.status).to eq(200)
26
+ expect(last_response.body).to eq("hello")
27
+ expect(last_response.headers["Content-Type"]).to include("text/html")
28
+ end
29
+
20
30
  it "returns a 404 if the file doesn't exist" do
21
31
  Refile.store.upload(StringIO.new("hello"))
22
32
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refile
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-09 00:00:00.000000000 Z
11
+ date: 2015-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra