doing 2.0.20 → 2.0.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +1 -1
  5. data/doing.rdoc +1 -1
  6. data/lib/doing/log_adapter.rb +3 -1
  7. data/lib/doing/version.rb +1 -1
  8. data/lib/doing/wwid.rb +19 -8
  9. data/lib/helpers/fzf/.goreleaser.yml +119 -0
  10. data/lib/helpers/fzf/.rubocop.yml +28 -0
  11. data/lib/helpers/fzf/ADVANCED.md +565 -0
  12. data/lib/helpers/fzf/BUILD.md +49 -0
  13. data/lib/helpers/fzf/CHANGELOG.md +1193 -0
  14. data/lib/helpers/fzf/Dockerfile +11 -0
  15. data/lib/helpers/fzf/LICENSE +21 -0
  16. data/lib/helpers/fzf/Makefile +166 -0
  17. data/lib/helpers/fzf/README-VIM.md +486 -0
  18. data/lib/helpers/fzf/README.md +712 -0
  19. data/lib/helpers/fzf/bin/fzf-tmux +233 -0
  20. data/lib/helpers/fzf/doc/fzf.txt +512 -0
  21. data/lib/helpers/fzf/go.mod +17 -0
  22. data/lib/helpers/fzf/go.sum +31 -0
  23. data/lib/helpers/fzf/install +382 -0
  24. data/lib/helpers/fzf/install.ps1 +65 -0
  25. data/lib/helpers/fzf/main.go +14 -0
  26. data/lib/helpers/fzf/man/man1/fzf-tmux.1 +68 -0
  27. data/lib/helpers/fzf/man/man1/fzf.1 +1001 -0
  28. data/lib/helpers/fzf/plugin/fzf.vim +1048 -0
  29. data/lib/helpers/fzf/shell/completion.bash +381 -0
  30. data/lib/helpers/fzf/shell/completion.zsh +329 -0
  31. data/lib/helpers/fzf/shell/key-bindings.bash +96 -0
  32. data/lib/helpers/fzf/shell/key-bindings.fish +172 -0
  33. data/lib/helpers/fzf/shell/key-bindings.zsh +114 -0
  34. data/lib/helpers/fzf/src/LICENSE +21 -0
  35. data/lib/helpers/fzf/src/algo/algo.go +884 -0
  36. data/lib/helpers/fzf/src/algo/algo_test.go +197 -0
  37. data/lib/helpers/fzf/src/algo/normalize.go +492 -0
  38. data/lib/helpers/fzf/src/ansi.go +409 -0
  39. data/lib/helpers/fzf/src/ansi_test.go +427 -0
  40. data/lib/helpers/fzf/src/cache.go +81 -0
  41. data/lib/helpers/fzf/src/cache_test.go +39 -0
  42. data/lib/helpers/fzf/src/chunklist.go +89 -0
  43. data/lib/helpers/fzf/src/chunklist_test.go +80 -0
  44. data/lib/helpers/fzf/src/constants.go +85 -0
  45. data/lib/helpers/fzf/src/core.go +351 -0
  46. data/lib/helpers/fzf/src/history.go +96 -0
  47. data/lib/helpers/fzf/src/history_test.go +68 -0
  48. data/lib/helpers/fzf/src/item.go +44 -0
  49. data/lib/helpers/fzf/src/item_test.go +23 -0
  50. data/lib/helpers/fzf/src/matcher.go +235 -0
  51. data/lib/helpers/fzf/src/merger.go +120 -0
  52. data/lib/helpers/fzf/src/merger_test.go +88 -0
  53. data/lib/helpers/fzf/src/options.go +1691 -0
  54. data/lib/helpers/fzf/src/options_test.go +457 -0
  55. data/lib/helpers/fzf/src/pattern.go +425 -0
  56. data/lib/helpers/fzf/src/pattern_test.go +209 -0
  57. data/lib/helpers/fzf/src/protector/protector.go +8 -0
  58. data/lib/helpers/fzf/src/protector/protector_openbsd.go +10 -0
  59. data/lib/helpers/fzf/src/reader.go +201 -0
  60. data/lib/helpers/fzf/src/reader_test.go +63 -0
  61. data/lib/helpers/fzf/src/result.go +243 -0
  62. data/lib/helpers/fzf/src/result_others.go +16 -0
  63. data/lib/helpers/fzf/src/result_test.go +159 -0
  64. data/lib/helpers/fzf/src/result_x86.go +16 -0
  65. data/lib/helpers/fzf/src/terminal.go +2832 -0
  66. data/lib/helpers/fzf/src/terminal_test.go +638 -0
  67. data/lib/helpers/fzf/src/terminal_unix.go +26 -0
  68. data/lib/helpers/fzf/src/terminal_windows.go +45 -0
  69. data/lib/helpers/fzf/src/tokenizer.go +253 -0
  70. data/lib/helpers/fzf/src/tokenizer_test.go +112 -0
  71. data/lib/helpers/fzf/src/tui/dummy.go +46 -0
  72. data/lib/helpers/fzf/src/tui/light.go +987 -0
  73. data/lib/helpers/fzf/src/tui/light_unix.go +110 -0
  74. data/lib/helpers/fzf/src/tui/light_windows.go +145 -0
  75. data/lib/helpers/fzf/src/tui/tcell.go +721 -0
  76. data/lib/helpers/fzf/src/tui/tcell_test.go +392 -0
  77. data/lib/helpers/fzf/src/tui/ttyname_unix.go +47 -0
  78. data/lib/helpers/fzf/src/tui/ttyname_windows.go +14 -0
  79. data/lib/helpers/fzf/src/tui/tui.go +625 -0
  80. data/lib/helpers/fzf/src/tui/tui_test.go +20 -0
  81. data/lib/helpers/fzf/src/util/atomicbool.go +34 -0
  82. data/lib/helpers/fzf/src/util/atomicbool_test.go +17 -0
  83. data/lib/helpers/fzf/src/util/chars.go +198 -0
  84. data/lib/helpers/fzf/src/util/chars_test.go +46 -0
  85. data/lib/helpers/fzf/src/util/eventbox.go +96 -0
  86. data/lib/helpers/fzf/src/util/eventbox_test.go +61 -0
  87. data/lib/helpers/fzf/src/util/slab.go +12 -0
  88. data/lib/helpers/fzf/src/util/util.go +138 -0
  89. data/lib/helpers/fzf/src/util/util_test.go +40 -0
  90. data/lib/helpers/fzf/src/util/util_unix.go +47 -0
  91. data/lib/helpers/fzf/src/util/util_windows.go +83 -0
  92. data/lib/helpers/fzf/test/fzf.vader +175 -0
  93. data/lib/helpers/fzf/test/test_go.rb +2626 -0
  94. data/lib/helpers/fzf/uninstall +117 -0
  95. metadata +88 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29a3fd2f95b1eb4a02f49bddca32255e0f56b93693a4114d004181d6c309d453
4
- data.tar.gz: 696931fdda6f08e136225ceb6e47425f171f86b222a8313cd485a21ab7222ac3
3
+ metadata.gz: be908ed31434bd248efe3ebcba66b9022ed35be3651af6ada7e6464b50c91c9f
4
+ data.tar.gz: 0dcf2ce4915637e2514a8d9735c8ca294a6d5bbc0558afdabeb714d3f1de5b50
5
5
  SHA512:
6
- metadata.gz: a60c786a031b42be76cc10cacecf7247363369facf8584df5fd7790a9ea0dd6ccd148b460fa121aacada61a9d86a33b6a0827cda20e0b28d9614affe464ccccc
7
- data.tar.gz: f47889440ee5ed7e53f227086139705b90b30004bb0c815f1aff3ffc9f6faa35cb47707c330476f73a47d56fd88963430e1ffb6b26e8c2b9f045e6c18685bdff
6
+ metadata.gz: ef314b60821ba50306c0d6b9704f310a21d6652480e67350f092cfc670c6ddab9024c24f602d68396e555fb624cf316507526a50b241c959639c738699c8602e
7
+ data.tar.gz: 8474ed1164f978c0359f7826b1c92fd66821bb112ae71938a67245b42a8e342f8e629dd42ec4cc8216b033e6aff20e1c44d0b3d89cdbc7f96b5e6d4513cd1319
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ### 2.0.24
2
+
3
+ - include fzf source directly, in case git isn't installed
4
+ - fall back to installing fzf with sudo on error
5
+
1
6
  ### 2.0.20
2
7
 
3
8
  #### IMPROVED
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- doing (2.0.20)
4
+ doing (2.0.24)
5
5
  chronic (~> 0.10, >= 0.10.2)
6
6
  deep_merge (~> 1.2, >= 1.2.1)
7
7
  gli (~> 2.19, >= 2.19.2)
data/README.md CHANGED
@@ -6,7 +6,7 @@ _If you're one of the rare people like me who find this useful, feel free to [bu
6
6
 
7
7
  <!--README-->
8
8
 
9
- The current version of `doing` is <!--VER-->2.0.19<!--END VER-->.
9
+ The current version of `doing` is <!--VER-->2.0.23<!--END VER-->.
10
10
 
11
11
  Find all of the documentation in the [doing wiki](https://github.com/ttscoff/doing/wiki).
12
12
 
data/doing.rdoc CHANGED
@@ -5,7 +5,7 @@ record of what you've been doing, complete with tag-based time tracking. The
5
5
  command line tool allows you to add entries, annotate with tags and notes, and
6
6
  view your entries with myriad options, with a focus on a "natural" language syntax.
7
7
 
8
- v2.0.20
8
+ v2.0.24
9
9
 
10
10
  === Global Options
11
11
  === --config_file arg
@@ -72,7 +72,9 @@ module Doing
72
72
  end
73
73
 
74
74
  def adjust_verbosity(options = {})
75
- if options[:quiet]
75
+ if options[:log_level]
76
+ self.log_level = options[:log_level].to_sym
77
+ elsif options[:quiet]
76
78
  self.log_level = :error
77
79
  elsif options[:verbose] || options[:debug]
78
80
  self.log_level = :debug
data/lib/doing/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Doing
2
- VERSION = '2.0.20'
2
+ VERSION = '2.0.24'
3
3
  end
data/lib/doing/wwid.rb CHANGED
@@ -612,19 +612,30 @@ module Doing
612
612
  end
613
613
 
614
614
  def fzf
615
+ @fzf ||= install_fzf
616
+ end
617
+
618
+ def install_fzf
615
619
  fzf_dir = File.join(File.dirname(__FILE__), '../helpers/fzf')
616
620
  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)
621
+ fzf_bin = File.join(fzf_dir, 'bin/fzf')
622
+ return fzf_bin if File.exist?(fzf_bin)
619
623
 
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
+ prev_level = Doing.logger.level
625
+ Doing.logger.adjust_verbosity({ log_level: :info })
626
+ Doing.logger.log_now(:warn, 'Compiling and installing fzf -- this will only happen once')
627
+ Doing.logger.log_now(:warn, 'fzf is copyright Junegunn Choi, MIT License <https://github.com/junegunn/fzf/blob/master/LICENSE>')
624
628
 
625
- raise DoingRuntimeError unless File.exist?(fzf)
629
+ res = system("'#{fzf_dir}/install' --bin --no-key-bindings --no-completion --no-update-rc --no-bash --no-zsh --no-fish &> /dev/null")
630
+ unless File.exist?(fzf_bin)
631
+ Doing.logger.log_now(:warn, 'Error installing, trying again as root')
632
+ system("sudo '#{fzf_dir}/install' --bin --no-key-bindings --no-completion --no-update-rc --no-bash --no-zsh --no-fish &> /dev/null")
633
+ end
634
+ raise RuntimeError.new('Error installing fzf, please report at https://github.com/ttscoff/doing/issues') unless File.exist?(fzf_bin)
626
635
 
627
- fzf
636
+ Doing.logger.info("fzf installed to #{fzf}")
637
+ Doing.logger.adjust_verbosity({ log_level: prev_level })
638
+ fzf_bin
628
639
  end
629
640
 
630
641
  ##
@@ -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