[Groonga-mysql-commit] mroonga/mroonga [fix-for-visual-studio] add GitHub uploader.

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Oct 4 10:33:16 JST 2012


Kouhei Sutou	2011-11-29 01:34:35 +0900 (Tue, 29 Nov 2011)

  New Revision: 99079aaba548b3f7d2c43fd36d8c5698041504c4
  https://github.com/mroonga/mroonga/commit/99079aaba548b3f7d2c43fd36d8c5698041504c4

  Log:
    add GitHub uploader.

  Added files:
    tools/upload-to-github.rb
  Modified files:
    Makefile.am
    tools/Makefile.am

  Modified: Makefile.am (+4 -0)
===================================================================
--- Makefile.am    2011-11-29 01:04:37 +0900 (4375f48)
+++ Makefile.am    2011-11-29 01:34:35 +0900 (e1cab2c)
@@ -95,6 +95,10 @@ update-files:
 	cd $(srcdir)/doc && $(MAKE) update-files
 	cd $(srcdir)/test/sql && $(MAKE) update-files
 
+upload-to-github:
+	ruby $(srcdir)/tools/upload-to-github.rb \
+	  $$USER $(PACKAGE)-$(VERSION).tar.gz
+
 echo-mysql-source:
 	echo $(MYSQL_SOURCE)
 

  Modified: tools/Makefile.am (+2 -1)
===================================================================
--- tools/Makefile.am    2011-11-29 01:04:37 +0900 (245fb81)
+++ tools/Makefile.am    2011-11-29 01:34:35 +0900 (b65b930)
@@ -1,5 +1,6 @@
 noinstall_ruby_scripts =			\
-	prepare-sphinx-html.rb
+	prepare-sphinx-html.rb			\
+	upload-to-github.rb
 
 EXTRA_DIST =					\
 	$(noinstall_ruby_scripts)

  Added: tools/upload-to-github.rb (+30 -0) 100755
===================================================================
--- /dev/null
+++ tools/upload-to-github.rb    2011-11-29 01:34:35 +0900 (618e2df)
@@ -0,0 +1,30 @@
+#!/usr/bin/env ruby
+
+if ARGV.size < 1
+  puts "Usage: #{$0} USER FILE ..."
+  puts " e.g.: #{$0} kou mroonga-1.10.tar.gz ..."
+  exit false
+end
+
+require "rubygems"
+require "github_api"
+require "mime/types"
+
+user, *files = *ARGV
+
+print "password[#{user}]: "
+system("stty -echo")
+password = STDIN.gets.chomp
+system("stty echo")
+puts
+
+github = Github.new(:login => user, :password => password)
+files.each do |file|
+  content_type = MIME::Types.type_for(file)[0].to_s
+  resource = github.repos.create_download("mroonga", "mroonga",
+                                          :name => File.basename(file),
+                                          :size => File.size(file),
+                                          :description => File.basename(file),
+                                          :content_type => content_type)
+  github.repos.upload(resource, File.basename(file))
+end
-------------- next part --------------
HTML����������������������������...
다운로드 



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