howzit 1.2.19 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -1
- data/CHANGELOG.md +25 -0
- data/bin/howzit +1 -1
- data/howzit.gemspec +1 -1
- data/lib/howzit/buildnote.rb +2 -8
- data/lib/howzit/stringutils.rb +10 -0
- data/lib/howzit/task.rb +1 -1
- data/lib/howzit/topic.rb +3 -2
- data/lib/howzit/version.rb +1 -1
- data/spec/ruby_gem_spec.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5758dea871a182fc419de237ba35828396000307710b1680841bb774ea6994a2
|
4
|
+
data.tar.gz: bdf200a5a60c0acd268e37adcfae6b187807a14766e8199970fbd1d3ac1e4e3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6ec5058df211c32bdf02a33f99626822221317ee95eb16161d17e4ede96ae31b744a16aee328cead7c4e3bab5ca393f0911227234709622fea27f4026a6504f
|
7
|
+
data.tar.gz: 7ce5c34e121fa6a3fa6fea662d21b3ccc60beba0e0fee8f0b87b0f8653e3d0e64c66f61cfdc978e0a4b1d425cb757fcf191ba4026262c1ce26225dad8b87897d
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
+
### 2.0.2
|
2
|
+
|
3
|
+
2022-08-03 18:26
|
4
|
+
|
5
|
+
#### IMPROVED
|
6
|
+
|
7
|
+
- If a title is provided after an @command, display it instead of the contents when viewing
|
8
|
+
|
9
|
+
### 2.0.1
|
10
|
+
|
11
|
+
2022-08-03 12:46
|
12
|
+
|
13
|
+
#### FIXED
|
14
|
+
|
15
|
+
- Failure to create new notes file when one isn't found
|
16
|
+
|
17
|
+
### 2.0.0
|
18
|
+
|
19
|
+
2022-08-03 12:37
|
20
|
+
|
21
|
+
#### FIXED
|
22
|
+
|
23
|
+
- Positional arguments not rendering in tasks
|
24
|
+
- Fix degradation where arguments are empty
|
25
|
+
|
1
26
|
### 1.2.19
|
2
27
|
|
3
28
|
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,
|
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/howzit.gemspec
CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.test_files = spec.files.grep(%r{^(features|spec|test)/})
|
18
18
|
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.required_ruby_version = '>= 2.0
|
20
|
+
spec.required_ruby_version = '>= 2.6.0'
|
21
21
|
|
22
22
|
spec.add_development_dependency 'bundler', '~> 2.2'
|
23
23
|
spec.add_development_dependency 'rake', '~> 11.2'
|
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/topic.rb
CHANGED
@@ -153,10 +153,11 @@ module Howzit
|
|
153
153
|
Howzit.inclusions.push(matches[0])
|
154
154
|
end
|
155
155
|
|
156
|
-
when /@(run|copy|open|url|include)\((.*?)\)
|
156
|
+
when /@(run|copy|open|url|include)\((.*?)\)(.*?)$/
|
157
157
|
m = Regexp.last_match
|
158
158
|
cmd = m[1]
|
159
159
|
obj = m[2]
|
160
|
+
title = m[3].nil? ? obj : m[3]
|
160
161
|
icon = case cmd
|
161
162
|
when 'run'
|
162
163
|
"\u{25B6}"
|
@@ -166,7 +167,7 @@ module Howzit
|
|
166
167
|
"\u{279A}"
|
167
168
|
end
|
168
169
|
|
169
|
-
output.push(Color.template("{bmK}#{icon} {bwK}#{
|
170
|
+
output.push(Color.template("{bmK}#{icon} {bwK}#{title.gsub(/\\n/, '\n')}{x}"))
|
170
171
|
when /(`{3,})run *(.*?)$/i
|
171
172
|
m = Regexp.last_match
|
172
173
|
desc = m[2].length.positive? ? "Block: #{m[2]}" : 'Code Block'
|
data/lib/howzit/version.rb
CHANGED
data/spec/ruby_gem_spec.rb
CHANGED
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:
|
4
|
+
version: 2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brett Terpstra
|
@@ -295,7 +295,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
295
295
|
requirements:
|
296
296
|
- - ">="
|
297
297
|
- !ruby/object:Gem::Version
|
298
|
-
version: 2.0
|
298
|
+
version: 2.6.0
|
299
299
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
300
300
|
requirements:
|
301
301
|
- - ">="
|