Kouhei Sutou
null+****@clear*****
Tue Jun 24 16:06:07 JST 2014
Kouhei Sutou 2014-06-24 16:06:07 +0900 (Tue, 24 Jun 2014) New Revision: b34fe3796a3de68822bdfebb9de75cfbf0e3830e https://github.com/droonga/droonga-engine/commit/b34fe3796a3de68822bdfebb9de75cfbf0e3830e Message: Simplify Modified files: lib/droonga/command/serf_event_handler.rb Modified: lib/droonga/command/serf_event_handler.rb (+4 -4) =================================================================== --- lib/droonga/command/serf_event_handler.rb 2014-06-24 16:05:33 +0900 (5521348) +++ lib/droonga/command/serf_event_handler.rb 2014-06-24 16:06:07 +0900 (eda34e6) @@ -69,15 +69,15 @@ module Droonga end def output_live_nodes - list_path = Path.live_nodes + path = Path.live_nodes nodes = live_nodes file_contents = JSON.pretty_generate(nodes) - FileUtils.mkdir_p(list_path.parent.to_s) + FileUtils.mkdir_p(path.parent.to_s) # Don't output the file directly to prevent loading of incomplete file! - Tempfile.open(list_path.basename.to_s, list_path.parent.to_s, "w") do |output| + Tempfile.open(path.basename.to_s, path.parent.to_s, "w") do |output| output.write(file_contents) output.flush - File.rename(output.path, list_path.to_s) + File.rename(output.path, path.to_s) end end end -------------- next part -------------- HTML����������������������������... 다운로드