mongo_grid 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mongo_grid.rb +7 -8
- data/lib/version.rb +1 -1
- metadata +2 -3
- data/bin/resize +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 426e3942961accd764ebd0ca12fa3c52865a870d2848696794d715894fa486ec
|
4
|
+
data.tar.gz: f26eef496b519d4d8813f8b540b59d5542c9cbedcf3845f1773d41c41a62e734
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd0ed2f026ffe6f7b0c2c87ad091578a1d70b00aefa428654668926c36de3ecc21d600b821ccccbc17e3039ac88c486041b22636a29a7b797b06006ff0a58dbb
|
7
|
+
data.tar.gz: bb3896ed2014bf2435932d7c3d8df570626175ee831c080a30d6138258d9156580f64511d9e7ba2d5c6aaa2bbfd526c1602ff43cdce4e4ff7caa540c42ec93c1
|
data/lib/mongo_grid.rb
CHANGED
@@ -36,14 +36,13 @@ module ::MongoGrid
|
|
36
36
|
def uploadtogrid(upload,opts={})
|
37
37
|
filename=upload.original_filename
|
38
38
|
content_type=upload.content_type
|
39
|
-
if /jpg|jpeg|png/ =~ content_type
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
39
|
+
#if /jpg|jpeg|png/ =~ content_type
|
40
|
+
# if opts[:width]
|
41
|
+
# %x[resize -fixed -w #{opts[:width]} #{upload.tempfile.path}]
|
42
|
+
# else
|
43
|
+
# %x[resize -fixed #{upload.tempfile.path}]
|
44
|
+
# end
|
45
|
+
#end
|
47
46
|
data = File.open(upload.tempfile.path)
|
48
47
|
length=File.size(upload.tempfile.path)
|
49
48
|
gfile = ::Mongo::Grid::File.new(data,filename: filename, metadata: {content_type: content_type,length: length})
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo_grid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zxy
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: file upload to mongodb
|
14
14
|
email:
|
@@ -22,7 +22,6 @@ files:
|
|
22
22
|
- README.md
|
23
23
|
- Rakefile
|
24
24
|
- bin/console
|
25
|
-
- bin/resize
|
26
25
|
- bin/setup
|
27
26
|
- lib/ext/action_base.rb
|
28
27
|
- lib/ext/mongoid.rb
|
data/bin/resize
DELETED
Binary file
|