es-scout 5.3.0.es1
Sign up to get free protection for your applications and to get access to all the features.
- data/AUTHORS +4 -0
- data/CHANGELOG +225 -0
- data/COPYING +340 -0
- data/INSTALL +18 -0
- data/LICENSE +6 -0
- data/README +66 -0
- data/Rakefile +74 -0
- data/TODO +6 -0
- data/bin/es-scout +10 -0
- data/data/cacert.pem +3154 -0
- data/data/code_key.pub +13 -0
- data/data/gpl-2.0.txt +339 -0
- data/data/lgpl-2.1.txt +504 -0
- data/lib/es-scout/command/install.rb +68 -0
- data/lib/es-scout/command/run.rb +56 -0
- data/lib/es-scout/command/test.rb +62 -0
- data/lib/es-scout/command/troubleshoot.rb +142 -0
- data/lib/es-scout/command.rb +258 -0
- data/lib/es-scout/plugin.rb +237 -0
- data/lib/es-scout/plugin_options.rb +80 -0
- data/lib/es-scout/scout_logger.rb +19 -0
- data/lib/es-scout/server.rb +578 -0
- data/lib/es-scout.rb +11 -0
- data/vendor/json_pure/CHANGES +162 -0
- data/vendor/json_pure/COPYING +58 -0
- data/vendor/json_pure/GPL +340 -0
- data/vendor/json_pure/README +358 -0
- data/vendor/json_pure/Rakefile +292 -0
- data/vendor/json_pure/TODO +1 -0
- data/vendor/json_pure/VERSION +1 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +52 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +900 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +901 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +261 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +262 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +82 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +34 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +900 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +901 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +81 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +82 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +82 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +82 -0
- data/vendor/json_pure/benchmarks/generator2_benchmark.rb +222 -0
- data/vendor/json_pure/benchmarks/generator_benchmark.rb +224 -0
- data/vendor/json_pure/benchmarks/ohai.json +1216 -0
- data/vendor/json_pure/benchmarks/ohai.ruby +1 -0
- data/vendor/json_pure/benchmarks/parser2_benchmark.rb +251 -0
- data/vendor/json_pure/benchmarks/parser_benchmark.rb +259 -0
- data/vendor/json_pure/bin/edit_json.rb +9 -0
- data/vendor/json_pure/bin/prettify_json.rb +75 -0
- data/vendor/json_pure/data/example.json +1 -0
- data/vendor/json_pure/data/index.html +38 -0
- data/vendor/json_pure/data/prototype.js +4184 -0
- data/vendor/json_pure/ext/json/ext/generator/extconf.rb +16 -0
- data/vendor/json_pure/ext/json/ext/generator/generator.c +1341 -0
- data/vendor/json_pure/ext/json/ext/generator/generator.h +170 -0
- data/vendor/json_pure/ext/json/ext/parser/extconf.rb +15 -0
- data/vendor/json_pure/ext/json/ext/parser/parser.c +1935 -0
- data/vendor/json_pure/ext/json/ext/parser/parser.h +71 -0
- data/vendor/json_pure/ext/json/ext/parser/parser.rl +792 -0
- data/vendor/json_pure/install.rb +26 -0
- data/vendor/json_pure/lib/json/Array.xpm +21 -0
- data/vendor/json_pure/lib/json/FalseClass.xpm +21 -0
- data/vendor/json_pure/lib/json/Hash.xpm +21 -0
- data/vendor/json_pure/lib/json/Key.xpm +73 -0
- data/vendor/json_pure/lib/json/NilClass.xpm +21 -0
- data/vendor/json_pure/lib/json/Numeric.xpm +28 -0
- data/vendor/json_pure/lib/json/String.xpm +96 -0
- data/vendor/json_pure/lib/json/TrueClass.xpm +21 -0
- data/vendor/json_pure/lib/json/add/core.rb +148 -0
- data/vendor/json_pure/lib/json/add/rails.rb +58 -0
- data/vendor/json_pure/lib/json/common.rb +397 -0
- data/vendor/json_pure/lib/json/editor.rb +1371 -0
- data/vendor/json_pure/lib/json/ext.rb +15 -0
- data/vendor/json_pure/lib/json/json.xpm +1499 -0
- data/vendor/json_pure/lib/json/pure/generator.rb +452 -0
- data/vendor/json_pure/lib/json/pure/parser.rb +307 -0
- data/vendor/json_pure/lib/json/pure.rb +77 -0
- data/vendor/json_pure/lib/json/version.rb +8 -0
- data/vendor/json_pure/lib/json.rb +10 -0
- data/vendor/json_pure/tests/fixtures/fail1.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail10.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail11.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail12.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail13.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail14.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail18.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail19.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail2.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail20.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail21.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail22.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail23.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail24.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail25.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail27.json +2 -0
- data/vendor/json_pure/tests/fixtures/fail28.json +2 -0
- data/vendor/json_pure/tests/fixtures/fail3.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail4.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail5.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail6.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail7.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail8.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail9.json +1 -0
- data/vendor/json_pure/tests/fixtures/pass1.json +56 -0
- data/vendor/json_pure/tests/fixtures/pass15.json +1 -0
- data/vendor/json_pure/tests/fixtures/pass16.json +1 -0
- data/vendor/json_pure/tests/fixtures/pass17.json +1 -0
- data/vendor/json_pure/tests/fixtures/pass2.json +1 -0
- data/vendor/json_pure/tests/fixtures/pass26.json +1 -0
- data/vendor/json_pure/tests/fixtures/pass3.json +6 -0
- data/vendor/json_pure/tests/test_json.rb +340 -0
- data/vendor/json_pure/tests/test_json_addition.rb +162 -0
- data/vendor/json_pure/tests/test_json_encoding.rb +68 -0
- data/vendor/json_pure/tests/test_json_fixtures.rb +34 -0
- data/vendor/json_pure/tests/test_json_generate.rb +122 -0
- data/vendor/json_pure/tests/test_json_rails.rb +144 -0
- data/vendor/json_pure/tests/test_json_unicode.rb +76 -0
- data/vendor/json_pure/tools/fuzz.rb +139 -0
- data/vendor/json_pure/tools/server.rb +61 -0
- metadata +233 -0
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rbconfig'
|
4
|
+
require 'fileutils'
|
5
|
+
include FileUtils::Verbose
|
6
|
+
|
7
|
+
include Config
|
8
|
+
|
9
|
+
bindir = CONFIG["bindir"]
|
10
|
+
cd 'bin' do
|
11
|
+
filename = 'edit_json.rb'
|
12
|
+
#install(filename, bindir)
|
13
|
+
end
|
14
|
+
sitelibdir = CONFIG["sitelibdir"]
|
15
|
+
cd 'lib' do
|
16
|
+
install('json.rb', sitelibdir)
|
17
|
+
mkdir_p File.join(sitelibdir, 'json')
|
18
|
+
for file in Dir['json/**/*.{rb,xpm}']
|
19
|
+
d = File.join(sitelibdir, file)
|
20
|
+
mkdir_p File.dirname(d)
|
21
|
+
install(file, d)
|
22
|
+
end
|
23
|
+
install(File.join('json', 'editor.rb'), File.join(sitelibdir,'json'))
|
24
|
+
install(File.join('json', 'json.xpm'), File.join(sitelibdir,'json'))
|
25
|
+
end
|
26
|
+
warn " *** Installed PURE ruby library."
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/* XPM */
|
2
|
+
static char * Array_xpm[] = {
|
3
|
+
"16 16 2 1",
|
4
|
+
" c None",
|
5
|
+
". c #000000",
|
6
|
+
" ",
|
7
|
+
" ",
|
8
|
+
" ",
|
9
|
+
" .......... ",
|
10
|
+
" . . ",
|
11
|
+
" . . ",
|
12
|
+
" . . ",
|
13
|
+
" . . ",
|
14
|
+
" . . ",
|
15
|
+
" . . ",
|
16
|
+
" . . ",
|
17
|
+
" . . ",
|
18
|
+
" .......... ",
|
19
|
+
" ",
|
20
|
+
" ",
|
21
|
+
" "};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/* XPM */
|
2
|
+
static char * False_xpm[] = {
|
3
|
+
"16 16 2 1",
|
4
|
+
" c None",
|
5
|
+
". c #FF0000",
|
6
|
+
" ",
|
7
|
+
" ",
|
8
|
+
" ",
|
9
|
+
" ...... ",
|
10
|
+
" . ",
|
11
|
+
" . ",
|
12
|
+
" . ",
|
13
|
+
" ...... ",
|
14
|
+
" . ",
|
15
|
+
" . ",
|
16
|
+
" . ",
|
17
|
+
" . ",
|
18
|
+
" . ",
|
19
|
+
" ",
|
20
|
+
" ",
|
21
|
+
" "};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/* XPM */
|
2
|
+
static char * Hash_xpm[] = {
|
3
|
+
"16 16 2 1",
|
4
|
+
" c None",
|
5
|
+
". c #000000",
|
6
|
+
" ",
|
7
|
+
" ",
|
8
|
+
" ",
|
9
|
+
" . . ",
|
10
|
+
" . . ",
|
11
|
+
" . . ",
|
12
|
+
" ......... ",
|
13
|
+
" . . ",
|
14
|
+
" . . ",
|
15
|
+
" ......... ",
|
16
|
+
" . . ",
|
17
|
+
" . . ",
|
18
|
+
" . . ",
|
19
|
+
" ",
|
20
|
+
" ",
|
21
|
+
" "};
|
@@ -0,0 +1,73 @@
|
|
1
|
+
/* XPM */
|
2
|
+
static char * Key_xpm[] = {
|
3
|
+
"16 16 54 1",
|
4
|
+
" c None",
|
5
|
+
". c #110007",
|
6
|
+
"+ c #0E0900",
|
7
|
+
"@ c #000013",
|
8
|
+
"# c #070600",
|
9
|
+
"$ c #F6F006",
|
10
|
+
"% c #ECE711",
|
11
|
+
"& c #E5EE00",
|
12
|
+
"* c #16021E",
|
13
|
+
"= c #120900",
|
14
|
+
"- c #EDF12B",
|
15
|
+
"; c #000033",
|
16
|
+
"> c #0F0000",
|
17
|
+
", c #FFFE03",
|
18
|
+
"' c #E6E500",
|
19
|
+
") c #16021B",
|
20
|
+
"! c #F7F502",
|
21
|
+
"~ c #000E00",
|
22
|
+
"{ c #130000",
|
23
|
+
"] c #FFF000",
|
24
|
+
"^ c #FFE711",
|
25
|
+
"/ c #140005",
|
26
|
+
"( c #190025",
|
27
|
+
"_ c #E9DD27",
|
28
|
+
": c #E7DC04",
|
29
|
+
"< c #FFEC09",
|
30
|
+
"[ c #FFE707",
|
31
|
+
"} c #FFDE10",
|
32
|
+
"| c #150021",
|
33
|
+
"1 c #160700",
|
34
|
+
"2 c #FAF60E",
|
35
|
+
"3 c #EFE301",
|
36
|
+
"4 c #FEF300",
|
37
|
+
"5 c #E7E000",
|
38
|
+
"6 c #FFFF08",
|
39
|
+
"7 c #0E0206",
|
40
|
+
"8 c #040000",
|
41
|
+
"9 c #03052E",
|
42
|
+
"0 c #041212",
|
43
|
+
"a c #070300",
|
44
|
+
"b c #F2E713",
|
45
|
+
"c c #F9DE13",
|
46
|
+
"d c #36091E",
|
47
|
+
"e c #00001C",
|
48
|
+
"f c #1F0010",
|
49
|
+
"g c #FFF500",
|
50
|
+
"h c #DEDE00",
|
51
|
+
"i c #050A00",
|
52
|
+
"j c #FAF14A",
|
53
|
+
"k c #F5F200",
|
54
|
+
"l c #040404",
|
55
|
+
"m c #1A0D00",
|
56
|
+
"n c #EDE43D",
|
57
|
+
"o c #ECE007",
|
58
|
+
" ",
|
59
|
+
" ",
|
60
|
+
" .+@ ",
|
61
|
+
" #$%&* ",
|
62
|
+
" =-;>,') ",
|
63
|
+
" >!~{]^/ ",
|
64
|
+
" (_:<[}| ",
|
65
|
+
" 1234567 ",
|
66
|
+
" 890abcd ",
|
67
|
+
" efghi ",
|
68
|
+
" >jkl ",
|
69
|
+
" mnol ",
|
70
|
+
" >kl ",
|
71
|
+
" ll ",
|
72
|
+
" ",
|
73
|
+
" "};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/* XPM */
|
2
|
+
static char * False_xpm[] = {
|
3
|
+
"16 16 2 1",
|
4
|
+
" c None",
|
5
|
+
". c #000000",
|
6
|
+
" ",
|
7
|
+
" ",
|
8
|
+
" ",
|
9
|
+
" ... ",
|
10
|
+
" . . ",
|
11
|
+
" . . ",
|
12
|
+
" . . ",
|
13
|
+
" . . ",
|
14
|
+
" . . ",
|
15
|
+
" . . ",
|
16
|
+
" . . ",
|
17
|
+
" . . ",
|
18
|
+
" ... ",
|
19
|
+
" ",
|
20
|
+
" ",
|
21
|
+
" "};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/* XPM */
|
2
|
+
static char * Numeric_xpm[] = {
|
3
|
+
"16 16 9 1",
|
4
|
+
" c None",
|
5
|
+
". c #FF0000",
|
6
|
+
"+ c #0000FF",
|
7
|
+
"@ c #0023DB",
|
8
|
+
"# c #00EA14",
|
9
|
+
"$ c #00FF00",
|
10
|
+
"% c #004FAF",
|
11
|
+
"& c #0028D6",
|
12
|
+
"* c #00F20C",
|
13
|
+
" ",
|
14
|
+
" ",
|
15
|
+
" ",
|
16
|
+
" ... +++@#$$$$ ",
|
17
|
+
" .+ %& $$ ",
|
18
|
+
" . + $ ",
|
19
|
+
" . + $$ ",
|
20
|
+
" . ++$$$$ ",
|
21
|
+
" . + $$ ",
|
22
|
+
" . + $ ",
|
23
|
+
" . + $ ",
|
24
|
+
" . + $ $$ ",
|
25
|
+
" .....++++*$$ ",
|
26
|
+
" ",
|
27
|
+
" ",
|
28
|
+
" "};
|
@@ -0,0 +1,96 @@
|
|
1
|
+
/* XPM */
|
2
|
+
static char * String_xpm[] = {
|
3
|
+
"16 16 77 1",
|
4
|
+
" c None",
|
5
|
+
". c #000000",
|
6
|
+
"+ c #040404",
|
7
|
+
"@ c #080806",
|
8
|
+
"# c #090606",
|
9
|
+
"$ c #EEEAE1",
|
10
|
+
"% c #E7E3DA",
|
11
|
+
"& c #E0DBD1",
|
12
|
+
"* c #D4B46F",
|
13
|
+
"= c #0C0906",
|
14
|
+
"- c #E3C072",
|
15
|
+
"; c #E4C072",
|
16
|
+
"> c #060505",
|
17
|
+
", c #0B0A08",
|
18
|
+
"' c #D5B264",
|
19
|
+
") c #D3AF5A",
|
20
|
+
"! c #080602",
|
21
|
+
"~ c #E1B863",
|
22
|
+
"{ c #DDB151",
|
23
|
+
"] c #DBAE4A",
|
24
|
+
"^ c #DDB152",
|
25
|
+
"/ c #DDB252",
|
26
|
+
"( c #070705",
|
27
|
+
"_ c #0C0A07",
|
28
|
+
": c #D3A33B",
|
29
|
+
"< c #020201",
|
30
|
+
"[ c #DAAA41",
|
31
|
+
"} c #040302",
|
32
|
+
"| c #E4D9BF",
|
33
|
+
"1 c #0B0907",
|
34
|
+
"2 c #030201",
|
35
|
+
"3 c #020200",
|
36
|
+
"4 c #C99115",
|
37
|
+
"5 c #080704",
|
38
|
+
"6 c #DBC8A2",
|
39
|
+
"7 c #E7D7B4",
|
40
|
+
"8 c #E0CD9E",
|
41
|
+
"9 c #080601",
|
42
|
+
"0 c #040400",
|
43
|
+
"a c #010100",
|
44
|
+
"b c #0B0B08",
|
45
|
+
"c c #DCBF83",
|
46
|
+
"d c #DCBC75",
|
47
|
+
"e c #DEB559",
|
48
|
+
"f c #040301",
|
49
|
+
"g c #BC8815",
|
50
|
+
"h c #120E07",
|
51
|
+
"i c #060402",
|
52
|
+
"j c #0A0804",
|
53
|
+
"k c #D4A747",
|
54
|
+
"l c #D6A12F",
|
55
|
+
"m c #0E0C05",
|
56
|
+
"n c #C8C1B0",
|
57
|
+
"o c #1D1B15",
|
58
|
+
"p c #D7AD51",
|
59
|
+
"q c #070502",
|
60
|
+
"r c #080804",
|
61
|
+
"s c #BC953B",
|
62
|
+
"t c #C4BDAD",
|
63
|
+
"u c #0B0807",
|
64
|
+
"v c #DBAC47",
|
65
|
+
"w c #1B150A",
|
66
|
+
"x c #B78A2C",
|
67
|
+
"y c #D8A83C",
|
68
|
+
"z c #D4A338",
|
69
|
+
"A c #0F0B03",
|
70
|
+
"B c #181105",
|
71
|
+
"C c #C59325",
|
72
|
+
"D c #C18E1F",
|
73
|
+
"E c #060600",
|
74
|
+
"F c #CC992D",
|
75
|
+
"G c #B98B25",
|
76
|
+
"H c #B3831F",
|
77
|
+
"I c #C08C1C",
|
78
|
+
"J c #060500",
|
79
|
+
"K c #0E0C03",
|
80
|
+
"L c #0D0A00",
|
81
|
+
" ",
|
82
|
+
" .+@# ",
|
83
|
+
" .$%&*= ",
|
84
|
+
" .-;>,')! ",
|
85
|
+
" .~. .{]. ",
|
86
|
+
" .^/. (_:< ",
|
87
|
+
" .[.}|$12 ",
|
88
|
+
" 345678}90 ",
|
89
|
+
" a2bcdefgh ",
|
90
|
+
" ijkl.mno ",
|
91
|
+
" <pq. rstu ",
|
92
|
+
" .]v. wx= ",
|
93
|
+
" .yzABCDE ",
|
94
|
+
" .FGHIJ ",
|
95
|
+
" 0KL0 ",
|
96
|
+
" "};
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/* XPM */
|
2
|
+
static char * TrueClass_xpm[] = {
|
3
|
+
"16 16 2 1",
|
4
|
+
" c None",
|
5
|
+
". c #0BF311",
|
6
|
+
" ",
|
7
|
+
" ",
|
8
|
+
" ",
|
9
|
+
" ......... ",
|
10
|
+
" . ",
|
11
|
+
" . ",
|
12
|
+
" . ",
|
13
|
+
" . ",
|
14
|
+
" . ",
|
15
|
+
" . ",
|
16
|
+
" . ",
|
17
|
+
" . ",
|
18
|
+
" . ",
|
19
|
+
" ",
|
20
|
+
" ",
|
21
|
+
" "};
|
@@ -0,0 +1,148 @@
|
|
1
|
+
# This file contains implementations of ruby core's custom objects for
|
2
|
+
# serialisation/deserialisation.
|
3
|
+
|
4
|
+
unless Object.const_defined?(:JSON) and ::JSON.const_defined?(:JSON_LOADED) and
|
5
|
+
::JSON::JSON_LOADED
|
6
|
+
require 'json'
|
7
|
+
end
|
8
|
+
require 'date'
|
9
|
+
|
10
|
+
class Symbol
|
11
|
+
def to_json(*a)
|
12
|
+
{
|
13
|
+
JSON.create_id => self.class.name,
|
14
|
+
's' => to_s,
|
15
|
+
}.to_json(*a)
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.json_create(o)
|
19
|
+
o['s'].to_sym
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class Time
|
24
|
+
def self.json_create(object)
|
25
|
+
if usec = object.delete('u') # used to be tv_usec -> tv_nsec
|
26
|
+
object['n'] = usec * 1000
|
27
|
+
end
|
28
|
+
if respond_to?(:tv_nsec)
|
29
|
+
at(*object.values_at('s', 'n'))
|
30
|
+
else
|
31
|
+
at(object['s'], object['n'] / 1000)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_json(*args)
|
36
|
+
{
|
37
|
+
JSON.create_id => self.class.name,
|
38
|
+
's' => tv_sec,
|
39
|
+
'n' => respond_to?(:tv_nsec) ? tv_nsec : tv_usec * 1000
|
40
|
+
}.to_json(*args)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class Date
|
45
|
+
def self.json_create(object)
|
46
|
+
civil(*object.values_at('y', 'm', 'd', 'sg'))
|
47
|
+
end
|
48
|
+
|
49
|
+
alias start sg unless method_defined?(:start)
|
50
|
+
|
51
|
+
def to_json(*args)
|
52
|
+
{
|
53
|
+
JSON.create_id => self.class.name,
|
54
|
+
'y' => year,
|
55
|
+
'm' => month,
|
56
|
+
'd' => day,
|
57
|
+
'sg' => start,
|
58
|
+
}.to_json(*args)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
class DateTime
|
63
|
+
def self.json_create(object)
|
64
|
+
args = object.values_at('y', 'm', 'd', 'H', 'M', 'S')
|
65
|
+
of_a, of_b = object['of'].split('/')
|
66
|
+
if of_b and of_b != '0'
|
67
|
+
args << Rational(of_a.to_i, of_b.to_i)
|
68
|
+
else
|
69
|
+
args << of_a
|
70
|
+
end
|
71
|
+
args << object['sg']
|
72
|
+
civil(*args)
|
73
|
+
end
|
74
|
+
|
75
|
+
alias start sg unless method_defined?(:start)
|
76
|
+
|
77
|
+
def to_json(*args)
|
78
|
+
{
|
79
|
+
JSON.create_id => self.class.name,
|
80
|
+
'y' => year,
|
81
|
+
'm' => month,
|
82
|
+
'd' => day,
|
83
|
+
'H' => hour,
|
84
|
+
'M' => min,
|
85
|
+
'S' => sec,
|
86
|
+
'of' => offset.to_s,
|
87
|
+
'sg' => start,
|
88
|
+
}.to_json(*args)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
class Range
|
93
|
+
def self.json_create(object)
|
94
|
+
new(*object['a'])
|
95
|
+
end
|
96
|
+
|
97
|
+
def to_json(*args)
|
98
|
+
{
|
99
|
+
JSON.create_id => self.class.name,
|
100
|
+
'a' => [ first, last, exclude_end? ]
|
101
|
+
}.to_json(*args)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
class Struct
|
106
|
+
def self.json_create(object)
|
107
|
+
new(*object['v'])
|
108
|
+
end
|
109
|
+
|
110
|
+
def to_json(*args)
|
111
|
+
klass = self.class.name
|
112
|
+
klass.to_s.empty? and raise JSON::JSONError, "Only named structs are supported!"
|
113
|
+
{
|
114
|
+
JSON.create_id => klass,
|
115
|
+
'v' => values,
|
116
|
+
}.to_json(*args)
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
class Exception
|
121
|
+
def self.json_create(object)
|
122
|
+
result = new(object['m'])
|
123
|
+
result.set_backtrace object['b']
|
124
|
+
result
|
125
|
+
end
|
126
|
+
|
127
|
+
def to_json(*args)
|
128
|
+
{
|
129
|
+
JSON.create_id => self.class.name,
|
130
|
+
'm' => message,
|
131
|
+
'b' => backtrace,
|
132
|
+
}.to_json(*args)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
136
|
+
class Regexp
|
137
|
+
def self.json_create(object)
|
138
|
+
new(object['s'], object['o'])
|
139
|
+
end
|
140
|
+
|
141
|
+
def to_json(*)
|
142
|
+
{
|
143
|
+
JSON.create_id => self.class.name,
|
144
|
+
'o' => options,
|
145
|
+
's' => source,
|
146
|
+
}.to_json
|
147
|
+
end
|
148
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# This file contains implementations of rails custom objects for
|
2
|
+
# serialisation/deserialisation.
|
3
|
+
|
4
|
+
unless Object.const_defined?(:JSON) and ::JSON.const_defined?(:JSON_LOADED) and
|
5
|
+
::JSON::JSON_LOADED
|
6
|
+
require 'json'
|
7
|
+
end
|
8
|
+
|
9
|
+
class Object
|
10
|
+
def self.json_create(object)
|
11
|
+
obj = new
|
12
|
+
for key, value in object
|
13
|
+
next if key == JSON.create_id
|
14
|
+
instance_variable_set "@#{key}", value
|
15
|
+
end
|
16
|
+
obj
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_json(*a)
|
20
|
+
result = {
|
21
|
+
JSON.create_id => self.class.name
|
22
|
+
}
|
23
|
+
instance_variables.inject(result) do |r, name|
|
24
|
+
r[name[1..-1]] = instance_variable_get name
|
25
|
+
r
|
26
|
+
end
|
27
|
+
result.to_json(*a)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
class Symbol
|
32
|
+
def to_json(*a)
|
33
|
+
to_s.to_json(*a)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
module Enumerable
|
38
|
+
def to_json(*a)
|
39
|
+
to_a.to_json(*a)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
# class Regexp
|
44
|
+
# def to_json(*)
|
45
|
+
# inspect
|
46
|
+
# end
|
47
|
+
# end
|
48
|
+
#
|
49
|
+
# The above rails definition has some problems:
|
50
|
+
#
|
51
|
+
# 1. { 'foo' => /bar/ }.to_json # => "{foo: /bar/}"
|
52
|
+
# This isn't valid JSON, because the regular expression syntax is not
|
53
|
+
# defined in RFC 4627. (And unquoted strings are disallowed there, too.)
|
54
|
+
# Though it is valid Javascript.
|
55
|
+
#
|
56
|
+
# 2. { 'foo' => /bar/mix }.to_json # => "{foo: /bar/mix}"
|
57
|
+
# This isn't even valid Javascript.
|
58
|
+
|