doing 2.0.17 → 2.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/Gemfile.lock +15 -5
- data/README.md +1 -1
- data/bin/doing +2 -18
- data/doing.gemspec +5 -4
- data/doing.rdoc +2 -2
- data/generate_completions.sh +3 -3
- data/lib/completion/_doing.zsh +19 -19
- data/lib/completion/doing.bash +28 -28
- data/lib/completion/doing.fish +0 -14
- data/lib/doing/cli_status.rb +6 -2
- data/lib/doing/completion/bash_completion.rb +185 -0
- data/lib/doing/completion/fish_completion.rb +175 -0
- data/lib/doing/completion/string.rb +17 -0
- data/lib/doing/completion/zsh_completion.rb +140 -0
- data/lib/doing/completion.rb +39 -0
- data/lib/doing/plugins/export/template_export.rb +3 -1
- data/lib/doing/string.rb +1 -1
- data/lib/doing/version.rb +1 -1
- data/lib/doing/wwid.rb +22 -8
- data/lib/doing.rb +1 -1
- data/lib/helpers/fzf/.goreleaser.yml +119 -0
- data/lib/helpers/fzf/.rubocop.yml +28 -0
- data/lib/helpers/fzf/ADVANCED.md +565 -0
- data/lib/helpers/fzf/BUILD.md +49 -0
- data/lib/helpers/fzf/CHANGELOG.md +1193 -0
- data/lib/helpers/fzf/Dockerfile +11 -0
- data/lib/helpers/fzf/LICENSE +21 -0
- data/lib/helpers/fzf/Makefile +166 -0
- data/lib/helpers/fzf/README-VIM.md +486 -0
- data/lib/helpers/fzf/README.md +712 -0
- data/lib/helpers/fzf/bin/fzf-tmux +233 -0
- data/lib/helpers/fzf/doc/fzf.txt +512 -0
- data/lib/helpers/fzf/go.mod +17 -0
- data/lib/helpers/fzf/go.sum +31 -0
- data/lib/helpers/fzf/install +382 -0
- data/lib/helpers/fzf/install.ps1 +65 -0
- data/lib/helpers/fzf/main.go +14 -0
- data/lib/helpers/fzf/man/man1/fzf-tmux.1 +68 -0
- data/lib/helpers/fzf/man/man1/fzf.1 +1001 -0
- data/lib/helpers/fzf/plugin/fzf.vim +1048 -0
- data/lib/helpers/fzf/shell/completion.bash +381 -0
- data/lib/helpers/fzf/shell/completion.zsh +329 -0
- data/lib/helpers/fzf/shell/key-bindings.bash +96 -0
- data/lib/helpers/fzf/shell/key-bindings.fish +172 -0
- data/lib/helpers/fzf/shell/key-bindings.zsh +114 -0
- data/lib/helpers/fzf/src/LICENSE +21 -0
- data/lib/helpers/fzf/src/algo/algo.go +884 -0
- data/lib/helpers/fzf/src/algo/algo_test.go +197 -0
- data/lib/helpers/fzf/src/algo/normalize.go +492 -0
- data/lib/helpers/fzf/src/ansi.go +409 -0
- data/lib/helpers/fzf/src/ansi_test.go +427 -0
- data/lib/helpers/fzf/src/cache.go +81 -0
- data/lib/helpers/fzf/src/cache_test.go +39 -0
- data/lib/helpers/fzf/src/chunklist.go +89 -0
- data/lib/helpers/fzf/src/chunklist_test.go +80 -0
- data/lib/helpers/fzf/src/constants.go +85 -0
- data/lib/helpers/fzf/src/core.go +351 -0
- data/lib/helpers/fzf/src/history.go +96 -0
- data/lib/helpers/fzf/src/history_test.go +68 -0
- data/lib/helpers/fzf/src/item.go +44 -0
- data/lib/helpers/fzf/src/item_test.go +23 -0
- data/lib/helpers/fzf/src/matcher.go +235 -0
- data/lib/helpers/fzf/src/merger.go +120 -0
- data/lib/helpers/fzf/src/merger_test.go +88 -0
- data/lib/helpers/fzf/src/options.go +1691 -0
- data/lib/helpers/fzf/src/options_test.go +457 -0
- data/lib/helpers/fzf/src/pattern.go +425 -0
- data/lib/helpers/fzf/src/pattern_test.go +209 -0
- data/lib/helpers/fzf/src/protector/protector.go +8 -0
- data/lib/helpers/fzf/src/protector/protector_openbsd.go +10 -0
- data/lib/helpers/fzf/src/reader.go +201 -0
- data/lib/helpers/fzf/src/reader_test.go +63 -0
- data/lib/helpers/fzf/src/result.go +243 -0
- data/lib/helpers/fzf/src/result_others.go +16 -0
- data/lib/helpers/fzf/src/result_test.go +159 -0
- data/lib/helpers/fzf/src/result_x86.go +16 -0
- data/lib/helpers/fzf/src/terminal.go +2832 -0
- data/lib/helpers/fzf/src/terminal_test.go +638 -0
- data/lib/helpers/fzf/src/terminal_unix.go +26 -0
- data/lib/helpers/fzf/src/terminal_windows.go +45 -0
- data/lib/helpers/fzf/src/tokenizer.go +253 -0
- data/lib/helpers/fzf/src/tokenizer_test.go +112 -0
- data/lib/helpers/fzf/src/tui/dummy.go +46 -0
- data/lib/helpers/fzf/src/tui/light.go +987 -0
- data/lib/helpers/fzf/src/tui/light_unix.go +110 -0
- data/lib/helpers/fzf/src/tui/light_windows.go +145 -0
- data/lib/helpers/fzf/src/tui/tcell.go +721 -0
- data/lib/helpers/fzf/src/tui/tcell_test.go +392 -0
- data/lib/helpers/fzf/src/tui/ttyname_unix.go +47 -0
- data/lib/helpers/fzf/src/tui/ttyname_windows.go +14 -0
- data/lib/helpers/fzf/src/tui/tui.go +625 -0
- data/lib/helpers/fzf/src/tui/tui_test.go +20 -0
- data/lib/helpers/fzf/src/util/atomicbool.go +34 -0
- data/lib/helpers/fzf/src/util/atomicbool_test.go +17 -0
- data/lib/helpers/fzf/src/util/chars.go +198 -0
- data/lib/helpers/fzf/src/util/chars_test.go +46 -0
- data/lib/helpers/fzf/src/util/eventbox.go +96 -0
- data/lib/helpers/fzf/src/util/eventbox_test.go +61 -0
- data/lib/helpers/fzf/src/util/slab.go +12 -0
- data/lib/helpers/fzf/src/util/util.go +138 -0
- data/lib/helpers/fzf/src/util/util_test.go +40 -0
- data/lib/helpers/fzf/src/util/util_unix.go +47 -0
- data/lib/helpers/fzf/src/util/util_windows.go +83 -0
- data/lib/helpers/fzf/test/fzf.vader +175 -0
- data/lib/helpers/fzf/test/test_go.rb +2626 -0
- data/lib/helpers/fzf/uninstall +117 -0
- data/scripts/generate_bash_completions.rb +6 -12
- data/scripts/generate_fish_completions.rb +7 -16
- data/scripts/generate_zsh_completions.rb +6 -15
- metadata +145 -10
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'tty-progressbar'
|
|
4
|
+
|
|
5
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'completion'))
|
|
6
|
+
require 'string'
|
|
7
|
+
require 'fish_completion'
|
|
8
|
+
require 'zsh_completion'
|
|
9
|
+
require 'bash_completion'
|
|
10
|
+
|
|
11
|
+
module Doing
|
|
12
|
+
# Completion script generator
|
|
13
|
+
module Completion
|
|
14
|
+
class << self
|
|
15
|
+
def generate_completion(type: 'zsh', file: 'stdout')
|
|
16
|
+
|
|
17
|
+
generator = case type.to_s
|
|
18
|
+
when /^f/
|
|
19
|
+
FishCompletions.new
|
|
20
|
+
when /^b/
|
|
21
|
+
BashCompletions.new
|
|
22
|
+
else
|
|
23
|
+
ZshCompletions.new
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
result = generator.generate_completions
|
|
27
|
+
|
|
28
|
+
if file =~ /^stdout$/i
|
|
29
|
+
$stdout.puts result
|
|
30
|
+
else
|
|
31
|
+
File.open(File.expand_path(file), 'w') do |f|
|
|
32
|
+
f.puts result
|
|
33
|
+
end
|
|
34
|
+
Doing.logger.warn('File written:', "#{type} completions written to #{file}")
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
@@ -42,6 +42,7 @@ module Doing
|
|
|
42
42
|
else
|
|
43
43
|
note = []
|
|
44
44
|
end
|
|
45
|
+
|
|
45
46
|
output = opt[:template].dup
|
|
46
47
|
|
|
47
48
|
output.gsub!(/%[a-z]+/) do |m|
|
|
@@ -90,7 +91,7 @@ module Doing
|
|
|
90
91
|
item.title.wrap(width, pad: pad, indent: indent, offset: title_offset, prefix: prefix, color: title_color, after: after, reset: reset)
|
|
91
92
|
# flag + item.title.gsub(/(.{#{opt[:wrap_width]}})(?=\s+|\Z)/, "\\1\n ").sub(/\s*$/, '') + reset
|
|
92
93
|
else
|
|
93
|
-
format("%s
|
|
94
|
+
format("%s%#{pad}s%s", prefix, item.title.sub(/\s*$/, ''), after)
|
|
94
95
|
end
|
|
95
96
|
end
|
|
96
97
|
|
|
@@ -135,6 +136,7 @@ module Doing
|
|
|
135
136
|
|
|
136
137
|
out += "#{output}\n"
|
|
137
138
|
end
|
|
139
|
+
|
|
138
140
|
# Doing.logger.debug('Template Export:', "#{items.count} items output to template #{opt[:template]}")
|
|
139
141
|
out += wwid.tag_times(format: wwid.config['timer_format'].to_sym, sort_by_name: opt[:sort_tags], sort_order: opt[:tag_order]) if opt[:totals]
|
|
140
142
|
out
|
data/lib/doing/string.rb
CHANGED
|
@@ -162,7 +162,7 @@ module Doing
|
|
|
162
162
|
## @param prefix [String] (Optional) A prefix to add to each line
|
|
163
163
|
##
|
|
164
164
|
def wrap(len, pad: 0, indent: ' ', offset: 0, prefix: '', color: '', after: '', reset: '')
|
|
165
|
-
last_color = after.last_color
|
|
165
|
+
last_color = color.empty? ? '' : after.last_color
|
|
166
166
|
note_rx = /(?i-m)(%(?:[io]d|(?:\^[\s\S])?(?:(?:[ _t]|[^a-z0-9])?\d+)?(?:[\s\S][ _t]?)?)?note)/
|
|
167
167
|
# Don't break inside of tag values
|
|
168
168
|
str = gsub(/@\S+\(.*?\)/) { |tag| tag.gsub(/\s/, '%%%%') }
|
data/lib/doing/version.rb
CHANGED
data/lib/doing/wwid.rb
CHANGED
|
@@ -611,6 +611,22 @@ module Doing
|
|
|
611
611
|
last_entry
|
|
612
612
|
end
|
|
613
613
|
|
|
614
|
+
def fzf
|
|
615
|
+
fzf_dir = File.join(File.dirname(__FILE__), '../helpers/fzf')
|
|
616
|
+
FileUtils.mkdir_p(fzf_dir) unless File.directory?(fzf_dir)
|
|
617
|
+
fzf = File.join(fzf_dir, 'bin/fzf')
|
|
618
|
+
return fzf if File.exist?(fzf)
|
|
619
|
+
|
|
620
|
+
Doing.logger.log_now(:warn, 'Downloading and installing FZF. This will only happen once')
|
|
621
|
+
Doing.logger.log_now(:warn, 'fzf is copyright Junegunn Choi <https://github.com/junegunn/fzf/blob/master/LICENSE>')
|
|
622
|
+
res = `git clone --depth 1 https://github.com/junegunn/fzf.git #{fzf_dir}`
|
|
623
|
+
res = `#{fzf_dir}/install --bin --no-key-bindings --no-completion --no-update-rc --no-bash --no-zsh --no-fish`
|
|
624
|
+
|
|
625
|
+
raise DoingRuntimeError unless File.exist?(fzf)
|
|
626
|
+
|
|
627
|
+
fzf
|
|
628
|
+
end
|
|
629
|
+
|
|
614
630
|
##
|
|
615
631
|
## Generate a menu of options and allow user selection
|
|
616
632
|
##
|
|
@@ -619,7 +635,6 @@ module Doing
|
|
|
619
635
|
def choose_from(options, prompt: 'Make a selection: ', multiple: false, sorted: true, fzf_args: [])
|
|
620
636
|
return nil unless $stdout.isatty
|
|
621
637
|
|
|
622
|
-
fzf = File.join(File.dirname(__FILE__), '../helpers/fuzzyfilefinder')
|
|
623
638
|
# fzf_args << '-1' # User is expecting a menu, and even if only one it seves as confirmation
|
|
624
639
|
fzf_args << %(--prompt "#{prompt}")
|
|
625
640
|
fzf_args << '--multi' if multiple
|
|
@@ -653,8 +668,6 @@ module Doing
|
|
|
653
668
|
def fuzzy_filter_items(items, opt: {})
|
|
654
669
|
scannable = items.map.with_index { |item, idx| "#{item.title} #{item.note.join(' ')}".gsub(/[|*?!]/, '') + "|#{idx}" }.join("\n")
|
|
655
670
|
|
|
656
|
-
fzf = File.join(File.dirname(__FILE__), '../helpers/fuzzyfilefinder')
|
|
657
|
-
|
|
658
671
|
fzf_args = [
|
|
659
672
|
'--multi',
|
|
660
673
|
%(--filter="#{opt[:search].sub(/^'?/, "'")}"),
|
|
@@ -869,8 +882,6 @@ module Doing
|
|
|
869
882
|
out.join('')
|
|
870
883
|
end
|
|
871
884
|
|
|
872
|
-
fzf = File.join(File.dirname(__FILE__), '../helpers/fuzzyfilefinder')
|
|
873
|
-
|
|
874
885
|
fzf_args = [
|
|
875
886
|
%(--header="#{opt[:header]}"),
|
|
876
887
|
%(--prompt="#{opt[:prompt].sub(/ *$/, ' ')}"),
|
|
@@ -1649,7 +1660,9 @@ module Doing
|
|
|
1649
1660
|
opt[:format] ||= cfg['date_format']
|
|
1650
1661
|
opt[:order] ||= cfg['order'] || 'asc'
|
|
1651
1662
|
opt[:tag_order] ||= 'asc'
|
|
1652
|
-
opt[:tags_color]
|
|
1663
|
+
if opt[:tags_color].nil?
|
|
1664
|
+
opt[:tags_color] = cfg['tags_color'] || false
|
|
1665
|
+
end
|
|
1653
1666
|
opt[:template] ||= cfg['template']
|
|
1654
1667
|
|
|
1655
1668
|
# opt[:highlight] ||= true
|
|
@@ -2182,10 +2195,11 @@ EOS
|
|
|
2182
2195
|
|
|
2183
2196
|
@content.each do |title, section|
|
|
2184
2197
|
output += "#{section[:original]}\n"
|
|
2185
|
-
output += list_section({ section: title, template: "\t- %date | %title%t2note", highlight: false, wrap_width: 0 })
|
|
2198
|
+
output += list_section({ section: title, template: "\t- %date | %title%t2note", highlight: false, wrap_width: 0, tags_color: false })
|
|
2186
2199
|
end
|
|
2187
2200
|
|
|
2188
|
-
output
|
|
2201
|
+
output += @other_content_bottom.join("\n") unless @other_content_bottom.nil?
|
|
2202
|
+
output.uncolor
|
|
2189
2203
|
end
|
|
2190
2204
|
|
|
2191
2205
|
##
|
data/lib/doing.rb
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
2
|
require 'doing/version'
|
|
4
3
|
require 'time'
|
|
5
4
|
require 'date'
|
|
@@ -30,6 +29,7 @@ require 'doing/errors'
|
|
|
30
29
|
require 'doing/hooks'
|
|
31
30
|
require 'doing/plugin_manager'
|
|
32
31
|
require 'doing/pager'
|
|
32
|
+
require 'doing/completion'
|
|
33
33
|
# require 'doing/markdown_document_listener'
|
|
34
34
|
|
|
35
35
|
# Main doing module
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
project_name: fzf
|
|
3
|
+
|
|
4
|
+
before:
|
|
5
|
+
hooks:
|
|
6
|
+
- go mod download
|
|
7
|
+
|
|
8
|
+
builds:
|
|
9
|
+
- id: fzf-macos
|
|
10
|
+
binary: fzf
|
|
11
|
+
goos:
|
|
12
|
+
- darwin
|
|
13
|
+
goarch:
|
|
14
|
+
- amd64
|
|
15
|
+
ldflags:
|
|
16
|
+
- "-s -w -X main.version={{ .Version }} -X main.revision={{ .ShortCommit }}"
|
|
17
|
+
hooks:
|
|
18
|
+
post: |
|
|
19
|
+
sh -c '
|
|
20
|
+
cat > /tmp/fzf-gon-amd64.hcl << EOF
|
|
21
|
+
source = ["./dist/fzf-macos_darwin_amd64/fzf"]
|
|
22
|
+
bundle_id = "kr.junegunn.fzf"
|
|
23
|
+
apple_id {
|
|
24
|
+
username = "junegunn.c@gmail.com"
|
|
25
|
+
password = "@env:AC_PASSWORD"
|
|
26
|
+
}
|
|
27
|
+
sign {
|
|
28
|
+
application_identity = "Developer ID Application: Junegunn Choi (Y254DRW44Z)"
|
|
29
|
+
}
|
|
30
|
+
zip {
|
|
31
|
+
output_path = "./dist/fzf-{{ .Version }}-darwin_amd64.zip"
|
|
32
|
+
}
|
|
33
|
+
EOF
|
|
34
|
+
gon /tmp/fzf-gon-amd64.hcl
|
|
35
|
+
'
|
|
36
|
+
|
|
37
|
+
- id: fzf-macos-arm
|
|
38
|
+
binary: fzf
|
|
39
|
+
goos:
|
|
40
|
+
- darwin
|
|
41
|
+
goarch:
|
|
42
|
+
- arm64
|
|
43
|
+
ldflags:
|
|
44
|
+
- "-s -w -X main.version={{ .Version }} -X main.revision={{ .ShortCommit }}"
|
|
45
|
+
hooks:
|
|
46
|
+
post: |
|
|
47
|
+
sh -c '
|
|
48
|
+
cat > /tmp/fzf-gon-arm64.hcl << EOF
|
|
49
|
+
source = ["./dist/fzf-macos-arm_darwin_arm64/fzf"]
|
|
50
|
+
bundle_id = "kr.junegunn.fzf"
|
|
51
|
+
apple_id {
|
|
52
|
+
username = "junegunn.c@gmail.com"
|
|
53
|
+
password = "@env:AC_PASSWORD"
|
|
54
|
+
}
|
|
55
|
+
sign {
|
|
56
|
+
application_identity = "Developer ID Application: Junegunn Choi (Y254DRW44Z)"
|
|
57
|
+
}
|
|
58
|
+
zip {
|
|
59
|
+
output_path = "./dist/fzf-{{ .Version }}-darwin_arm64.zip"
|
|
60
|
+
}
|
|
61
|
+
EOF
|
|
62
|
+
gon /tmp/fzf-gon-arm64.hcl
|
|
63
|
+
'
|
|
64
|
+
|
|
65
|
+
- id: fzf
|
|
66
|
+
goos:
|
|
67
|
+
- linux
|
|
68
|
+
- windows
|
|
69
|
+
- freebsd
|
|
70
|
+
- openbsd
|
|
71
|
+
goarch:
|
|
72
|
+
- amd64
|
|
73
|
+
- arm
|
|
74
|
+
- arm64
|
|
75
|
+
goarm:
|
|
76
|
+
- 5
|
|
77
|
+
- 6
|
|
78
|
+
- 7
|
|
79
|
+
ldflags:
|
|
80
|
+
- "-s -w -X main.version={{ .Version }} -X main.revision={{ .ShortCommit }}"
|
|
81
|
+
ignore:
|
|
82
|
+
- goos: freebsd
|
|
83
|
+
goarch: arm
|
|
84
|
+
- goos: openbsd
|
|
85
|
+
goarch: arm
|
|
86
|
+
- goos: freebsd
|
|
87
|
+
goarch: arm64
|
|
88
|
+
- goos: openbsd
|
|
89
|
+
goarch: arm64
|
|
90
|
+
|
|
91
|
+
archives:
|
|
92
|
+
- name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
|
|
93
|
+
builds:
|
|
94
|
+
- fzf
|
|
95
|
+
format: tar.gz
|
|
96
|
+
format_overrides:
|
|
97
|
+
- goos: windows
|
|
98
|
+
format: zip
|
|
99
|
+
files:
|
|
100
|
+
- non-existent*
|
|
101
|
+
|
|
102
|
+
release:
|
|
103
|
+
github:
|
|
104
|
+
owner: junegunn
|
|
105
|
+
name: fzf
|
|
106
|
+
prerelease: auto
|
|
107
|
+
name_template: '{{ .Tag }}'
|
|
108
|
+
extra_files:
|
|
109
|
+
- glob: ./dist/fzf-*darwin*.zip
|
|
110
|
+
|
|
111
|
+
snapshot:
|
|
112
|
+
name_template: "{{ .Tag }}-devel"
|
|
113
|
+
|
|
114
|
+
changelog:
|
|
115
|
+
sort: asc
|
|
116
|
+
filters:
|
|
117
|
+
exclude:
|
|
118
|
+
- README
|
|
119
|
+
- test
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Layout/LineLength:
|
|
2
|
+
Enabled: false
|
|
3
|
+
Metrics:
|
|
4
|
+
Enabled: false
|
|
5
|
+
Lint/ShadowingOuterLocalVariable:
|
|
6
|
+
Enabled: false
|
|
7
|
+
Style/MethodCallWithArgsParentheses:
|
|
8
|
+
Enabled: true
|
|
9
|
+
IgnoredMethods:
|
|
10
|
+
- assert
|
|
11
|
+
- exit
|
|
12
|
+
- paste
|
|
13
|
+
- puts
|
|
14
|
+
- raise
|
|
15
|
+
- refute
|
|
16
|
+
- require
|
|
17
|
+
- send_keys
|
|
18
|
+
IgnoredPatterns:
|
|
19
|
+
- ^assert_
|
|
20
|
+
- ^refute_
|
|
21
|
+
Style/NumericPredicate:
|
|
22
|
+
Enabled: false
|
|
23
|
+
Style/StringConcatenation:
|
|
24
|
+
Enabled: false
|
|
25
|
+
Style/OptionalBooleanParameter:
|
|
26
|
+
Enabled: false
|
|
27
|
+
Style/WordArray:
|
|
28
|
+
MinSize: 1
|