howzit 2.0.23 → 2.0.24

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: aef13e763de59e83d14808c8778e5941c43b1b68669d09a9047dd53aaff60b38
4
- data.tar.gz: 0f4052f07e44bbe1b9679a021abd147bc0830941351221baa61cb09f6bfe25c6
3
+ metadata.gz: 4d5ddc7a4ec5cda133517d27dfef17d80299c17a68de2469e9dab66e81dffa33
4
+ data.tar.gz: 78fed9d51d054f4c39d3bb6b9daed3709e6a7f7644e5a6368bb924bb0b042665
5
5
  SHA512:
6
- metadata.gz: 69231c5b96a7c011710787d6f47ef628286a5b7237489c6220f1bc25a9aab2d76d70f438b9d1872e2531710f100b3d09f715acabb138c7a8cfc6967d6dde9f70
7
- data.tar.gz: 49c1e9266d4401d8ca863a9f107ab4e2c2722db719ab253b03db1b1c8983aeb83e3c715971d15be5ebe42d074f79b4ee521a9062a216422023c9884123555646
6
+ metadata.gz: 5427a3f6754462ae1311194407a3c6dfc71b084bb639afa29d961fad758ed554ce40ccdb21ec7b9175289343866da6d1ddb0f9db5fccb12f8224d206f9d53b98
7
+ data.tar.gz: 6222c4a34783c842fc342a27b2167588578afefa3f45a2fc16637b5d3f266d99d11bbefada5dd4a586902f914566a86efcef4262396133e573cf520923cd468a
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 2.0.24
2
+
3
+ 2022-08-09 09:04
4
+
5
+ #### FIXED
6
+
7
+ - Avoid reading upstream files multiple times
8
+
1
9
  ### 2.0.23
2
10
 
3
11
  2022-08-09 05:51
@@ -32,7 +32,7 @@ module Howzit
32
32
  ## @return description
33
33
  ##
34
34
  def inspect
35
- puts "#<Howzit::BuildNote @topics=[#{@topics.count}]>"
35
+ "#<Howzit::BuildNote @topics=[#{@topics.count}]>"
36
36
  end
37
37
 
38
38
  ##
@@ -205,14 +205,14 @@ module Howzit
205
205
  if File.exist?(file) && !default
206
206
  file = "{by}#{file}".c
207
207
  unless Prompt.yn("Are you sure you want to overwrite #{file}", default: false)
208
- puts 'Cancelled'
208
+ Howzit.console.info('Cancelled')
209
209
  Process.exit 0
210
210
  end
211
211
  end
212
212
 
213
213
  File.open(file, 'w') do |f|
214
214
  f.puts note
215
- puts "{by}Template {bw}#{title}{by} written to {bw}#{file}{x}".c
215
+ Howzit.console.info("{by}Template {bw}#{title}{by} written to {bw}#{file}{x}".c)
216
216
  end
217
217
 
218
218
  if File.exist?(file) && !default && Prompt.yn("{bg}Do you want to open {bw}#{file} {bg}for editing?{x}".c,
@@ -298,14 +298,14 @@ module Howzit
298
298
  if File.exist?(fname) && !default
299
299
  file = "{by}#{fname}".c
300
300
  unless Prompt.yn("Are you absolutely sure you want to overwrite #{file}", default: false)
301
- puts 'Canceled'
301
+ Howzit.console.info('Canceled')
302
302
  Process.exit 0
303
303
  end
304
304
  end
305
305
 
306
306
  File.open(fname, 'w') do |f|
307
307
  f.puts note
308
- puts "{by}Build notes for {bw}#{title}{by} written to {bw}#{fname}{x}".c
308
+ Howzit.console.info("{by}Build notes for {bw}#{title}{by} written to {bw}#{fname}{x}".c)
309
309
  end
310
310
 
311
311
  if File.exist?(fname) && !default && Prompt.yn("{bg}Do you want to open {bw}#{fname} {bg}for editing?{x}".c,
@@ -532,7 +532,6 @@ module Howzit
532
532
  ##
533
533
  def read_upstream
534
534
  buildnotes = glob_upstream
535
-
536
535
  topics_dict = []
537
536
  buildnotes.each do |path|
538
537
  topics_dict.concat(read_help_file(path))
@@ -627,12 +626,15 @@ module Howzit
627
626
  ##
628
627
  def read_help(path = nil)
629
628
  @topics = read_help_file(path)
630
- return unless path.nil? && Howzit.options[:include_upstream]
629
+ return unless Howzit.options[:include_upstream]
631
630
 
632
- upstream_topics = read_upstream
631
+ unless Howzit.has_read_upstream
632
+ upstream_topics = read_upstream
633
633
 
634
- upstream_topics.each do |topic|
635
- @topics.push(topic) unless find_topic(title.sub(/^.+:/, '')).count.positive?
634
+ upstream_topics.each do |topic|
635
+ @topics.push(topic) unless find_topic(topic.title.sub(/^.+:/, '')).count.positive?
636
+ end
637
+ Howzit.has_read_upstream = true
636
638
  end
637
639
 
638
640
  if note_file && @topics.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.23'
6
+ VERSION = '2.0.24'
7
7
  end
data/lib/howzit.rb CHANGED
@@ -82,5 +82,13 @@ module Howzit
82
82
  def console
83
83
  @console ||= Howzit::ConsoleLogger.new(options[:log_level])
84
84
  end
85
+
86
+ def has_read_upstream
87
+ @has_read_upstream ||= false
88
+ end
89
+
90
+ def has_read_upstream=(has_read)
91
+ @has_read_upstream = has_read
92
+ end
85
93
  end
86
94
  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.23
4
+ version: 2.0.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra