synvert-core 1.10.0 → 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/lib/synvert/core/rewriter.rb +6 -18
- data/lib/synvert/core/version.rb +1 -1
- data/lib/synvert/core.rb +0 -2
- data/spec/synvert/core/rewriter_spec.rb +0 -9
- metadata +1 -2
- data/lib/synvert/core/exceptions.rb +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 966c0db8262c57bb94be47d44c5638c9c9607728da335b4bde9d39c49f7bc665
|
4
|
+
data.tar.gz: e2be9da04e58da3b236d03006883778f6e202d9bbb5a8fa922dd6339117a6a2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e1f6a8a25817ebe46c03bdbf6e7982f559c426bf5537c2ae28549215ad77a03c45768af6b3f74ba84e34105c6d1e8c9cbb365cb1f431220b59028678c373dcd
|
7
|
+
data.tar.gz: 44f57f854c537825acb57217b216294f226df391b1eb185fd1558f463084a91ad9fcc296f54eba05c5b66e1d995a40c897d267fff662ff5bf85472d83d993be1
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -51,14 +51,10 @@ module Synvert::Core
|
|
51
51
|
# @param group [String] rewrtier group.
|
52
52
|
# @param name [String] rewrtier name.
|
53
53
|
# @return [Synvert::Core::Rewriter] the matching rewriter.
|
54
|
-
# @raise [Synvert::Core::RewriterNotFound] if the registered rewriter is not found.
|
55
54
|
def fetch(group, name)
|
56
55
|
group = group.to_s
|
57
56
|
name = name.to_s
|
58
|
-
|
59
|
-
raise RewriterNotFound, "Rewriter #{group} #{name} not found" unless rewriter
|
60
|
-
|
61
|
-
rewriter
|
57
|
+
rewriters.dig(group, name)
|
62
58
|
end
|
63
59
|
|
64
60
|
# Get all available rewriters
|
@@ -136,24 +132,16 @@ module Synvert::Core
|
|
136
132
|
# It will call the block but doesn't change any file.
|
137
133
|
def process_with_sandbox
|
138
134
|
@options[:run_instance] = false
|
139
|
-
|
140
|
-
process
|
141
|
-
ensure
|
142
|
-
@options[:run_instance] = true
|
143
|
-
end
|
135
|
+
process
|
144
136
|
end
|
145
137
|
|
146
138
|
def test
|
147
139
|
@options[:write_to_file] = false
|
148
|
-
|
149
|
-
|
150
|
-
instance_eval(&@block)
|
140
|
+
@affected_files = Set.new
|
141
|
+
instance_eval(&@block)
|
151
142
|
|
152
|
-
|
153
|
-
|
154
|
-
end
|
155
|
-
ensure
|
156
|
-
@options[:write_to_file] = true
|
143
|
+
if !@affected_files.empty? && @redo_until_no_change # redo
|
144
|
+
test
|
157
145
|
end
|
158
146
|
@test_results
|
159
147
|
end
|
data/lib/synvert/core/version.rb
CHANGED
data/lib/synvert/core.rb
CHANGED
@@ -17,8 +17,6 @@ module Synvert
|
|
17
17
|
autoload :Configuration, 'synvert/core/configuration'
|
18
18
|
autoload :Rewriter, 'synvert/core/rewriter'
|
19
19
|
autoload :Engine, 'synvert/core/engine'
|
20
|
-
autoload :RewriterNotFound, 'synvert/core/exceptions'
|
21
|
-
autoload :MethodNotSupported, 'synvert/core/exceptions'
|
22
20
|
autoload :Utils, 'synvert/core/utils'
|
23
21
|
end
|
24
22
|
end
|
@@ -238,15 +238,6 @@ module Synvert::Core
|
|
238
238
|
rewriter.process
|
239
239
|
expect(Rewriter.fetch('group', 'sub_rewriter')).not_to be_nil
|
240
240
|
end
|
241
|
-
|
242
|
-
it 'raises RewriterNotFound' do
|
243
|
-
rewriter =
|
244
|
-
Rewriter.new 'group', 'name' do
|
245
|
-
add_snippet :group, :not_exist
|
246
|
-
end
|
247
|
-
expect { rewriter.process }
|
248
|
-
.to raise_error(RewriterNotFound)
|
249
|
-
end
|
250
241
|
end
|
251
242
|
|
252
243
|
it 'parses helper_method' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synvert-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
@@ -116,7 +116,6 @@ files:
|
|
116
116
|
- lib/synvert/core/configuration.rb
|
117
117
|
- lib/synvert/core/engine.rb
|
118
118
|
- lib/synvert/core/engine/erb.rb
|
119
|
-
- lib/synvert/core/exceptions.rb
|
120
119
|
- lib/synvert/core/node_ext.rb
|
121
120
|
- lib/synvert/core/rewriter.rb
|
122
121
|
- lib/synvert/core/rewriter/action/replace_erb_stmt_with_expr_action.rb
|