howzit 1.2.17 → 2.0.0

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: f1d8a45dca4630f76f10fd6f410c63fd4e1685844ca895231d9910717ca97d9b
4
- data.tar.gz: 27476b1f987f6f1555e81f14270e923867d75519f5c25d3241a104ec861ddbe3
3
+ metadata.gz: 63f11ed9fe31950a9c32e5b818904fd35ad1d2157aa715301a397c5c88859f00
4
+ data.tar.gz: 147be12d1b132682c40c0e23ed6d258d3d3ad28af8246d03576ed53c2e880f84
5
5
  SHA512:
6
- metadata.gz: f3105ab63cc58b59f488f10a9717b457892b83b10760a303364bd9d790d7bb3630d30663ad6232979ce8dbab361c4ba67ee837009cc2f53c12c6bbb2035b8eca
7
- data.tar.gz: 661c54c86f55cbe939001b30848c3c35e7779571bb9a5797af96c107db761322cd37f11c2bf4d0e2b61d65173c9855735296fe46f029283845fd5a1c19f61103
6
+ metadata.gz: 98ced3c838b6a78cdfa668e08bfe96ee60959f942255a0f5e80d4baf6c328ed3e03456c0c145a7ce925666394f7f89055c19cab17a99e32a5e22e35334a639d4
7
+ data.tar.gz: ba8448a8185f1a8d8da7c39ad008b60be4253aee6253252f9f1e7a9db5d68bed67329e7092cf2a2c08d4703cc77e27174cb505c5b08f8ed18548c32a402e4c99
data/CHANGELOG.md CHANGED
@@ -1,3 +1,28 @@
1
+ ### 2.0.0
2
+
3
+ 2022-08-03 12:37
4
+
5
+ #### FIXED
6
+
7
+ - Positional arguments not rendering in tasks
8
+ - Fix degradation where arguments are empty
9
+
10
+ ### 1.2.19
11
+
12
+ 2022-08-03 12:18
13
+
14
+ #### FIXED
15
+
16
+ - --config-get returning non-default options
17
+
18
+ ### 1.2.18
19
+
20
+ 2022-08-03 12:13
21
+
22
+ #### FIXED
23
+
24
+ - Unwritable content property
25
+
1
26
  ### 1.2.17
2
27
 
3
28
  2022-08-03 12:10
data/bin/howzit CHANGED
@@ -95,9 +95,9 @@ OptionParser.new do |opts|
95
95
 
96
96
  opts.on('--config-get [KEY]', 'Display the configuration settings or setting for a specific key') do |k|
97
97
  if k.nil?
98
- Howzit.options.sort_by { |key, _| key }.each do |key, val|
98
+ Howzit::Config::DEFAULTS.sort_by { |key, _| key }.each do |key, _|
99
99
  print "#{key}: "
100
- p val
100
+ p Howzit.options[key]
101
101
  end
102
102
  else
103
103
  k.sub!(/^:/, '')
@@ -422,14 +422,7 @@ module Howzit
422
422
  new_topic = topic.dup
423
423
 
424
424
  # Handle variable replacement
425
-
426
- unless Howzit.arguments.empty?
427
- new_topic.content = new_topic.content.gsub(/\$(\d+)/) do |m|
428
- idx = m[1].to_i - 1
429
- Howzit.arguments.length > idx ? Howzit.arguments[idx] : m
430
- end
431
- new_topic.content = new_topic.content.gsub(/\$[@*]/, Shellwords.join(Howzit.arguments))
432
- end
425
+ new_topic.content = new_topic.content.render_arguments
433
426
 
434
427
  output = if run
435
428
  new_topic.run
data/lib/howzit/prompt.rb CHANGED
@@ -46,7 +46,7 @@ module Howzit
46
46
  '-0',
47
47
  '-1',
48
48
  '-m',
49
- "--height=#{matches.count + 2}",
49
+ "--height=#{matches.count + 3}",
50
50
  '--header="Use tab to mark multiple selections, enter to display/run"',
51
51
  '--prompt="Select a section > "'
52
52
  ]
@@ -131,6 +131,16 @@ module Howzit
131
131
  replace render_template(vars)
132
132
  end
133
133
 
134
+ def render_arguments
135
+ return self if Howzit.arguments.nil? || Howzit.arguments.empty?
136
+
137
+ gsub!(/\$(\d+)/) do |m|
138
+ idx = m[1].to_i - 1
139
+ Howzit.arguments.length > idx ? Howzit.arguments[idx] : m
140
+ end
141
+ gsub(/\$[@*]/, Shellwords.join(Howzit.arguments))
142
+ end
143
+
134
144
  def extract_metadata
135
145
  if File.exist?(self)
136
146
  leader = IO.read(self).split(/^#/)[0].strip
data/lib/howzit/task.rb CHANGED
@@ -7,7 +7,7 @@ module Howzit
7
7
  def initialize(type, title, action, parent = nil)
8
8
  @type = type
9
9
  @title = title
10
- @action = action
10
+ @action = action.render_arguments
11
11
  @parent = parent
12
12
  end
13
13
 
data/lib/howzit/topic.rb CHANGED
@@ -5,7 +5,9 @@ module Howzit
5
5
  class Topic
6
6
  attr_writer :parent
7
7
 
8
- attr_reader :title, :content, :tasks, :prereqs, :postreqs
8
+ attr_accessor :content
9
+
10
+ attr_reader :title, :tasks, :prereqs, :postreqs
9
11
 
10
12
  def initialize(title, content)
11
13
  @title = title
@@ -2,5 +2,5 @@
2
2
  # Primary module for this gem.
3
3
  module Howzit
4
4
  # Current Howzit version.
5
- VERSION = '1.2.17'.freeze
5
+ VERSION = '2.0.0'.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.17
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra