branch-name 3.2.1 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8a3968d20d8af29e02e511894c96e66b09965f60fd945efdb42c0454d190ce75
4
- data.tar.gz: 3d936e247ea81a147fd4e117ee15a10ffce733557c117060c1ead457c1c0bf13
3
+ metadata.gz: 589277a07c2a1a873385e77be6276f7b0f2aaecbe6d5047b4f6e56e436ffcf8a
4
+ data.tar.gz: a185c55be39afb5611b25cecd50d39a761c0fedef40bf96b4927fd3e410ac3a2
5
5
  SHA512:
6
- metadata.gz: 64bf17dc7a54feffe42ed5195d869291a59689c4cc7a06a0c2329ae3c1dbc86cc3ba08225aa58a30b964cd7c82fb6e55aedb8e121a346b2ddc5602938feb46bd
7
- data.tar.gz: 29a1c7a1b64f38ed6404c6c9f87d5c95bc5470d31408362b42b96ceaf9b0ca8958a7d59f8bbab0b06b322734b4326ae55652cf5aa4edbcaf3d35fd5aabef8b57
6
+ metadata.gz: 5418d3f1ad7aa1cdc5ab523fb1824ffcf022c5c16ad54d3f9be773eaa4f02b3ba5f040ab2b3b5f5a8f7c0aecbe58dc2be848464f5409f68468cfb0059b222e49
7
+ data.tar.gz: eb1fc297bdd508848208e8b95a389d0ac8ff37e9c2310a865a209587ea42377206c17543595790ac7dabb8f90ac73171a0160c7fd4e3d3359ac963e7dc2679cd
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## ['3.2.1'] - 2022-09-26
1
+ ## ['3.2.2'] - 2022-09-27
2
+ * Changes:
3
+ * Refactor code that patches Thor incorrect display of nested commands (subcommangs).
4
+
5
+ ## ['3.2.1'] - 2022-09-27
2
6
  * Changes:
3
7
  * Fix rubocop violations.
4
8
  * Miscellaneous mixin refactors.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- branch-name (3.2.1)
4
+ branch-name (3.2.2)
5
5
  activesupport (~> 7.0, >= 7.0.4)
6
6
  colorize (~> 0.8.1)
7
7
  os (~> 1.1, >= 1.1.4)
@@ -3,7 +3,6 @@
3
3
  require 'thor'
4
4
  require_relative '../configurable'
5
5
  require_relative '../exitable'
6
- require_relative 'help_nestable'
7
6
  require_relative 'nestable'
8
7
  require_relative '../task_defaultable'
9
8
 
@@ -17,16 +16,12 @@ module Branch
17
16
  include TaskDefaultable
18
17
 
19
18
  class << self
20
- def ancestor_name
19
+ def base_usage
21
20
  'config delete'
22
21
  end
23
22
  end
24
23
 
25
- # NOTE: This must be included AFTER defining .ancestor_name
26
- include HelpNestable
27
-
28
24
  desc 'all', 'Deletes all config files (local and global) for this gem'
29
- help_override "#{ancestor_name} all"
30
25
  long_desc <<-LONG_DESC
31
26
  NAME
32
27
  \x5
@@ -42,7 +37,6 @@ module Branch
42
37
  end
43
38
 
44
39
  desc 'global', 'Deletes the global config file for this gem'
45
- help_override "#{ancestor_name} global"
46
40
  long_desc <<-LONG_DESC
47
41
  NAME
48
42
  \x5
@@ -57,7 +51,6 @@ module Branch
57
51
  end
58
52
 
59
53
  desc 'local', 'Deletes the local config file for this gem'
60
- help_override "#{ancestor_name} local"
61
54
  long_desc <<-LONG_DESC
62
55
  NAME
63
56
  \x5
@@ -3,7 +3,6 @@
3
3
  require 'thor'
4
4
  require_relative '../configurable'
5
5
  require_relative '../exitable'
6
- require_relative 'help_nestable'
7
6
  require_relative 'nestable'
8
7
  require_relative '../task_defaultable'
9
8
 
@@ -17,16 +16,12 @@ module Branch
17
16
  include TaskDefaultable
18
17
 
19
18
  class << self
20
- def ancestor_name
19
+ def base_usage
21
20
  'config init'
22
21
  end
23
22
  end
24
23
 
25
- # NOTE: This must be included AFTER defining .ancestor_name
26
- include HelpNestable
27
-
28
24
  desc 'global', 'Creates and initializes a .branch-name file in the global folder'
29
- help_override "#{ancestor_name} global"
30
25
  long_desc <<-LONG_DESC
31
26
  NAME
32
27
  \x5
@@ -42,7 +37,6 @@ module Branch
42
37
  end
43
38
 
44
39
  desc 'local', 'Creates and initializes a .branch-name file in the local folder'
45
- help_override "#{ancestor_name} local"
46
40
  long_desc <<-LONG_DESC
47
41
  NAME
48
42
  \x5
@@ -15,33 +15,29 @@ module Branch
15
15
  end
16
16
 
17
17
  module ClassMethods
18
- def ancestor_name
18
+ def base_usage
19
19
  raise NotImplementedError
20
20
  end
21
21
 
22
+ # Thor override
23
+ # rubocop:disable Style/OptionHash
24
+ def desc(usage, description, options = {})
25
+ super "#{base_usage} #{usage} ", description, options
26
+ end
27
+ # rubocop:enable Style/OptionHash
28
+
22
29
  # Thor override
23
30
  # rubocop:disable Style/GlobalVars
24
31
  # rubocop:disable Lint/UnusedMethodArgument
25
32
  # rubocop:disable Style/OptionalBooleanParameter
26
33
  def banner(command, namespace = nil, subcommand = false)
27
34
  command.formatted_usage(self, $thor_runner, subcommand).split("\n").map do |_formatted_usage|
28
- "#{basename} #{@help_override[command.usage]}"
35
+ "#{basename} #{command.usage}"
29
36
  end.join("\n")
30
37
  end
31
38
  # rubocop:enable Style/GlobalVars
32
39
  # rubocop:enable Lint/UnusedMethodArgument
33
40
  # rubocop:enable Style/OptionalBooleanParameter
34
-
35
- def help_override(help_string)
36
- if @usage.blank?
37
- raise 'Thor.desc must be called for the command that should ' \
38
- "be associated with \"#{help_string}\" prior to calling " \
39
- '.help_override'
40
- end
41
-
42
- @help_override = {} unless defined? @help_override
43
- @help_override[@usage] = help_string
44
- end
45
41
  end
46
42
  end
47
43
  end
@@ -3,6 +3,6 @@
3
3
  module Branch
4
4
  module Name
5
5
  # branch-name version
6
- VERSION = '3.2.1'
6
+ VERSION = '3.2.2'
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: branch-name
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gene M. Angelo, Jr.
@@ -119,7 +119,6 @@ files:
119
119
  - lib/branch/name/projectable.rb
120
120
  - lib/branch/name/subcommands/config.rb
121
121
  - lib/branch/name/subcommands/delete.rb
122
- - lib/branch/name/subcommands/help_nestable.rb
123
122
  - lib/branch/name/subcommands/init.rb
124
123
  - lib/branch/name/subcommands/nestable.rb
125
124
  - lib/branch/name/task_defaultable.rb
@@ -1,27 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Branch
4
- module Name
5
- module Subcommands
6
- # This module helps fix a bug in Thor that prohibits help for nested
7
- # subcommands from displaying help properly. Nested subcommands fail
8
- # to display their subcommand ancestor command name. This fixes that
9
- # bug. This module is used in conjunction with the Nestable module.
10
- module HelpNestable
11
- class << self
12
- def included(base)
13
- # Thor override
14
- base.desc 'help [COMMAND]', 'Describe available commands or one specific command'
15
- base.help_override "#{base.ancestor_name} help [SUBCOMMAND]"
16
- # rubocop:disable Style/OptionalBooleanParameter
17
- # def help(command = nil, subcommand = false)
18
- # puts "subcommand: #{subcommand}"
19
- # super
20
- # end
21
- # rubocop:enable Style/OptionalBooleanParameter
22
- end
23
- end
24
- end
25
- end
26
- end
27
- end