content_server 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. data/bin/backup_server +8 -20
  2. data/bin/content_server +8 -20
  3. data/bin/testing_memory +60 -0
  4. data/bin/testing_server +57 -0
  5. data/ext/run_in_background/mkrf_conf.rb +34 -0
  6. data/lib/content_data/content_data.rb +613 -0
  7. data/lib/content_data/version.rb +3 -0
  8. data/lib/content_data.rb +6 -0
  9. data/lib/content_server/backup_server.rb +65 -86
  10. data/lib/content_server/content_server.rb +47 -77
  11. data/lib/content_server/file_streamer.rb +27 -33
  12. data/lib/content_server/queue_copy.rb +154 -49
  13. data/lib/content_server/queue_indexer.rb +19 -11
  14. data/lib/content_server/remote_content.rb +41 -23
  15. data/lib/content_server/server.rb +91 -0
  16. data/lib/content_server/version.rb +1 -1
  17. data/lib/content_server.rb +0 -15
  18. data/lib/email/email.rb +87 -0
  19. data/lib/email/version.rb +3 -0
  20. data/lib/email.rb +4 -0
  21. data/lib/file_copy/copy.rb +68 -0
  22. data/lib/file_copy/version.rb +4 -0
  23. data/lib/file_copy.rb +4 -0
  24. data/lib/file_indexing/index_agent.rb +170 -0
  25. data/lib/file_indexing/indexer_patterns.rb +72 -0
  26. data/lib/file_indexing/version.rb +3 -0
  27. data/lib/file_indexing.rb +9 -0
  28. data/lib/file_monitoring/file_monitoring.rb +105 -0
  29. data/lib/file_monitoring/monitor_path.rb +304 -0
  30. data/lib/file_monitoring/version.rb +3 -0
  31. data/lib/file_monitoring.rb +29 -0
  32. data/lib/file_utils/file_generator/README +97 -0
  33. data/lib/file_utils/file_generator/file_generator.rb +156 -0
  34. data/lib/file_utils/file_utils.rb +260 -0
  35. data/lib/file_utils/version.rb +3 -0
  36. data/lib/file_utils.rb +4 -0
  37. data/lib/log/version.rb +3 -0
  38. data/lib/log.rb +188 -0
  39. data/lib/networking/tcp.rb +213 -0
  40. data/lib/networking/version.rb +3 -0
  41. data/lib/networking.rb +4 -0
  42. data/lib/params/version.rb +3 -0
  43. data/lib/params.rb +419 -0
  44. data/lib/process_monitoring/monitoring.rb +85 -0
  45. data/lib/process_monitoring/monitoring_info.rb +79 -0
  46. data/lib/process_monitoring/send_email.rb +40 -0
  47. data/lib/process_monitoring/thread_safe_hash.rb +77 -0
  48. data/lib/process_monitoring/version.rb +3 -0
  49. data/lib/process_monitoring.rb +6 -0
  50. data/lib/run_in_background/version.rb +3 -0
  51. data/lib/run_in_background.rb +432 -0
  52. data/lib/testing_memory/testing_memory.rb +187 -0
  53. data/lib/testing_server/testing_server.rb +236 -0
  54. data/lib/testing_server/version.rb +3 -0
  55. data/lib/testing_server.rb +12 -0
  56. data/lib/validations/index_validations.rb +106 -0
  57. data/lib/validations/version.rb +3 -0
  58. data/lib/validations.rb +4 -0
  59. data/spec/content_data/validations_spec.rb +113 -0
  60. data/spec/file_copy/copy_spec.rb +54 -0
  61. data/spec/file_indexing/index_agent_spec.rb +53 -0
  62. data/spec/networking/tcp_spec.rb +95 -0
  63. data/spec/validations/index_validations_spec.rb +77 -0
  64. data/test/content_data/content_data_test.rb +290 -0
  65. data/test/file_generator/file_generator_spec.rb +84 -0
  66. data/test/file_indexing/index_agent_test/New.txt +0 -0
  67. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/libexslt.dll +0 -0
  68. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/libxslt.dll +0 -0
  69. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/bin/xsltproc.exe +0 -0
  70. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exslt.h +102 -0
  71. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exsltconfig.h +73 -0
  72. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/exsltexports.h +140 -0
  73. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libexslt/libexslt.h +29 -0
  74. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/attributes.h +38 -0
  75. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/documents.h +93 -0
  76. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/extensions.h +262 -0
  77. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/extra.h +80 -0
  78. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/functions.h +78 -0
  79. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/imports.h +75 -0
  80. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/keys.h +53 -0
  81. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/libxslt.h +30 -0
  82. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/namespaces.h +68 -0
  83. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/numbersInternals.h +69 -0
  84. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/pattern.h +81 -0
  85. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/preproc.h +43 -0
  86. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/security.h +104 -0
  87. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/templates.h +77 -0
  88. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/transform.h +207 -0
  89. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/trio.h +216 -0
  90. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/triodef.h +220 -0
  91. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/variables.h +91 -0
  92. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/win32config.h +101 -0
  93. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xslt.h +103 -0
  94. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltInternals.h +1967 -0
  95. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltconfig.h +172 -0
  96. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltexports.h +142 -0
  97. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltlocale.h +57 -0
  98. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltutils.h +309 -0
  99. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/include/libxslt/xsltwin32config.h +105 -0
  100. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libexslt.lib +0 -0
  101. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libexslt_a.lib +0 -0
  102. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libxslt.lib +0 -0
  103. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/lib/libxslt_a.lib +0 -0
  104. data/test/file_indexing/index_agent_test/libxslt-1.1.26.win32/readme.txt +22 -0
  105. data/test/file_indexing/index_agent_test/patterns.input +3 -0
  106. data/test/file_indexing/index_agent_test.rb +51 -0
  107. data/test/file_monitoring/file_monitoring_test/conf.yml +4 -0
  108. data/test/file_monitoring/file_monitoring_test/conf_win32.yml +5 -0
  109. data/test/file_monitoring/file_monitoring_test/log +56 -0
  110. data/test/file_monitoring/file_monitoring_test.rb +0 -0
  111. data/test/file_monitoring/monitor_path_test/dir1000/test_file.1000 +1000 -0
  112. data/test/file_monitoring/monitor_path_test/dir1000/test_file.1000.0 +1000 -0
  113. data/test/file_monitoring/monitor_path_test/dir1000/test_file.1000.1 +1000 -0
  114. data/test/file_monitoring/monitor_path_test/dir1500/test_file.1500 +1500 -0
  115. data/test/file_monitoring/monitor_path_test/dir1500/test_file.1500.0 +1500 -0
  116. data/test/file_monitoring/monitor_path_test/dir1500/test_file.1500.1 +1500 -0
  117. data/test/file_monitoring/monitor_path_test/test_file.500 +500 -0
  118. data/test/file_monitoring/monitor_path_test/test_file.500.0 +500 -0
  119. data/test/file_monitoring/monitor_path_test/test_file.500.1 +500 -0
  120. data/test/file_monitoring/monitor_path_test.rb +153 -0
  121. data/test/file_utils/fileutil_mksymlink_test/dir1000/dir1500/test_file.1500 +1500 -0
  122. data/test/file_utils/fileutil_mksymlink_test/dir1000/dir1500/test_file.1500.0 +1500 -0
  123. data/test/file_utils/fileutil_mksymlink_test/dir1000/dir1500/test_file.1500.1 +1500 -0
  124. data/test/file_utils/fileutil_mksymlink_test/dir1000/test_file.1000 +1000 -0
  125. data/test/file_utils/fileutil_mksymlink_test/dir1000/test_file.1000.0 +1000 -0
  126. data/test/file_utils/fileutil_mksymlink_test/dir1000/test_file.1000.1 +1000 -0
  127. data/test/file_utils/fileutil_mksymlink_test/test_file.500 +500 -0
  128. data/test/file_utils/fileutil_mksymlink_test/test_file.500.0 +500 -0
  129. data/test/file_utils/fileutil_mksymlink_test/test_file.500.1 +500 -0
  130. data/test/file_utils/fileutil_mksymlink_test.rb +125 -0
  131. data/test/file_utils/time_modification_test.rb +132 -0
  132. data/test/params/params_spec.rb +280 -0
  133. data/test/params/params_test.rb +43 -0
  134. data/test/run_in_background/run_in_background_test.rb +122 -0
  135. data/test/run_in_background/test_app +57 -0
  136. metadata +272 -132
  137. data/lib/content_server/globals.rb +0 -10
@@ -0,0 +1,91 @@
1
+ /*
2
+ * Summary: interface for the variable matching and lookup.
3
+ * Description: interface for the variable matching and lookup.
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_XSLT_VARIABLES_H__
11
+ #define __XML_XSLT_VARIABLES_H__
12
+
13
+ #include <libxml/xpath.h>
14
+ #include <libxml/xpathInternals.h>
15
+ #include "xsltexports.h"
16
+ #include "xsltInternals.h"
17
+ #include "functions.h"
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+
24
+ /**
25
+ * XSLT_REGISTER_VARIABLE_LOOKUP:
26
+ *
27
+ * Registering macro, not general purpose at all but used in different modules.
28
+ */
29
+
30
+ #define XSLT_REGISTER_VARIABLE_LOOKUP(ctxt) \
31
+ xmlXPathRegisterVariableLookup((ctxt)->xpathCtxt, \
32
+ xsltXPathVariableLookup, (void *)(ctxt)); \
33
+ xsltRegisterAllFunctions((ctxt)->xpathCtxt); \
34
+ xsltRegisterAllElement(ctxt); \
35
+ (ctxt)->xpathCtxt->extra = ctxt
36
+
37
+ /*
38
+ * Interfaces for the variable module.
39
+ */
40
+
41
+ XSLTPUBFUN int XSLTCALL
42
+ xsltEvalGlobalVariables (xsltTransformContextPtr ctxt);
43
+ XSLTPUBFUN int XSLTCALL
44
+ xsltEvalUserParams (xsltTransformContextPtr ctxt,
45
+ const char **params);
46
+ XSLTPUBFUN int XSLTCALL
47
+ xsltQuoteUserParams (xsltTransformContextPtr ctxt,
48
+ const char **params);
49
+ XSLTPUBFUN int XSLTCALL
50
+ xsltEvalOneUserParam (xsltTransformContextPtr ctxt,
51
+ const xmlChar * name,
52
+ const xmlChar * value);
53
+ XSLTPUBFUN int XSLTCALL
54
+ xsltQuoteOneUserParam (xsltTransformContextPtr ctxt,
55
+ const xmlChar * name,
56
+ const xmlChar * value);
57
+
58
+ XSLTPUBFUN void XSLTCALL
59
+ xsltParseGlobalVariable (xsltStylesheetPtr style,
60
+ xmlNodePtr cur);
61
+ XSLTPUBFUN void XSLTCALL
62
+ xsltParseGlobalParam (xsltStylesheetPtr style,
63
+ xmlNodePtr cur);
64
+ XSLTPUBFUN void XSLTCALL
65
+ xsltParseStylesheetVariable (xsltTransformContextPtr ctxt,
66
+ xmlNodePtr cur);
67
+ XSLTPUBFUN void XSLTCALL
68
+ xsltParseStylesheetParam (xsltTransformContextPtr ctxt,
69
+ xmlNodePtr cur);
70
+ XSLTPUBFUN xsltStackElemPtr XSLTCALL
71
+ xsltParseStylesheetCallerParam (xsltTransformContextPtr ctxt,
72
+ xmlNodePtr cur);
73
+ XSLTPUBFUN int XSLTCALL
74
+ xsltAddStackElemList (xsltTransformContextPtr ctxt,
75
+ xsltStackElemPtr elems);
76
+ XSLTPUBFUN void XSLTCALL
77
+ xsltFreeGlobalVariables (xsltTransformContextPtr ctxt);
78
+ XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
79
+ xsltVariableLookup (xsltTransformContextPtr ctxt,
80
+ const xmlChar *name,
81
+ const xmlChar *ns_uri);
82
+ XSLTPUBFUN xmlXPathObjectPtr XSLTCALL
83
+ xsltXPathVariableLookup (void *ctxt,
84
+ const xmlChar *name,
85
+ const xmlChar *ns_uri);
86
+ #ifdef __cplusplus
87
+ }
88
+ #endif
89
+
90
+ #endif /* __XML_XSLT_VARIABLES_H__ */
91
+
@@ -0,0 +1,101 @@
1
+ /*
2
+ * Summary: Windows configuration header
3
+ * Description: Windows configuration header
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Igor Zlatkovic
8
+ */
9
+ #ifndef __LIBXSLT_WIN32_CONFIG__
10
+ #define __LIBXSLT_WIN32_CONFIG__
11
+
12
+ #define HAVE_CTYPE_H 1
13
+ #define HAVE_STDLIB_H 1
14
+ #define HAVE_STDARG_H 1
15
+ #define HAVE_MALLOC_H 1
16
+ #define HAVE_TIME_H 1
17
+ #define HAVE_LOCALTIME 1
18
+ #define HAVE_GMTIME 1
19
+ #define HAVE_TIME 1
20
+ #define HAVE_MATH_H 1
21
+ #define HAVE_FCNTL_H 1
22
+
23
+ #include <io.h>
24
+
25
+ #define HAVE_ISINF
26
+ #define HAVE_ISNAN
27
+
28
+ #include <math.h>
29
+ #if defined _MSC_VER || defined __MINGW32__
30
+ /* MS C-runtime has functions which can be used in order to determine if
31
+ a given floating-point variable contains NaN, (+-)INF. These are
32
+ preferred, because floating-point technology is considered propriatary
33
+ by MS and we can assume that their functions know more about their
34
+ oddities than we do. */
35
+ #include <float.h>
36
+ /* Bjorn Reese figured a quite nice construct for isinf() using the
37
+ _fpclass() function. */
38
+ #ifndef isinf
39
+ #define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
40
+ : ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))
41
+ #endif
42
+ /* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
43
+ #ifndef isnan
44
+ #define isnan(d) (_isnan(d))
45
+ #endif
46
+ #else /* _MSC_VER */
47
+ static int isinf (double d) {
48
+ int expon = 0;
49
+ double val = frexp (d, &expon);
50
+ if (expon == 1025) {
51
+ if (val == 0.5) {
52
+ return 1;
53
+ } else if (val == -0.5) {
54
+ return -1;
55
+ } else {
56
+ return 0;
57
+ }
58
+ } else {
59
+ return 0;
60
+ }
61
+ }
62
+ static int isnan (double d) {
63
+ int expon = 0;
64
+ double val = frexp (d, &expon);
65
+ if (expon == 1025) {
66
+ if (val == 0.5) {
67
+ return 0;
68
+ } else if (val == -0.5) {
69
+ return 0;
70
+ } else {
71
+ return 1;
72
+ }
73
+ } else {
74
+ return 0;
75
+ }
76
+ }
77
+ #endif /* _MSC_VER */
78
+
79
+ #include <direct.h>
80
+ #if defined(_MSC_VER) || defined(__MINGW32__)
81
+ #define mkdir(p,m) _mkdir(p)
82
+ #define snprintf _snprintf
83
+ #if _MSC_VER < 1500
84
+ #define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
85
+ #endif
86
+ #endif
87
+
88
+ #define HAVE_SYS_STAT_H
89
+ #define HAVE__STAT
90
+ #define HAVE_STRING_H
91
+
92
+ #include <libxml/xmlversion.h>
93
+
94
+ #ifndef ATTRIBUTE_UNUSED
95
+ #define ATTRIBUTE_UNUSED
96
+ #endif
97
+
98
+ #define _WINSOCKAPI_
99
+
100
+ #endif /* __LIBXSLT_WIN32_CONFIG__ */
101
+
@@ -0,0 +1,103 @@
1
+ /*
2
+ * Summary: Interfaces, constants and types related to the XSLT engine
3
+ * Description: Interfaces, constants and types related to the XSLT engine
4
+ *
5
+ * Copy: See Copyright for the status of this software.
6
+ *
7
+ * Author: Daniel Veillard
8
+ */
9
+
10
+ #ifndef __XML_XSLT_H__
11
+ #define __XML_XSLT_H__
12
+
13
+ #include <libxml/tree.h>
14
+ #include "xsltexports.h"
15
+
16
+ #ifdef __cplusplus
17
+ extern "C" {
18
+ #endif
19
+
20
+ /**
21
+ * XSLT_DEFAULT_VERSION:
22
+ *
23
+ * The default version of XSLT supported.
24
+ */
25
+ #define XSLT_DEFAULT_VERSION "1.0"
26
+
27
+ /**
28
+ * XSLT_DEFAULT_VENDOR:
29
+ *
30
+ * The XSLT "vendor" string for this processor.
31
+ */
32
+ #define XSLT_DEFAULT_VENDOR "libxslt"
33
+
34
+ /**
35
+ * XSLT_DEFAULT_URL:
36
+ *
37
+ * The XSLT "vendor" URL for this processor.
38
+ */
39
+ #define XSLT_DEFAULT_URL "http://xmlsoft.org/XSLT/"
40
+
41
+ /**
42
+ * XSLT_NAMESPACE:
43
+ *
44
+ * The XSLT specification namespace.
45
+ */
46
+ #define XSLT_NAMESPACE ((xmlChar *) "http://www.w3.org/1999/XSL/Transform")
47
+
48
+ /**
49
+ * XSLT_PARSE_OPTIONS:
50
+ *
51
+ * The set of options to pass to an xmlReadxxx when loading files for
52
+ * XSLT consumption.
53
+ */
54
+ #define XSLT_PARSE_OPTIONS \
55
+ XML_PARSE_NOENT | XML_PARSE_DTDLOAD | XML_PARSE_DTDATTR | XML_PARSE_NOCDATA
56
+
57
+ /**
58
+ * xsltMaxDepth:
59
+ *
60
+ * This value is used to detect templates loops.
61
+ */
62
+ XSLTPUBVAR int xsltMaxDepth;
63
+
64
+ /**
65
+ * xsltEngineVersion:
66
+ *
67
+ * The version string for libxslt.
68
+ */
69
+ XSLTPUBVAR const char *xsltEngineVersion;
70
+
71
+ /**
72
+ * xsltLibxsltVersion:
73
+ *
74
+ * The version of libxslt compiled.
75
+ */
76
+ XSLTPUBVAR const int xsltLibxsltVersion;
77
+
78
+ /**
79
+ * xsltLibxmlVersion:
80
+ *
81
+ * The version of libxml libxslt was compiled against.
82
+ */
83
+ XSLTPUBVAR const int xsltLibxmlVersion;
84
+
85
+ /*
86
+ * Global initialization function.
87
+ */
88
+
89
+ XSLTPUBFUN void XSLTCALL
90
+ xsltInit (void);
91
+
92
+ /*
93
+ * Global cleanup function.
94
+ */
95
+ XSLTPUBFUN void XSLTCALL
96
+ xsltCleanupGlobals (void);
97
+
98
+ #ifdef __cplusplus
99
+ }
100
+ #endif
101
+
102
+ #endif /* __XML_XSLT_H__ */
103
+