honkster-friendly 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) 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/examples/friendly.yml +7 -0
  12. data/friendly.gemspec +240 -0
  13. data/lib/friendly.rb +53 -0
  14. data/lib/friendly/associations.rb +7 -0
  15. data/lib/friendly/associations/association.rb +34 -0
  16. data/lib/friendly/associations/set.rb +37 -0
  17. data/lib/friendly/attribute.rb +98 -0
  18. data/lib/friendly/boolean.rb +10 -0
  19. data/lib/friendly/cache.rb +24 -0
  20. data/lib/friendly/cache/by_id.rb +33 -0
  21. data/lib/friendly/data_store.rb +73 -0
  22. data/lib/friendly/document.rb +70 -0
  23. data/lib/friendly/document/associations.rb +50 -0
  24. data/lib/friendly/document/attributes.rb +114 -0
  25. data/lib/friendly/document/convenience.rb +41 -0
  26. data/lib/friendly/document/mixin.rb +15 -0
  27. data/lib/friendly/document/scoping.rb +66 -0
  28. data/lib/friendly/document/storage.rb +63 -0
  29. data/lib/friendly/document_table.rb +56 -0
  30. data/lib/friendly/index.rb +73 -0
  31. data/lib/friendly/indexer.rb +50 -0
  32. data/lib/friendly/memcached.rb +48 -0
  33. data/lib/friendly/newrelic.rb +6 -0
  34. data/lib/friendly/query.rb +42 -0
  35. data/lib/friendly/scope.rb +100 -0
  36. data/lib/friendly/scope_proxy.rb +43 -0
  37. data/lib/friendly/sequel_monkey_patches.rb +34 -0
  38. data/lib/friendly/storage.rb +31 -0
  39. data/lib/friendly/storage_factory.rb +24 -0
  40. data/lib/friendly/storage_proxy.rb +111 -0
  41. data/lib/friendly/table.rb +15 -0
  42. data/lib/friendly/table_creator.rb +48 -0
  43. data/lib/friendly/time.rb +14 -0
  44. data/lib/friendly/translator.rb +33 -0
  45. data/lib/friendly/uuid.rb +148 -0
  46. data/lib/tasks/friendly.rake +7 -0
  47. data/rails/init.rb +6 -0
  48. data/spec/config.yml.example +7 -0
  49. data/spec/fakes/data_store_fake.rb +29 -0
  50. data/spec/fakes/database_fake.rb +12 -0
  51. data/spec/fakes/dataset_fake.rb +28 -0
  52. data/spec/fakes/document.rb +18 -0
  53. data/spec/fakes/serializer_fake.rb +12 -0
  54. data/spec/fakes/time_fake.rb +12 -0
  55. data/spec/integration/ad_hoc_scopes_spec.rb +42 -0
  56. data/spec/integration/basic_object_lifecycle_spec.rb +114 -0
  57. data/spec/integration/batch_insertion_spec.rb +29 -0
  58. data/spec/integration/convenience_api_spec.rb +25 -0
  59. data/spec/integration/count_spec.rb +12 -0
  60. data/spec/integration/default_value_spec.rb +30 -0
  61. data/spec/integration/dirty_tracking_spec.rb +43 -0
  62. data/spec/integration/find_via_cache_spec.rb +101 -0
  63. data/spec/integration/finder_spec.rb +71 -0
  64. data/spec/integration/has_many_spec.rb +18 -0
  65. data/spec/integration/index_spec.rb +57 -0
  66. data/spec/integration/named_scope_spec.rb +34 -0
  67. data/spec/integration/offline_indexing_spec.rb +53 -0
  68. data/spec/integration/pagination_spec.rb +63 -0
  69. data/spec/integration/scope_chaining_spec.rb +22 -0
  70. data/spec/integration/table_creator_spec.rb +64 -0
  71. data/spec/integration/write_through_cache_spec.rb +53 -0
  72. data/spec/spec.opts +1 -0
  73. data/spec/spec_helper.rb +105 -0
  74. data/spec/unit/associations/association_spec.rb +57 -0
  75. data/spec/unit/associations/set_spec.rb +43 -0
  76. data/spec/unit/attribute_spec.rb +125 -0
  77. data/spec/unit/cache_by_id_spec.rb +102 -0
  78. data/spec/unit/cache_spec.rb +21 -0
  79. data/spec/unit/data_store_spec.rb +201 -0
  80. data/spec/unit/document/attributes_spec.rb +130 -0
  81. data/spec/unit/document_spec.rb +318 -0
  82. data/spec/unit/document_table_spec.rb +126 -0
  83. data/spec/unit/friendly_spec.rb +25 -0
  84. data/spec/unit/index_spec.rb +196 -0
  85. data/spec/unit/memcached_spec.rb +114 -0
  86. data/spec/unit/query_spec.rb +104 -0
  87. data/spec/unit/scope_proxy_spec.rb +44 -0
  88. data/spec/unit/scope_spec.rb +113 -0
  89. data/spec/unit/storage_factory_spec.rb +59 -0
  90. data/spec/unit/storage_proxy_spec.rb +244 -0
  91. data/spec/unit/translator_spec.rb +91 -0
  92. data/website/index.html +210 -0
  93. data/website/scripts/clipboard.swf +0 -0
  94. data/website/scripts/shBrushAS3.js +61 -0
  95. data/website/scripts/shBrushBash.js +66 -0
  96. data/website/scripts/shBrushCSharp.js +67 -0
  97. data/website/scripts/shBrushColdFusion.js +102 -0
  98. data/website/scripts/shBrushCpp.js +99 -0
  99. data/website/scripts/shBrushCss.js +93 -0
  100. data/website/scripts/shBrushDelphi.js +57 -0
  101. data/website/scripts/shBrushDiff.js +43 -0
  102. data/website/scripts/shBrushErlang.js +54 -0
  103. data/website/scripts/shBrushGroovy.js +69 -0
  104. data/website/scripts/shBrushJScript.js +52 -0
  105. data/website/scripts/shBrushJava.js +59 -0
  106. data/website/scripts/shBrushJavaFX.js +60 -0
  107. data/website/scripts/shBrushPerl.js +74 -0
  108. data/website/scripts/shBrushPhp.js +91 -0
  109. data/website/scripts/shBrushPlain.js +35 -0
  110. data/website/scripts/shBrushPowerShell.js +76 -0
  111. data/website/scripts/shBrushPython.js +66 -0
  112. data/website/scripts/shBrushRuby.js +57 -0
  113. data/website/scripts/shBrushScala.js +53 -0
  114. data/website/scripts/shBrushSql.js +68 -0
  115. data/website/scripts/shBrushVb.js +58 -0
  116. data/website/scripts/shBrushXml.js +71 -0
  117. data/website/scripts/shCore.js +30 -0
  118. data/website/scripts/shLegacy.js +30 -0
  119. data/website/styles/friendly.css +103 -0
  120. data/website/styles/help.png +0 -0
  121. data/website/styles/ie.css +35 -0
  122. data/website/styles/magnifier.png +0 -0
  123. data/website/styles/page_white_code.png +0 -0
  124. data/website/styles/page_white_copy.png +0 -0
  125. data/website/styles/print.css +29 -0
  126. data/website/styles/printer.png +0 -0
  127. data/website/styles/screen.css +257 -0
  128. data/website/styles/shCore.css +330 -0
  129. data/website/styles/shThemeDefault.css +173 -0
  130. data/website/styles/shThemeDjango.css +176 -0
  131. data/website/styles/shThemeEclipse.css +190 -0
  132. data/website/styles/shThemeEmacs.css +175 -0
  133. data/website/styles/shThemeFadeToGrey.css +177 -0
  134. data/website/styles/shThemeMidnight.css +175 -0
  135. data/website/styles/shThemeRDark.css +175 -0
  136. metadata +337 -0
@@ -0,0 +1,59 @@
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.Java = function()
31
+ {
32
+ var keywords = 'abstract assert boolean break byte case catch char class const ' +
33
+ 'continue default do double else enum extends ' +
34
+ 'false final finally float for goto if implements import ' +
35
+ 'instanceof int interface long native new null ' +
36
+ 'package private protected public return ' +
37
+ 'short static strictfp super switch synchronized this throw throws true ' +
38
+ 'transient try void volatile while';
39
+
40
+ this.regexList = [
41
+ { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
42
+ { regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
43
+ { regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
44
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
45
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
46
+ { regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
47
+ { regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
48
+ { regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
49
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
50
+ ];
51
+
52
+ this.forHtmlScript({
53
+ left : /(&lt;|<)%[@!=]?/g,
54
+ right : /%(&gt;|>)/g
55
+ });
56
+ };
57
+
58
+ SyntaxHighlighter.brushes.Java.prototype = new SyntaxHighlighter.Highlighter();
59
+ SyntaxHighlighter.brushes.Java.aliases = ['java'];
@@ -0,0 +1,60 @@
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.JavaFX = function()
31
+ {
32
+ // Contributed by Patrick Webster
33
+ // http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html
34
+ var datatypes = 'Boolean Byte Character Double Duration '
35
+ + 'Float Integer Long Number Short String Void'
36
+ ;
37
+
38
+ var keywords = 'abstract after and as assert at before bind bound break catch class '
39
+ + 'continue def delete else exclusive extends false finally first for from '
40
+ + 'function if import in indexof init insert instanceof into inverse last '
41
+ + 'lazy mixin mod nativearray new not null on or override package postinit '
42
+ + 'protected public public-init public-read replace return reverse sizeof '
43
+ + 'step super then this throw true try tween typeof var where while with '
44
+ + 'attribute let private readonly static trigger'
45
+ ;
46
+
47
+ this.regexList = [
48
+ { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' },
49
+ { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' },
50
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
51
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
52
+ { regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers
53
+ { regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes
54
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
55
+ ];
56
+ this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
57
+ };
58
+
59
+ SyntaxHighlighter.brushes.JavaFX.prototype = new SyntaxHighlighter.Highlighter();
60
+ SyntaxHighlighter.brushes.JavaFX.aliases = ['jfx', 'javafx'];
@@ -0,0 +1,74 @@
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.Perl = function()
31
+ {
32
+ // Contributed by David Simmons-Duffin and Marty Kube
33
+
34
+ var funcs =
35
+ 'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' +
36
+ 'chroot close closedir connect cos crypt defined delete each endgrent ' +
37
+ 'endhostent endnetent endprotoent endpwent endservent eof exec exists ' +
38
+ 'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' +
39
+ 'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' +
40
+ 'getnetbyname getnetent getpeername getpgrp getppid getpriority ' +
41
+ 'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' +
42
+ 'getservbyname getservbyport getservent getsockname getsockopt glob ' +
43
+ 'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' +
44
+ 'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' +
45
+ 'oct open opendir ord pack pipe pop pos print printf prototype push ' +
46
+ 'quotemeta rand read readdir readline readlink readpipe recv rename ' +
47
+ 'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' +
48
+ 'semget semop send setgrent sethostent setnetent setpgrp setpriority ' +
49
+ 'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' +
50
+ 'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' +
51
+ 'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' +
52
+ 'system syswrite tell telldir time times tr truncate uc ucfirst umask ' +
53
+ 'undef unlink unpack unshift utime values vec wait waitpid warn write';
54
+
55
+ var keywords =
56
+ 'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' +
57
+ 'for foreach goto if import last local my next no our package redo ref ' +
58
+ 'require return sub tie tied unless untie until use wantarray while';
59
+
60
+ this.regexList = [
61
+ { regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' },
62
+ { regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang
63
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
64
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
65
+ { regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' },
66
+ { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
67
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
68
+ ];
69
+
70
+ this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
71
+ }
72
+
73
+ SyntaxHighlighter.brushes.Perl.prototype = new SyntaxHighlighter.Highlighter();
74
+ SyntaxHighlighter.brushes.Perl.aliases = ['perl', 'Perl', 'pl'];
@@ -0,0 +1,91 @@
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.Php = function()
31
+ {
32
+ var funcs = 'abs acos acosh addcslashes addslashes ' +
33
+ 'array_change_key_case array_chunk array_combine array_count_values array_diff '+
34
+ 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
35
+ 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+
36
+ 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+
37
+ 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+
38
+ 'array_push array_rand array_reduce array_reverse array_search array_shift '+
39
+ 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+
40
+ 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+
41
+ 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+
42
+ 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+
43
+ 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+
44
+ 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+
45
+ 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+
46
+ 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+
47
+ 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+
48
+ 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+
49
+ 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+
50
+ 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+
51
+ 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+
52
+ 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+
53
+ 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+
54
+ 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+
55
+ 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+
56
+ 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+
57
+ 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+
58
+ 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+
59
+ 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+
60
+ 'parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir '+
61
+ 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+
62
+ 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+
63
+ 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+
64
+ 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+
65
+ 'strtoupper strtr strval substr substr_compare';
66
+
67
+ var keywords = 'and or xor array as break case ' +
68
+ 'cfunction class const continue declare default die do else ' +
69
+ 'elseif enddeclare endfor endforeach endif endswitch endwhile ' +
70
+ 'extends for foreach function include include_once global if ' +
71
+ 'new old_function return static switch use require require_once ' +
72
+ 'var while abstract interface public implements extends private protected throw';
73
+
74
+ var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__';
75
+
76
+ this.regexList = [
77
+ { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
78
+ { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
79
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
80
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
81
+ { regex: /\$\w+/g, css: 'variable' }, // variables
82
+ { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions
83
+ { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants
84
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword
85
+ ];
86
+
87
+ this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
88
+ };
89
+
90
+ SyntaxHighlighter.brushes.Php.prototype = new SyntaxHighlighter.Highlighter();
91
+ SyntaxHighlighter.brushes.Php.aliases = ['php'];
@@ -0,0 +1,35 @@
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.Plain = function()
31
+ {
32
+ };
33
+
34
+ SyntaxHighlighter.brushes.Plain.prototype = new SyntaxHighlighter.Highlighter();
35
+ SyntaxHighlighter.brushes.Plain.aliases = ['text', 'plain'];
@@ -0,0 +1,76 @@
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.PowerShell = function()
31
+ {
32
+ // Contributes by B.v.Zanten, Getronics
33
+ // http://confluence.atlassian.com/display/CONFEXT/New+Code+Macro
34
+
35
+ var keywords = 'Add-Content Add-History Add-Member Add-PSSnapin Clear(-Content)? Clear-Item ' +
36
+ 'Clear-ItemProperty Clear-Variable Compare-Object ConvertFrom-SecureString Convert-Path ' +
37
+ 'ConvertTo-Html ConvertTo-SecureString Copy(-Item)? Copy-ItemProperty Export-Alias ' +
38
+ 'Export-Clixml Export-Console Export-Csv ForEach(-Object)? Format-Custom Format-List ' +
39
+ 'Format-Table Format-Wide Get-Acl Get-Alias Get-AuthenticodeSignature Get-ChildItem Get-Command ' +
40
+ 'Get-Content Get-Credential Get-Culture Get-Date Get-EventLog Get-ExecutionPolicy ' +
41
+ 'Get-Help Get-History Get-Host Get-Item Get-ItemProperty Get-Location Get-Member ' +
42
+ 'Get-PfxCertificate Get-Process Get-PSDrive Get-PSProvider Get-PSSnapin Get-Service ' +
43
+ 'Get-TraceSource Get-UICulture Get-Unique Get-Variable Get-WmiObject Group-Object ' +
44
+ 'Import-Alias Import-Clixml Import-Csv Invoke-Expression Invoke-History Invoke-Item ' +
45
+ 'Join-Path Measure-Command Measure-Object Move(-Item)? Move-ItemProperty New-Alias ' +
46
+ 'New-Item New-ItemProperty New-Object New-PSDrive New-Service New-TimeSpan ' +
47
+ 'New-Variable Out-Default Out-File Out-Host Out-Null Out-Printer Out-String Pop-Location ' +
48
+ 'Push-Location Read-Host Remove-Item Remove-ItemProperty Remove-PSDrive Remove-PSSnapin ' +
49
+ 'Remove-Variable Rename-Item Rename-ItemProperty Resolve-Path Restart-Service Resume-Service ' +
50
+ 'Select-Object Select-String Set-Acl Set-Alias Set-AuthenticodeSignature Set-Content ' +
51
+ 'Set-Date Set-ExecutionPolicy Set-Item Set-ItemProperty Set-Location Set-PSDebug ' +
52
+ 'Set-Service Set-TraceSource Set(-Variable)? Sort-Object Split-Path Start-Service ' +
53
+ 'Start-Sleep Start-Transcript Stop-Process Stop-Service Stop-Transcript Suspend-Service ' +
54
+ 'Tee-Object Test-Path Trace-Command Update-FormatData Update-TypeData Where(-Object)? ' +
55
+ 'Write-Debug Write-Error Write(-Host)? Write-Output Write-Progress Write-Verbose Write-Warning';
56
+ var alias = 'ac asnp clc cli clp clv cpi cpp cvpa diff epal epcsv fc fl ' +
57
+ 'ft fw gal gc gci gcm gdr ghy gi gl gm gp gps group gsv ' +
58
+ 'gsnp gu gv gwmi iex ihy ii ipal ipcsv mi mp nal ndr ni nv oh rdr ' +
59
+ 'ri rni rnp rp rsnp rv rvpa sal sasv sc select si sl sleep sort sp ' +
60
+ 'spps spsv sv tee cat cd cp h history kill lp ls ' +
61
+ 'mount mv popd ps pushd pwd r rm rmdir echo cls chdir del dir ' +
62
+ 'erase rd ren type % \\?';
63
+
64
+ this.regexList = [
65
+ { regex: /#.*$/gm, css: 'comments' }, // one line comments
66
+ { regex: /\$[a-zA-Z0-9]+\b/g, css: 'value' }, // variables $Computer1
67
+ { regex: /\-[a-zA-Z]+\b/g, css: 'keyword' }, // Operators -not -and -eq
68
+ { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
69
+ { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
70
+ { regex: new RegExp(this.getKeywords(keywords), 'gmi'), css: 'keyword' },
71
+ { regex: new RegExp(this.getKeywords(alias), 'gmi'), css: 'keyword' }
72
+ ];
73
+ };
74
+
75
+ SyntaxHighlighter.brushes.PowerShell.prototype = new SyntaxHighlighter.Highlighter();
76
+ SyntaxHighlighter.brushes.PowerShell.aliases = ['powershell', 'ps'];
@@ -0,0 +1,66 @@
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.Python = function()
31
+ {
32
+ // Contributed by Gheorghe Milas and Ahmad Sherif
33
+
34
+ var keywords = 'and assert break class continue def del elif else ' +
35
+ 'except exec finally for from global if import in is ' +
36
+ 'lambda not or pass print raise return try yield while';
37
+
38
+ var funcs = '__import__ abs all any apply basestring bin bool buffer callable ' +
39
+ 'chr classmethod cmp coerce compile complex delattr dict dir ' +
40
+ 'divmod enumerate eval execfile file filter float format frozenset ' +
41
+ 'getattr globals hasattr hash help hex id input int intern ' +
42
+ 'isinstance issubclass iter len list locals long map max min next ' +
43
+ 'object oct open ord pow print property range raw_input reduce ' +
44
+ 'reload repr reversed round set setattr slice sorted staticmethod ' +
45
+ 'str sum super tuple type type unichr unicode vars xrange zip';
46
+
47
+ var special = 'None True False self cls class_';
48
+
49
+ this.regexList = [
50
+ { regex: SyntaxHighlighter.regexLib.singleLinePerlComments, css: 'comments' },
51
+ { regex: /^\s*@\w+/gm, css: 'decorator' },
52
+ { regex: /(['\"]{3})([^\1])*?\1/gm, css: 'comments' },
53
+ { regex: /"(?!")(?:\.|\\\"|[^\""\n])*"/gm, css: 'string' },
54
+ { regex: /'(?!')(?:\.|(\\\')|[^\''\n])*'/gm, css: 'string' },
55
+ { regex: /\+|\-|\*|\/|\%|=|==/gm, css: 'keyword' },
56
+ { regex: /\b\d+\.?\w*/g, css: 'value' },
57
+ { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
58
+ { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' },
59
+ { regex: new RegExp(this.getKeywords(special), 'gm'), css: 'color1' }
60
+ ];
61
+
62
+ this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
63
+ };
64
+
65
+ SyntaxHighlighter.brushes.Python.prototype = new SyntaxHighlighter.Highlighter();
66
+ SyntaxHighlighter.brushes.Python.aliases = ['py', 'python'];