chusaku 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -6
- data/lib/chusaku/cli.rb +12 -0
- data/lib/chusaku/version.rb +1 -1
- data/lib/chusaku.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62bb838dd76c648a120303c3a0bde8c67ea7232f90accb9f3e739a3b69764026
|
4
|
+
data.tar.gz: 9af1726825550cb4ce7d642e6a80217b8810cb6a56e8703c6d7f4f23a8643f3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0baeb0a41404f911ef11b3d12709773a44ecc18aa542f5dcb854e1b67023b7fd79f640d10d7d8a4368121a33714327c5120ed701c9a67c238537023db78603e7
|
7
|
+
data.tar.gz: 1e5026ac8d35af5ff8c5d8c02d32d7d634716966dad3a61947398ee870203795ff91286bb43b7daf6802c4bace3df42b1ffb325c130e88b1fe26495d72100118
|
data/README.md
CHANGED
@@ -52,12 +52,13 @@ Chusaku has some flags available for use as well:
|
|
52
52
|
```
|
53
53
|
$ bundle exec chusaku --help
|
54
54
|
Usage: chusaku [options]
|
55
|
-
--dry-run
|
56
|
-
--exit-with-error-on-annotation
|
57
|
-
|
58
|
-
--verbose
|
59
|
-
-v, --version
|
60
|
-
-h, --help
|
55
|
+
--dry-run Run without file modifications
|
56
|
+
--exit-with-error-on-annotation Fail if any file was annotated
|
57
|
+
-c, --controllers-pattern=GLOB Specify alternative controller files glob pattern
|
58
|
+
--verbose Print all annotations
|
59
|
+
-v, --version Show Chusaku version number and quit
|
60
|
+
-h, --help Show this help message and quit
|
61
|
+
|
61
62
|
```
|
62
63
|
|
63
64
|
|
data/lib/chusaku/cli.rb
CHANGED
@@ -52,8 +52,10 @@ module Chusaku
|
|
52
52
|
def optparser
|
53
53
|
OptionParser.new do |opts|
|
54
54
|
opts.banner = "Usage: chusaku [options]"
|
55
|
+
opts.set_summary_width(35)
|
55
56
|
add_dry_run_flag(opts)
|
56
57
|
add_error_on_annotation_flag(opts)
|
58
|
+
add_controllers_pattern_flag(opts)
|
57
59
|
add_verbose_flag(opts)
|
58
60
|
add_version_flag(opts)
|
59
61
|
add_help_flag(opts)
|
@@ -80,6 +82,16 @@ module Chusaku
|
|
80
82
|
end
|
81
83
|
end
|
82
84
|
|
85
|
+
# Adds `--controllers-pattern` flag.
|
86
|
+
#
|
87
|
+
# @param opts [OptionParser] OptionParser instance
|
88
|
+
# @return [void]
|
89
|
+
def add_controllers_pattern_flag(opts)
|
90
|
+
opts.on("-c", "--controllers-pattern", "=GLOB", "Specify alternative controller files glob pattern") do |value|
|
91
|
+
@options[:controllers_pattern] = value
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
83
95
|
# Adds `--verbose` flag.
|
84
96
|
#
|
85
97
|
# @param opts [OptionParser] OptionParser instance
|
data/lib/chusaku/version.rb
CHANGED
data/lib/chusaku.rb
CHANGED
@@ -20,7 +20,7 @@ module Chusaku
|
|
20
20
|
@routes = Chusaku::Routes.call
|
21
21
|
@changes = []
|
22
22
|
@changed_files = []
|
23
|
-
controllers_pattern = "app/controllers/**/*_controller.rb"
|
23
|
+
controllers_pattern = @flags[:controllers_pattern] || "app/controllers/**/*_controller.rb"
|
24
24
|
|
25
25
|
Dir.glob(Rails.root.join(controllers_pattern)).each do |path|
|
26
26
|
controller = %r{controllers/(.*)_controller\.rb}.match(path)[1]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chusaku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nishiki Liu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
- !ruby/object:Gem::Version
|
129
129
|
version: '0'
|
130
130
|
requirements: []
|
131
|
-
rubygems_version: 3.4.
|
131
|
+
rubygems_version: 3.4.19
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: Annotate your Rails controllers with route info.
|