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 +4 -4
- data/CHANGELOG.md +9 -0
- data/bin/howzit +1 -1
- data/lib/howzit/buildnote.rb +1 -8
- data/lib/howzit/stringutils.rb +10 -0
- data/lib/howzit/task.rb +1 -1
- data/lib/howzit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63f11ed9fe31950a9c32e5b818904fd35ad1d2157aa715301a397c5c88859f00
|
4
|
+
data.tar.gz: 147be12d1b132682c40c0e23ed6d258d3d3ad28af8246d03576ed53c2e880f84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98ced3c838b6a78cdfa668e08bfe96ee60959f942255a0f5e80d4baf6c328ed3e03456c0c145a7ce925666394f7f89055c19cab17a99e32a5e22e35334a639d4
|
7
|
+
data.tar.gz: ba8448a8185f1a8d8da7c39ad008b60be4253aee6253252f9f1e7a9db5d68bed67329e7092cf2a2c08d4703cc77e27174cb505c5b08f8ed18548c32a402e4c99
|
data/CHANGELOG.md
CHANGED
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,
|
98
|
+
Howzit::Config::DEFAULTS.sort_by { |key, _| key }.each do |key, _|
|
99
99
|
print "#{key}: "
|
100
100
|
p Howzit.options[key]
|
101
101
|
end
|
data/lib/howzit/buildnote.rb
CHANGED
@@ -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/stringutils.rb
CHANGED
@@ -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
data/lib/howzit/version.rb
CHANGED