resumetools 0.2.7.0 → 0.2.7.6

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.
@@ -1,389 +1,391 @@
1
- grammar Resume
2
-
3
- rule document
4
- ((contact_data / section / period / period_data / item / para / data) / LF)*
5
- end
6
-
7
- rule period_data
8
- period_org / period_loc / period_dates / period_detail
9
- end
10
-
11
- rule period_org
12
- period_detail_marker "O" whitespace content:text LF+ {
13
- def data_type
14
- :period_organization
15
- end
16
-
17
- def value
18
- content.text_value.squeeze(" ").strip
19
- end
20
-
21
- def inspect
22
- "Organization: " + value
23
- end
24
- }
25
- end
26
-
27
- rule period_loc
28
- period_detail_marker "L" whitespace content:text LF+ {
29
- def data_type
30
- :period_location
31
- end
32
-
33
- def value
34
- content.text_value.squeeze(" ").strip
35
- end
36
-
37
- def inspect
38
- "Location: " + value
39
- end
40
- }
41
- end
42
-
43
- rule period_dates
44
- period_detail_marker "D" whitespace content:text LF+ {
45
- def data_type
46
- :period_dates
47
- end
48
-
49
- def value
50
- content.text_value.squeeze(" ").strip
51
- end
52
-
53
- def inspect
54
- "Dates: " + value
55
- end
56
- }
57
- end
58
-
59
- rule contact_data
60
- contact_name / contact_telephone / contact_email / contact_address /
61
- contact_url / contact_detail
62
- end
63
-
64
- rule contact_url
65
- contact_marker "U" whitespace content:text LF+ {
66
- def data_type
67
- :contact_url
68
- end
69
-
70
- def value
71
- content.text_value.squeeze(" ").strip
72
- end
73
-
74
- def inspect
75
- "Contact URL: " + value
76
- end
77
- }
78
- end
79
-
80
- rule contact_address
81
- contact_marker "A" whitespace content:text LF+ {
82
- def data_type
83
- :contact_address
84
- end
85
-
86
- def value
87
- content.text_value.squeeze(" ").strip
88
- end
89
-
90
- def inspect
91
- "Contact address: " + value
92
- end
93
- }
94
- end
95
-
96
- rule contact_telephone
97
- contact_marker "T" whitespace content:text LF+ {
98
- def data_type
99
- :contact_telephone
100
- end
101
-
102
- def value
103
- content.text_value.squeeze(" ").strip
104
- end
105
-
106
- def inspect
107
- "Contact telephone: " + value
108
- end
109
- }
110
- end
111
-
112
- rule contact_email
113
- contact_marker "E" whitespace content:text LF+ {
114
- def data_type
115
- :contact_email
116
- end
117
-
118
- def value
119
- content.text_value.squeeze(" ").strip
120
- end
121
-
122
- def inspect
123
- "Contact e-mail: " + value
124
- end
125
- }
126
- end
127
-
128
- rule contact_telephone
129
- contact_marker "T" whitespace content:text LF+ {
130
- def data_type
131
- :contact_telephone
132
- end
133
-
134
- def value
135
- content.text_value.squeeze(" ").strip
136
- end
137
-
138
- def inspect
139
- "Contact telephone: " + value
140
- end
141
- }
142
- end
143
-
144
- rule contact_name
145
- contact_marker "N" whitespace content:text LF+ {
146
- def data_type
147
- :contact_name
148
- end
149
-
150
- def value
151
- content.text_value.squeeze(" ").strip
152
- end
153
-
154
- def inspect
155
- "Contact name: " + value
156
- end
157
- }
158
- end
159
-
160
- rule item
161
- item_marker whitespace content:(item_data+) {
162
- def data_type
163
- :item
164
- end
165
-
166
- def value
167
- content.text_value.gsub("\n", ' ').gsub("\t", ' ').squeeze(" ").strip
168
- end
169
-
170
- def inspect
171
- "Item: " + value[0..100]
172
- end
173
- }
174
- end
175
-
176
- rule item_data
177
- continuation content:text LF+ {
178
- def inspect
179
- content.text_value
180
- end
181
- }
182
- end
183
-
184
- rule continuation
185
- [^-=>#+\n]
186
- end
187
-
188
- rule period_detail
189
- period_detail_marker whitespace content:text LF+ {
190
- def data_type
191
- :period_detail
192
- end
193
-
194
- def value
195
- content.text_value.squeeze(" ").strip
196
- end
197
-
198
- def inspect
199
- "Detail: " + value
200
- end
201
- }
202
- end
203
-
204
- rule period
205
- period_marker whitespace content:text LF {
206
- def data_type
207
- :period
208
- end
209
-
210
- def value
211
- content.text_value.squeeze(" ").strip
212
- end
213
-
214
- def inspect
215
- "Period: " + value
216
- end
217
- }
218
- end
219
-
220
- rule para
221
- para_marker LF
222
- content:(!("---") text LF)*
223
- para_marker LF+ {
224
- def data_type
225
- :paragraph
226
- end
227
-
228
- def value
229
- content.text_value.gsub(/\n/, ' ').squeeze(" ").strip
230
- end
231
-
232
- def inspect
233
- "Paragraph: " + value[0..100]
234
- end
235
- }
236
- end
237
-
238
- rule section
239
- section_marker whitespace content:text LF+ {
240
- def data_type
241
- :section
242
- end
243
-
244
- def value
245
- content.text_value.squeeze(" ").strip
246
- end
247
-
248
- def inspect
249
- "Section: " + elements[2].text_value
250
- end
251
- }
252
- end
253
-
254
- rule contact_detail
255
- contact_marker whitespace content:text LF {
256
- def data_type
257
- :contact_detail
258
- end
259
- def value
260
- content.text_value.squeeze(" ").strip
261
- end
262
-
263
- def inspect
264
- "Contact detail: " + value
265
- end
266
- }
267
- end
268
-
269
- rule data
270
- content:(text) LF {
271
- def data_type
272
- :untyped
273
- end
274
-
275
- def value
276
- content.text_value
277
- end
278
-
279
- def inspect
280
- "Data: \"" + value[0..100] + "\""
281
- end
282
- }
283
- end
284
-
285
- rule text
286
- ([^\n])+ {
287
- def value
288
- text_value
289
- end
290
-
291
- def inspect
292
- "Line: " + value
293
- end
294
- }
295
- end
296
-
297
- rule LF
298
- [\n] {
299
- def data_type
300
- nil
301
- end
302
-
303
- def value
304
- ""
305
- end
306
-
307
- def inspect
308
- value
309
- end
310
- }
311
- end
312
-
313
- rule whitespace
314
- [\t ]
315
- end
316
-
317
- rule contact_marker
318
- "#" {
319
- def value
320
- nil
321
- end
322
-
323
- def inspect
324
- "#"
325
- end
326
- }
327
- end
328
-
329
- rule item_marker
330
- "-" {
331
- def value
332
- nil
333
- end
334
-
335
- def inspect
336
- "-"
337
- end
338
- }
339
- end
340
-
341
- rule section_marker
342
- "=" {
343
- def value
344
- nil
345
- end
346
-
347
- def inspect
348
- "="
349
- end
350
- }
351
- end
352
-
353
- rule period_marker
354
- "+" {
355
- def value
356
- nil
357
- end
358
-
359
- def inspect
360
- "+"
361
- end
362
- }
363
- end
364
-
365
- rule period_detail_marker
366
- ">" {
367
- def value
368
- nil
369
- end
370
-
371
- def inspect
372
- ">"
373
- end
374
- }
375
- end
376
-
377
- rule para_marker
378
- "---" {
379
- def value
380
- nil
381
- end
382
-
383
- def inspect
384
- "---"
385
- end
386
- }
387
- end
388
-
389
- end
1
+ module ResumeTools
2
+ grammar ResumeGrammar
3
+
4
+ rule document
5
+ ((contact_data / section / period / period_data / item / para / data) / LF)*
6
+ end
7
+
8
+ rule period_data
9
+ period_org / period_loc / period_dates / period_detail
10
+ end
11
+
12
+ rule period_org
13
+ period_detail_marker "O" whitespace content:text LF+ {
14
+ def data_type
15
+ :period_organization
16
+ end
17
+
18
+ def value
19
+ content.text_value.squeeze(" ").strip
20
+ end
21
+
22
+ def inspect
23
+ "Organization: " + value
24
+ end
25
+ }
26
+ end
27
+
28
+ rule period_loc
29
+ period_detail_marker "L" whitespace content:text LF+ {
30
+ def data_type
31
+ :period_location
32
+ end
33
+
34
+ def value
35
+ content.text_value.squeeze(" ").strip
36
+ end
37
+
38
+ def inspect
39
+ "Location: " + value
40
+ end
41
+ }
42
+ end
43
+
44
+ rule period_dates
45
+ period_detail_marker "D" whitespace content:text LF+ {
46
+ def data_type
47
+ :period_dates
48
+ end
49
+
50
+ def value
51
+ content.text_value.squeeze(" ").strip
52
+ end
53
+
54
+ def inspect
55
+ "Dates: " + value
56
+ end
57
+ }
58
+ end
59
+
60
+ rule contact_data
61
+ contact_name / contact_telephone / contact_email / contact_address /
62
+ contact_url / contact_detail
63
+ end
64
+
65
+ rule contact_url
66
+ contact_marker "U" whitespace content:text LF+ {
67
+ def data_type
68
+ :contact_url
69
+ end
70
+
71
+ def value
72
+ content.text_value.squeeze(" ").strip
73
+ end
74
+
75
+ def inspect
76
+ "Contact URL: " + value
77
+ end
78
+ }
79
+ end
80
+
81
+ rule contact_address
82
+ contact_marker "A" whitespace content:text LF+ {
83
+ def data_type
84
+ :contact_address
85
+ end
86
+
87
+ def value
88
+ content.text_value.squeeze(" ").strip
89
+ end
90
+
91
+ def inspect
92
+ "Contact address: " + value
93
+ end
94
+ }
95
+ end
96
+
97
+ rule contact_telephone
98
+ contact_marker "T" whitespace content:text LF+ {
99
+ def data_type
100
+ :contact_telephone
101
+ end
102
+
103
+ def value
104
+ content.text_value.squeeze(" ").strip
105
+ end
106
+
107
+ def inspect
108
+ "Contact telephone: " + value
109
+ end
110
+ }
111
+ end
112
+
113
+ rule contact_email
114
+ contact_marker "E" whitespace content:text LF+ {
115
+ def data_type
116
+ :contact_email
117
+ end
118
+
119
+ def value
120
+ content.text_value.squeeze(" ").strip
121
+ end
122
+
123
+ def inspect
124
+ "Contact e-mail: " + value
125
+ end
126
+ }
127
+ end
128
+
129
+ rule contact_telephone
130
+ contact_marker "T" whitespace content:text LF+ {
131
+ def data_type
132
+ :contact_telephone
133
+ end
134
+
135
+ def value
136
+ content.text_value.squeeze(" ").strip
137
+ end
138
+
139
+ def inspect
140
+ "Contact telephone: " + value
141
+ end
142
+ }
143
+ end
144
+
145
+ rule contact_name
146
+ contact_marker "N" whitespace content:text LF+ {
147
+ def data_type
148
+ :contact_name
149
+ end
150
+
151
+ def value
152
+ content.text_value.squeeze(" ").strip
153
+ end
154
+
155
+ def inspect
156
+ "Contact name: " + value
157
+ end
158
+ }
159
+ end
160
+
161
+ rule item
162
+ item_marker whitespace content:(item_data+) {
163
+ def data_type
164
+ :item
165
+ end
166
+
167
+ def value
168
+ content.text_value.gsub("\n", ' ').gsub("\t", ' ').squeeze(" ").strip
169
+ end
170
+
171
+ def inspect
172
+ "Item: " + value[0..100]
173
+ end
174
+ }
175
+ end
176
+
177
+ rule item_data
178
+ continuation content:text LF+ {
179
+ def inspect
180
+ content.text_value
181
+ end
182
+ }
183
+ end
184
+
185
+ rule continuation
186
+ [^-=>#+\n]
187
+ end
188
+
189
+ rule period_detail
190
+ period_detail_marker whitespace content:text LF+ {
191
+ def data_type
192
+ :period_detail
193
+ end
194
+
195
+ def value
196
+ content.text_value.squeeze(" ").strip
197
+ end
198
+
199
+ def inspect
200
+ "Detail: " + value
201
+ end
202
+ }
203
+ end
204
+
205
+ rule period
206
+ period_marker whitespace content:text LF {
207
+ def data_type
208
+ :period
209
+ end
210
+
211
+ def value
212
+ content.text_value.squeeze(" ").strip
213
+ end
214
+
215
+ def inspect
216
+ "Period: " + value
217
+ end
218
+ }
219
+ end
220
+
221
+ rule para
222
+ para_marker LF
223
+ content:(!("---") text LF)*
224
+ para_marker LF+ {
225
+ def data_type
226
+ :paragraph
227
+ end
228
+
229
+ def value
230
+ content.text_value.gsub(/\n/, ' ').squeeze(" ").strip
231
+ end
232
+
233
+ def inspect
234
+ "Paragraph: " + value[0..100]
235
+ end
236
+ }
237
+ end
238
+
239
+ rule section
240
+ section_marker whitespace content:text LF+ {
241
+ def data_type
242
+ :section
243
+ end
244
+
245
+ def value
246
+ content.text_value.squeeze(" ").strip
247
+ end
248
+
249
+ def inspect
250
+ "Section: " + elements[2].text_value
251
+ end
252
+ }
253
+ end
254
+
255
+ rule contact_detail
256
+ contact_marker whitespace content:text LF {
257
+ def data_type
258
+ :contact_detail
259
+ end
260
+ def value
261
+ content.text_value.squeeze(" ").strip
262
+ end
263
+
264
+ def inspect
265
+ "Contact detail: " + value
266
+ end
267
+ }
268
+ end
269
+
270
+ rule data
271
+ content:(text) LF {
272
+ def data_type
273
+ :untyped
274
+ end
275
+
276
+ def value
277
+ content.text_value
278
+ end
279
+
280
+ def inspect
281
+ "Data: \"" + value[0..100] + "\""
282
+ end
283
+ }
284
+ end
285
+
286
+ rule text
287
+ ([^\n])+ {
288
+ def value
289
+ text_value
290
+ end
291
+
292
+ def inspect
293
+ "Line: " + value
294
+ end
295
+ }
296
+ end
297
+
298
+ rule LF
299
+ [\n] {
300
+ def data_type
301
+ nil
302
+ end
303
+
304
+ def value
305
+ ""
306
+ end
307
+
308
+ def inspect
309
+ value
310
+ end
311
+ }
312
+ end
313
+
314
+ rule whitespace
315
+ [\t ]
316
+ end
317
+
318
+ rule contact_marker
319
+ "#" {
320
+ def value
321
+ nil
322
+ end
323
+
324
+ def inspect
325
+ "#"
326
+ end
327
+ }
328
+ end
329
+
330
+ rule item_marker
331
+ "-" {
332
+ def value
333
+ nil
334
+ end
335
+
336
+ def inspect
337
+ "-"
338
+ end
339
+ }
340
+ end
341
+
342
+ rule section_marker
343
+ "=" {
344
+ def value
345
+ nil
346
+ end
347
+
348
+ def inspect
349
+ "="
350
+ end
351
+ }
352
+ end
353
+
354
+ rule period_marker
355
+ "+" {
356
+ def value
357
+ nil
358
+ end
359
+
360
+ def inspect
361
+ "+"
362
+ end
363
+ }
364
+ end
365
+
366
+ rule period_detail_marker
367
+ ">" {
368
+ def value
369
+ nil
370
+ end
371
+
372
+ def inspect
373
+ ">"
374
+ end
375
+ }
376
+ end
377
+
378
+ rule para_marker
379
+ "---" {
380
+ def value
381
+ nil
382
+ end
383
+
384
+ def inspect
385
+ "---"
386
+ end
387
+ }
388
+ end
389
+
390
+ end # grammar ResumeGrammar
391
+ end # module ResumeTools