lazibi 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,12 @@
1
+ == 0.1.12 2007-06-21
2
+
3
+ * Bugs
4
+ * inline block do; end fix
5
+ * Mix " and / inline fix
6
+ * Features
7
+ * Passed RSpec test ( manually disabled optional_do filter for spec )
8
+ * Passed redMine test
9
+
1
10
  == 0.1.11 2007-06-20
2
11
 
3
12
  * Bugs
data/Manifest.txt CHANGED
@@ -23,6 +23,7 @@ lib/vendor/beautifier.rb
23
23
  scripts/rdoc2html
24
24
  scripts/txt2html
25
25
  test/fixtures/clean/comment_break.txt
26
+ test/fixtures/clean/complex_string.txt
26
27
  test/fixtures/clean/end_concat.txt
27
28
  test/fixtures/clean/long_indent.txt
28
29
  test/fixtures/clean/mixed_re.txt
@@ -38,6 +39,7 @@ test/fixtures/meta/comment.txt
38
39
  test/fixtures/meta/comment_after_end.txt
39
40
  test/fixtures/meta/eval_code.txt
40
41
  test/fixtures/meta/here_doc.txt
42
+ test/fixtures/meta/inline_do_end.txt
41
43
  test/fixtures/meta/inline_end.txt
42
44
  test/fixtures/meta/loop.txt
43
45
  test/fixtures/meta/middle.txt
@@ -55,10 +57,12 @@ test/fixtures/real/comment.txt
55
57
  test/fixtures/real/comment_after_end.txt
56
58
  test/fixtures/real/comment_after_end_expected.txt
57
59
  test/fixtures/real/comment_break.txt
60
+ test/fixtures/real/complex_string.txt
58
61
  test/fixtures/real/end_concat.txt
59
62
  test/fixtures/real/eval_code.txt
60
63
  test/fixtures/real/general_eval.txt
61
64
  test/fixtures/real/here_doc.txt
65
+ test/fixtures/real/inline_do_end.txt
62
66
  test/fixtures/real/inline_end.txt
63
67
  test/fixtures/real/javascript.txt
64
68
  test/fixtures/real/long_indent.txt
@@ -49,5 +49,9 @@ module Lazibi
49
49
  offset = 'meta'.size + 1
50
50
  path[offset..-1]
51
51
  end
52
+
53
+ def clean_block(line)
54
+ line.gsub /do.*?end/, ''
55
+ end
52
56
  end
53
57
  end
@@ -2,7 +2,7 @@ module Lazibi #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 11
5
+ TINY = 12
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
data/lib/parser.rb CHANGED
@@ -59,8 +59,9 @@ module Lazibi
59
59
  lines.each_index do |index|
60
60
  # run through filters
61
61
  l = filter_for_to_rb(lines, index, filters)
62
-
63
- if start_anchor?(get_rest(l))
62
+
63
+ safe_l = clean_block(clean_line(get_rest(l)))
64
+ if start_anchor? safe_l
64
65
  relative_index_for_end = find_end( lines[index..-1], get_indent(l))
65
66
  unless relative_index_for_end
66
67
  progress += 1
@@ -64,35 +64,30 @@ module Beautifier
64
64
 
65
65
  # throw out sequences that will
66
66
  # only sow confusion
67
-
67
+ # " \"" << "#{base}/#{path}".gsub(/["?<>\*]/, '') << "\""
68
68
  tline = line.dup.sub /[;]*$/, ''
69
69
 
70
70
 
71
- tline.gsub!(/\/.*?[^\\]\//,"//")
71
+
72
72
 
73
73
  tline.gsub!(/#\{.*?\}/,"")
74
74
  tline.gsub!(/\\\"/,"'")
75
+
76
+ # deal with nested syntax
77
+
78
+ tline.gsub!(/"\/*?"/,"\"\"")
79
+ tline.gsub!(/\/.*?[^\\]\//,"//")
80
+
81
+ # again
75
82
  tline.gsub!(/".*?"/,"\"\"")
76
83
  tline.gsub!(/'.*?'/,"''")
84
+ tline.gsub!(/`.*?`/,"''")
77
85
 
78
86
  # more ..
79
- tline.gsub!(/%r\{.*?\}/, "''")
80
- tline.gsub!(/%r\(.*?\)/, "''")
81
- tline.gsub!(/%r\[.*?\]/, "''")
82
- tline.gsub!(/%r(.).*?\1/, "''")
83
-
84
- tline.gsub!(/%w\{.*?\}/, "''")
85
- tline.gsub!(/%w\(.*?\)/, "''")
86
- tline.gsub!(/%w\[.*?\]/, "''")
87
- tline.gsub!(/%w(.).*?\1/, "''")
88
-
89
-
90
- tline.gsub!(/%q\{.*?\}/, "''")
91
- tline.gsub!(/%q\(.*?\)/, "''")
92
- tline.gsub!(/%q\[.*?\]/, "''")
93
- tline.gsub!(/%q(.).*?\1/, "''")
94
-
95
-
87
+ tline.gsub!(/%[qwsrx]\{.*?\}/, "''")
88
+ tline.gsub!(/%[qwsrx]\(.*?\)/, "''")
89
+ tline.gsub!(/%[qwsrx]\[.*?\]/, "''")
90
+ tline.gsub!(/%[qwsrx](.).*?\1/, "''")
96
91
 
97
92
  tline.gsub!(/#.*$/, '') unless leave_comment
98
93
 
@@ -0,0 +1,3 @@
1
+ def target(path)
2
+ " \"" << "#{base}/#{path}".gsub(/["?<>\*]/, '') << "\""
3
+ end
@@ -0,0 +1,2 @@
1
+ it "should fail when no description given" do
2
+ lambda { describe do; end }.should raise_error(ArgumentError)
@@ -0,0 +1,3 @@
1
+ def target(path)
2
+ " \"" << "#{base}/#{path}".gsub(/["?<>\*]/, '') << "\""
3
+ end
@@ -0,0 +1,3 @@
1
+ it "should fail when no description given" do
2
+ lambda { describe do; end }.should raise_error(ArgumentError)
3
+ end
data/website/index.html CHANGED
@@ -33,7 +33,7 @@
33
33
  <h1>Welcome to Lazibi</h1>
34
34
  <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/lazibi"; return false'>
35
35
  <p>Get Version</p>
36
- <a href="http://rubyforge.org/projects/lazibi" class="numbers">0.1.11</a>
36
+ <a href="http://rubyforge.org/projects/lazibi" class="numbers">0.1.12</a>
37
37
  </div>
38
38
  <p>
39
39
  Lazibi is a preprocessor that allows you to use Python style indentation in
metadata CHANGED
@@ -3,7 +3,7 @@ rubygems_version: 0.9.3
3
3
  specification_version: 1
4
4
  name: lazibi
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.1.11
6
+ version: 0.1.12
7
7
  date: 2007-06-21 00:00:00 +08:00
8
8
  summary: Python like syntax for Ruby
9
9
  require_paths:
@@ -54,6 +54,7 @@ files:
54
54
  - scripts/rdoc2html
55
55
  - scripts/txt2html
56
56
  - test/fixtures/clean/comment_break.txt
57
+ - test/fixtures/clean/complex_string.txt
57
58
  - test/fixtures/clean/end_concat.txt
58
59
  - test/fixtures/clean/long_indent.txt
59
60
  - test/fixtures/clean/mixed_re.txt
@@ -69,6 +70,7 @@ files:
69
70
  - test/fixtures/meta/comment_after_end.txt
70
71
  - test/fixtures/meta/eval_code.txt
71
72
  - test/fixtures/meta/here_doc.txt
73
+ - test/fixtures/meta/inline_do_end.txt
72
74
  - test/fixtures/meta/inline_end.txt
73
75
  - test/fixtures/meta/loop.txt
74
76
  - test/fixtures/meta/middle.txt
@@ -86,10 +88,12 @@ files:
86
88
  - test/fixtures/real/comment_after_end.txt
87
89
  - test/fixtures/real/comment_after_end_expected.txt
88
90
  - test/fixtures/real/comment_break.txt
91
+ - test/fixtures/real/complex_string.txt
89
92
  - test/fixtures/real/end_concat.txt
90
93
  - test/fixtures/real/eval_code.txt
91
94
  - test/fixtures/real/general_eval.txt
92
95
  - test/fixtures/real/here_doc.txt
96
+ - test/fixtures/real/inline_do_end.txt
93
97
  - test/fixtures/real/inline_end.txt
94
98
  - test/fixtures/real/javascript.txt
95
99
  - test/fixtures/real/long_indent.txt
@@ -130,6 +134,7 @@ extra_rdoc_files:
130
134
  - Manifest.txt
131
135
  - README.txt
132
136
  - test/fixtures/clean/comment_break.txt
137
+ - test/fixtures/clean/complex_string.txt
133
138
  - test/fixtures/clean/end_concat.txt
134
139
  - test/fixtures/clean/long_indent.txt
135
140
  - test/fixtures/clean/mixed_re.txt
@@ -145,6 +150,7 @@ extra_rdoc_files:
145
150
  - test/fixtures/meta/comment_after_end.txt
146
151
  - test/fixtures/meta/eval_code.txt
147
152
  - test/fixtures/meta/here_doc.txt
153
+ - test/fixtures/meta/inline_do_end.txt
148
154
  - test/fixtures/meta/inline_end.txt
149
155
  - test/fixtures/meta/loop.txt
150
156
  - test/fixtures/meta/middle.txt
@@ -162,10 +168,12 @@ extra_rdoc_files:
162
168
  - test/fixtures/real/comment_after_end.txt
163
169
  - test/fixtures/real/comment_after_end_expected.txt
164
170
  - test/fixtures/real/comment_break.txt
171
+ - test/fixtures/real/complex_string.txt
165
172
  - test/fixtures/real/end_concat.txt
166
173
  - test/fixtures/real/eval_code.txt
167
174
  - test/fixtures/real/general_eval.txt
168
175
  - test/fixtures/real/here_doc.txt
176
+ - test/fixtures/real/inline_do_end.txt
169
177
  - test/fixtures/real/inline_end.txt
170
178
  - test/fixtures/real/javascript.txt
171
179
  - test/fixtures/real/long_indent.txt