null+****@clear*****
null+****@clear*****
Thu Jun 28 12:02:33 JST 2012
SHIMADA Koji 2012-06-08 08:34:52 +0900 (Fri, 08 Jun 2012) New Revision: c518bcc90f7566a472bc541a18a631fd22b81949 https://github.com/logaling/logaling-command/commit/c518bcc90f7566a472bc541a18a631fd22b81949 Merged 7228757: Merge pull request #60 from logaling/refactor-structure Log: Rename variable name: out to output Modified files: lib/logaling/command/renderers.rb Modified: lib/logaling/command/renderers.rb (+9 -9) =================================================================== --- lib/logaling/command/renderers.rb 2012-06-07 16:19:42 +0900 (84e27ec) +++ lib/logaling/command/renderers.rb 2012-06-08 08:34:52 +0900 (be893e7) @@ -8,7 +8,7 @@ module Logaling::Command @options = options end - def render(out); end + def render(output); end def glossary_name if****@repos*****_counts > 1 @@ -61,9 +61,9 @@ module Logaling::Command @max_str_size = 0 end - def render(out) + def render(output) format = [target_term, note, glossary_name].compact.join("\t") - out.printf(" %-#{@max_str_size+10}s %s\n", source_term, format) + output.printf(" %-#{@max_str_size+10}s %s\n", source_term, format) end def note @@ -73,10 +73,10 @@ module Logaling::Command end class TermCsvRenderer < TermRenderer - def render(out) + def render(output) items = [source_term, target_term, note, @config.source_language, @config.target_language] - out.print(CSV.generate {|csv| csv << items}) + output.print(CSV.generate {|csv| csv << items}) end end @@ -89,15 +89,15 @@ module Logaling::Command @last_index = 0 end - def render(out) - first_line? ? out.puts("[") : out.puts(",") + def render(output) + first_line? ? output.puts("[") : output.puts(",") record = { :source => source_term, :target => target_term, :note => note, :source_language => @config.source_language, :target_language => @config.target_language } - out.print JSON.pretty_generate(record) - out.puts("\n]") if last_line? + output.print JSON.pretty_generate(record) + output.puts("\n]") if last_line? end private -------------- next part -------------- An HTML attachment was scrubbed... 다운로드