[Groonga-commit] groonga/heroku-groonga-builder at d71a365 [master] Use curl

Back to archive index

Kouhei Sutou null+****@clear*****
Mon May 19 23:14:57 JST 2014


Kouhei Sutou	2014-05-19 23:14:57 +0900 (Mon, 19 May 2014)

  New Revision: d71a3652e018aca5b07eca142d5c52b0b1085a24
  https://github.com/groonga/heroku-groonga-builder/commit/d71a3652e018aca5b07eca142d5c52b0b1085a24

  Message:
    Use curl

  Modified files:
    Rakefile

  Modified: Rakefile (+4 -13)
===================================================================
--- Rakefile    2014-05-19 23:14:47 +0900 (4da3554)
+++ Rakefile    2014-05-19 23:14:57 +0900 (56fcba4)
@@ -1,6 +1,3 @@
-require "pathname"
-require "net/http"
-
 task :default => :build
 
 task :build do
@@ -30,14 +27,8 @@ task :build do
   upload_base_url = ENV["UPLOAD_BASE_URL"]
   upload_base_url ||= "http://groonga-builder.herokuapp.com"
   upload_url = "#{upload_base_url}/#{built_archive_name}"
-  uri = URI(upload_url)
-  Net::HTTP.start(uri.host, uri.port) do |http|
-    response = File.open(built_archive_name, "rb") do |archive|
-      request = Net::HTTP::Put.new
-      request.body = archive
-      http.request(request)
-    end
-    puts(response.code)
-    puts(response.body)
-  end
+  sh("curl",
+     "--request", "PUT",
+     "--data-binary", "@#{built_archive_name}",
+     upload_url)
 end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index