Skip to content

Commit

Permalink
Merge branch 'release/2.1.81'
Browse files Browse the repository at this point in the history
* release/2.1.81:
  Finishing 2.1.81
  2.1.81 release prep
  update based on test failures
  Changelog update
  Allow multiple sections
  Version bump, add funding
  • Loading branch information
ttscoff committed May 31, 2023
2 parents b6f73c2 + 8529630 commit 05ad860
Show file tree
Hide file tree
Showing 147 changed files with 1,113 additions and 1,028 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### 2.1.81

2023-05-31 11:47

#### IMPROVED

- Most commands that allow --section can now take multiple values, either by using --section multiple times or providing a comma separated list of sections to the flag

### 2.1.80

2023-03-11 10:50
Expand Down
28 changes: 13 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
doing (2.1.80)
doing (2.1.81)
chronic (~> 0.10, >= 0.10.2)
deep_merge (~> 1.2, >= 1.2.1)
gli (~> 2.20, >= 2.20.1)
Expand All @@ -21,43 +21,43 @@ GEM
specs:
chronic (0.10.2)
deep_merge (1.2.2)
github-markup (4.0.0)
github-markup (4.0.1)
gli (2.21.0)
haml (5.0.4)
temple (>= 0.8.0)
tilt
kramdown (2.4.0)
rexml
parallel (1.21.0)
parallel_tests (3.7.3)
parallel (1.23.0)
parallel_tests (3.13.0)
parallel
parslet (2.0.0)
pastel (0.8.0)
tty-color (~> 0.5)
plist (3.6.0)
power_assert (2.0.1)
plist (3.7.0)
power_assert (2.0.3)
rake (13.0.6)
rdoc (6.3.3)
redcarpet (3.5.1)
redcarpet (3.6.0)
rexml (3.2.5)
rouge (3.30.0)
rouge (4.1.0)
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.9.1)
temple (0.10.0)
test-unit (3.4.9)
power_assert
tilt (2.0.11)
tilt (2.1.0)
tty-color (0.6.0)
tty-cursor (0.7.1)
tty-link (0.1.1)
tty-markdown (0.7.1)
tty-markdown (0.7.2)
kramdown (>= 1.16.2, < 3.0)
pastel (~> 0.8)
rouge (~> 3.14)
rouge (>= 3.14, < 5.0)
strings (~> 0.2.0)
tty-color (~> 0.5)
tty-screen (~> 0.8)
Expand All @@ -76,10 +76,8 @@ GEM
tty-which (0.5.0)
unicode-display_width (2.4.2)
unicode_utils (1.4.0)
webrick (1.7.0)
wisper (2.0.1)
yard (0.9.27)
webrick (~> 1.7.0)
yard (0.9.34)

PLATFORMS
ruby
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ _If you're one of the rare people like me who find this useful, feel free to

<!--README-->

The current version of `doing` is <!--VER-->2.1.79<!--END VER-->.
The current version of `doing` is <!--VER-->2.1.80<!--END VER-->.

Find all of the documentation in the [doing wiki][wiki].

Expand Down
2 changes: 1 addition & 1 deletion bin/commands/again.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

c.desc 'Get last entry from a specific section'
c.arg_name 'NAME'
c.flag %i[s section], default_value: 'All'
c.flag %i[s section], default_value: 'All', multiple: true

c.desc 'Add new entry to section (default: same section as repeated entry)'
c.arg_name 'SECTION_NAME'
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/archive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
elsif args[0] =~ /^@\S+/
['all', args.tags_to_array]
else
[args.shift.cap_first, args.tags_to_array]
[@wwid.guess_section(args.shift.cap_first), args.tags_to_array]
end

raise InvalidArgument, '--keep and --count can not be used together' if options[:keep] && options[:count]
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/cancel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

c.desc 'Section'
c.arg_name 'NAME'
c.flag %i[s section]
c.flag %i[s section], multiple: true

c.desc 'Cancel last entry (or entries) not already marked @done'
c.switch %i[u unfinished], negatable: false, default_value: false
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/finish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def add_options(cmd)

cmd.desc 'Section'
cmd.arg_name 'NAME'
cmd.flag %i[s section]
cmd.flag %i[s section], multiple: true

cmd.desc 'Select item(s) to finish from a menu of matching entries'
cmd.switch %i[i interactive], negatable: false, default_value: false
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/flag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

c.desc 'Section'
c.arg_name 'SECTION_NAME'
c.flag %i[s section], default_value: 'All'
c.flag %i[s section], default_value: 'All', multiple: true

c.desc 'How many recent entries to tag (0 for all)'
c.arg_name 'COUNT'
Expand Down
5 changes: 3 additions & 2 deletions bin/commands/grep.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# @@grep @@search
desc 'Search for entries'
long_desc %(
Search all sections (or limit to a single section) for entries matching text or regular expression. Normal strings are fuzzy matched.
Search all sections (or limit to a specific sections) for entries matching text or regular expression. Normal strings are fuzzy matched.
To search with regular expressions, single quote the string and surround with slashes: `doing search '/\bm.*?x\b/'`
)
Expand All @@ -11,10 +11,11 @@
c.example 'doing search "\'search command"', desc: 'Find entries containing "search command" using exact matching (search is an alias for grep)'
c.example 'doing grep "/do.*?wiki.*?@done/"', desc: 'Find entries matching regular expression'
c.example 'doing search --before 12/21 "doing wiki"', desc: 'Find entries containing "doing wiki" with entry dates before 12/21 of the current year'
c.example 'doing grep @project1 -s currently -s projects', desc: 'Search only in Currently and Projects'

c.desc 'Section'
c.arg_name 'NAME'
c.flag %i[s section], default_value: 'All'
c.flag %i[s section], default_value: 'All', multiple: true

# c.desc '[DEPRECATED] Use alternative fuzzy matching for search string'
# c.switch [:fuzzy], default_value: false, negatable: false
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/last.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

c.desc 'Specify a section'
c.arg_name 'NAME'
c.flag %i[s section], default_value: 'All'
c.flag %i[s section], default_value: 'All', multiple: true

c.desc "Edit entry with #{Doing::Util.default_editor}"
c.switch %i[e editor], negatable: false, default_value: false
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/note.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

c.desc 'Section'
c.arg_name 'NAME'
c.flag %i[s section], default_value: 'All'
c.flag %i[s section], default_value: 'All', multiple: true

c.desc "Edit entry with #{Doing::Util.default_editor}"
c.switch %i[e editor], negatable: false, default_value: false
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/on.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

c.desc 'Section'
c.arg_name 'NAME'
c.flag %i[s section], default_value: 'All'
c.flag %i[s section], default_value: 'All', multiple: true

add_options(:output_template, c)
add_options(:time_display, c)
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/recent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

c.desc 'Section'
c.arg_name 'NAME'
c.flag %i[s section], default_value: 'All'
c.flag %i[s section], default_value: 'All', multiple: true

c.desc 'Select from a menu of matching entries to perform additional operations'
c.switch %i[i interactive], negatable: false, default_value: false
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/reset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

c.desc 'Limit search to section'
c.arg_name 'NAME'
c.flag %i[s section], default_value: 'All'
c.flag %i[s section], default_value: 'All', multiple: true

c.desc 'Resume entry (remove @done)'
c.switch %i[r resume], default_value: true
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/select.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

c.desc 'Select from a specific section'
c.arg_name 'SECTION'
c.flag %i[s section]
c.flag %i[s section], multiple: true

c.desc 'Tag selected entries'
c.arg_name 'TAG'
Expand Down
8 changes: 5 additions & 3 deletions bin/commands/show.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

c.desc 'Only show entries within section'
c.arg_name 'NAME'
c.flag %i[s section]
c.flag %i[s section], multiple: true

c.desc 'Select section or tag to display from a menu'
c.switch %i[m menu], negatable: false, default_value: false
Expand Down Expand Up @@ -75,7 +75,8 @@
when /^[@+-]/
section = options[:section] ? @wwid.guess_section(options[:section]) : 'All'
else
sect = options[:section] ? options[:section] : args[0]
sect = options[:section].empty? ? args[0] : options[:section]

begin
section = @wwid.guess_section(sect)
rescue WrongCommand
Expand All @@ -88,6 +89,7 @@

args.shift
end

if args.length.positive?
args.each do |arg|
arg.split(/,/).each do |tag|
Expand All @@ -96,7 +98,7 @@
end
end
else
if options[:section]
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')
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/since.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

c.desc 'Section'
c.arg_name 'NAME'
c.flag %i[s section], default_value: 'All'
c.flag %i[s section], default_value: 'All', multiple: true

add_options(:output_template, c)
add_options(:time_display, c)
Expand Down
25 changes: 9 additions & 16 deletions bin/commands/tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

c.desc 'Section'
c.arg_name 'SECTION_NAME'
c.flag %i[s section], default_value: 'All'
c.flag %i[s section], default_value: 'All', multiple: true

c.desc 'How many recent entries to tag (0 for all)'
c.arg_name 'COUNT'
Expand Down Expand Up @@ -73,25 +73,18 @@
section = @wwid.guess_section(options[:section]) || options[:section].cap_first
end


if options[:tag].nil?
search_tags = []
else
search_tags = options[:tag]
end
search_tags = options[:tag].nil? ? [] : options[:tag]

if options[:autotag]
tags = []
else
if args.empty?
tags = []
else
tags = if args.join('') =~ /,/
args.join('').split(/ *, */)
else
args.join(' ').split(' ') # in case tags are quoted as one arg
end
end
tags = if args.empty?
[]
elsif args.join('') =~ /,/
args.join('').split(/ *, */)
else
args.join(' ').split(' ') # in case tags are quoted as one arg
end

tags.map! { |tag| tag.sub(/^@/, '').strip }
end
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
command :tags do |c|
c.desc 'Section'
c.arg_name 'SECTION_NAME'
c.flag %i[s section], default_value: 'All'
c.flag %i[s section], default_value: 'All', multiple: true

c.desc 'Show count of occurrences'
c.switch %i[c counts]
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/today.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

c.desc 'Specify a section'
c.arg_name 'NAME'
c.flag %i[s section], default_value: 'All'
c.flag %i[s section], default_value: 'All', multiple: true

add_options(:output_template, c, default_template: 'today')
add_options(:time_filter, c)
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

c.desc 'Section'
c.arg_name 'NAME'
c.flag %i[s section]
c.flag %i[s section], multiple: true

c.desc 'Count to display'
c.arg_name 'COUNT'
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/views.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def edit_views
res = if @options[:output] =~ /^j/i
JSON.parse(@wwid.fork_editor(JSON.pretty_generate(@views), message: nil))
else
YAML.safe_load(@wwid.fork_editor(YAML.dump(@views), message: nil))
Doing::Util.safe_load_file(@wwid.fork_editor(YAML.dump(@views), message: nil))
end
@args.each do |v|
save_view(v, res)
Expand Down
2 changes: 1 addition & 1 deletion bin/commands/yesterday.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

c.desc 'Specify a section'
c.arg_name 'NAME'
c.flag %i[s section], default_value: 'All'
c.flag %i[s section], default_value: 'All', multiple: true

add_options(:output_template, c, default_template: 'today')
add_options(:time_filter, c)
Expand Down
Loading

0 comments on commit 05ad860

Please sign in to comment.