howzit 1.2.9 → 1.2.10
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 +8 -0
- data/lib/howzit/buildnotes.rb +17 -6
- data/lib/howzit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fba37c5c428aeab92ed337697a52323d5b98d5f9398776187e000043e3a5173b
|
4
|
+
data.tar.gz: 6f3a3ebfe50f50476837c2d702cd1c9854d49ff4960c51a06641e79d88abb410
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 015bc504dca39d5b7a32b6d81a4df037abf61467f58b392e88389557f38a2abfb078fd3dc5ced7411b5d1654479d5a79b94da843f8384d4cf77216e9efa1c24c
|
7
|
+
data.tar.gz: c0b2003e8c1b24efa1e193520a66e01813fab6e9d8e21318a7d0c82718540fa8ef1c99b075d40dc07254c678015ca3fe687b64a2be6f8ce541c22e786ac63c9a
|
data/CHANGELOG.md
CHANGED
data/lib/howzit/buildnotes.rb
CHANGED
@@ -132,8 +132,12 @@ module Howzit
|
|
132
132
|
end
|
133
133
|
end
|
134
134
|
|
135
|
+
def should_mark_iterm?
|
136
|
+
ENV['TERM_PROGRAM'] =~ /^iTerm/ && !@options[:run] && !@options[:paginate]
|
137
|
+
end
|
138
|
+
|
135
139
|
def iterm_marker
|
136
|
-
"\e]1337;SetMark\a
|
140
|
+
"\e]1337;SetMark\a" if should_mark_iterm?
|
137
141
|
end
|
138
142
|
|
139
143
|
def color_single_options(choices = %w[y n])
|
@@ -226,16 +230,23 @@ module Howzit
|
|
226
230
|
options = {
|
227
231
|
hr: "\u{254C}",
|
228
232
|
color: '1;32',
|
229
|
-
border: '0'
|
233
|
+
border: '0',
|
234
|
+
mark: false
|
230
235
|
}
|
231
236
|
|
232
237
|
options.merge!(opts)
|
233
238
|
|
234
239
|
cols = TTY::Screen.columns
|
240
|
+
|
235
241
|
cols = @options[:wrap] if (@options[:wrap]).positive? && cols > @options[:wrap]
|
236
|
-
title = "\e[#{options[:border]}m#{options[:hr]}
|
237
|
-
|
238
|
-
|
242
|
+
title = "\e[#{options[:border]}m#{options[:hr] * 2}( \e[#{options[:color]}m#{title}\e[#{options[:border]}m )"
|
243
|
+
|
244
|
+
tail = if should_mark_iterm?
|
245
|
+
"#{options[:hr] * (cols - title.uncolor.length - 15)}#{options[:mark] ? iterm_marker : ''}"
|
246
|
+
else
|
247
|
+
options[:hr] * (cols - title.uncolor.length)
|
248
|
+
end
|
249
|
+
"#{title}#{tail}\e[0m"
|
239
250
|
end
|
240
251
|
|
241
252
|
def os_open(command)
|
@@ -344,7 +355,7 @@ module Howzit
|
|
344
355
|
|
345
356
|
output = []
|
346
357
|
if opt[:header]
|
347
|
-
output.push(format_header(key))
|
358
|
+
output.push(format_header(key, { mark: should_mark_iterm? }))
|
348
359
|
output.push('')
|
349
360
|
end
|
350
361
|
topic = topics[key].strip
|
data/lib/howzit/version.rb
CHANGED