howzit 2.0.19 → 2.0.20

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c08d6ceea211cc4e603a59c5e2f1ac7c2db806d55a8eaa1f260e1f0994bdf45
4
- data.tar.gz: c5b6c284c725a8f1edabc07723a18d0e9d9c56204be0b7fb50e0d3bb1b5efccf
3
+ metadata.gz: 22f532430daee5c4c7a1d662d959aa5141848be745940e497b0f5d5d920e0739
4
+ data.tar.gz: 4db5982c0f1409754cf41206b747ccc39b02ceacdaf100dc12e32185d8c13602
5
5
  SHA512:
6
- metadata.gz: 8c456e2c7f820777d6e07a26fcc677bfa8ac09a12bd409e870c37dbaa431f186ac551575b6eead585d446a02b533b5c729eba4dfac40b2caa876ff9f63400c9b
7
- data.tar.gz: 03717f2b209cf812b31e5da66ab57000e7e54cd52efa08b8bc7e4c2840e30581509af401e76e8ccef9e5cd0b232d04601eb6d5723b49cc1e6ae3bb7e760bff29
6
+ metadata.gz: 7d57db8ee804c204c42b1b30fac02bede10a2ec1b46c31aaf33a688a3441c6338e033e568d61eecedf3ec5a0c05087106532504a4c7cfcbff6daf1ccd9efea20
7
+ data.tar.gz: 99d46ccfe0612d10c832e093a6b1f95fd4c48a72750e2375bc67b5bc8c1a017d15580f5806fa90fb47e8aae6db1f31c3fc931fd51d588ce1aa249bddfe875538
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ### 2.0.20
2
+
3
+ 2022-08-08 11:38
4
+
5
+ #### NEW
6
+
7
+ - --hook command for macOS to copy a link to the build note to clipboard
8
+
9
+ #### FIXED
10
+
11
+ - Error on --edit-config
12
+ - Fzf preview empty
13
+
1
14
  ### 2.0.19
2
15
 
3
16
  2022-08-08 06:18
data/bin/howzit CHANGED
@@ -131,13 +131,15 @@ OptionParser.new do |opts|
131
131
  Process.exit 0
132
132
  end
133
133
 
134
- desc = %(Edit buildnotes file in current working directory using editor (#{File.basename(Howzit.options[:config_editor])}))
134
+ editor = File.basename(Howzit.options[:editor])
135
+ desc = %(Edit buildnotes file in current working directory using editor (#{editor}))
135
136
  opts.on('-e', '--edit', desc) do
136
137
  Howzit.buildnote.edit
137
138
  Process.exit 0
138
139
  end
139
140
 
140
- opts.on('--edit-config', "Edit configuration file using editor (#{File.basename(Howzit.options[:editor])})") do
141
+ config_editor = File.basename(Howzit.options[:config_editor])
142
+ opts.on('--edit-config', "Edit configuration file using editor (#{config_editor})") do
141
143
  Howzit.config.editor
142
144
  Process.exit 0
143
145
  end
@@ -151,6 +153,13 @@ OptionParser.new do |opts|
151
153
  Howzit.options[:grep] = pat
152
154
  end
153
155
 
156
+ if RbConfig::CONFIG['target_os'] =~ /darwin.*/i
157
+ opts.on('--hook', 'Copy a link to the build note file, ready for pasting into Hook.app or other notes') do
158
+ Howzit.buildnote.hook
159
+ Process.exit 0
160
+ end
161
+ end
162
+
154
163
  opts.on('-r', '--run', 'Execute @run, @open, and/or @copy commands for given topic') do
155
164
  Howzit.options[:run] = true
156
165
  end
@@ -72,6 +72,17 @@ module Howzit
72
72
  end
73
73
  end
74
74
 
75
+ ##
76
+ ## Copy a link to the main build note file to clipboard (macOS only)
77
+ ##
78
+ def hook
79
+ title = Util.read_file(note_file).note_title(note_file, 20)
80
+ title = "#{title} build notes"
81
+ url = "[#{title}](file://#{note_file})"
82
+ `echo #{Shellwords.escape(url)}'\\c'|pbcopy`
83
+ Howzit.console.info('Link copied to clipboard.')
84
+ end
85
+
75
86
  ##
76
87
  ## Call grep on all topics, filtering out those that don't match
77
88
  ##
data/lib/howzit/config.rb CHANGED
@@ -74,7 +74,7 @@ module Howzit
74
74
  ## Initiate the editor for the config
75
75
  ##
76
76
  def editor
77
- edit_config(DEFAULTS)
77
+ edit_config
78
78
  end
79
79
 
80
80
  private
data/lib/howzit/prompt.rb CHANGED
@@ -100,7 +100,7 @@ module Howzit
100
100
  "--height=#{height}",
101
101
  '--header="Use tab to mark multiple selections, enter to display/run"',
102
102
  '--prompt="Select a section > "',
103
- '--preview="howzit {}"'
103
+ %(--preview="howzit --no-pager --header-format block --no-color --default --multiple first {}")
104
104
  ]
105
105
  res = `echo #{Shellwords.escape(matches.join("\n"))} | fzf #{settings.join(' ')}`.strip
106
106
  if res.nil? || res.empty?
@@ -3,5 +3,5 @@
3
3
  # Primary module for this gem.
4
4
  module Howzit
5
5
  # Current Howzit version.
6
- VERSION = '2.0.19'
6
+ VERSION = '2.0.20'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: howzit
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.19
4
+ version: 2.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra