corn 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/corn.rb +2 -2
  3. data/lib/corn/rack.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a683dd6a7151d53b1e5d4f39f2825cb636cb16fb
4
- data.tar.gz: 014031992189ffdb40867829d556a13af552c57c
3
+ metadata.gz: 1ce02508d746aa0ddc14391e054d66d380f89585
4
+ data.tar.gz: 4f4fa55488e02cbbc69fc4b096a59daa9e85fe3e
5
5
  SHA512:
6
- metadata.gz: 17bf5360fc21c770b1ea32fc6fba2c1af60ed68371033b6b161946f1be74de4d634788529e91d4d64ade38727d6e64afa555e9343e72f1873a5413c3373227f6
7
- data.tar.gz: 96d5a703ba798e4a2bfd4e383a7653d9bf228e282be757c252ca6942cde4f00c5671d5c39ffad30271d59f7b14d8b6dbfeb6360bfb0d28c17862006aaa0e3df1
6
+ metadata.gz: f425e6709f866fee98a50bb56eef27a70469c6b45a3b3185233a9b5f19e4675c9eb3ffaf0a81755b828f5314cb7e2e2affa01820a1eef6d931fbf8946fc755ee
7
+ data.tar.gz: aef311145c1b62fbd8561968c1df806cb599e756d25fe9fd3ac50416b5485c38e009acb9f147d38c94f695bf2c8a52323db5f4f815e67ff37432607b56bc6bb7
@@ -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" => UploadIO.new(data, 'text/plain', 'profile.txt'),
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|
@@ -5,7 +5,7 @@ module Corn
5
5
  output_interval=nil)
6
6
  @app = app
7
7
  @prof = SamplingProf.new(0.1, true) do |data|
8
- Corn.post(StringIO.new(data), report_name)
8
+ Corn.post(data, report_name)
9
9
  end
10
10
  if output_interval
11
11
  @prof.output_interval = output_interval
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.0
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-24 00:00:00 Z
12
+ date: 2014-03-28 00:00:00 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multipart-post