synvert 0.12.1 → 0.13.0
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 +2 -1
- data/lib/synvert/cli.rb +7 -7
- data/lib/synvert/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 43ccf2486b37c9a73a8f014901e152ff5229bbcac7a35922d6cb5811318c9621
|
|
4
|
+
data.tar.gz: 0d9a816901fd978e550f976a6678513a516872f8c41ec3c1a1f21751e8b0a781
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eafeb5f93d44b239f1c48dda8be7426491d126adb1b3ba4a7a17f16b93ec9b48b79db1af3be89a60469891b5b25c4afd31326fc1ef11094fc05d24e0e118f4bc
|
|
7
|
+
data.tar.gz: 37c977345a20633089077628dc58d1db3dc7a382f64550f42aa912450437886555f2b372fd4edf1fa54bb6ecdefe222a8a08d9d56af5f8d7e6032252f7eb82c1
|
data/CHANGELOG.md
CHANGED
data/lib/synvert/cli.rb
CHANGED
|
@@ -137,7 +137,7 @@ module Synvert
|
|
|
137
137
|
|
|
138
138
|
# Load all rewriters.
|
|
139
139
|
def load_rewriters
|
|
140
|
-
Dir.glob(File.join(
|
|
140
|
+
Dir.glob(File.join(default_snippets_home, 'lib/**/*.rb')).each { |file| require file }
|
|
141
141
|
|
|
142
142
|
@options[:custom_snippet_paths].each do |snippet_path|
|
|
143
143
|
if /^http/.match?(snippet_path)
|
|
@@ -148,7 +148,7 @@ module Synvert
|
|
|
148
148
|
end
|
|
149
149
|
end
|
|
150
150
|
rescue StandardError
|
|
151
|
-
FileUtils.rm_rf
|
|
151
|
+
FileUtils.rm_rf default_snippets_home
|
|
152
152
|
retry
|
|
153
153
|
end
|
|
154
154
|
|
|
@@ -194,7 +194,7 @@ module Synvert
|
|
|
194
194
|
editor = [ENV['SYNVERT_EDITOR'], ENV['EDITOR']].find { |e| !e.nil? && !e.empty? }
|
|
195
195
|
return puts 'To open a synvert snippet, set $EDITOR or $SYNVERT_EDITOR' unless editor
|
|
196
196
|
|
|
197
|
-
path = File.expand_path(File.join(
|
|
197
|
+
path = File.expand_path(File.join(default_snippets_home, "lib/#{@options[:snippet_name]}.rb"))
|
|
198
198
|
if File.exist? path
|
|
199
199
|
system editor, path
|
|
200
200
|
else
|
|
@@ -222,7 +222,7 @@ module Synvert
|
|
|
222
222
|
|
|
223
223
|
# Show and print one rewriter.
|
|
224
224
|
def show_rewriter
|
|
225
|
-
path = File.expand_path(File.join(
|
|
225
|
+
path = File.expand_path(File.join(default_snippets_home, "lib/#{@options[:snippet_name]}.rb"))
|
|
226
226
|
if File.exist?(path)
|
|
227
227
|
puts File.read(path)
|
|
228
228
|
else
|
|
@@ -232,7 +232,7 @@ module Synvert
|
|
|
232
232
|
|
|
233
233
|
# sync snippets
|
|
234
234
|
def sync_snippets
|
|
235
|
-
Snippet.new(
|
|
235
|
+
Snippet.new(default_snippets_home).sync
|
|
236
236
|
puts 'synvert snippets are synced'
|
|
237
237
|
core_version = Snippet.fetch_core_version
|
|
238
238
|
if Gem::Version.new(core_version) > Gem::Version.new(Synvert::Core::VERSION)
|
|
@@ -288,8 +288,8 @@ module Synvert
|
|
|
288
288
|
File.write("spec/#{group}/#{name}_spec.rb", spec_content)
|
|
289
289
|
end
|
|
290
290
|
|
|
291
|
-
def
|
|
292
|
-
File.join(ENV['HOME'], '.synvert')
|
|
291
|
+
def default_snippets_home
|
|
292
|
+
ENV['SYNVERT_SNIPPETS_HOME'] || File.join(ENV['HOME'], '.synvert')
|
|
293
293
|
end
|
|
294
294
|
end
|
|
295
295
|
end
|
data/lib/synvert/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: synvert
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.13.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Richard Huang
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-03-
|
|
11
|
+
date: 2021-03-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: synvert-core
|