leangem 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fileupload.rb +2 -2
- 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: 40b8886e8ffed189bee498bd38d0192a30b94495
|
4
|
+
data.tar.gz: 07764b3dd094f28b0899f74d03716efc15aabb2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f57acf405523cad7316c846f16f074e8b6651dd635c0cc6e2962a3fd69c793f82c6e785c0f59f71b436dbe91e7d2461fd576c09a6f6aa78dc908c09f32969553
|
7
|
+
data.tar.gz: b522ea2d321e178ab7066764db0431e713e794306a274143db7297371b50ee8299664202c91fd16b806b6aabce984c0d531889f13e03efa50ab32e0a70142566
|
data/lib/fileupload.rb
CHANGED
@@ -5,7 +5,7 @@ class Fileupload
|
|
5
5
|
def Fileupload.upload(file, filepath="", rule="jpg|xls", minsize=1, maxsize=4000)
|
6
6
|
result = Fileupload.rule_validata(file, rule, minsize, maxsize)
|
7
7
|
if result[:state]
|
8
|
-
sname = Fileupload.getname(file
|
8
|
+
sname = Fileupload.getname(file, filepath)
|
9
9
|
begin
|
10
10
|
unless Dir::exist?(filepath)
|
11
11
|
Dir.mkdir(filepath)
|
@@ -47,7 +47,7 @@ class Fileupload
|
|
47
47
|
#params:filestream->file stream file name,filepath->file save path
|
48
48
|
#return:new file's name
|
49
49
|
def Fileupload.getname(filestream, filepath)
|
50
|
-
file_for = Fileupload.file_format(filestream)
|
50
|
+
file_for = Fileupload.file_format(filestream.original_filename)
|
51
51
|
filename = Time.now.strftime("%Y%m%d%h%m%s")<<rand(99999).to_s<<file_for
|
52
52
|
file = filepath+filename
|
53
53
|
while File.exist?(file) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leangem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lean
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: vcode,fileupload,pager,func,pay_gateway
|
14
14
|
email: leanv@sina.com
|