howzit 1.2.8 → 1.2.11
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 +16 -0
- data/Gemfile +2 -0
- data/Guardfile +3 -1
- data/README.md +1 -0
- data/Rakefile +4 -2
- data/bin/howzit +4 -1
- data/howzit.gemspec +1 -1
- data/lib/howzit/buildnotes.rb +31 -17
- data/lib/howzit/stringutils.rb +1 -1
- data/lib/howzit/version.rb +1 -1
- data/spec/ruby_gem_spec.rb +1 -1
- data/spec/spec_helper.rb +8 -8
- metadata +1 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 24b630c81dbd81b43b8572bbc91baabe96063a17c3cb6295a8026e6a3176dd39
|
|
4
|
+
data.tar.gz: 04c98ab9c7a9c57e8c7536e7709b57d51b965a76cc315c846c46dca3a0a2105e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3ce4d9a3cd8cd8970cd37e5b90c7154c0b66de06827780c4e38bb4f358d517b8c81d720383cbaa8fa84ff74f56a9f1f60e554f92614cf12e4f1f563092d9d651
|
|
7
|
+
data.tar.gz: 5187fbd097d9171ddd3756f9df92e62b0df5309d7e1d2e0aef26551f6641340d65ade5f49f1c9b0a47852e6913c64d5914d334732e15a1ac71f2277edde38fe7
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Guardfile
CHANGED
data/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Howzit
|
|
2
2
|
|
|
3
3
|
[](https://rubygems.org/gems/howzit)
|
|
4
|
+
[](https://travis-ci.org/makenew/ruby-gem)
|
|
4
5
|
[](./LICENSE.txt)
|
|
5
6
|
|
|
6
7
|
A command-line reference tool for tracking project build systems
|
data/Rakefile
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'bump/tasks'
|
|
2
4
|
require 'bundler/gem_tasks'
|
|
3
5
|
require 'rspec/core/rake_task'
|
|
4
6
|
require 'rubocop/rake_task'
|
|
5
7
|
require 'yard'
|
|
6
8
|
|
|
7
|
-
task default: [
|
|
9
|
+
task default: %i[test yard]
|
|
8
10
|
|
|
9
11
|
desc 'Run test suite'
|
|
10
|
-
task test: [
|
|
12
|
+
task test: %i[rubocop spec]
|
|
11
13
|
|
|
12
14
|
RSpec::Core::RakeTask.new
|
|
13
15
|
|
data/bin/howzit
CHANGED
data/howzit.gemspec
CHANGED
|
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
|
31
31
|
spec.add_development_dependency 'rubocop', '~> 0.28'
|
|
32
32
|
spec.add_development_dependency 'rspec', '~> 3.1'
|
|
33
33
|
spec.add_development_dependency 'simplecov', '~> 0.9'
|
|
34
|
-
spec.add_development_dependency 'codecov', '~> 0.1'
|
|
34
|
+
# spec.add_development_dependency 'codecov', '~> 0.1'
|
|
35
35
|
spec.add_development_dependency 'fuubar', '~> 2.0'
|
|
36
36
|
|
|
37
37
|
spec.add_development_dependency 'yard', '~> 0.9.5'
|
data/lib/howzit/buildnotes.rb
CHANGED
|
@@ -3,7 +3,7 @@ module Howzit
|
|
|
3
3
|
class BuildNotes
|
|
4
4
|
include Prompt
|
|
5
5
|
|
|
6
|
-
attr_accessor :arguments, :metadata
|
|
6
|
+
attr_accessor :cli_args, :arguments, :metadata
|
|
7
7
|
|
|
8
8
|
def topics
|
|
9
9
|
@topics ||= read_help
|
|
@@ -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
|
|
@@ -662,7 +673,7 @@ module Howzit
|
|
|
662
673
|
matches
|
|
663
674
|
end
|
|
664
675
|
|
|
665
|
-
def initialize(args)
|
|
676
|
+
def initialize(args = [])
|
|
666
677
|
flags = {
|
|
667
678
|
run: false,
|
|
668
679
|
list_topics: false,
|
|
@@ -705,7 +716,8 @@ module Howzit
|
|
|
705
716
|
OptionParser.new do |opts|
|
|
706
717
|
opts.banner = "Usage: #{__FILE__} [OPTIONS] [TOPIC]"
|
|
707
718
|
opts.separator ''
|
|
708
|
-
opts.separator 'Show build notes for the current project (buildnotes.md).
|
|
719
|
+
opts.separator 'Show build notes for the current project (buildnotes.md).
|
|
720
|
+
Include a topic name to see just that topic, or no argument to display all.'
|
|
709
721
|
opts.separator ''
|
|
710
722
|
opts.separator 'Options:'
|
|
711
723
|
|
|
@@ -714,7 +726,8 @@ module Howzit
|
|
|
714
726
|
Process.exit 0
|
|
715
727
|
end
|
|
716
728
|
|
|
717
|
-
opts.on('-e', '--edit', "Edit buildnotes file in current working directory
|
|
729
|
+
opts.on('-e', '--edit', "Edit buildnotes file in current working directory
|
|
730
|
+
using #{File.basename(ENV['EDITOR'])}") do
|
|
718
731
|
edit_note
|
|
719
732
|
Process.exit 0
|
|
720
733
|
end
|
|
@@ -732,7 +745,8 @@ module Howzit
|
|
|
732
745
|
@options[:list_topics] = true
|
|
733
746
|
end
|
|
734
747
|
|
|
735
|
-
opts.on('-m', '--matching TYPE', MATCHING_OPTIONS,
|
|
748
|
+
opts.on('-m', '--matching TYPE', MATCHING_OPTIONS,
|
|
749
|
+
'Topics matching type', "(#{MATCHING_OPTIONS.join(', ')})") do |c|
|
|
736
750
|
@options[:matching] = c
|
|
737
751
|
end
|
|
738
752
|
|
|
@@ -795,7 +809,7 @@ module Howzit
|
|
|
795
809
|
puts "\e[1;30m[\e[1;37mtasks\e[1;30m]──────────────────────────────────────┐\e[0m"
|
|
796
810
|
metadata = file.extract_metadata
|
|
797
811
|
topics = read_help_file(file)
|
|
798
|
-
topics.
|
|
812
|
+
topics.each_key do |topic|
|
|
799
813
|
puts " \e[1;30m│\e[1;37m-\e[0m \e[1;36;40m#{template}:#{topic.sub(/^.*?:/, '')}\e[0m"
|
|
800
814
|
end
|
|
801
815
|
if metadata.size > 0
|
|
@@ -834,7 +848,7 @@ module Howzit
|
|
|
834
848
|
end
|
|
835
849
|
end.parse!(args)
|
|
836
850
|
|
|
837
|
-
|
|
851
|
+
@cli_args = args
|
|
838
852
|
end
|
|
839
853
|
|
|
840
854
|
def edit_note
|
|
@@ -851,7 +865,7 @@ module Howzit
|
|
|
851
865
|
end
|
|
852
866
|
|
|
853
867
|
##
|
|
854
|
-
##
|
|
868
|
+
## Traverse up directory tree looking for build notes
|
|
855
869
|
##
|
|
856
870
|
## @return topics dictionary
|
|
857
871
|
##
|
|
@@ -1053,7 +1067,7 @@ module Howzit
|
|
|
1053
1067
|
`#{ENV['EDITOR']} "#{config_file}"`
|
|
1054
1068
|
end
|
|
1055
1069
|
|
|
1056
|
-
def process
|
|
1070
|
+
def process
|
|
1057
1071
|
output = []
|
|
1058
1072
|
|
|
1059
1073
|
unless note_file
|
|
@@ -1107,9 +1121,9 @@ module Howzit
|
|
|
1107
1121
|
elsif @options[:choose]
|
|
1108
1122
|
topic_match = choose(topics.keys)
|
|
1109
1123
|
# If there are arguments use those to search for a matching topic
|
|
1110
|
-
elsif
|
|
1124
|
+
elsif !@cli_args.empty?
|
|
1111
1125
|
|
|
1112
|
-
search =
|
|
1126
|
+
search = @cli_args.join(' ').strip.downcase
|
|
1113
1127
|
matches = match_topic(search)
|
|
1114
1128
|
|
|
1115
1129
|
if matches.empty?
|
data/lib/howzit/stringutils.rb
CHANGED
|
@@ -5,7 +5,7 @@ module Howzit
|
|
|
5
5
|
module StringUtils
|
|
6
6
|
# Just strip out color codes when requested
|
|
7
7
|
def uncolor
|
|
8
|
-
gsub(/\e\[[\d;]+m/, '').gsub(/\e]1337;SetMark/,'')
|
|
8
|
+
gsub(/\e\[[\d;]+m/, '').gsub(/\e\]1337;SetMark/,'')
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
# Adapted from https://github.com/pazdera/word_wrap/,
|
data/lib/howzit/version.rb
CHANGED
data/spec/ruby_gem_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
require 'simplecov'
|
|
1
|
+
# require 'simplecov'
|
|
2
2
|
|
|
3
|
-
SimpleCov.start
|
|
3
|
+
# SimpleCov.start
|
|
4
4
|
|
|
5
|
-
if ENV['CI'] == 'true'
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
else
|
|
9
|
-
|
|
10
|
-
end
|
|
5
|
+
# if ENV['CI'] == 'true'
|
|
6
|
+
# require 'codecov'
|
|
7
|
+
# SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
|
8
|
+
# else
|
|
9
|
+
# SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
|
|
10
|
+
# end
|
|
11
11
|
|
|
12
12
|
require 'howzit'
|
|
13
13
|
|
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: 1.2.
|
|
4
|
+
version: 1.2.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brett Terpstra
|
|
@@ -150,20 +150,6 @@ dependencies:
|
|
|
150
150
|
- - "~>"
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
152
|
version: '0.9'
|
|
153
|
-
- !ruby/object:Gem::Dependency
|
|
154
|
-
name: codecov
|
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
|
156
|
-
requirements:
|
|
157
|
-
- - "~>"
|
|
158
|
-
- !ruby/object:Gem::Version
|
|
159
|
-
version: '0.1'
|
|
160
|
-
type: :development
|
|
161
|
-
prerelease: false
|
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
163
|
-
requirements:
|
|
164
|
-
- - "~>"
|
|
165
|
-
- !ruby/object:Gem::Version
|
|
166
|
-
version: '0.1'
|
|
167
153
|
- !ruby/object:Gem::Dependency
|
|
168
154
|
name: fuubar
|
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|