rails5-spec-converter 1.0.6 → 1.0.8
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09acdaf5aac98f957adf479e15e41fdcb50c15b8
|
4
|
+
data.tar.gz: 944323eb7a81f0968b71add26521ef9c05a056c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cdfe7db58fdef963722fabe00c9cf97ba976ad4ec9f5b6501f6c469fdcab2832aaf6a50d68f2dfdafc328923eb538712ba1316c002ced809ae50eea3a0b7504
|
7
|
+
data.tar.gz: 0f717273ca4a3c6767852cf248ceb9a137325f093de2ce1fee6475207dc24b3b1cf9abd1c90a127e7d4373662b14b085eff5d6a5a4106d3e613b05cfe534ce46
|
@@ -31,6 +31,7 @@ module Rails5
|
|
31
31
|
|
32
32
|
if args[0].hash_type? && args[0].children.length > 0
|
33
33
|
next if looks_like_route_definition?(args[0])
|
34
|
+
next if has_key?(args[0], :params)
|
34
35
|
|
35
36
|
write_params_hash(source_rewriter, args[0])
|
36
37
|
else
|
@@ -63,6 +64,10 @@ module Rails5
|
|
63
64
|
false
|
64
65
|
end
|
65
66
|
|
67
|
+
def has_key?(hash_node, key)
|
68
|
+
hash_node.children.any? { |pair| pair.children[0].children[0] == key }
|
69
|
+
end
|
70
|
+
|
66
71
|
def write_params_hash(source_rewriter, hash_node)
|
67
72
|
pairs_that_belong_in_params = []
|
68
73
|
pairs_that_belong_outside_params = []
|
@@ -105,7 +110,7 @@ module Rails5
|
|
105
110
|
def indent_after_last_pair(hash_node)
|
106
111
|
return nil unless hash_node.children.length > 0
|
107
112
|
|
108
|
-
text_after_last_pair = @content[hash_node.children.last.loc.expression.
|
113
|
+
text_after_last_pair = @content[hash_node.children.last.loc.expression.end_pos...hash_node.loc.expression.end_pos]
|
109
114
|
extract_indent(text_after_last_pair)
|
110
115
|
end
|
111
116
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails5-spec-converter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis Grathwell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parser
|