general 2.0.0 → 2.0.1
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/README.md +26 -0
- data/lib/gpartials/garrayplaceholder.rb +2 -2
- 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: 7116b5cf6208b7332acd88c3f5f2d9a5fc7e3029
|
4
|
+
data.tar.gz: 7dcc9fc52866b7f27f176055fd4ffab9d6734dbf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c17be95ef162c2ef46d3e2b5ee5b6106261cab92073ce5e3d9cd9600e141b06586ca70500b5039c0f8273cf3373af77af864d843c3686e3011fc18a32bc5990
|
7
|
+
data.tar.gz: f0de9474c076cbf105cd29546346292efcb8f5bfc9e86661500edbda853e295d1606d0291b8b98aabfc8486aaeb3016b0ba09cdd4886703debc656ff870ec6a4
|
data/README.md
CHANGED
@@ -16,6 +16,7 @@ General is a simple templating system in ruby that allows you to create template
|
|
16
16
|
- [PrePartials](#prepartials)
|
17
17
|
- [Including Other Templates](#including-other-templates)
|
18
18
|
- [Extending Templates](#extending-templates)
|
19
|
+
- [Special Characters](#special-characters)
|
19
20
|
|
20
21
|
## General Templates
|
21
22
|
|
@@ -273,6 +274,31 @@ Extending a file wraps the contents of the file around the current template. Thi
|
|
273
274
|
|
274
275
|
The extending file should define a `@@yield` where the file will be extended from. This is by default at the end of the file. Note that if `@@yield` is defined in a template, the template is considered a meta-template and cannot be parsed. Also, like extend, only one `@@yield` statement can be defined in a single file.
|
275
276
|
|
277
|
+
## Special Characters
|
278
|
+
|
279
|
+
Special characters can be entered into general using the format `@[code];`. The table of codes are below:
|
280
|
+
|
281
|
+
| Code | Character |
|
282
|
+
|:----:|:---------:|
|
283
|
+
| at | @ |
|
284
|
+
| pd | # |
|
285
|
+
| lt | < |
|
286
|
+
| gt | > |
|
287
|
+
| op | ( |
|
288
|
+
| cp | ) |
|
289
|
+
| ob | [ |
|
290
|
+
| cb | ] |
|
291
|
+
| oc | { |
|
292
|
+
| cc | } |
|
293
|
+
| ms | - |
|
294
|
+
| ps | + |
|
295
|
+
| st | * |
|
296
|
+
| pc | % |
|
297
|
+
| bs | \ |
|
298
|
+
| fs | / |
|
299
|
+
| dl | $ |
|
300
|
+
|
301
|
+
|
276
302
|
## Notes
|
277
303
|
|
278
304
|
Regex and matching have now been officially depricated, and will be removed in General 2.1.0.
|
@@ -28,10 +28,10 @@ module General
|
|
28
28
|
# Created: 7 - 1 - 2016
|
29
29
|
class GArrayPlaceholder < GPartial
|
30
30
|
# Regular expression that matches array placeholders
|
31
|
-
REGEX = /\A@\[#{NAME}\s*(#{OPERATION}\s*#{ARGUMENTS}?)?\](
|
31
|
+
REGEX = /\A@\[#{NAME}\s*(#{OPERATION}\s*#{ARGUMENTS}?)?\]( +|(\r?\n)+)?(?<text>.*?)( +|(\r?\n)+)?@\[(?<delimeter>.+)?\]/m
|
32
32
|
|
33
33
|
# Default delimeter
|
34
|
-
DEFAULT_DELIMETER = "
|
34
|
+
DEFAULT_DELIMETER = "\n"
|
35
35
|
|
36
36
|
# Initializes the GArrayPlaceholder with the given match
|
37
37
|
#
|