Commit MetaInfo

修订版e8a2b9fba1b08b1a6f25129a648cd8aa2545b68c (tree)
时间2016-03-16 19:55:31
作者Tatsuki Sugiura <sugi@nemu...>
CommiterTatsuki Sugiura

Log Message

Move digest calc to base class.

更改概述

差异

--- a/lib/osdn/cli.rb
+++ b/lib/osdn/cli.rb
@@ -167,6 +167,18 @@ module OSDN
167167 def update_variables(dir, vars)
168168 write_variables(load_variables(dir, false).merge(vars), dir)
169169 end
170+
171+ private
172+ def hexdigest(klass, file)
173+ fio = file.open
174+ dig = klass.new
175+ while buf = fio.read(1024*1024) and buf.length > 0
176+ dig << buf
177+ end
178+ fio.close
179+ dig.hexdigest
180+ end
181+
170182 end
171183
172184 class Ping < Base
--- a/lib/osdn/cli/command/frs_upload.rb
+++ b/lib/osdn/cli/command/frs_upload.rb
@@ -149,16 +149,5 @@ module OSDN; module CLI; module Command
149149 def api
150150 OSDNClient::ProjectApi.new
151151 end
152-
153- def hexdigest(klass, file)
154- fio = file.open
155- dig = klass.new
156- while buf = fio.read(1024*1024) and buf.length > 0
157- dig << buf
158- end
159- fio.close
160- dig.hexdigest
161- end
162-
163152 end
164153 end; end; end
Show on old repository browser