OSDN Git Service

Move digest calc to base class.
authorTatsuki Sugiura <sugi@nemui.org>
Wed, 16 Mar 2016 10:55:31 +0000 (19:55 +0900)
committerTatsuki Sugiura <sugi@nemui.org>
Wed, 16 Mar 2016 10:55:31 +0000 (19:55 +0900)
lib/osdn/cli.rb
lib/osdn/cli/command/frs_upload.rb

index 66b8c64..631a07d 100644 (file)
@@ -167,6 +167,18 @@ module OSDN
         def update_variables(dir, vars)
           write_variables(load_variables(dir, false).merge(vars), dir)
         end
+
+        private
+        def hexdigest(klass, file)
+          fio = file.open
+          dig = klass.new
+          while buf = fio.read(1024*1024) and buf.length > 0
+            dig << buf
+          end
+          fio.close
+          dig.hexdigest
+        end
+        
       end
 
       class Ping < Base
index f28fd80..3832c96 100644 (file)
@@ -149,16 +149,5 @@ module OSDN; module CLI; module Command
     def api
       OSDNClient::ProjectApi.new
     end
-
-    def hexdigest(klass, file)
-      fio = file.open
-      dig = klass.new
-      while buf = fio.read(1024*1024) and buf.length > 0
-        dig << buf
-      end
-      fio.close
-      dig.hexdigest
-    end
-
   end
 end; end; end