ditto_code 0.1.9 → 0.2.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/lib/dittocode/parse.rb +5 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 849da2b6c7fedf77d9bff8d4aa49b31f0d780841
|
4
|
+
data.tar.gz: 35951ad9722725e13824825daa27dec96a04d342
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a1dc058670de2a6027988b46bb6f7e0449d65ce271b7a8fd7c58c15a7ed6324eacf5f8c00e6f128f61d5db3f8d87414e9c7740d35f0b225f16bac8d80d0d0b0
|
7
|
+
data.tar.gz: b565a9e6182412fbb4351c21125e5844f52fd23ea04fdf265beb619df28e474d700de4aca45f0908b64c37b4db6daea211248e7d2e588dd271c3babbb79bfaa2
|
data/lib/dittocode/parse.rb
CHANGED
@@ -12,12 +12,14 @@ module DittoCode
|
|
12
12
|
@override = override
|
13
13
|
@verbose = verbose
|
14
14
|
@indent = indent
|
15
|
-
@remove = false
|
16
15
|
end
|
17
16
|
|
18
17
|
# Transform the file based in the environment
|
19
18
|
def transformation(file_path, isView)
|
20
19
|
|
20
|
+
# Init removed false
|
21
|
+
@removed = false
|
22
|
+
|
21
23
|
# Start to read the file
|
22
24
|
file = File.open(file_path)
|
23
25
|
if isView
|
@@ -188,12 +190,12 @@ module DittoCode
|
|
188
190
|
|
189
191
|
# Get the initializers and the ends of the blocks
|
190
192
|
if @isView
|
191
|
-
initializers = line.scan(/<%[\s]*(case|unless|if|do|def)[\s]+/).size
|
193
|
+
initializers = line.scan(/<%[\s]*(case|unless|if|do|def|begin)[\s]+/).size
|
192
194
|
initializers += line.scan(/<%[@=;\s\w\d]*(case|unless|if|do|def)[\s]+/).size
|
193
195
|
|
194
196
|
finals = line.scan(/[\s]+(end)[\s]*%>/).size
|
195
197
|
else
|
196
|
-
initializers = line.scan(/^[\s\t]*(case|unless|if|do|def)[\s]+/).size
|
198
|
+
initializers = line.scan(/^[\s\t]*(case|unless|if|do|def|begin)[\s]+/).size # If, def, unless... of a start line
|
197
199
|
initializers += line.scan(/[\s\t]+(case|do)[\s]+[|]+/).size # Case or do inside a line
|
198
200
|
initializers += line.scan(/[\s\t]+(do)[\s]*$/).size # Finals do
|
199
201
|
initializers += line.scan(/[\s\t]+(if|unless)[\s]+[@=\d\w\s]+(?:then){1}/).size # Only if|unless + then, this line disable error by: unless|if var
|