KITAITI Makoto
null+****@clear*****
Mon Dec 22 07:22:47 JST 2014
KITAITI Makoto 2014-12-22 07:22:47 +0900 (Mon, 22 Dec 2014) New Revision: 173a2b4c82df927314b76ff24d6313e5f91d853c https://github.com/ranguba/epub-searcher/commit/173a2b4c82df927314b76ff24d6313e5f91d853c Message: Share settings with background processes Modified files: app/controllers/main-controller.rb config/apps.rb config/boot.rb Modified: app/controllers/main-controller.rb (+1 -1) =================================================================== --- app/controllers/main-controller.rb 2014-12-22 06:26:49 +0900 (a59469e) +++ app/controllers/main-controller.rb 2014-12-22 07:22:47 +0900 (7090a81) @@ -23,7 +23,7 @@ end def search_from_groonga(query_words) records = nil - Groonga::Client.open protocol: :http do |client| + Groonga::Client.open protocol: :http, host: settings.droonga_host, port: settings.droonga_port do |client| select = client.select( :table => :Books, :query => query_words, Modified: config/apps.rb (+2 -0) =================================================================== --- config/apps.rb 2014-12-22 06:26:49 +0900 (8238f1e) +++ config/apps.rb 2014-12-22 07:22:47 +0900 (aa55a1e) @@ -30,6 +30,8 @@ Padrino.configure_apps do set :session_secret, '6dd0f61200fa0daf3c0f607069603164d15b6ab2171f92ba2989f2134959a78d' set :protection, true set :protect_from_csrf, true + set :droonga_host, ENV['host'] + set :droonga_port, ENV['http_server_port'] end # Mounts the core application for this project Modified: config/boot.rb (+3 -0) =================================================================== --- config/boot.rb 2014-12-22 06:26:49 +0900 (e929104) +++ config/boot.rb 2014-12-22 07:22:47 +0900 (d935d2f) @@ -31,6 +31,9 @@ Bundler.require(:default, PADRINO_ENV) # include Padrino::Helpers::TranslationHelpers # end +require 'dotenv' +Dotenv.load ".env.#{PADRINO_ENV}" + ## # Add your before (RE)load hooks here # -------------- next part -------------- HTML����������������������������...Download