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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8cd60835b374d4c4eae5d1a8b0c38eaea4032189
4
- data.tar.gz: a37a61c98244f3927208539dcf5da0994ceabc35
3
+ metadata.gz: 7116b5cf6208b7332acd88c3f5f2d9a5fc7e3029
4
+ data.tar.gz: 7dcc9fc52866b7f27f176055fd4ffab9d6734dbf
5
5
  SHA512:
6
- metadata.gz: ef5ce9c1ed0d2f1e02418b46e54c2ddea1af940ca7d461f846b423aa19eaa064c2dbb16393c1982caf7293cffdeee635562678472cdef14f38b67bf18ac02bd4
7
- data.tar.gz: 1850598692f1c631661f912fc86e30a300d1883c23fc575474a817b2ca6e9905f96c43314959c1961d2709d5a3f6690761e2dfecc935e9e5e5a411055234a00c
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}?)?\]( +|\n+)?(?<text>.*?)( +|\n+)?@\[(?<delimeter>.+)?\]/m
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
  #
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: general
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anshul Kharbanda