thor-zsh_completion 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +127 -0
- data/CHANGELOG.md +6 -0
- data/Gemfile +6 -1
- data/bin/rspec +29 -0
- data/bin/rubocop +29 -0
- data/lib/thor/zsh_completion/generator.rb +16 -18
- data/lib/thor/zsh_completion/template/subcommand_function.erb +1 -1
- data/lib/thor/zsh_completion/version.rb +1 -1
- data/thor-zsh_completion.gemspec +6 -10
- metadata +6 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a14bd88f01d2f3389989eb8325cf4fefeb441bf73678a9e35665f27d4420a052
|
4
|
+
data.tar.gz: 632f050d06d11c50355e318867037ec31a1b53e151e379c21b85d66bf739dc33
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cf2c8c5c8cf1f61851bec0570810ba00e628d2374b7c7a05e812dce088d94edc80933debe86c70f9a937eeac9d6621737208f54d4fb12b3fd150ddcf6400188
|
7
|
+
data.tar.gz: 9015c85103b6a35f150bc74bd139194b22a7102dd8b76d82c9227e92079e27f1e5cf50cd50ad9cf6d4a9ae209a9d3b7b51046a3c1265faaff1908ba4ff9ddbfe
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,127 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- bin/*
|
4
|
+
- node_modules/**/*
|
5
|
+
NewCops: enable
|
6
|
+
|
7
|
+
Layout/CaseIndentation:
|
8
|
+
EnforcedStyle: end
|
9
|
+
|
10
|
+
Layout/EndAlignment:
|
11
|
+
EnforcedStyleAlignWith: variable
|
12
|
+
|
13
|
+
Layout/LineLength:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
Layout/EmptyLinesAroundAccessModifier:
|
17
|
+
EnforcedStyle: only_before
|
18
|
+
|
19
|
+
Layout/SpaceInLambdaLiteral:
|
20
|
+
EnforcedStyle: require_space
|
21
|
+
|
22
|
+
Layout/SpaceInsideBlockBraces:
|
23
|
+
SpaceBeforeBlockParameters: false
|
24
|
+
|
25
|
+
Layout/SpaceInsideHashLiteralBraces:
|
26
|
+
EnforcedStyle: no_space
|
27
|
+
|
28
|
+
Metrics/AbcSize:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
Metrics/BlockLength:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Metrics/ClassLength:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
Metrics/CyclomaticComplexity:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Metrics/MethodLength:
|
41
|
+
Enabled: false
|
42
|
+
|
43
|
+
Metrics/ModuleLength:
|
44
|
+
Enabled: false
|
45
|
+
|
46
|
+
Metrics/PerceivedComplexity:
|
47
|
+
Enabled: false
|
48
|
+
|
49
|
+
Naming/HeredocDelimiterNaming:
|
50
|
+
Enabled: false
|
51
|
+
|
52
|
+
Naming/MethodParameterName:
|
53
|
+
Enabled: false
|
54
|
+
|
55
|
+
Naming/PredicateName:
|
56
|
+
Enabled: false
|
57
|
+
|
58
|
+
Style/Alias:
|
59
|
+
EnforcedStyle: prefer_alias_method
|
60
|
+
|
61
|
+
Style/AsciiComments:
|
62
|
+
Enabled: false
|
63
|
+
|
64
|
+
Style/BlockDelimiters:
|
65
|
+
Enabled: false
|
66
|
+
|
67
|
+
Style/Documentation:
|
68
|
+
Enabled: false
|
69
|
+
|
70
|
+
Style/EmptyCaseCondition:
|
71
|
+
Enabled: false
|
72
|
+
|
73
|
+
Style/EmptyMethod:
|
74
|
+
EnforcedStyle: expanded
|
75
|
+
|
76
|
+
Style/FrozenStringLiteralComment:
|
77
|
+
Enabled: false
|
78
|
+
|
79
|
+
Style/HashSyntax:
|
80
|
+
Exclude:
|
81
|
+
- Rakefile
|
82
|
+
- "**/*.rake"
|
83
|
+
|
84
|
+
Style/Lambda:
|
85
|
+
EnforcedStyle: literal
|
86
|
+
|
87
|
+
Style/IfUnlessModifier:
|
88
|
+
Enabled: false
|
89
|
+
|
90
|
+
Style/MultilineBlockChain:
|
91
|
+
Enabled: false
|
92
|
+
|
93
|
+
Style/NumericLiterals:
|
94
|
+
Enabled: false
|
95
|
+
|
96
|
+
Style/NumericPredicate:
|
97
|
+
Enabled: false
|
98
|
+
|
99
|
+
Style/PercentLiteralDelimiters:
|
100
|
+
PreferredDelimiters:
|
101
|
+
'%i': '()'
|
102
|
+
'%w': '()'
|
103
|
+
'%r': '()'
|
104
|
+
|
105
|
+
Style/SpecialGlobalVars:
|
106
|
+
Enabled: false
|
107
|
+
|
108
|
+
Style/StringLiterals:
|
109
|
+
EnforcedStyle: double_quotes
|
110
|
+
|
111
|
+
Style/StringLiteralsInInterpolation:
|
112
|
+
EnforcedStyle: double_quotes
|
113
|
+
|
114
|
+
Style/SymbolArray:
|
115
|
+
Enabled: false
|
116
|
+
|
117
|
+
Style/TrailingCommaInArguments:
|
118
|
+
EnforcedStyleForMultiline: consistent_comma
|
119
|
+
|
120
|
+
Style/TrailingCommaInArrayLiteral:
|
121
|
+
EnforcedStyleForMultiline: consistent_comma
|
122
|
+
|
123
|
+
Style/TrailingCommaInHashLiteral:
|
124
|
+
EnforcedStyleForMultiline: consistent_comma
|
125
|
+
|
126
|
+
Style/ZeroLengthPredicate:
|
127
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/bin/rspec
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rspec' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rspec-core", "rspec")
|
data/bin/rubocop
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
#
|
5
|
+
# This file was generated by Bundler.
|
6
|
+
#
|
7
|
+
# The application 'rubocop' is installed as part of a gem, and
|
8
|
+
# this file is here to facilitate running it.
|
9
|
+
#
|
10
|
+
|
11
|
+
require "pathname"
|
12
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
13
|
+
Pathname.new(__FILE__).realpath)
|
14
|
+
|
15
|
+
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
16
|
+
|
17
|
+
if File.file?(bundle_binstub)
|
18
|
+
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
19
|
+
load(bundle_binstub)
|
20
|
+
else
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
require "rubygems"
|
27
|
+
require "bundler/setup"
|
28
|
+
|
29
|
+
load Gem.bin_path("rubocop", "rubocop")
|
@@ -47,7 +47,7 @@ class Thor
|
|
47
47
|
name: "__#{name}",
|
48
48
|
description: nil,
|
49
49
|
options: [],
|
50
|
-
subcommands: subcommand_metadata(thor)
|
50
|
+
subcommands: subcommand_metadata(thor),
|
51
51
|
}
|
52
52
|
|
53
53
|
erb = File.read("#{File.dirname(__FILE__)}/template/main.erb")
|
@@ -66,8 +66,8 @@ class Thor
|
|
66
66
|
|
67
67
|
source << SUBCOMMAND_FUNCTION_TEMPLATE.result(binding)
|
68
68
|
|
69
|
-
subcommand[:subcommands].each do |
|
70
|
-
source << render_subcommand_function(
|
69
|
+
subcommand[:subcommands].each do |nested|
|
70
|
+
source << render_subcommand_function(nested, prefix: prefix)
|
71
71
|
end
|
72
72
|
source.join("\n").strip + "\n"
|
73
73
|
end
|
@@ -75,7 +75,7 @@ class Thor
|
|
75
75
|
def subcommand_metadata(thor)
|
76
76
|
result = []
|
77
77
|
thor.tasks.each do |(name, command)|
|
78
|
-
aliases = thor.map.select{|_, original_name|
|
78
|
+
aliases = thor.map.select {|_, original_name|
|
79
79
|
name == original_name
|
80
80
|
}.map(&:first)
|
81
81
|
result << generate_command_information(thor, name, command, aliases)
|
@@ -84,25 +84,23 @@ class Thor
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def generate_command_information(thor, name, command, aliases)
|
87
|
-
if subcommand_class = thor.subcommand_classes[name]
|
88
|
-
|
87
|
+
subcommands = if (subcommand_class = thor.subcommand_classes[name])
|
88
|
+
subcommand_metadata(subcommand_class)
|
89
89
|
else
|
90
|
-
|
90
|
+
[]
|
91
91
|
end
|
92
|
-
{
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
}
|
92
|
+
{name: hyphenate(name),
|
93
|
+
aliases: aliases.map {|a| hyphenate(a) },
|
94
|
+
usage: command.usage,
|
95
|
+
description: command.description,
|
96
|
+
options: thor.class_options.map {|_, o| option_metadata(o) } +
|
97
|
+
command.options.map {|(_, o)| option_metadata(o) },
|
98
|
+
subcommands: subcommands,}
|
100
99
|
end
|
101
100
|
|
102
101
|
def option_metadata(option)
|
103
|
-
{
|
104
|
-
|
105
|
-
}
|
102
|
+
{names: ["--#{option.name}"] + option.aliases.map {|a| "-#{a}" },
|
103
|
+
description: option.description,}
|
106
104
|
end
|
107
105
|
|
108
106
|
def quote(s)
|
data/thor-zsh_completion.gemspec
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
3
|
+
require "thor/zsh_completion/version"
|
5
4
|
|
6
5
|
Gem::Specification.new do |spec|
|
7
6
|
spec.name = "thor-zsh_completion"
|
@@ -9,18 +8,15 @@ Gem::Specification.new do |spec|
|
|
9
8
|
spec.authors = ["labocho"]
|
10
9
|
spec.email = ["labocho@penguinlab.jp"]
|
11
10
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
11
|
+
spec.summary = "Create zsh completion script for Thor subclass"
|
12
|
+
spec.description = "Create zsh completion script for Thor subclass"
|
14
13
|
spec.homepage = "https://github.com/labocho/thor-zsh_completion"
|
15
14
|
spec.license = "MIT"
|
16
15
|
|
17
|
-
spec.files = `git ls-files -z`.split("\x0").reject {
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/}) }
|
18
17
|
spec.bindir = "exe"
|
19
|
-
spec.executables = spec.files.grep(%r
|
18
|
+
spec.executables = spec.files.grep(%r(^exe/)) {|f| File.basename(f) }
|
20
19
|
spec.require_paths = ["lib"]
|
21
20
|
|
22
21
|
spec.add_dependency "thor", "~> 0"
|
23
|
-
spec.add_development_dependency "bundler", "~> 1.10"
|
24
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
-
spec.add_development_dependency "rspec"
|
26
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thor-zsh_completion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- labocho
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -24,48 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: bundler
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '1.10'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '1.10'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: rake
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '10.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '10.0'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: rspec
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - ">="
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
27
|
description: Create zsh completion script for Thor subclass
|
70
28
|
email:
|
71
29
|
- labocho@penguinlab.jp
|
@@ -75,6 +33,7 @@ extra_rdoc_files: []
|
|
75
33
|
files:
|
76
34
|
- ".gitignore"
|
77
35
|
- ".rspec"
|
36
|
+
- ".rubocop.yml"
|
78
37
|
- ".travis.yml"
|
79
38
|
- CHANGELOG.md
|
80
39
|
- CODE_OF_CONDUCT.md
|
@@ -83,6 +42,8 @@ files:
|
|
83
42
|
- README.md
|
84
43
|
- Rakefile
|
85
44
|
- bin/console
|
45
|
+
- bin/rspec
|
46
|
+
- bin/rubocop
|
86
47
|
- bin/setup
|
87
48
|
- lib/thor/zsh_completion.rb
|
88
49
|
- lib/thor/zsh_completion/command.rb
|
@@ -110,8 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
71
|
- !ruby/object:Gem::Version
|
111
72
|
version: '0'
|
112
73
|
requirements: []
|
113
|
-
|
114
|
-
rubygems_version: 2.7.3
|
74
|
+
rubygems_version: 3.1.2
|
115
75
|
signing_key:
|
116
76
|
specification_version: 4
|
117
77
|
summary: Create zsh completion script for Thor subclass
|