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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 574fddfbc584d44f9b1f9c6abaaaf16ac5b5d1115b303ba714269210c332e843
4
- data.tar.gz: 94d81054906fc579ff104cbc917e0d85b005723d02bd84d59430bb1e340513bb
3
+ metadata.gz: c765e26fa17336ee43c9695a14e86ac5a3a3f72c028e6264b17593d1c0b607e6
4
+ data.tar.gz: f158ef7138d572cbfd94a08d56d50d221c6c04dc45477e437848d238055846b2
5
5
  SHA512:
6
- metadata.gz: 41f8acd5969c1943d675dd149b7b02e4942933eaa988de6046885d2b5536d81ef3fc91e9dab06b2f7a3bcc4a2b8896d408e0ca6cb963f54dcc0aec35fa78f537
7
- data.tar.gz: 193995fa9d533b1937a390fe11cca96459f1a97bd259e31b7a5bb70aabc85261da2c77349b5af00655b45356a43fe0e6d297469d7b2772b1ff0eb4c4b0760912
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.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!(/^:/, '')
@@ -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
@@ -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.18'.freeze
5
+ VERSION = '2.0.1'.freeze
6
6
  end
@@ -43,8 +43,8 @@ describe Howzit::BuildNote do
43
43
  Howzit.options[:include_upstream] = false
44
44
  Howzit.options[:default] = true
45
45
  hz = Howzit.buildnote
46
-
47
46
  hz.create_note
47
+
48
48
  subject(:how) { hz }
49
49
 
50
50
  describe ".note_file" do
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.18
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra