[Groonga-mysql-commit] mroonga/mroonga [master] Use curl instead of github_api

Back to archive index

null+****@clear***** null+****@clear*****
2012年 3月 29日 (木) 18:39:16 JST


Kouhei Sutou	2012-03-29 18:39:16 +0900 (Thu, 29 Mar 2012)

  New Revision: 184fe07a2e7ae8a9172fc13b3a1e03e7b49b5ccb

  Log:
    Use curl instead of github_api
    
    Because github_api's upload doesn't work... :<

  Modified files:
    tools/upload-to-github.rb

  Modified: tools/upload-to-github.rb (+13 -1)
===================================================================
--- tools/upload-to-github.rb    2012-03-29 11:59:33 +0900 (618e2df)
+++ tools/upload-to-github.rb    2012-03-29 18:39:16 +0900 (edb2a46)
@@ -26,5 +26,17 @@ files.each do |file|
                                           :size => File.size(file),
                                           :description => File.basename(file),
                                           :content_type => content_type)
-  github.repos.upload(resource, File.basename(file))
+  p resource
+
+  system("curl",
+    "-F", "key=#{resource.path}",
+    "-F", "acl=#{resource.acl}",
+    "-F", "success_action_status=201",
+    "-F", "Filename=#{resource.name}",
+    "-F", "AWSAccessKeyId=#{resource.accesskeyid}",
+    "-F", "Policy=#{resource.policy}",
+    "-F", "Signature=#{resource.signature}",
+    "-F", "Content-Type=#{resource.mime_type[0]['Content-Type']}",
+    "-F", "file=@#{file}",
+    resourec.s3_url)
 end




Groonga-mysql-commit メーリングリストの案内
Back to archive index