[Groonga-commit] groonga/heroku-groonga-builder at 349f3fa [build_kytea] Remove upload feature

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Sep 14 17:38:21 JST 2014


Kouhei Sutou	2014-06-05 12:58:43 +0900 (Thu, 05 Jun 2014)

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

  Message:
    Remove upload feature
    
    It is no longer needed.

  Removed files:
    Procfile
  Modified files:
    Gemfile
    Gemfile.lock
    config.ru

  Modified: Gemfile (+0 -1)
===================================================================
--- Gemfile    2014-06-05 12:50:01 +0900 (f5749a0)
+++ Gemfile    2014-06-05 12:58:43 +0900 (cd8142b)
@@ -2,4 +2,3 @@ source "https://rubygems.org/"
 
 gem "rake"
 gem "octokit"
-gem "puma"

  Modified: Gemfile.lock (+0 -4)
===================================================================
--- Gemfile.lock    2014-06-05 12:50:01 +0900 (9c6cdc6)
+++ Gemfile.lock    2014-06-05 12:58:43 +0900 (73c4fe5)
@@ -7,9 +7,6 @@ GEM
     multipart-post (2.0.0)
     octokit (3.1.0)
       sawyer (~> 0.5.3)
-    puma (2.8.2)
-      rack (>= 1.1, < 2.0)
-    rack (1.5.2)
     rake (10.3.2)
     sawyer (0.5.4)
       addressable (~> 2.3.5)
@@ -20,5 +17,4 @@ PLATFORMS
 
 DEPENDENCIES
   octokit
-  puma
   rake

  Deleted: Procfile (+0 -1) 100644
===================================================================
--- Procfile    2014-06-05 12:50:01 +0900 (449ff97)
+++ /dev/null
@@ -1 +0,0 @@
-web: bundle exec puma --port $PORT config.ru

  Modified: config.ru (+1 -81)
===================================================================
--- config.ru    2014-06-05 12:50:01 +0900 (09f3669)
+++ config.ru    2014-06-05 12:58:43 +0900 (59e04c9)
@@ -1,86 +1,6 @@
 # -*- ruby -*-
 
-require "fileutils"
-
-class Uploader
-  class ValidationError < StandardError
-  end
-
-  def initialize(request, response)
-    @request = request
-    @response = response
-    @response["Content-Type"] = "text/plain"
-  end
-
-  def run
-    begin
-      validate
-    rescue ValidationError
-    else
-      upload
-    end
-
-    @response.finish
-  end
-
-  private
-  def validate
-    validate_method
-    validate_path
-    validate_content
-  end
-
-  def validation_error(message)
-    @response.status = 400
-    @response.write(message)
-    raise ValidationError
-  end
-
-  def validate_method
-    return if****@reque*****?
-    validation_error("must be PUT\n")
-  end
-
-  def validate_path
-    return unles****@reque*****_with?("/")
-    validation_error("must be file name\n")
-  end
-
-  def validate_content
-    return if****@reque*****
-    validation_error("body is required\n")
-  end
-
-  def upload
-    path = "public#{@request.path}"
-    FileUtils.mkdir_p(File.dirname(path))
-    File.open(path, "wb") do |output|
-      buffer_size = 8912
-      buffer = ""
-      while****@reque*****(buffer_size, buffer)
-        output.write(buffer)
-      end
-    end
-
-    @response.write("Uploaded\n")
-  end
-end
-
-file_server = Rack::File.new("public")
-directory_server = Rack::Directory.new("public")
-
 application = lambda do |env|
-  request = Rack::Request.new(env)
-  response = Rack::Response.new
-  if request.get?
-    if request.path.end_with?("/")
-      directory_server.call(env)
-    else
-      file_server.call(env)
-    end
-  else
-    uploader = Uploader.new(request, response)
-    uploader.run
-  end
+  [200, {"Content-Type" => "text/plain"}, ["Groonga builder"]]
 end
 run application
-------------- next part --------------
HTML����������������������������...
Download 



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