howzit 1.2.18 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/bin/howzit +2 -2
- data/lib/howzit/buildnote.rb +2 -8
- data/lib/howzit/stringutils.rb +10 -0
- data/lib/howzit/task.rb +1 -1
- data/lib/howzit/version.rb +1 -1
- data/spec/ruby_gem_spec.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: c765e26fa17336ee43c9695a14e86ac5a3a3f72c028e6264b17593d1c0b607e6
|
4
|
+
data.tar.gz: f158ef7138d572cbfd94a08d56d50d221c6c04dc45477e437848d238055846b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 636f61b3f6ad8cc161e7a5453a0bc3afafe96cef27df2f0a3542083c0302c7f581a0d6fdabaaa37d52c958145297dec4496bda9e8e68ed94a77c5a151ffb5bb8
|
7
|
+
data.tar.gz: '095a73c3482d35f493c695e5d0a154b814bb7630fefe16212859527113e476c715856bf1d3394702f51f8954a12c83095e97a70c64090652c3d41601f02b6a03'
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
### 2.0.1
|
2
|
+
|
3
|
+
2022-08-03 12:46
|
4
|
+
|
5
|
+
#### FIXED
|
6
|
+
|
7
|
+
- Failure to create new notes file when one isn't found
|
8
|
+
|
9
|
+
### 2.0.0
|
10
|
+
|
11
|
+
2022-08-03 12:37
|
12
|
+
|
13
|
+
#### FIXED
|
14
|
+
|
15
|
+
- Positional arguments not rendering in tasks
|
16
|
+
- Fix degradation where arguments are empty
|
17
|
+
|
18
|
+
### 1.2.19
|
19
|
+
|
20
|
+
2022-08-03 12:18
|
21
|
+
|
22
|
+
#### FIXED
|
23
|
+
|
24
|
+
- --config-get returning non-default options
|
25
|
+
|
1
26
|
### 1.2.18
|
2
27
|
|
3
28
|
2022-08-03 12:13
|
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.
|
98
|
+
Howzit::Config::DEFAULTS.sort_by { |key, _| key }.each do |key, _|
|
99
99
|
print "#{key}: "
|
100
|
-
p
|
100
|
+
p Howzit.options[key]
|
101
101
|
end
|
102
102
|
else
|
103
103
|
k.sub!(/^:/, '')
|
data/lib/howzit/buildnote.rb
CHANGED
@@ -9,6 +9,7 @@ module Howzit
|
|
9
9
|
|
10
10
|
def initialize(file: nil, args: [])
|
11
11
|
@topics = []
|
12
|
+
create_note if note_file.nil?
|
12
13
|
@metadata = IO.read(note_file).split(/^#/)[0].strip.get_metadata
|
13
14
|
|
14
15
|
read_help(file)
|
@@ -422,14 +423,7 @@ module Howzit
|
|
422
423
|
new_topic = topic.dup
|
423
424
|
|
424
425
|
# 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
|
426
|
+
new_topic.content = new_topic.content.render_arguments
|
433
427
|
|
434
428
|
output = if run
|
435
429
|
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
data/spec/ruby_gem_spec.rb
CHANGED