Commit MetaInfo

Revisão2cd6fd5cb2041206779b68a8314bdc7c3bf81f7e (tree)
Hora2016-07-01 15:53:43
AutorTatsuki Sugiura <sugi@nemu...>
CommiterTatsuki Sugiura

Mensagem de Log

Version 0.1.4: frs_uplaod, relfile: Allow multiple target arguments.

Mudança Sumário

Diff

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
1+2016-07-01 Tatsuki Sugiura <sugi@nemui.org>
2+
3+ * Versino 0.1.4
4+ * frs_upload, relfile: Add progress options.
5+
16 2016-05-26 Tatsuki Sugiura <sugi@nemui.org>
27
38 * Version 0.1.3
--- a/lib/osdn/cli/command/frs_upload.rb
+++ b/lib/osdn/cli/command/frs_upload.rb
@@ -10,6 +10,8 @@ module OSDN; module CLI; module Command
1010 puts " -v --visibility=<public|private|hidden>"
1111 puts " Default visibility for newly created items"
1212 puts " --force-digest Calc local file digest forcely"
13+ puts " --progress Force to show upload progress"
14+ puts " --no-progress Force to hide upload progress"
1315 end
1416
1517 def run
@@ -21,6 +23,8 @@ module OSDN; module CLI; module Command
2123 [ '--release', GetoptLong::REQUIRED_ARGUMENT ],
2224 [ '--visibility', '-v', GetoptLong::REQUIRED_ARGUMENT ],
2325 [ '--force-digest', GetoptLong::NO_ARGUMENT],
26+ [ '--progress', GetoptLong::NO_ARGUMENT],
27+ [ '--no-progress', GetoptLong::NO_ARGUMENT],
2428 )
2529 opts.each do |opt, arg|
2630 case opt
@@ -43,6 +47,10 @@ module OSDN; module CLI; module Command
4347 @force_digest = true
4448 when '--dry-run'
4549 @dry_run = true
50+ when '--progress'
51+ @show_progress = true
52+ when '--no-progress'
53+ @show_progress = false
4654 end
4755 end
4856
@@ -182,7 +190,7 @@ module OSDN; module CLI; module Command
182190 if @dry_run
183191 finfo = Hashie::Mash.new id: '(dry-run)', url: '(dry-run)'
184192 else
185- logger.level <= Logger::INFO and
193+ logger.level <= Logger::INFO && @show_progress != false || @show_progress and
186194 OSDN::CLI._show_progress = true
187195 fio = file.open
188196 logger.info "Starting upload #{file}..."
--- a/lib/osdn/cli/command/relfile.rb
+++ b/lib/osdn/cli/command/relfile.rb
@@ -15,6 +15,8 @@ module OSDN; module CLI; module Command
1515 puts " --release=<release-id> Target release (numeric id)"
1616 puts " -v --visibility=<public|private|hidden>"
1717 puts " --force-digest Calc local file digest forcely"
18+ puts " --progress Force to show upload progress"
19+ puts " --no-progress Force to hide upload progress"
1820 end
1921
2022 def self.description
@@ -29,6 +31,8 @@ module OSDN; module CLI; module Command
2931 [ '--release', GetoptLong::REQUIRED_ARGUMENT ],
3032 [ '--visibility', '-v', GetoptLong::REQUIRED_ARGUMENT ],
3133 [ '--force-digest', GetoptLong::NO_ARGUMENT],
34+ [ '--progress', GetoptLong::NO_ARGUMENT],
35+ [ '--no-progress', GetoptLong::NO_ARGUMENT],
3236 )
3337 opts.each do |opt, arg|
3438 case opt
@@ -52,6 +56,10 @@ module OSDN; module CLI; module Command
5256 exit
5357 end
5458 @visibility = arg
59+ when '--progress'
60+ @show_progress = true
61+ when '--no-progress'
62+ @show_progress = false
5563 end
5664 end
5765 end
@@ -105,7 +113,7 @@ module OSDN; module CLI; module Command
105113 end
106114
107115 fio = file.open
108- logger.level <= Logger::INFO and
116+ logger.level <= Logger::INFO && @show_progress != false || @show_progress and
109117 OSDN::CLI._show_progress = true
110118 logger.info "Starting upload #{file}..."
111119 f = api.create_release_file target_proj, target_package, target_release, fio, visibility: @visibility
--- a/lib/osdn/cli/overrides.rb
+++ b/lib/osdn/cli/overrides.rb
@@ -23,6 +23,7 @@ module Typhoeus
2323 end
2424 if OSDN::CLI._show_progress
2525 Ethon::Curl.set_option(:noprogress, false, easy.handle)
26+
2627 else
2728 Ethon::Curl.set_option(:noprogress, true, easy.handle)
2829 end
--- a/lib/osdn/cli/version.rb
+++ b/lib/osdn/cli/version.rb
@@ -1,5 +1,5 @@
11 module OSDN
22 module CLI
3- VERSION = "0.1.3"
3+ VERSION = "0.1.4"
44 end
55 end
Show on old repository browser