corn 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/corn.rb +2 -2
- data/lib/corn/rack.rb +1 -1
- 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: 1ce02508d746aa0ddc14391e054d66d380f89585
|
4
|
+
data.tar.gz: 4f4fa55488e02cbbc69fc4b096a59daa9e85fe3e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f425e6709f866fee98a50bb56eef27a70469c6b45a3b3185233a9b5f19e4675c9eb3ffaf0a81755b828f5314cb7e2e2affa01820a1eef6d931fbf8946fc755ee
|
7
|
+
data.tar.gz: aef311145c1b62fbd8561968c1df806cb599e756d25fe9fd3ac50416b5485c38e009acb9f147d38c94f695bf2c8a52323db5f4f815e67ff37432607b56bc6bb7
|
data/lib/corn.rb
CHANGED
@@ -49,14 +49,14 @@ module Corn
|
|
49
49
|
|
50
50
|
def upload(file, name)
|
51
51
|
File.open(file) do |f|
|
52
|
-
post(f, name)
|
52
|
+
post(UploadIO.new(f, 'text/plain', File.basename(f.path)), name)
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
56
|
def post(data, name)
|
57
57
|
url = URI.parse(submit_url)
|
58
58
|
req = Net::HTTP::Post::Multipart.new(url.path,
|
59
|
-
"data" =>
|
59
|
+
"data" => data,
|
60
60
|
'client_id' => client_id,
|
61
61
|
'name' => name)
|
62
62
|
res = Net::HTTP.start(url.host, url.port) do |http|
|
data/lib/corn/rack.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: corn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Xiao Li
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2014-03-
|
12
|
+
date: 2014-03-28 00:00:00 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multipart-post
|