erbal 0.0.2 → 0.0.3.rc1
Sign up to get free protection for your applications and to get access to all the features.
- data/benchmark/bench.rb +3 -3
- data/ext/erbal/erbal.c +3 -3
- data/ext/erbal/parser.c +69 -64
- data/ext/erbal/parser.h +14 -6
- data/ext/erbal/parser.rl +53 -48
- data/lib/erbal.bundle +0 -0
- data/spec/erbal_spec.rb +47 -0
- data/spec/spec_helper.rb +10 -0
- data/tasks/gem.rake +6 -6
- data/tasks/spec.rake +7 -0
- metadata +24 -7
data/benchmark/bench.rb
CHANGED
@@ -3,7 +3,7 @@ require 'rubygems'
|
|
3
3
|
require 'erubis'
|
4
4
|
require File.expand_path(File.dirname(__FILE__)) + '/../lib/erbal'
|
5
5
|
|
6
|
-
RUNS =
|
6
|
+
RUNS = 3000
|
7
7
|
REPEAT = 6
|
8
8
|
SRC = File.read('sample.erb')
|
9
9
|
|
@@ -19,10 +19,10 @@ class Benchmark
|
|
19
19
|
total += Time.now-start
|
20
20
|
end
|
21
21
|
times << total
|
22
|
-
puts " #{i+1}) #{sprintf("%.
|
22
|
+
puts " #{i+1}) #{sprintf("%.3f", total)}" unless warmup
|
23
23
|
end
|
24
24
|
unless warmup
|
25
|
-
puts "=> Average: #{sprintf("%.
|
25
|
+
puts "=> Average: #{sprintf("%.3f", times.inject(0){|c, n| c += n} / times.size)}"
|
26
26
|
end
|
27
27
|
end
|
28
28
|
end
|
data/ext/erbal/erbal.c
CHANGED
@@ -15,12 +15,12 @@ VALUE rb_erbal_alloc(VALUE klass) {
|
|
15
15
|
return obj;
|
16
16
|
}
|
17
17
|
|
18
|
-
VALUE rb_erbal_initialize(VALUE self, VALUE str, VALUE
|
18
|
+
VALUE rb_erbal_initialize(VALUE self, VALUE str, VALUE buffer_name) {
|
19
19
|
Check_Type(str, T_STRING);
|
20
|
-
Check_Type(
|
20
|
+
Check_Type(buffer_name, T_STRING);
|
21
21
|
erbal_parser *parser = NULL;
|
22
22
|
Data_Get_Struct(self, erbal_parser, parser);
|
23
|
-
parser->
|
23
|
+
parser->buffer_name = buffer_name;
|
24
24
|
parser->str = str;
|
25
25
|
return self;
|
26
26
|
}
|
data/ext/erbal/parser.c
CHANGED
@@ -21,81 +21,86 @@ static const int erbal_parser_en_main = 1;
|
|
21
21
|
static char *ts, *te, *p, *pe, *eof;
|
22
22
|
static int act, cs;
|
23
23
|
|
24
|
-
inline void
|
25
|
-
parser->
|
26
|
-
|
27
|
-
parser->
|
24
|
+
inline void erbal_parser_tag_open_common(erbal_parser *parser, int shift) {
|
25
|
+
if (parser->chars_seen != 0) {
|
26
|
+
rb_str_concat(parser->src, parser->buffer_name);
|
27
|
+
rb_str_buf_cat(parser->src, ".concat(\"", 9);
|
28
|
+
erbal_concat_chars_seen(parser, shift);
|
28
29
|
rb_str_buf_cat(parser->src, "\");", 3);
|
30
|
+
parser->chars_seen = 0;
|
29
31
|
}
|
30
32
|
}
|
31
33
|
|
32
|
-
inline void
|
33
|
-
|
34
|
-
parser->
|
35
|
-
rb_str_concat(parser->src, parser->buffer);
|
36
|
-
rb_str_buf_cat(parser->src, ".concat((", 9);
|
34
|
+
inline void erbal_parser_tag_open(erbal_parser *parser) {
|
35
|
+
erbal_parser_tag_open_common(parser, -1);
|
36
|
+
parser->state = TAG_OPEN;
|
37
37
|
}
|
38
38
|
|
39
|
-
inline void
|
40
|
-
|
41
|
-
parser->
|
39
|
+
inline void erbal_parser_tag_open_for_output(erbal_parser *parser) {
|
40
|
+
erbal_parser_tag_open_common(parser, -2);
|
41
|
+
parser->state = TAG_OPEN_FOR_OUTPUT;
|
42
42
|
}
|
43
43
|
|
44
|
-
inline void
|
45
|
-
|
46
|
-
|
47
|
-
}
|
44
|
+
inline void erbal_parser_tag_open_for_comment(erbal_parser *parser) {
|
45
|
+
parser->state = TAG_OPEN_FOR_COMMENT;
|
46
|
+
}
|
48
47
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
48
|
+
inline void erbal_parser_non_tag(erbal_parser *parser) {
|
49
|
+
parser->chars_seen += 1;
|
50
|
+
}
|
51
|
+
|
52
|
+
inline void erbal_parser_tag_close_common(erbal_parser *parser, int tag_size) {
|
53
|
+
if (parser->state == TAG_OPEN_FOR_OUTPUT) {
|
54
|
+
rb_str_concat(parser->src, parser->buffer_name);
|
55
|
+
rb_str_buf_cat(parser->src, ".concat((", 9);
|
56
|
+
erbal_concat_chars_seen(parser, -tag_size);
|
57
|
+
rb_str_buf_cat(parser->src, ").to_s);", 8);
|
58
|
+
} else if (parser->state == TAG_OPEN) {
|
59
|
+
erbal_concat_chars_seen(parser, -tag_size);
|
60
|
+
rb_str_buf_cat(parser->src, ";", 1);
|
62
61
|
}
|
62
|
+
|
63
|
+
parser->state = OUTSIDE_TAG;
|
64
|
+
parser->chars_seen = 0;
|
63
65
|
}
|
64
66
|
|
65
67
|
inline void erbal_parser_tag_close_with_trim(erbal_parser *parser) {
|
66
|
-
|
67
|
-
|
68
|
+
erbal_parser_tag_close_common(parser, 2);
|
69
|
+
|
70
|
+
if (*(p + 1) == '\n') {
|
68
71
|
p++;
|
69
72
|
}
|
70
73
|
}
|
71
74
|
|
72
75
|
inline void erbal_parser_tag_close(erbal_parser *parser) {
|
73
|
-
parser
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
rb_str_buf_cat(parser->src,
|
76
|
+
erbal_parser_tag_close_common(parser, 1);
|
77
|
+
}
|
78
|
+
|
79
|
+
inline void erbal_concat_chars_seen(erbal_parser *parser, int rewind_chars) {
|
80
|
+
if (parser->chars_seen != 0) {
|
81
|
+
rb_str_buf_cat(parser->src, ((p + rewind_chars) - parser->chars_seen), parser->chars_seen);
|
79
82
|
}
|
80
|
-
|
83
|
+
|
84
|
+
parser->chars_seen = 0;
|
81
85
|
}
|
82
86
|
|
83
87
|
inline void erbal_parser_finish(erbal_parser *parser) {
|
84
|
-
if (parser->
|
88
|
+
if (parser->chars_seen != 0) {
|
89
|
+
rb_str_concat(parser->src, parser->buffer_name);
|
90
|
+
rb_str_buf_cat(parser->src, ".concat(\"", 9);
|
91
|
+
erbal_concat_chars_seen(parser, 0);
|
85
92
|
rb_str_buf_cat(parser->src, "\");", 3);
|
86
93
|
}
|
87
|
-
rb_str_concat(parser->src, parser->
|
94
|
+
rb_str_concat(parser->src, parser->buffer_name);
|
88
95
|
}
|
89
96
|
|
90
97
|
void erbal_parser_init(erbal_parser *parser) {
|
91
|
-
parser->
|
92
|
-
parser->
|
93
|
-
parser->
|
94
|
-
parser->comment = 0;
|
95
|
-
parser->src = rb_str_dup(parser->buffer);
|
98
|
+
parser->state = 0;
|
99
|
+
parser->chars_seen = 0;
|
100
|
+
parser->src = rb_str_dup(parser->buffer_name);
|
96
101
|
rb_str_buf_cat(parser->src, "=\"\";", 4);
|
97
102
|
|
98
|
-
#line
|
103
|
+
#line 104 "parser.c"
|
99
104
|
{
|
100
105
|
cs = erbal_parser_start;
|
101
106
|
ts = 0;
|
@@ -103,37 +108,37 @@ void erbal_parser_init(erbal_parser *parser) {
|
|
103
108
|
act = 0;
|
104
109
|
}
|
105
110
|
|
106
|
-
#line
|
111
|
+
#line 101 "parser.rl"
|
107
112
|
}
|
108
113
|
|
109
114
|
void erbal_parser_exec(erbal_parser *parser) {
|
110
115
|
p = RSTRING(parser->str)->ptr;
|
111
116
|
pe = p + strlen(p);
|
112
117
|
|
113
|
-
#line
|
118
|
+
#line 119 "parser.c"
|
114
119
|
{
|
115
120
|
if ( p == pe )
|
116
121
|
goto _test_eof;
|
117
122
|
switch ( cs )
|
118
123
|
{
|
119
124
|
tr0:
|
120
|
-
#line
|
121
|
-
{{p = ((te))-1;}{
|
125
|
+
#line 13 "parser.rl"
|
126
|
+
{{p = ((te))-1;}{ erbal_parser_non_tag(parser); }}
|
122
127
|
goto st1;
|
123
128
|
tr1:
|
124
|
-
#line
|
129
|
+
#line 11 "parser.rl"
|
125
130
|
{te = p+1;{ erbal_parser_tag_close_with_trim(parser); }}
|
126
131
|
goto st1;
|
127
132
|
tr2:
|
128
|
-
#line
|
129
|
-
{te = p+1;{
|
133
|
+
#line 13 "parser.rl"
|
134
|
+
{te = p+1;{ erbal_parser_non_tag(parser); }}
|
130
135
|
goto st1;
|
131
136
|
tr6:
|
132
|
-
#line
|
133
|
-
{te = p;p--;{
|
137
|
+
#line 13 "parser.rl"
|
138
|
+
{te = p;p--;{ erbal_parser_non_tag(parser); }}
|
134
139
|
goto st1;
|
135
140
|
tr7:
|
136
|
-
#line
|
141
|
+
#line 12 "parser.rl"
|
137
142
|
{te = p+1;{ erbal_parser_tag_close(parser); }}
|
138
143
|
goto st1;
|
139
144
|
tr10:
|
@@ -142,21 +147,21 @@ tr10:
|
|
142
147
|
goto st1;
|
143
148
|
tr11:
|
144
149
|
#line 9 "parser.rl"
|
145
|
-
{te = p+1;{
|
150
|
+
{te = p+1;{ erbal_parser_tag_open_for_comment(parser); }}
|
146
151
|
goto st1;
|
147
152
|
tr12:
|
148
153
|
#line 10 "parser.rl"
|
149
|
-
{te = p+1;{
|
154
|
+
{te = p+1;{ erbal_parser_tag_open_for_output(parser); }}
|
150
155
|
goto st1;
|
151
156
|
st1:
|
152
|
-
#line 1 "
|
157
|
+
#line 1 "NONE"
|
153
158
|
{ts = 0;}
|
154
159
|
if ( ++p == pe )
|
155
160
|
goto _test_eof1;
|
156
161
|
case 1:
|
157
|
-
#line 1 "
|
162
|
+
#line 1 "NONE"
|
158
163
|
{ts = p;}
|
159
|
-
#line
|
164
|
+
#line 165 "parser.c"
|
160
165
|
switch( (*p) ) {
|
161
166
|
case 37: goto st2;
|
162
167
|
case 45: goto tr4;
|
@@ -171,14 +176,14 @@ case 2:
|
|
171
176
|
goto tr7;
|
172
177
|
goto tr6;
|
173
178
|
tr4:
|
174
|
-
#line 1 "
|
179
|
+
#line 1 "NONE"
|
175
180
|
{te = p+1;}
|
176
181
|
goto st3;
|
177
182
|
st3:
|
178
183
|
if ( ++p == pe )
|
179
184
|
goto _test_eof3;
|
180
185
|
case 3:
|
181
|
-
#line
|
186
|
+
#line 187 "parser.c"
|
182
187
|
if ( (*p) == 37 )
|
183
188
|
goto st0;
|
184
189
|
goto tr6;
|
@@ -227,6 +232,6 @@ case 5:
|
|
227
232
|
|
228
233
|
}
|
229
234
|
|
230
|
-
#line
|
235
|
+
#line 107 "parser.rl"
|
231
236
|
erbal_parser_finish(parser);
|
232
237
|
}
|
data/ext/erbal/parser.h
CHANGED
@@ -4,16 +4,24 @@
|
|
4
4
|
#include "ruby.h"
|
5
5
|
|
6
6
|
typedef struct erbal_parser {
|
7
|
-
int
|
8
|
-
VALUE str, src,
|
7
|
+
unsigned int state, chars_seen, tag_seen;
|
8
|
+
VALUE str, src, buffer_name;
|
9
9
|
} erbal_parser;
|
10
10
|
|
11
11
|
inline void erbal_parser_tag_open(erbal_parser*);
|
12
|
-
inline void
|
13
|
-
inline void
|
14
|
-
inline void
|
12
|
+
inline void erbal_parser_tag_open_for_comment(erbal_parser*);
|
13
|
+
inline void erbal_parser_tag_open_for_output(erbal_parser*);
|
14
|
+
inline void erbal_parser_non_tag(erbal_parser*);
|
15
15
|
inline void erbal_parser_tag_close(erbal_parser*);
|
16
16
|
inline void erbal_parser_tag_close_with_trim(erbal_parser*);
|
17
|
+
inline void erbal_parser_tag_close_common(erbal_parser*, int shift);
|
17
18
|
inline void erbal_parser_finish(erbal_parser*);
|
19
|
+
inline void erbal_concat_chars_seen(erbal_parser*, int shift);
|
20
|
+
inline void erbal_parser_tag_open_common(erbal_parser*, int shift);
|
18
21
|
|
19
|
-
#
|
22
|
+
#define TAG_OPEN 1
|
23
|
+
#define TAG_OPEN_FOR_COMMENT 2
|
24
|
+
#define TAG_OPEN_FOR_OUTPUT 3
|
25
|
+
#define OUTSIDE_TAG 4
|
26
|
+
|
27
|
+
#endif
|
data/ext/erbal/parser.rl
CHANGED
@@ -6,11 +6,11 @@
|
|
6
6
|
|
7
7
|
main := |*
|
8
8
|
'<%' => { erbal_parser_tag_open(parser); };
|
9
|
-
'<%#'
|
10
|
-
'<%=' => {
|
11
|
-
any => { erbal_parser_any(parser); };
|
9
|
+
'<%#' => { erbal_parser_tag_open_for_comment(parser); };
|
10
|
+
'<%=' => { erbal_parser_tag_open_for_output(parser); };
|
12
11
|
'-%>' => { erbal_parser_tag_close_with_trim(parser); };
|
13
12
|
'%>' => { erbal_parser_tag_close(parser); };
|
13
|
+
any => { erbal_parser_non_tag(parser); };
|
14
14
|
*|;
|
15
15
|
}%%
|
16
16
|
|
@@ -19,78 +19,83 @@
|
|
19
19
|
static char *ts, *te, *p, *pe, *eof;
|
20
20
|
static int act, cs;
|
21
21
|
|
22
|
-
inline void
|
23
|
-
parser->
|
24
|
-
|
25
|
-
parser->
|
22
|
+
inline void erbal_parser_tag_open_common(erbal_parser *parser, int shift) {
|
23
|
+
if (parser->chars_seen != 0) {
|
24
|
+
rb_str_concat(parser->src, parser->buffer_name);
|
25
|
+
rb_str_buf_cat(parser->src, ".concat(\"", 9);
|
26
|
+
erbal_concat_chars_seen(parser, shift);
|
26
27
|
rb_str_buf_cat(parser->src, "\");", 3);
|
28
|
+
parser->chars_seen = 0;
|
27
29
|
}
|
28
30
|
}
|
29
31
|
|
30
|
-
inline void
|
31
|
-
|
32
|
-
parser->
|
33
|
-
rb_str_concat(parser->src, parser->buffer);
|
34
|
-
rb_str_buf_cat(parser->src, ".concat((", 9);
|
32
|
+
inline void erbal_parser_tag_open(erbal_parser *parser) {
|
33
|
+
erbal_parser_tag_open_common(parser, -1);
|
34
|
+
parser->state = TAG_OPEN;
|
35
35
|
}
|
36
36
|
|
37
|
-
inline void
|
38
|
-
|
39
|
-
parser->
|
37
|
+
inline void erbal_parser_tag_open_for_output(erbal_parser *parser) {
|
38
|
+
erbal_parser_tag_open_common(parser, -2);
|
39
|
+
parser->state = TAG_OPEN_FOR_OUTPUT;
|
40
40
|
}
|
41
41
|
|
42
|
-
inline void
|
43
|
-
|
44
|
-
|
45
|
-
}
|
42
|
+
inline void erbal_parser_tag_open_for_comment(erbal_parser *parser) {
|
43
|
+
parser->state = TAG_OPEN_FOR_COMMENT;
|
44
|
+
}
|
46
45
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
46
|
+
inline void erbal_parser_non_tag(erbal_parser *parser) {
|
47
|
+
parser->chars_seen += 1;
|
48
|
+
}
|
49
|
+
|
50
|
+
inline void erbal_parser_tag_close_common(erbal_parser *parser, int tag_size) {
|
51
|
+
if (parser->state == TAG_OPEN_FOR_OUTPUT) {
|
52
|
+
rb_str_concat(parser->src, parser->buffer_name);
|
53
|
+
rb_str_buf_cat(parser->src, ".concat((", 9);
|
54
|
+
erbal_concat_chars_seen(parser, -tag_size);
|
55
|
+
rb_str_buf_cat(parser->src, ").to_s);", 8);
|
56
|
+
} else if (parser->state == TAG_OPEN) {
|
57
|
+
erbal_concat_chars_seen(parser, -tag_size);
|
58
|
+
rb_str_buf_cat(parser->src, ";", 1);
|
60
59
|
}
|
60
|
+
|
61
|
+
parser->state = OUTSIDE_TAG;
|
62
|
+
parser->chars_seen = 0;
|
61
63
|
}
|
62
64
|
|
63
65
|
inline void erbal_parser_tag_close_with_trim(erbal_parser *parser) {
|
64
|
-
|
65
|
-
|
66
|
+
erbal_parser_tag_close_common(parser, 2);
|
67
|
+
|
68
|
+
if (*(p + 1) == '\n') {
|
66
69
|
p++;
|
67
70
|
}
|
68
71
|
}
|
69
72
|
|
70
73
|
inline void erbal_parser_tag_close(erbal_parser *parser) {
|
71
|
-
parser
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
rb_str_buf_cat(parser->src,
|
74
|
+
erbal_parser_tag_close_common(parser, 1);
|
75
|
+
}
|
76
|
+
|
77
|
+
inline void erbal_concat_chars_seen(erbal_parser *parser, int rewind_chars) {
|
78
|
+
if (parser->chars_seen != 0) {
|
79
|
+
rb_str_buf_cat(parser->src, ((p + rewind_chars) - parser->chars_seen), parser->chars_seen);
|
77
80
|
}
|
78
|
-
|
81
|
+
|
82
|
+
parser->chars_seen = 0;
|
79
83
|
}
|
80
84
|
|
81
85
|
inline void erbal_parser_finish(erbal_parser *parser) {
|
82
|
-
if (parser->
|
86
|
+
if (parser->chars_seen != 0) {
|
87
|
+
rb_str_concat(parser->src, parser->buffer_name);
|
88
|
+
rb_str_buf_cat(parser->src, ".concat(\"", 9);
|
89
|
+
erbal_concat_chars_seen(parser, 0);
|
83
90
|
rb_str_buf_cat(parser->src, "\");", 3);
|
84
91
|
}
|
85
|
-
rb_str_concat(parser->src, parser->
|
92
|
+
rb_str_concat(parser->src, parser->buffer_name);
|
86
93
|
}
|
87
94
|
|
88
95
|
void erbal_parser_init(erbal_parser *parser) {
|
89
|
-
parser->
|
90
|
-
parser->
|
91
|
-
parser->
|
92
|
-
parser->comment = 0;
|
93
|
-
parser->src = rb_str_dup(parser->buffer);
|
96
|
+
parser->state = 0;
|
97
|
+
parser->chars_seen = 0;
|
98
|
+
parser->src = rb_str_dup(parser->buffer_name);
|
94
99
|
rb_str_buf_cat(parser->src, "=\"\";", 4);
|
95
100
|
%% write init;
|
96
101
|
}
|
data/lib/erbal.bundle
CHANGED
Binary file
|
data/spec/erbal_spec.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Erbal do
|
4
|
+
def parse(str)
|
5
|
+
Erbal.new(str, '@out').parse
|
6
|
+
end
|
7
|
+
|
8
|
+
it "should parse a blank string" do
|
9
|
+
parse("").should == '@out="";@out'
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should parse content without any tags" do
|
13
|
+
parse("I love unicorns!").should == '@out="";@out.concat("I love unicorns!");@out'
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should parse the <% tag" do
|
17
|
+
parse("<% 1 + 1 %>").should == '@out=""; 1 + 1 ;@out'
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should parse the <%= tag" do
|
21
|
+
parse("<%= 1 + 1 %>").should == '@out="";@out.concat(( 1 + 1 ).to_s);@out'
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should parse the comment tag <%#" do
|
25
|
+
parse("<%# I'm a comment %>").should == '@out="";@out'
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should swallow the following newline if the -%> tag is used" do
|
29
|
+
parse("<%= 1 + 1 -%>\n").should == '@out="";@out.concat(( 1 + 1 ).to_s);@out'
|
30
|
+
end
|
31
|
+
|
32
|
+
it "should not swallow the following character if the -%> tag is used and the following character is not a newline" do
|
33
|
+
parse("<%= 1 + 1 -%>Z").should == '@out="";@out.concat(( 1 + 1 ).to_s);@out.concat("Z");@out'
|
34
|
+
end
|
35
|
+
|
36
|
+
it "should concat text surrounding the tags when the opening tag is <%" do
|
37
|
+
parse("1 + 1 is <% 1 + 1 %>. Easy!").should == '@out="";@out.concat("1 + 1 is "); 1 + 1 ;@out.concat(". Easy!");@out'
|
38
|
+
end
|
39
|
+
|
40
|
+
it "should concat text surrounding the tags when the opening tag is <%=" do
|
41
|
+
parse("1 + 1 is <%= 1 + 1 %>. Easy!").should == '@out="";@out.concat("1 + 1 is ");@out.concat(( 1 + 1 ).to_s);@out.concat(". Easy!");@out'
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should escape double quotes used outside tags" do
|
45
|
+
puts eval(parse("1 + \" 1 is <%= \"weeee\" %>. Easy!"))
|
46
|
+
end
|
47
|
+
end
|
data/spec/spec_helper.rb
ADDED
data/tasks/gem.rake
CHANGED
@@ -2,7 +2,7 @@ require 'rake/gempackagetask'
|
|
2
2
|
require 'yaml'
|
3
3
|
|
4
4
|
WIN_SUFFIX = ENV['WIN_SUFFIX'] || 'i386-mswin32'
|
5
|
-
ERBAL_VERSION = '0.0.
|
5
|
+
ERBAL_VERSION = '0.0.3.rc1'
|
6
6
|
|
7
7
|
task :clean => :clobber_package
|
8
8
|
|
@@ -10,7 +10,7 @@ spec = Gem::Specification.new do |s|
|
|
10
10
|
s.name = 'erbal'
|
11
11
|
s.version = ERBAL_VERSION
|
12
12
|
s.platform = WIN ? Gem::Platform::CURRENT : Gem::Platform::RUBY
|
13
|
-
s.summary =
|
13
|
+
s.summary =
|
14
14
|
s.description = "Very small, very fast Ragel/C based ERB parser"
|
15
15
|
s.author = "Ian Leitch"
|
16
16
|
s.email = 'ian.leitch@systino.net'
|
@@ -18,15 +18,15 @@ spec = Gem::Specification.new do |s|
|
|
18
18
|
s.has_rdoc = false
|
19
19
|
|
20
20
|
s.files = %w(COPYING CHANGELOG README.rdoc Rakefile) +
|
21
|
-
Dir.glob("{lib,spec,tasks,benchmark}/**/*") +
|
21
|
+
Dir.glob("{lib,spec,tasks,benchmark}/**/*") +
|
22
22
|
Dir.glob("ext/**/*.{h,c,rb,rl}")
|
23
|
-
|
23
|
+
|
24
24
|
if WIN
|
25
25
|
s.files += ["lib/erbal.#{Config::CONFIG['DLEXT']}"]
|
26
26
|
else
|
27
27
|
s.extensions = FileList["ext/**/extconf.rb"].to_a
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
s.require_path = "lib"
|
31
31
|
end
|
32
32
|
|
@@ -38,7 +38,7 @@ namespace :gem do
|
|
38
38
|
desc "Update the gemspec for GitHub's gem server"
|
39
39
|
task :github do
|
40
40
|
File.open("erbal.gemspec", 'w') { |f| f << YAML.dump(spec) }
|
41
|
-
end
|
41
|
+
end
|
42
42
|
end
|
43
43
|
|
44
44
|
task :install => [:clean, :clobber, :ragel, :compile, :package] do
|
data/tasks/spec.rake
CHANGED
metadata
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erbal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 977940546
|
5
|
+
prerelease: true
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 3
|
10
|
+
- rc1
|
11
|
+
version: 0.0.3.rc1
|
5
12
|
platform: ruby
|
6
13
|
authors:
|
7
14
|
- Ian Leitch
|
@@ -9,7 +16,7 @@ autorequire:
|
|
9
16
|
bindir: bin
|
10
17
|
cert_chain: []
|
11
18
|
|
12
|
-
date:
|
19
|
+
date: 2010-12-17 00:00:00 +11:00
|
13
20
|
default_executable:
|
14
21
|
dependencies: []
|
15
22
|
|
@@ -28,6 +35,8 @@ files:
|
|
28
35
|
- Rakefile
|
29
36
|
- lib/erbal/rails.rb
|
30
37
|
- lib/erbal.bundle
|
38
|
+
- spec/erbal_spec.rb
|
39
|
+
- spec/spec_helper.rb
|
31
40
|
- tasks/ext.rake
|
32
41
|
- tasks/gem.rake
|
33
42
|
- tasks/spec.rake
|
@@ -48,21 +57,29 @@ rdoc_options: []
|
|
48
57
|
require_paths:
|
49
58
|
- lib
|
50
59
|
required_ruby_version: !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
51
61
|
requirements:
|
52
62
|
- - ">="
|
53
63
|
- !ruby/object:Gem::Version
|
64
|
+
hash: 3
|
65
|
+
segments:
|
66
|
+
- 0
|
54
67
|
version: "0"
|
55
|
-
version:
|
56
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
|
+
none: false
|
57
70
|
requirements:
|
58
|
-
- - "
|
71
|
+
- - ">"
|
59
72
|
- !ruby/object:Gem::Version
|
60
|
-
|
61
|
-
|
73
|
+
hash: 25
|
74
|
+
segments:
|
75
|
+
- 1
|
76
|
+
- 3
|
77
|
+
- 1
|
78
|
+
version: 1.3.1
|
62
79
|
requirements: []
|
63
80
|
|
64
81
|
rubyforge_project:
|
65
|
-
rubygems_version: 1.3.
|
82
|
+
rubygems_version: 1.3.7
|
66
83
|
signing_key:
|
67
84
|
specification_version: 3
|
68
85
|
summary: Very small, very fast Ragel/C based ERB parser
|