howzit 1.2.10 → 1.2.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fba37c5c428aeab92ed337697a52323d5b98d5f9398776187e000043e3a5173b
4
- data.tar.gz: 6f3a3ebfe50f50476837c2d702cd1c9854d49ff4960c51a06641e79d88abb410
3
+ metadata.gz: 24b630c81dbd81b43b8572bbc91baabe96063a17c3cb6295a8026e6a3176dd39
4
+ data.tar.gz: 04c98ab9c7a9c57e8c7536e7709b57d51b965a76cc315c846c46dca3a0a2105e
5
5
  SHA512:
6
- metadata.gz: 015bc504dca39d5b7a32b6d81a4df037abf61467f58b392e88389557f38a2abfb078fd3dc5ced7411b5d1654479d5a79b94da843f8384d4cf77216e9efa1c24c
7
- data.tar.gz: c0b2003e8c1b24efa1e193520a66e01813fab6e9d8e21318a7d0c82718540fa8ef1c99b075d40dc07254c678015ca3fe687b64a2be6f8ce541c22e786ac63c9a
6
+ metadata.gz: 3ce4d9a3cd8cd8970cd37e5b90c7154c0b66de06827780c4e38bb4f358d517b8c81d720383cbaa8fa84ff74f56a9f1f60e554f92614cf12e4f1f563092d9d651
7
+ data.tar.gz: 5187fbd097d9171ddd3756f9df92e62b0df5309d7e1d2e0aef26551f6641340d65ade5f49f1c9b0a47852e6913c64d5914d334732e15a1ac71f2277edde38fe7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 1.2.11
2
+
3
+ 2022-08-01 08:23
4
+
5
+ #### IMPROVED
6
+
7
+ - Code cleanup and refactoring
8
+
1
9
  ### 1.2.10
2
10
 
3
11
  2022-08-01 07:45
@@ -6,10 +14,6 @@
6
14
 
7
15
  - Headline formatting when iTerm markers are inserted
8
16
 
9
- ### 1.2.9
10
-
11
- 2022-08-01 07:09
12
-
13
17
  ### 1.2.8
14
18
 
15
19
  2022-08-01 07:01
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in howzit.gemspec.
data/Guardfile CHANGED
@@ -1,4 +1,6 @@
1
- scope groups: [:doc, :lint, :unit]
1
+ # frozen_string_literal: true
2
+
3
+ scope groups: %i[doc lint unit]
2
4
 
3
5
  group :doc do
4
6
  guard :yard do
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Howzit
2
2
 
3
3
  [![Gem](https://img.shields.io/gem/v/howzit.svg)](https://rubygems.org/gems/howzit)
4
+ [![Travis](https://img.shields.io/travis/makenew/ruby-gem.svg)](https://travis-ci.org/makenew/ruby-gem)
4
5
  [![GitHub license](https://img.shields.io/github/license/ttscoff/howzit.svg)](./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: [:test, :yard]
9
+ task default: %i[test yard]
8
10
 
9
11
  desc 'Run test suite'
10
- task test: [:rubocop, :spec]
12
+ task test: %i[rubocop spec]
11
13
 
12
14
  RSpec::Core::RakeTask.new
13
15
 
data/bin/howzit CHANGED
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
+
3
4
  $LOAD_PATH.unshift File.join(__dir__, '..', 'lib')
4
5
  require 'howzit'
5
6
 
6
- Howzit::BuildNotes.new(ARGV)
7
+ how = Howzit::BuildNotes.new(ARGV)
8
+ how.process
9
+
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'
@@ -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
@@ -673,7 +673,7 @@ module Howzit
673
673
  matches
674
674
  end
675
675
 
676
- def initialize(args)
676
+ def initialize(args = [])
677
677
  flags = {
678
678
  run: false,
679
679
  list_topics: false,
@@ -716,7 +716,8 @@ module Howzit
716
716
  OptionParser.new do |opts|
717
717
  opts.banner = "Usage: #{__FILE__} [OPTIONS] [TOPIC]"
718
718
  opts.separator ''
719
- opts.separator 'Show build notes for the current project (buildnotes.md). Include a topic name to see just that topic, or no argument to display all.'
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.'
720
721
  opts.separator ''
721
722
  opts.separator 'Options:'
722
723
 
@@ -725,7 +726,8 @@ module Howzit
725
726
  Process.exit 0
726
727
  end
727
728
 
728
- opts.on('-e', '--edit', "Edit buildnotes file in current working directory using #{File.basename(ENV['EDITOR'])}") do
729
+ opts.on('-e', '--edit', "Edit buildnotes file in current working directory
730
+ using #{File.basename(ENV['EDITOR'])}") do
729
731
  edit_note
730
732
  Process.exit 0
731
733
  end
@@ -743,7 +745,8 @@ module Howzit
743
745
  @options[:list_topics] = true
744
746
  end
745
747
 
746
- opts.on('-m', '--matching TYPE', MATCHING_OPTIONS, 'Topics matching type', "(#{MATCHING_OPTIONS.join(', ')})") do |c|
748
+ opts.on('-m', '--matching TYPE', MATCHING_OPTIONS,
749
+ 'Topics matching type', "(#{MATCHING_OPTIONS.join(', ')})") do |c|
747
750
  @options[:matching] = c
748
751
  end
749
752
 
@@ -806,7 +809,7 @@ module Howzit
806
809
  puts "\e[1;30m[\e[1;37mtasks\e[1;30m]──────────────────────────────────────┐\e[0m"
807
810
  metadata = file.extract_metadata
808
811
  topics = read_help_file(file)
809
- topics.keys.each do |topic|
812
+ topics.each_key do |topic|
810
813
  puts " \e[1;30m│\e[1;37m-\e[0m \e[1;36;40m#{template}:#{topic.sub(/^.*?:/, '')}\e[0m"
811
814
  end
812
815
  if metadata.size > 0
@@ -845,7 +848,7 @@ module Howzit
845
848
  end
846
849
  end.parse!(args)
847
850
 
848
- process(args)
851
+ @cli_args = args
849
852
  end
850
853
 
851
854
  def edit_note
@@ -862,7 +865,7 @@ module Howzit
862
865
  end
863
866
 
864
867
  ##
865
- ## @brief Traverse up directory tree looking for build notes
868
+ ## Traverse up directory tree looking for build notes
866
869
  ##
867
870
  ## @return topics dictionary
868
871
  ##
@@ -1064,7 +1067,7 @@ module Howzit
1064
1067
  `#{ENV['EDITOR']} "#{config_file}"`
1065
1068
  end
1066
1069
 
1067
- def process(args)
1070
+ def process
1068
1071
  output = []
1069
1072
 
1070
1073
  unless note_file
@@ -1118,9 +1121,9 @@ module Howzit
1118
1121
  elsif @options[:choose]
1119
1122
  topic_match = choose(topics.keys)
1120
1123
  # If there are arguments use those to search for a matching topic
1121
- elsif !args.empty?
1124
+ elsif !@cli_args.empty?
1122
1125
 
1123
- search = args.join(' ').strip.downcase
1126
+ search = @cli_args.join(' ').strip.downcase
1124
1127
  matches = match_topic(search)
1125
1128
 
1126
1129
  if matches.empty?
@@ -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/,
@@ -2,5 +2,5 @@
2
2
  # Primary module for this gem.
3
3
  module Howzit
4
4
  # Current Howzit version.
5
- VERSION = '1.2.10'.freeze
5
+ VERSION = '1.2.11'.freeze
6
6
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Howzit::BuildNotes do
4
- subject(:ruby_gem) { Howzit::BuildNotes.new }
4
+ subject(:ruby_gem) { Howzit::BuildNotes.new([]) }
5
5
 
6
6
  describe ".new" do
7
7
  it "makes a new instance" do
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
- require 'codecov'
7
- SimpleCov.formatter = SimpleCov::Formatter::Codecov
8
- else
9
- SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
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.10
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