chusaku 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chusaku.rb +27 -5
- data/lib/chusaku/version.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: 006eca0c4d1c3b87363edd35f9070dd48bc0693e1b56b01fd3900696fa50387d
|
4
|
+
data.tar.gz: d5d3816c84eaba7c36d4e06e30eb7b8783b1dbb69f3c42190a278bf82fd01619
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b103a27205545c18aba9e7570e0f0c63aafa558b0cb6b870520e8a25d60cbb73cdfceccc7937c09c3de5090cc304b08c1151a29ba16602802b0fdf685f8fe360
|
7
|
+
data.tar.gz: ff6eb6258eea5a27f0422d633975251827c114af744f229ab3f4eca101a6ce840b39c4bf47300f16813944b055502f78d1a88d89725d827edf90649003b43b22
|
data/lib/chusaku.rb
CHANGED
@@ -154,12 +154,34 @@ module Chusaku
|
|
154
154
|
#
|
155
155
|
# @return [Integer] 0 for success, 1 for error
|
156
156
|
def output_results
|
157
|
-
|
158
|
-
|
159
|
-
|
157
|
+
puts(output_copy)
|
158
|
+
exit_code = 0
|
159
|
+
exit_code = 1 if @annotated_paths.any? && @flags.include?(:error_on_annotation)
|
160
|
+
exit_code
|
161
|
+
end
|
162
|
+
|
163
|
+
# Determines the copy to be used in the program output.
|
164
|
+
#
|
165
|
+
# @return [String] Copy to be outputted to user
|
166
|
+
def output_copy
|
167
|
+
return 'Nothing to annotate.' if @annotated_paths.empty?
|
168
|
+
|
169
|
+
annotated_paths = @annotated_paths.join(', ')
|
170
|
+
dry_run = @flags.include?(:dry)
|
171
|
+
error_on_annotation = @flags.include?(:error_on_annotation)
|
172
|
+
|
173
|
+
if dry_run && error_on_annotation
|
174
|
+
<<~COPY
|
175
|
+
Annotations missing in the following files: #{annotated_paths}
|
176
|
+
|
177
|
+
Run `chusaku` to annotate them. Exiting with status code 1.
|
178
|
+
COPY
|
179
|
+
elsif dry_run
|
180
|
+
"The following files would be annotated without `--dry-run`: #{annotated_paths}"
|
181
|
+
elsif error_on_annotation
|
182
|
+
"Annotated #{annotated_paths}.\n\nExiting with status code 1."
|
160
183
|
else
|
161
|
-
|
162
|
-
0
|
184
|
+
"Annotated #{annotated_paths}."
|
163
185
|
end
|
164
186
|
end
|
165
187
|
end
|
data/lib/chusaku/version.rb
CHANGED
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: 0.
|
4
|
+
version: 0.5.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: 2021-
|
11
|
+
date: 2021-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -142,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
|
-
rubygems_version: 3.2.
|
145
|
+
rubygems_version: 3.2.15
|
146
146
|
signing_key:
|
147
147
|
specification_version: 4
|
148
148
|
summary: Annotate your Rails controllers with route info.
|