synvert 0.12.0 → 0.12.1
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 +4 -0
- data/lib/synvert/cli.rb +4 -15
- data/lib/synvert/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6850587d42a82286479a86f22018a83b4e6f3b6d23d65a6518120acde4c4a52c
|
4
|
+
data.tar.gz: e9a223cae6a39601d7bd9f793c109d28db4483664da77a20a88c267a4432568e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eca37ac2eda8ea96d555b32061336b2576f0efbd5471dbfb0ca58594e21a55e17559675d8f2880d5b0f9740564f719311eb06bb34f90491bed713c0b7d6e3267
|
7
|
+
data.tar.gz: 796ce440e914222563a41741b54a89584da3ee2418fe830a37bdfa076beabb794c69312d38e3a319f42c2d483dd72ccb402666dd97e0b0aa539ef47726b0c2b9
|
data/CHANGELOG.md
CHANGED
data/lib/synvert/cli.rb
CHANGED
@@ -114,9 +114,7 @@ module Synvert
|
|
114
114
|
'run specified snippets, each SNIPPET_NAME is combined by group and name, e.g. ruby/new_hash_syntax,ruby/new_lambda_syntax' do |snippet_names|
|
115
115
|
@options[:snippet_names] = snippet_names.split(',').map(&:strip)
|
116
116
|
end
|
117
|
-
opts.on '-g',
|
118
|
-
'--generate NEW_SNIPPET_NAME',
|
119
|
-
'generate a new snippet' do |name|
|
117
|
+
opts.on '-g', '--generate NEW_SNIPPET_NAME', 'generate a new snippet' do |name|
|
120
118
|
@options[:command] = 'generate'
|
121
119
|
@options[:snippet_name] = name
|
122
120
|
end
|
@@ -224,18 +222,9 @@ module Synvert
|
|
224
222
|
|
225
223
|
# Show and print one rewriter.
|
226
224
|
def show_rewriter
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
rewriter.process_with_sandbox
|
231
|
-
puts rewriter.description
|
232
|
-
rewriter.sub_snippets.each do |sub_rewriter|
|
233
|
-
puts
|
234
|
-
puts '=' * 80
|
235
|
-
puts "snippet: #{sub_rewriter.name}"
|
236
|
-
puts '=' * 80
|
237
|
-
puts sub_rewriter.description
|
238
|
-
end
|
225
|
+
path = File.expand_path(File.join(default_snippets_path, "lib/#{@options[:snippet_name]}.rb"))
|
226
|
+
if File.exist?(path)
|
227
|
+
puts File.read(path)
|
239
228
|
else
|
240
229
|
puts "snippet #{@options[:snippet_name]} not found"
|
241
230
|
end
|
data/lib/synvert/version.rb
CHANGED