howzit 1.2.16 → 1.2.17

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: 14bc9569ad9313ee45f42b23fb1181ad3c70c4c7d7c69d436feff9804035c3ac
4
- data.tar.gz: e40a8f4ca0e99a8e68c6df996d24bcd121a1d69dde2780f3836237303cf85e2c
3
+ metadata.gz: f1d8a45dca4630f76f10fd6f410c63fd4e1685844ca895231d9910717ca97d9b
4
+ data.tar.gz: 27476b1f987f6f1555e81f14270e923867d75519f5c25d3241a104ec861ddbe3
5
5
  SHA512:
6
- metadata.gz: bfa974d861fe4d225239d8b4ed496a46feeba3048b7b1eba4ec61bc5fdc5ad33e46cd1dab97dcf4553b64b916bf59cb28a8d1f3605cff6a7d222752266e0e644
7
- data.tar.gz: 02c3c096d1841122c1e027274912b233e167a073c711945cad72186741e759f1c007d421a5accee7c86c0474742a033789e076a53d4858852c673317ccd0b56b
6
+ metadata.gz: f3105ab63cc58b59f488f10a9717b457892b83b10760a303364bd9d790d7bb3630d30663ad6232979ce8dbab361c4ba67ee837009cc2f53c12c6bbb2035b8eca
7
+ data.tar.gz: 661c54c86f55cbe939001b30848c3c35e7779571bb9a5797af96c107db761322cd37f11c2bf4d0e2b61d65173c9855735296fe46f029283845fd5a1c19f61103
data/.rubocop.yml CHANGED
@@ -4,6 +4,11 @@ AllCops:
4
4
  - Guardfile
5
5
  - Rakefile
6
6
 
7
+ Metrics/BlockLength:
8
+ Exclude:
9
+ - bin/howzit
10
+ - lib/*.rb
11
+
7
12
  Style/RegexpLiteral:
8
13
  Exclude:
9
14
  - Guardfile
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ### 1.2.17
2
+
3
+ 2022-08-03 12:10
4
+
5
+ #### FIXED
6
+
7
+ - Variables in topics not being replaced with metadata
8
+ - Allow default response in yes/no prompt
9
+
1
10
  ### 1.2.16
2
11
 
3
12
  2022-08-03 11:41
data/bin/howzit CHANGED
@@ -126,7 +126,7 @@ OptionParser.new do |opts|
126
126
  Process.exit 0
127
127
  end
128
128
 
129
- opts.on('--edit-config', "Edit configuration file using default $EDITOR") do
129
+ opts.on('--edit-config', 'Edit configuration file using default $EDITOR') do
130
130
  Howzit.config.editor
131
131
  Process.exit 0
132
132
  end
@@ -141,20 +141,20 @@ OptionParser.new do |opts|
141
141
  Dir.glob('*.md').each do |file|
142
142
  template = File.basename(file, '.md')
143
143
  puts Howzit::Color.template("{Mk}template:{Yk}#{template}{x}")
144
- puts Howzit::Color.template("{bk}[{bl}tasks{bk}]──────────────────────────────────────┐{x}")
144
+ puts Howzit::Color.template('{bk}[{bl}tasks{bk}]──────────────────────────────────────┐{x}')
145
145
  metadata = file.extract_metadata
146
146
  topics = Howzit.buildnote.read_file(file)
147
147
  topics.each do |topic|
148
148
  puts Howzit::Color.template(" {bk}│{bw}-{x} {bcK}#{template}:#{topic.title.sub(/^.*?:/, '')}{x}")
149
149
  end
150
- if metadata.size > 0
150
+ unless metadata.empty?
151
151
  meta = []
152
- meta << metadata['required'].split(/\s*,\s*/).map {|m| "*{bw}#{m}{xw}" } if metadata.key?('required')
153
- meta << metadata['optional'].split(/\s*,\s*/).map {|m| "#{m}" } if metadata.key?('optional')
154
- puts Howzit::Color.template("{bk}[{bl}meta{bk}]───────────────────────────────────────┤{x}")
155
- puts Howzit::Color.template(" {bk}│ {xw}#{meta.join(", ")}{x}")
152
+ meta << metadata['required'].split(/\s*,\s*/).map { |m| "*{bw}#{m}{xw}" } if metadata.key?('required')
153
+ meta << metadata['optional'].split(/\s*,\s*/).map(&:to_s) if metadata.key?('optional')
154
+ puts Howzit::Color.template('{bk}[{bl}meta{bk}]───────────────────────────────────────┤{x}')
155
+ puts Howzit::Color.template(" {bk}│ {xw}#{meta.join(', ')}{x}")
156
156
  end
157
- puts Howzit::Color.template(" {bk}└───────────────────────────────────────────┘{x}")
157
+ puts Howzit::Color.template(' {bk}└───────────────────────────────────────────┘{x}')
158
158
  end
159
159
  Process.exit 0
160
160
  end
@@ -9,7 +9,7 @@ module Howzit
9
9
 
10
10
  def initialize(file: nil, args: [])
11
11
  @topics = []
12
- @metadata = {}
12
+ @metadata = IO.read(note_file).split(/^#/)[0].strip.get_metadata
13
13
 
14
14
  read_help(file)
15
15
  end
@@ -274,7 +274,6 @@ module Howzit
274
274
 
275
275
  if leader.length > 0
276
276
  data = leader.get_metadata
277
- @metadata = @metadata.merge(data)
278
277
 
279
278
  if data.key?('template')
280
279
  templates = data['template'].strip.split(/\s*,\s*/)
@@ -380,6 +379,7 @@ module Howzit
380
379
  title = "#{short_path}:#{title}"
381
380
  end
382
381
  topic = Topic.new(title, prefix + lines.join("\n").strip.render_template(@metadata))
382
+
383
383
  topics.push(topic)
384
384
  end
385
385
 
data/lib/howzit/prompt.rb CHANGED
@@ -14,7 +14,7 @@ module Howzit
14
14
  res.chomp!
15
15
  puts
16
16
  system 'stty cooked'
17
- res =~ /y/i
17
+ res.empty? ? default : res =~ /y/i
18
18
  end
19
19
 
20
20
  def color_single_options(choices = %w[y n])
@@ -2,5 +2,5 @@
2
2
  # Primary module for this gem.
3
3
  module Howzit
4
4
  # Current Howzit version.
5
- VERSION = '1.2.16'.freeze
5
+ VERSION = '1.2.17'.freeze
6
6
  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: 1.2.16
4
+ version: 1.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra