ditto_code 0.1.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dittocode/parse.rb +5 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89878b0fa06bbd81f76c75ccd999d978cd61a25b
4
- data.tar.gz: 4e890cabd15a0063b01cc9306759707a361e7b2a
3
+ metadata.gz: 849da2b6c7fedf77d9bff8d4aa49b31f0d780841
4
+ data.tar.gz: 35951ad9722725e13824825daa27dec96a04d342
5
5
  SHA512:
6
- metadata.gz: ce6fefc7f72c9584ebce1a52208146b62ceb97f4783723dd044cadd3363768d3e0811922568aba528ba28f9a57412c2db4cddb390ddd5a566be89fb53b81e743
7
- data.tar.gz: 54907456795f48ee4e6d523324fe9aaccb6fcc51e1a888f2284fabd5d6883365d833d30b18a471b50fc57a65299684ec5c72d85a6bb74f7b0d1623336d0c885e
6
+ metadata.gz: 7a1dc058670de2a6027988b46bb6f7e0449d65ce271b7a8fd7c58c15a7ed6324eacf5f8c00e6f128f61d5db3f8d87414e9c7740d35f0b225f16bac8d80d0d0b0
7
+ data.tar.gz: b565a9e6182412fbb4351c21125e5844f52fd23ea04fdf265beb619df28e474d700de4aca45f0908b64c37b4db6daea211248e7d2e588dd271c3babbb79bfaa2
@@ -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 # If, def, unless... of a start line
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ditto_code
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Angel M Miguel