howzit 1.2.19 → 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: d8b16b06b6f594b321d2226b4985c51330b437cda97528e120b09e1bfa9d777c
4
- data.tar.gz: fda79561390a39336c2bfe2aa94de7c6d81ce97b71e8721cf91066ec495d4080
3
+ metadata.gz: 63f11ed9fe31950a9c32e5b818904fd35ad1d2157aa715301a397c5c88859f00
4
+ data.tar.gz: 147be12d1b132682c40c0e23ed6d258d3d3ad28af8246d03576ed53c2e880f84
5
5
  SHA512:
6
- metadata.gz: e20d289047b1824e0f882895b580703003514c09424dbd848a461d7ed1680b2368d5ac0f11143a0fdd21eaab80a23545c0e4ceb131964003b442c8f112654a1b
7
- data.tar.gz: 4b5af891c82a9e1dcaec9177a025336d023873114e87ce906f1a0cdaa49845e02d113e60d90395fbbde2568a99b0766af3c889d4f8786e4f24e36d52a408c2a7
6
+ metadata.gz: 98ced3c838b6a78cdfa668e08bfe96ee60959f942255a0f5e80d4baf6c328ed3e03456c0c145a7ce925666394f7f89055c19cab17a99e32a5e22e35334a639d4
7
+ data.tar.gz: ba8448a8185f1a8d8da7c39ad008b60be4253aee6253252f9f1e7a9db5d68bed67329e7092cf2a2c08d4703cc77e27174cb505c5b08f8ed18548c32a402e4c99
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
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
+
1
10
  ### 1.2.19
2
11
 
3
12
  2022-08-03 12:18
data/bin/howzit CHANGED
@@ -95,7 +95,7 @@ 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::Config::DEFAULTS.sort_by { |key, _| key }.each do |key, val|
98
+ Howzit::Config::DEFAULTS.sort_by { |key, _| key }.each do |key, _|
99
99
  print "#{key}: "
100
100
  p Howzit.options[key]
101
101
  end
@@ -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
@@ -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
 
@@ -2,5 +2,5 @@
2
2
  # Primary module for this gem.
3
3
  module Howzit
4
4
  # Current Howzit version.
5
- VERSION = '1.2.19'.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.19
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra