synvert-core 0.8.1 → 0.8.2
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/core/node_ext.rb +2 -1
- data/lib/synvert/core/version.rb +1 -1
- data/spec/synvert/core/node_ext_spec.rb +18 -0
- data/synvert-core.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 50629c1df6f1807a908e29168151ce28b9aad353
|
|
4
|
+
data.tar.gz: 95c03ecdfc6097da06f34102d6e99ab5ca76929d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5023594501e0f72371ba9857649893c109fc682fc4235692bdd9e8e79291453533c6b41c46e9d8d93fd7af2823e3c94fcae599d24a1b5ca2f820b48e63262b5a
|
|
7
|
+
data.tar.gz: 86905f7dfe07be1fba1274759d8c9efc217c9cf6dd59b2e81861eee79a2f89ee1f0efe6a3adc483540743e9cac8f9e9212f11630e067525a8353b54689dce1d3
|
data/CHANGELOG.md
CHANGED
|
@@ -346,7 +346,8 @@ module Parser::AST
|
|
|
346
346
|
file_source = evaluated.first.loc.expression.source_buffer.source
|
|
347
347
|
source = file_source[evaluated.first.loc.expression.begin_pos...evaluated.last.loc.expression.end_pos]
|
|
348
348
|
lines = source.split "\n"
|
|
349
|
-
|
|
349
|
+
lines_count = lines.length
|
|
350
|
+
if lines_count > 1 && lines_count == evaluated.size
|
|
350
351
|
new_code = []
|
|
351
352
|
lines.each_with_index { |line, index|
|
|
352
353
|
new_code << (index == 0 ? line : line[evaluated.first.indent-2..-1])
|
data/lib/synvert/core/version.rb
CHANGED
|
@@ -366,5 +366,23 @@ describe Parser::AST::Node do
|
|
|
366
366
|
node = parse(source)
|
|
367
367
|
expect(node.rewritten_source('{{arguments}}')).to eq %(a, b)
|
|
368
368
|
end
|
|
369
|
+
|
|
370
|
+
it 'rewrites array with multi line given as argument for method'do
|
|
371
|
+
source = <<-EOS.strip
|
|
372
|
+
long_name_method([
|
|
373
|
+
1,
|
|
374
|
+
2,
|
|
375
|
+
3
|
|
376
|
+
])
|
|
377
|
+
EOS
|
|
378
|
+
node = parse(source)
|
|
379
|
+
expect(node.rewritten_source('{{arguments}}')).to eq <<-EOS.strip
|
|
380
|
+
[
|
|
381
|
+
1,
|
|
382
|
+
2,
|
|
383
|
+
3
|
|
384
|
+
]
|
|
385
|
+
EOS
|
|
386
|
+
end
|
|
369
387
|
end
|
|
370
388
|
end
|
data/synvert-core.gemspec
CHANGED
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
|
19
19
|
spec.require_paths = ["lib"]
|
|
20
20
|
|
|
21
|
-
spec.add_runtime_dependency "parser"
|
|
21
|
+
spec.add_runtime_dependency "parser", "~> 2.2"
|
|
22
22
|
spec.add_runtime_dependency "activesupport"
|
|
23
23
|
spec.add_runtime_dependency "erubis"
|
|
24
24
|
|
metadata
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: synvert-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Richard Huang
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-01
|
|
11
|
+
date: 2015-04-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: parser
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '2.2'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- - "
|
|
24
|
+
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '2.2'
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: activesupport
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|