diff --git a/Gemfile.lock b/Gemfile.lock index 5d68b93f..7726dfaa 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - doing (2.1.81) + doing (2.1.82) chronic (~> 0.10, >= 0.10.2) deep_merge (~> 1.2, >= 1.2.1) gli (~> 2.20, >= 2.20.1) @@ -40,17 +40,17 @@ GEM rdoc (6.3.3) redcarpet (3.6.0) rexml (3.2.5) - rouge (4.1.0) + rouge (4.1.2) safe_yaml (1.0.5) strings (0.2.1) strings-ansi (~> 0.2) unicode-display_width (>= 1.5, < 3.0) unicode_utils (~> 1.4) strings-ansi (0.2.0) - temple (0.10.0) + temple (0.10.2) test-unit (3.4.9) power_assert - tilt (2.1.0) + tilt (2.2.0) tty-color (0.6.0) tty-cursor (0.7.1) tty-link (0.1.1) diff --git a/bin/commands/show.rb b/bin/commands/show.rb index d4b2db96..dbd38843 100644 --- a/bin/commands/show.rb +++ b/bin/commands/show.rb @@ -68,7 +68,7 @@ when /^all$/i section = 'All' args.shift - when /^(choose|pick)$/i + when /^(choose|pick|menu)$/i section = @wwid.choose_section(include_all: true) args.shift @@ -98,11 +98,11 @@ end end else - if options[:section] && !options[:section].empty? - section = @wwid.guess_section(options[:section]) || 'All' - else - section = options[:menu] ? @wwid.choose_section(include_all: true) : Doing.setting('current_section') - end + section = if options[:section] && !options[:section].empty? + @wwid.guess_section(options[:section]) || 'All' + else + options[:menu] ? @wwid.choose_section(include_all: true) : Doing.setting('current_section') + end section ||= 'All' end @@ -111,11 +111,11 @@ options[:times] = true if options[:totals] template = Doing.setting(['templates', options[:config_template]]).deep_merge({ - 'wrap_width' => Doing.setting('wrap_width') || 0, - 'date_format' => Doing.setting('default_date_format'), - 'order' => Doing.setting('order')&.normalize_order || :asc, - 'tags_color' => Doing.setting('tags_color') - }) + 'wrap_width' => Doing.setting('wrap_width') || 0, + 'date_format' => Doing.setting('default_date_format'), + 'order' => Doing.setting('order')&.normalize_order || :asc, + 'tags_color' => Doing.setting('tags_color') + }) if options[:search] search = options[:search] diff --git a/lib/doing/errors.rb b/lib/doing/errors.rb index 596ab528..eea71ba8 100644 --- a/lib/doing/errors.rb +++ b/lib/doing/errors.rb @@ -70,7 +70,7 @@ def initialize(msg, exit_code = 26) class InvalidPlugin < DoingRuntimeError def initialize(kind = 'output', msg = nil) - super(%(Invalid #{kind} type (#{msg})), 128, topic: 'Invalid:') + super(%(Invalid #{kind} type (#{msg})), 128, topic: 'Plugin:') end end diff --git a/lib/doing/good.rb b/lib/doing/good.rb index 9d032cbf..07d6f498 100644 --- a/lib/doing/good.rb +++ b/lib/doing/good.rb @@ -5,7 +5,7 @@ module Doing class ::Numeric # Test of number is positive def good? - positive? + self >= 0 end end diff --git a/lib/doing/hash.rb b/lib/doing/hash.rb index cd8831a5..dd86359a 100644 --- a/lib/doing/hash.rb +++ b/lib/doing/hash.rb @@ -158,7 +158,7 @@ def remove_empty def tag_filter_to_options hsh = dup - if hsh.key?(:tag_filter) + if hsh.key?(:tag_filter) && hsh[:tag_filter] hsh[:tags] = hsh[:tag_filter][:tags] hsh[:bool] = hsh[:tag_filter][:bool] hsh.delete(:tag_filter) @@ -173,8 +173,8 @@ def tag_filter_to_options ## def to_view hsh = symbolize_keys - %w[x save c a s o h e editor m menu i interactive d delete t fuzzy time_filter sort_tags].each do |key| - hsh.delete(key.to_sym) if hsh.key?(key.to_sym) + %i[x save c a s o h e editor m menu i interactive d delete t fuzzy time_filter sort_tags].each do |key| + hsh.delete(key) if hsh.key?(key) end hsh.delete_unless_key(:tag, %i[bool])