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 +4 -4
- data/CHANGELOG.md +5 -1
- data/Gemfile.lock +1 -1
- data/lib/branch/name/subcommands/delete.rb +1 -8
- data/lib/branch/name/subcommands/init.rb +1 -7
- data/lib/branch/name/subcommands/nestable.rb +9 -13
- data/lib/branch/name/version.rb +1 -1
- metadata +1 -2
- data/lib/branch/name/subcommands/help_nestable.rb +0 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 589277a07c2a1a873385e77be6276f7b0f2aaecbe6d5047b4f6e56e436ffcf8a
|
4
|
+
data.tar.gz: a185c55be39afb5611b25cecd50d39a761c0fedef40bf96b4927fd3e410ac3a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5418d3f1ad7aa1cdc5ab523fb1824ffcf022c5c16ad54d3f9be773eaa4f02b3ba5f040ab2b3b5f5a8f7c0aecbe58dc2be848464f5409f68468cfb0059b222e49
|
7
|
+
data.tar.gz: eb1fc297bdd508848208e8b95a389d0ac8ff37e9c2310a865a209587ea42377206c17543595790ac7dabb8f90ac73171a0160c7fd4e3d3359ac963e7dc2679cd
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -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
|
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
|
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
|
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} #{
|
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
|
data/lib/branch/name/version.rb
CHANGED
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.
|
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
|