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,170 @@
|
|
1
|
+
#ifndef _GENERATOR_H_
|
2
|
+
#define _GENERATOR_H_
|
3
|
+
|
4
|
+
#include <string.h>
|
5
|
+
#include <assert.h>
|
6
|
+
#include <math.h>
|
7
|
+
|
8
|
+
#include "ruby.h"
|
9
|
+
|
10
|
+
#if HAVE_RUBY_RE_H
|
11
|
+
#include "ruby/re.h"
|
12
|
+
#endif
|
13
|
+
|
14
|
+
#if HAVE_RE_H
|
15
|
+
#include "re.h"
|
16
|
+
#endif
|
17
|
+
|
18
|
+
#ifdef HAVE_RUBY_ENCODING_H
|
19
|
+
#include "ruby/encoding.h"
|
20
|
+
#define FORCE_UTF8(obj) rb_enc_associate((obj), rb_utf8_encoding())
|
21
|
+
#else
|
22
|
+
#define FORCE_UTF8(obj)
|
23
|
+
#endif
|
24
|
+
|
25
|
+
#define option_given_p(opts, key) RTEST(rb_funcall(opts, i_key_p, 1, key))
|
26
|
+
|
27
|
+
#ifndef RHASH_SIZE
|
28
|
+
#define RHASH_SIZE(hsh) (RHASH(hsh)->tbl->num_entries)
|
29
|
+
#endif
|
30
|
+
|
31
|
+
#ifndef RFLOAT_VALUE
|
32
|
+
#define RFLOAT_VALUE(val) (RFLOAT(val)->value)
|
33
|
+
#endif
|
34
|
+
|
35
|
+
#ifndef RARRAY_PTR
|
36
|
+
#define RARRAY_PTR(ARRAY) RARRAY(ARRAY)->ptr
|
37
|
+
#endif
|
38
|
+
#ifndef RARRAY_LEN
|
39
|
+
#define RARRAY_LEN(ARRAY) RARRAY(ARRAY)->len
|
40
|
+
#endif
|
41
|
+
#ifndef RSTRING_PTR
|
42
|
+
#define RSTRING_PTR(string) RSTRING(string)->ptr
|
43
|
+
#endif
|
44
|
+
#ifndef RSTRING_LEN
|
45
|
+
#define RSTRING_LEN(string) RSTRING(string)->len
|
46
|
+
#endif
|
47
|
+
|
48
|
+
#define RSTRING_PAIR(string) RSTRING_PTR(string), RSTRING_LEN(string)
|
49
|
+
|
50
|
+
/* fbuffer implementation */
|
51
|
+
|
52
|
+
typedef struct FBufferStruct {
|
53
|
+
unsigned int initial_length;
|
54
|
+
char *ptr;
|
55
|
+
unsigned int len;
|
56
|
+
unsigned int capa;
|
57
|
+
} FBuffer;
|
58
|
+
|
59
|
+
#define FBUFFER_INITIAL_LENGTH 4096
|
60
|
+
|
61
|
+
#define FBUFFER_PTR(fb) (fb->ptr)
|
62
|
+
#define FBUFFER_LEN(fb) (fb->len)
|
63
|
+
#define FBUFFER_CAPA(fb) (fb->capa)
|
64
|
+
#define FBUFFER_PAIR(fb) FBUFFER_PTR(fb), FBUFFER_LEN(fb)
|
65
|
+
|
66
|
+
static char *fstrndup(const char *ptr, int len);
|
67
|
+
static FBuffer *fbuffer_alloc();
|
68
|
+
static FBuffer *fbuffer_alloc_with_length(unsigned initial_length);
|
69
|
+
static void fbuffer_free(FBuffer *fb);
|
70
|
+
static void fbuffer_free_only_buffer(FBuffer *fb);
|
71
|
+
static void fbuffer_clear(FBuffer *fb);
|
72
|
+
static void fbuffer_append(FBuffer *fb, const char *newstr, unsigned int len);
|
73
|
+
static void fbuffer_append_long(FBuffer *fb, long number);
|
74
|
+
static void fbuffer_append_char(FBuffer *fb, char newchr);
|
75
|
+
static FBuffer *fbuffer_dup(FBuffer *fb);
|
76
|
+
|
77
|
+
/* unicode defintions */
|
78
|
+
|
79
|
+
#define UNI_STRICT_CONVERSION 1
|
80
|
+
|
81
|
+
typedef unsigned long UTF32; /* at least 32 bits */
|
82
|
+
typedef unsigned short UTF16; /* at least 16 bits */
|
83
|
+
typedef unsigned char UTF8; /* typically 8 bits */
|
84
|
+
|
85
|
+
#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
|
86
|
+
#define UNI_MAX_BMP (UTF32)0x0000FFFF
|
87
|
+
#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
|
88
|
+
#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
|
89
|
+
#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
|
90
|
+
|
91
|
+
#define UNI_SUR_HIGH_START (UTF32)0xD800
|
92
|
+
#define UNI_SUR_HIGH_END (UTF32)0xDBFF
|
93
|
+
#define UNI_SUR_LOW_START (UTF32)0xDC00
|
94
|
+
#define UNI_SUR_LOW_END (UTF32)0xDFFF
|
95
|
+
|
96
|
+
static const int halfShift = 10; /* used for shifting by 10 bits */
|
97
|
+
|
98
|
+
static const UTF32 halfBase = 0x0010000UL;
|
99
|
+
static const UTF32 halfMask = 0x3FFUL;
|
100
|
+
|
101
|
+
static unsigned char isLegalUTF8(const UTF8 *source, int length);
|
102
|
+
static void unicode_escape(char *buf, UTF16 character);
|
103
|
+
static void unicode_escape_to_buffer(FBuffer *buffer, char buf[6], UTF16 character);
|
104
|
+
static void convert_UTF8_to_JSON_ASCII(FBuffer *buffer, VALUE string);
|
105
|
+
static void convert_UTF8_to_JSON(FBuffer *buffer, VALUE string);
|
106
|
+
|
107
|
+
/* ruby api and some helpers */
|
108
|
+
|
109
|
+
typedef struct JSON_Generator_StateStruct {
|
110
|
+
char *indent;
|
111
|
+
long indent_len;
|
112
|
+
char *space;
|
113
|
+
long space_len;
|
114
|
+
char *space_before;
|
115
|
+
long space_before_len;
|
116
|
+
char *object_nl;
|
117
|
+
long object_nl_len;
|
118
|
+
char *array_nl;
|
119
|
+
long array_nl_len;
|
120
|
+
FBuffer *array_delim;
|
121
|
+
FBuffer *object_delim;
|
122
|
+
FBuffer *object_delim2;
|
123
|
+
long max_nesting;
|
124
|
+
char allow_nan;
|
125
|
+
char ascii_only;
|
126
|
+
} JSON_Generator_State;
|
127
|
+
|
128
|
+
#define GET_STATE(self) \
|
129
|
+
JSON_Generator_State *state; \
|
130
|
+
Data_Get_Struct(self, JSON_Generator_State, state)
|
131
|
+
|
132
|
+
static VALUE mHash_to_json(int argc, VALUE *argv, VALUE self);
|
133
|
+
static VALUE mArray_to_json(int argc, VALUE *argv, VALUE self);
|
134
|
+
static VALUE mInteger_to_json(int argc, VALUE *argv, VALUE self);
|
135
|
+
static VALUE mFloat_to_json(int argc, VALUE *argv, VALUE self);
|
136
|
+
static VALUE mString_included_s(VALUE self, VALUE modul);
|
137
|
+
static VALUE mString_to_json(int argc, VALUE *argv, VALUE self);
|
138
|
+
static VALUE mString_to_json_raw_object(VALUE self);
|
139
|
+
static VALUE mString_to_json_raw(int argc, VALUE *argv, VALUE self);
|
140
|
+
static VALUE mString_Extend_json_create(VALUE self, VALUE o);
|
141
|
+
static VALUE mTrueClass_to_json(int argc, VALUE *argv, VALUE self);
|
142
|
+
static VALUE mFalseClass_to_json(int argc, VALUE *argv, VALUE self);
|
143
|
+
static VALUE mNilClass_to_json(int argc, VALUE *argv, VALUE self);
|
144
|
+
static VALUE mObject_to_json(int argc, VALUE *argv, VALUE self);
|
145
|
+
static void State_free(JSON_Generator_State *state);
|
146
|
+
static JSON_Generator_State *State_allocate();
|
147
|
+
static VALUE cState_s_allocate(VALUE klass);
|
148
|
+
static VALUE cState_configure(VALUE self, VALUE opts);
|
149
|
+
static VALUE cState_to_h(VALUE self);
|
150
|
+
static void generate_json(FBuffer *buffer, VALUE Vstate, JSON_Generator_State *state, VALUE obj, long depth);
|
151
|
+
static VALUE cState_partial_generate(VALUE self, VALUE obj, VALUE depth);
|
152
|
+
static VALUE cState_generate(VALUE self, VALUE obj);
|
153
|
+
static VALUE cState_initialize(int argc, VALUE *argv, VALUE self);
|
154
|
+
static VALUE cState_from_state_s(VALUE self, VALUE opts);
|
155
|
+
static VALUE cState_indent(VALUE self);
|
156
|
+
static VALUE cState_indent_set(VALUE self, VALUE indent);
|
157
|
+
static VALUE cState_space(VALUE self);
|
158
|
+
static VALUE cState_space_set(VALUE self, VALUE space);
|
159
|
+
static VALUE cState_space_before(VALUE self);
|
160
|
+
static VALUE cState_space_before_set(VALUE self, VALUE space_before);
|
161
|
+
static VALUE cState_object_nl(VALUE self);
|
162
|
+
static VALUE cState_object_nl_set(VALUE self, VALUE object_nl);
|
163
|
+
static VALUE cState_array_nl(VALUE self);
|
164
|
+
static VALUE cState_array_nl_set(VALUE self, VALUE array_nl);
|
165
|
+
static VALUE cState_max_nesting(VALUE self);
|
166
|
+
static VALUE cState_max_nesting_set(VALUE self, VALUE depth);
|
167
|
+
static VALUE cState_allow_nan_p(VALUE self);
|
168
|
+
static VALUE cState_ascii_only_p(VALUE self);
|
169
|
+
|
170
|
+
#endif
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'mkmf'
|
2
|
+
require 'rbconfig'
|
3
|
+
|
4
|
+
unless $CFLAGS.gsub!(/ -O[\dsz]?/, ' -O3')
|
5
|
+
$CFLAGS << ' -O3'
|
6
|
+
end
|
7
|
+
if CONFIG['CC'] =~ /gcc/
|
8
|
+
$CFLAGS << ' -Wall'
|
9
|
+
#unless $CFLAGS.gsub!(/ -O[\dsz]?/, ' -O0 -ggdb')
|
10
|
+
# $CFLAGS << ' -O0 -ggdb'
|
11
|
+
#end
|
12
|
+
end
|
13
|
+
|
14
|
+
have_header("re.h")
|
15
|
+
create_makefile 'json/ext/parser'
|