refile 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of refile might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/History.md +7 -0
- data/lib/refile/app.rb +1 -1
- data/lib/refile/image_processing.rb +2 -2
- data/lib/refile/version.rb +1 -1
- data/spec/refile/app_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f88d8e0859054884b85f7fc478d6e93ddf05d84
|
4
|
+
data.tar.gz: f48b85dfeb3f29e91dd1b7871c5d74216bc95eda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af3a13531db636c5b4c611911a7d03cced2c43c2f8c4edf4a4f300f4de55b90e7b86cf173d6c5f1c69cbc672de59d248014ac593cd1e9b5ea1e14f727035f921
|
7
|
+
data.tar.gz: 73f3e4a8c8503f3445313bb363900ff394edb8ce974267cb0c491bc3552c273d910be64e6d546afcf4162a1bef447d8bdd4759280712dcbe9ab9ecf9bd06e2bc
|
data/History.md
CHANGED
data/lib/refile/app.rb
CHANGED
@@ -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")
|
data/lib/refile/version.rb
CHANGED
data/spec/refile/app_spec.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2015-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|