arunthampi-friendly 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. data/.document +2 -0
  2. data/.gitignore +26 -0
  3. data/APACHE-LICENSE +202 -0
  4. data/CHANGELOG.md +28 -0
  5. data/CONTRIBUTORS.md +7 -0
  6. data/LICENSE +20 -0
  7. data/README.md +288 -0
  8. data/Rakefile +68 -0
  9. data/TODO.md +5 -0
  10. data/VERSION +1 -0
  11. data/arunthampi-friendly.gemspec +241 -0
  12. data/examples/friendly.yml +7 -0
  13. data/friendly.gemspec +240 -0
  14. data/lib/friendly.rb +53 -0
  15. data/lib/friendly/associations.rb +7 -0
  16. data/lib/friendly/associations/association.rb +34 -0
  17. data/lib/friendly/associations/set.rb +37 -0
  18. data/lib/friendly/attribute.rb +98 -0
  19. data/lib/friendly/boolean.rb +10 -0
  20. data/lib/friendly/cache.rb +24 -0
  21. data/lib/friendly/cache/by_id.rb +33 -0
  22. data/lib/friendly/data_store.rb +73 -0
  23. data/lib/friendly/document.rb +70 -0
  24. data/lib/friendly/document/associations.rb +50 -0
  25. data/lib/friendly/document/attributes.rb +114 -0
  26. data/lib/friendly/document/convenience.rb +41 -0
  27. data/lib/friendly/document/mixin.rb +15 -0
  28. data/lib/friendly/document/scoping.rb +66 -0
  29. data/lib/friendly/document/storage.rb +63 -0
  30. data/lib/friendly/document_table.rb +56 -0
  31. data/lib/friendly/index.rb +73 -0
  32. data/lib/friendly/indexer.rb +50 -0
  33. data/lib/friendly/memcached.rb +48 -0
  34. data/lib/friendly/newrelic.rb +6 -0
  35. data/lib/friendly/query.rb +42 -0
  36. data/lib/friendly/scope.rb +100 -0
  37. data/lib/friendly/scope_proxy.rb +43 -0
  38. data/lib/friendly/sequel_monkey_patches.rb +34 -0
  39. data/lib/friendly/storage.rb +31 -0
  40. data/lib/friendly/storage_factory.rb +24 -0
  41. data/lib/friendly/storage_proxy.rb +111 -0
  42. data/lib/friendly/table.rb +15 -0
  43. data/lib/friendly/table_creator.rb +50 -0
  44. data/lib/friendly/time.rb +14 -0
  45. data/lib/friendly/translator.rb +33 -0
  46. data/lib/friendly/uuid.rb +148 -0
  47. data/lib/tasks/friendly.rake +7 -0
  48. data/rails/init.rb +3 -0
  49. data/spec/config.yml.example +7 -0
  50. data/spec/fakes/data_store_fake.rb +29 -0
  51. data/spec/fakes/database_fake.rb +12 -0
  52. data/spec/fakes/dataset_fake.rb +28 -0
  53. data/spec/fakes/document.rb +18 -0
  54. data/spec/fakes/serializer_fake.rb +12 -0
  55. data/spec/fakes/time_fake.rb +12 -0
  56. data/spec/integration/ad_hoc_scopes_spec.rb +42 -0
  57. data/spec/integration/basic_object_lifecycle_spec.rb +114 -0
  58. data/spec/integration/batch_insertion_spec.rb +29 -0
  59. data/spec/integration/convenience_api_spec.rb +25 -0
  60. data/spec/integration/count_spec.rb +12 -0
  61. data/spec/integration/default_value_spec.rb +30 -0
  62. data/spec/integration/dirty_tracking_spec.rb +43 -0
  63. data/spec/integration/find_via_cache_spec.rb +101 -0
  64. data/spec/integration/finder_spec.rb +71 -0
  65. data/spec/integration/has_many_spec.rb +18 -0
  66. data/spec/integration/index_spec.rb +57 -0
  67. data/spec/integration/named_scope_spec.rb +34 -0
  68. data/spec/integration/offline_indexing_spec.rb +53 -0
  69. data/spec/integration/pagination_spec.rb +63 -0
  70. data/spec/integration/scope_chaining_spec.rb +22 -0
  71. data/spec/integration/table_creator_spec.rb +69 -0
  72. data/spec/integration/write_through_cache_spec.rb +53 -0
  73. data/spec/spec.opts +1 -0
  74. data/spec/spec_helper.rb +105 -0
  75. data/spec/unit/associations/association_spec.rb +57 -0
  76. data/spec/unit/associations/set_spec.rb +43 -0
  77. data/spec/unit/attribute_spec.rb +125 -0
  78. data/spec/unit/cache_by_id_spec.rb +102 -0
  79. data/spec/unit/cache_spec.rb +21 -0
  80. data/spec/unit/data_store_spec.rb +201 -0
  81. data/spec/unit/document/attributes_spec.rb +130 -0
  82. data/spec/unit/document_spec.rb +318 -0
  83. data/spec/unit/document_table_spec.rb +126 -0
  84. data/spec/unit/friendly_spec.rb +25 -0
  85. data/spec/unit/index_spec.rb +196 -0
  86. data/spec/unit/memcached_spec.rb +114 -0
  87. data/spec/unit/query_spec.rb +104 -0
  88. data/spec/unit/scope_proxy_spec.rb +44 -0
  89. data/spec/unit/scope_spec.rb +113 -0
  90. data/spec/unit/storage_factory_spec.rb +59 -0
  91. data/spec/unit/storage_proxy_spec.rb +244 -0
  92. data/spec/unit/translator_spec.rb +91 -0
  93. data/website/index.html +210 -0
  94. data/website/scripts/clipboard.swf +0 -0
  95. data/website/scripts/shBrushAS3.js +61 -0
  96. data/website/scripts/shBrushBash.js +66 -0
  97. data/website/scripts/shBrushCSharp.js +67 -0
  98. data/website/scripts/shBrushColdFusion.js +102 -0
  99. data/website/scripts/shBrushCpp.js +99 -0
  100. data/website/scripts/shBrushCss.js +93 -0
  101. data/website/scripts/shBrushDelphi.js +57 -0
  102. data/website/scripts/shBrushDiff.js +43 -0
  103. data/website/scripts/shBrushErlang.js +54 -0
  104. data/website/scripts/shBrushGroovy.js +69 -0
  105. data/website/scripts/shBrushJScript.js +52 -0
  106. data/website/scripts/shBrushJava.js +59 -0
  107. data/website/scripts/shBrushJavaFX.js +60 -0
  108. data/website/scripts/shBrushPerl.js +74 -0
  109. data/website/scripts/shBrushPhp.js +91 -0
  110. data/website/scripts/shBrushPlain.js +35 -0
  111. data/website/scripts/shBrushPowerShell.js +76 -0
  112. data/website/scripts/shBrushPython.js +66 -0
  113. data/website/scripts/shBrushRuby.js +57 -0
  114. data/website/scripts/shBrushScala.js +53 -0
  115. data/website/scripts/shBrushSql.js +68 -0
  116. data/website/scripts/shBrushVb.js +58 -0
  117. data/website/scripts/shBrushXml.js +71 -0
  118. data/website/scripts/shCore.js +30 -0
  119. data/website/scripts/shLegacy.js +30 -0
  120. data/website/styles/friendly.css +103 -0
  121. data/website/styles/help.png +0 -0
  122. data/website/styles/ie.css +35 -0
  123. data/website/styles/magnifier.png +0 -0
  124. data/website/styles/page_white_code.png +0 -0
  125. data/website/styles/page_white_copy.png +0 -0
  126. data/website/styles/print.css +29 -0
  127. data/website/styles/printer.png +0 -0
  128. data/website/styles/screen.css +257 -0
  129. data/website/styles/shCore.css +330 -0
  130. data/website/styles/shThemeDefault.css +173 -0
  131. data/website/styles/shThemeDjango.css +176 -0
  132. data/website/styles/shThemeEclipse.css +190 -0
  133. data/website/styles/shThemeEmacs.css +175 -0
  134. data/website/styles/shThemeFadeToGrey.css +177 -0
  135. data/website/styles/shThemeMidnight.css +175 -0
  136. data/website/styles/shThemeRDark.css +175 -0
  137. metadata +311 -0
@@ -0,0 +1,99 @@
1
+ /**
2
+ * SyntaxHighlighter
3
+ * http://alexgorbatchev.com/
4
+ *
5
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
6
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7
+ *
8
+ * @version
9
+ * 2.1.364 (October 15 2009)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * This file is part of SyntaxHighlighter.
16
+ *
17
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
18
+ * it under the terms of the GNU Lesser General Public License as published by
19
+ * the Free Software Foundation, either version 3 of the License, or
20
+ * (at your option) any later version.
21
+ *
22
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
23
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ * GNU General Public License for more details.
26
+ *
27
+ * You should have received a copy of the GNU General Public License
28
+ * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
29
+ */
30
+ SyntaxHighlighter.brushes.Cpp = function()
31
+ {
32
+ // Copyright 2006 Shin, YoungJin
33
+
34
+ var datatypes = 'ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR ' +
35
+ 'DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH ' +
36
+ 'HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP ' +
37
+ 'HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY ' +
38
+ 'HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT ' +
39
+ 'HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE ' +
40
+ 'LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF ' +
41
+ 'LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR ' +
42
+ 'LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR ' +
43
+ 'PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT ' +
44
+ 'PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 ' +
45
+ 'POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR ' +
46
+ 'PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 ' +
47
+ 'PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT ' +
48
+ 'SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG ' +
49
+ 'ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM ' +
50
+ 'char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t ' +
51
+ 'clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS ' +
52
+ 'FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t ' +
53
+ '__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t ' +
54
+ 'jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler ' +
55
+ 'sig_atomic_t size_t _stat __stat64 _stati64 terminate_function ' +
56
+ 'time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf ' +
57
+ 'va_list wchar_t wctrans_t wctype_t wint_t signed';
58
+
59
+ var keywords = 'break case catch class const __finally __exception __try ' +
60
+ 'const_cast continue private public protected __declspec ' +
61
+ 'default delete deprecated dllexport dllimport do dynamic_cast ' +
62
+ 'else enum explicit extern if for friend goto inline ' +
63
+ 'mutable naked namespace new noinline noreturn nothrow ' +
64
+ 'register reinterpret_cast return selectany ' +
65
+ 'sizeof static static_cast struct switch template this ' +
66
+ 'thread throw true false try typedef typeid typename union ' +
67
+ 'using uuid virtual void volatile whcar_t while';
68
+
69
+ var functions = 'assert isalnum isalpha iscntrl isdigit isgraph islower isprint' +
70
+ 'ispunct isspace isupper isxdigit tolower toupper errno localeconv ' +
71
+ 'setlocale acos asin atan atan2 ceil cos cosh exp fabs floor fmod ' +
72
+ 'frexp ldexp log log10 modf pow sin sinh sqrt tan tanh jmp_buf ' +
73
+ 'longjmp setjmp raise signal sig_atomic_t va_arg va_end va_start ' +
74
+ 'clearerr fclose feof ferror fflush fgetc fgetpos fgets fopen ' +
75
+ 'fprintf fputc fputs fread freopen fscanf fseek fsetpos ftell ' +
76
+ 'fwrite getc getchar gets perror printf putc putchar puts remove ' +
77
+ 'rename rewind scanf setbuf setvbuf sprintf sscanf tmpfile tmpnam ' +
78
+ 'ungetc vfprintf vprintf vsprintf abort abs atexit atof atoi atol ' +
79
+ 'bsearch calloc div exit free getenv labs ldiv malloc mblen mbstowcs ' +
80
+ 'mbtowc qsort rand realloc srand strtod strtol strtoul system ' +
81
+ 'wcstombs wctomb memchr memcmp memcpy memmove memset strcat strchr ' +
82
+ 'strcmp strcoll strcpy strcspn strerror strlen strncat strncmp ' +
83
+ 'strncpy strpbrk strrchr strspn strstr strtok strxfrm asctime ' +
84
+ 'clock ctime difftime gmtime localtime mktime strftime time';
85
+
86
+ this.regexList = [
87
+ { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
88
+ { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
89
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
90
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
91
+ { regex: /^ *#.*/gm, css: 'preprocessor' },
92
+ { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'color1 bold' },
93
+ { regex: new RegExp(this.getKeywords(functions), 'gm'), css: 'functions bold' },
94
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword bold' }
95
+ ];
96
+ };
97
+
98
+ SyntaxHighlighter.brushes.Cpp.prototype = new SyntaxHighlighter.Highlighter();
99
+ SyntaxHighlighter.brushes.Cpp.aliases = ['cpp', 'c'];
@@ -0,0 +1,93 @@
1
+ /**
2
+ * SyntaxHighlighter
3
+ * http://alexgorbatchev.com/
4
+ *
5
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
6
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7
+ *
8
+ * @version
9
+ * 2.1.364 (October 15 2009)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * This file is part of SyntaxHighlighter.
16
+ *
17
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
18
+ * it under the terms of the GNU Lesser General Public License as published by
19
+ * the Free Software Foundation, either version 3 of the License, or
20
+ * (at your option) any later version.
21
+ *
22
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
23
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ * GNU General Public License for more details.
26
+ *
27
+ * You should have received a copy of the GNU General Public License
28
+ * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
29
+ */
30
+ SyntaxHighlighter.brushes.CSS = function()
31
+ {
32
+ function getKeywordsCSS(str)
33
+ {
34
+ return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
35
+ };
36
+
37
+ function getValuesCSS(str)
38
+ {
39
+ return '\\b' + str.replace(/ /g, '(?!-)(?!:)\\b|\\b()') + '\:\\b';
40
+ };
41
+
42
+ var keywords = 'ascent azimuth background-attachment background-color background-image background-position ' +
43
+ 'background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top ' +
44
+ 'border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color ' +
45
+ 'border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width ' +
46
+ 'border-bottom-width border-left-width border-width border bottom cap-height caption-side centerline clear clip color ' +
47
+ 'content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display ' +
48
+ 'elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font ' +
49
+ 'height left letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top ' +
50
+ 'margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans ' +
51
+ 'outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page ' +
52
+ 'page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position ' +
53
+ 'quotes right richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress ' +
54
+ 'table-layout text-align top text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em ' +
55
+ 'vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index';
56
+
57
+ var values = 'above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder '+
58
+ 'both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed '+
59
+ 'continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double '+
60
+ 'embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia '+
61
+ 'gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic '+
62
+ 'justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha '+
63
+ 'lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower '+
64
+ 'navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset '+
65
+ 'outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side '+
66
+ 'rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow '+
67
+ 'small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize '+
68
+ 'table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal '+
69
+ 'text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin '+
70
+ 'upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow';
71
+
72
+ var fonts = '[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif [cC]ourier mono sans serif';
73
+
74
+ this.regexList = [
75
+ { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
76
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
77
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
78
+ { regex: /\#[a-fA-F0-9]{3,6}/g, css: 'value' }, // html colors
79
+ { regex: /(-?\d+)(\.\d+)?(px|em|pt|\:|\%|)/g, css: 'value' }, // sizes
80
+ { regex: /!important/g, css: 'color3' }, // !important
81
+ { regex: new RegExp(getKeywordsCSS(keywords), 'gm'), css: 'keyword' }, // keywords
82
+ { regex: new RegExp(getValuesCSS(values), 'g'), css: 'value' }, // values
83
+ { regex: new RegExp(this.getKeywords(fonts), 'g'), css: 'color1' } // fonts
84
+ ];
85
+
86
+ this.forHtmlScript({
87
+ left: /(&lt;|<)\s*style.*?(&gt;|>)/gi,
88
+ right: /(&lt;|<)\/\s*style\s*(&gt;|>)/gi
89
+ });
90
+ };
91
+
92
+ SyntaxHighlighter.brushes.CSS.prototype = new SyntaxHighlighter.Highlighter();
93
+ SyntaxHighlighter.brushes.CSS.aliases = ['css'];
@@ -0,0 +1,57 @@
1
+ /**
2
+ * SyntaxHighlighter
3
+ * http://alexgorbatchev.com/
4
+ *
5
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
6
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7
+ *
8
+ * @version
9
+ * 2.1.364 (October 15 2009)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * This file is part of SyntaxHighlighter.
16
+ *
17
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
18
+ * it under the terms of the GNU Lesser General Public License as published by
19
+ * the Free Software Foundation, either version 3 of the License, or
20
+ * (at your option) any later version.
21
+ *
22
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
23
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ * GNU General Public License for more details.
26
+ *
27
+ * You should have received a copy of the GNU General Public License
28
+ * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
29
+ */
30
+ SyntaxHighlighter.brushes.Delphi = function()
31
+ {
32
+ var keywords = 'abs addr and ansichar ansistring array as asm begin boolean byte cardinal ' +
33
+ 'case char class comp const constructor currency destructor div do double ' +
34
+ 'downto else end except exports extended false file finalization finally ' +
35
+ 'for function goto if implementation in inherited int64 initialization ' +
36
+ 'integer interface is label library longint longword mod nil not object ' +
37
+ 'of on or packed pansichar pansistring pchar pcurrency pdatetime pextended ' +
38
+ 'pint64 pointer private procedure program property pshortstring pstring ' +
39
+ 'pvariant pwidechar pwidestring protected public published raise real real48 ' +
40
+ 'record repeat set shl shortint shortstring shr single smallint string then ' +
41
+ 'threadvar to true try type unit until uses val var varirnt while widechar ' +
42
+ 'widestring with word write writeln xor';
43
+
44
+ this.regexList = [
45
+ { regex: /\(\*[\s\S]*?\*\)/gm, css: 'comments' }, // multiline comments (* *)
46
+ { regex: /{(?!\$)[\s\S]*?}/gm, css: 'comments' }, // multiline comments { }
47
+ { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line
48
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
49
+ { regex: /\{\$[a-zA-Z]+ .+\}/g, css: 'color1' }, // compiler Directives and Region tags
50
+ { regex: /\b[\d\.]+\b/g, css: 'value' }, // numbers 12345
51
+ { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // numbers $F5D3
52
+ { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' } // keyword
53
+ ];
54
+ };
55
+
56
+ SyntaxHighlighter.brushes.Delphi.prototype = new SyntaxHighlighter.Highlighter();
57
+ SyntaxHighlighter.brushes.Delphi.aliases = ['delphi', 'pascal', 'pas'];
@@ -0,0 +1,43 @@
1
+ /**
2
+ * SyntaxHighlighter
3
+ * http://alexgorbatchev.com/
4
+ *
5
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
6
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7
+ *
8
+ * @version
9
+ * 2.1.364 (October 15 2009)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * This file is part of SyntaxHighlighter.
16
+ *
17
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
18
+ * it under the terms of the GNU Lesser General Public License as published by
19
+ * the Free Software Foundation, either version 3 of the License, or
20
+ * (at your option) any later version.
21
+ *
22
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
23
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ * GNU General Public License for more details.
26
+ *
27
+ * You should have received a copy of the GNU General Public License
28
+ * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
29
+ */
30
+ SyntaxHighlighter.brushes.Diff = function()
31
+ {
32
+ this.regexList = [
33
+ { regex: /^\+\+\+.*$/gm, css: 'color2' },
34
+ { regex: /^\-\-\-.*$/gm, css: 'color2' },
35
+ { regex: /^\s.*$/gm, css: 'color1' },
36
+ { regex: /^@@.*@@$/gm, css: 'variable' },
37
+ { regex: /^\+[^\+]{1}.*$/gm, css: 'string' },
38
+ { regex: /^\-[^\-]{1}.*$/gm, css: 'comments' }
39
+ ];
40
+ };
41
+
42
+ SyntaxHighlighter.brushes.Diff.prototype = new SyntaxHighlighter.Highlighter();
43
+ SyntaxHighlighter.brushes.Diff.aliases = ['diff', 'patch'];
@@ -0,0 +1,54 @@
1
+ /**
2
+ * SyntaxHighlighter
3
+ * http://alexgorbatchev.com/
4
+ *
5
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
6
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7
+ *
8
+ * @version
9
+ * 2.1.364 (October 15 2009)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * This file is part of SyntaxHighlighter.
16
+ *
17
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
18
+ * it under the terms of the GNU Lesser General Public License as published by
19
+ * the Free Software Foundation, either version 3 of the License, or
20
+ * (at your option) any later version.
21
+ *
22
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
23
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ * GNU General Public License for more details.
26
+ *
27
+ * You should have received a copy of the GNU General Public License
28
+ * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
29
+ */
30
+ SyntaxHighlighter.brushes.Erlang = function()
31
+ {
32
+ // Contributed by Jean-Lou Dupont
33
+ // http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html
34
+
35
+ // According to: http://erlang.org/doc/reference_manual/introduction.html#1.5
36
+ var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+
37
+ 'case catch cond div end fun if let not of or orelse '+
38
+ 'query receive rem try when xor'+
39
+ // additional
40
+ ' module export import define';
41
+
42
+ this.regexList = [
43
+ { regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' },
44
+ { regex: new RegExp("\\%.+", 'gm'), css: 'comments' },
45
+ { regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' },
46
+ { regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' },
47
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
48
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
49
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
50
+ ];
51
+ };
52
+
53
+ SyntaxHighlighter.brushes.Erlang.prototype = new SyntaxHighlighter.Highlighter();
54
+ SyntaxHighlighter.brushes.Erlang.aliases = ['erl', 'erlang'];
@@ -0,0 +1,69 @@
1
+ /**
2
+ * SyntaxHighlighter
3
+ * http://alexgorbatchev.com/
4
+ *
5
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
6
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7
+ *
8
+ * @version
9
+ * 2.1.364 (October 15 2009)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * This file is part of SyntaxHighlighter.
16
+ *
17
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
18
+ * it under the terms of the GNU Lesser General Public License as published by
19
+ * the Free Software Foundation, either version 3 of the License, or
20
+ * (at your option) any later version.
21
+ *
22
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
23
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ * GNU General Public License for more details.
26
+ *
27
+ * You should have received a copy of the GNU General Public License
28
+ * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
29
+ */
30
+ SyntaxHighlighter.brushes.Groovy = function()
31
+ {
32
+ // Contributed by Andres Almiray
33
+ // http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter
34
+
35
+ var keywords = 'as assert break case catch class continue def default do else extends finally ' +
36
+ 'if in implements import instanceof interface new package property return switch ' +
37
+ 'throw throws try while public protected private static';
38
+ var types = 'void boolean byte char short int long float double';
39
+ var constants = 'null';
40
+ var methods = 'allProperties count get size '+
41
+ 'collect each eachProperty eachPropertyName eachWithIndex find findAll ' +
42
+ 'findIndexOf grep inject max min reverseEach sort ' +
43
+ 'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' +
44
+ 'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' +
45
+ 'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' +
46
+ 'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' +
47
+ 'transformChar transformLine withOutputStream withPrintWriter withStream ' +
48
+ 'withStreams withWriter withWriterAppend write writeLine '+
49
+ 'dump inspect invokeMethod print println step times upto use waitForOrKill '+
50
+ 'getText';
51
+
52
+ this.regexList = [
53
+ { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
54
+ { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
55
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
56
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
57
+ { regex: /""".*"""/g, css: 'string' }, // GStrings
58
+ { regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers
59
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword
60
+ { regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type
61
+ { regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants
62
+ { regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods
63
+ ];
64
+
65
+ this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
66
+ }
67
+
68
+ SyntaxHighlighter.brushes.Groovy.prototype = new SyntaxHighlighter.Highlighter();
69
+ SyntaxHighlighter.brushes.Groovy.aliases = ['groovy'];
@@ -0,0 +1,52 @@
1
+ /**
2
+ * SyntaxHighlighter
3
+ * http://alexgorbatchev.com/
4
+ *
5
+ * SyntaxHighlighter is donationware. If you are using it, please donate.
6
+ * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
7
+ *
8
+ * @version
9
+ * 2.1.364 (October 15 2009)
10
+ *
11
+ * @copyright
12
+ * Copyright (C) 2004-2009 Alex Gorbatchev.
13
+ *
14
+ * @license
15
+ * This file is part of SyntaxHighlighter.
16
+ *
17
+ * SyntaxHighlighter is free software: you can redistribute it and/or modify
18
+ * it under the terms of the GNU Lesser General Public License as published by
19
+ * the Free Software Foundation, either version 3 of the License, or
20
+ * (at your option) any later version.
21
+ *
22
+ * SyntaxHighlighter is distributed in the hope that it will be useful,
23
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
+ * GNU General Public License for more details.
26
+ *
27
+ * You should have received a copy of the GNU General Public License
28
+ * along with SyntaxHighlighter. If not, see <http://www.gnu.org/copyleft/lesser.html>.
29
+ */
30
+ SyntaxHighlighter.brushes.JScript = function()
31
+ {
32
+ var keywords = 'break case catch continue ' +
33
+ 'default delete do else false ' +
34
+ 'for function if in instanceof ' +
35
+ 'new null return super switch ' +
36
+ 'this throw true try typeof var while with'
37
+ ;
38
+
39
+ this.regexList = [
40
+ { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
41
+ { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
42
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
43
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
44
+ { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
45
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
46
+ ];
47
+
48
+ this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
49
+ };
50
+
51
+ SyntaxHighlighter.brushes.JScript.prototype = new SyntaxHighlighter.Highlighter();
52
+ SyntaxHighlighter.brushes.JScript.aliases = ['js', 'jscript', 'javascript'];