datadog-ruby_core_source 3.5.1 → 3.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/datadog-ruby_core_source.gemspec +1 -0
- data/lib/datadog/ruby_core_source/version.rb +1 -1
- data/lib/datadog/ruby_core_source.rb +2 -2
- metadata +2 -110
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/build_assert/build_assert.h +0 -40
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/check_type/check_type.h +0 -63
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/container_of/container_of.h +0 -142
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/list/list.h +0 -791
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ccan/str/str.h +0 -17
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/id.h +0 -354
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/id_table.h +0 -54
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/array.h +0 -154
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/basic_operators.h +0 -65
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/bignum.h +0 -245
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/bits.h +0 -650
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/box.h +0 -81
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/class.h +0 -805
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/cmdlineopt.h +0 -64
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/compar.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/compile.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/compilers.h +0 -107
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/complex.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/concurrent_set.h +0 -21
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/cont.h +0 -35
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/dir.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/enc.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/encoding.h +0 -39
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/enum.h +0 -18
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/enumerator.h +0 -21
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/error.h +0 -251
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/eval.h +0 -41
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/file.h +0 -38
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/fixnum.h +0 -185
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/gc.h +0 -358
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/hash.h +0 -194
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/imemo.h +0 -322
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/inits.h +0 -51
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/io.h +0 -163
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/load.h +0 -20
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/loadpath.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/math.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/missing.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/numeric.h +0 -275
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/object.h +0 -63
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/parse.h +0 -131
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/proc.h +0 -30
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/process.h +0 -124
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/ractor.h +0 -10
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/random.h +0 -17
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/range.h +0 -40
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/rational.h +0 -71
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/re.h +0 -33
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/ruby_parser.h +0 -102
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/sanitizers.h +0 -346
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/serial.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/set_table.h +0 -70
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/signal.h +0 -25
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/st.h +0 -11
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/static_assert.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/string.h +0 -203
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/struct.h +0 -160
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/symbol.h +0 -46
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/thread.h +0 -112
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/time.h +0 -37
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/transcode.h +0 -23
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/util.h +0 -27
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/variable.h +0 -74
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/vm.h +0 -136
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal/warnings.h +0 -16
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/internal.h +0 -105
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/iseq.h +0 -357
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/method.h +0 -271
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/node.h +0 -122
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/parser_st.h +0 -162
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/parser_value.h +0 -106
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/ast.h +0 -8233
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/defines.h +0 -260
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/diagnostic.h +0 -458
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/encoding.h +0 -283
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/extension.h +0 -19
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/node.h +0 -129
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/options.h +0 -485
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/pack.h +0 -163
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/parser.h +0 -936
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/prettyprint.h +0 -34
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/prism.h +0 -408
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/regexp.h +0 -43
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/static_literals.h +0 -121
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_buffer.h +0 -236
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_char.h +0 -204
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_constant_pool.h +0 -218
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_integer.h +0 -130
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_list.h +0 -103
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_memchr.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_newline_list.h +0 -113
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_string.h +0 -200
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_strncasecmp.h +0 -32
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/util/pm_strpbrk.h +0 -46
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism/version.h +0 -29
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/prism_compile.h +0 -106
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ractor_core.h +0 -306
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ruby_assert.h +0 -14
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/ruby_atomic.h +0 -66
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/rubyparser.h +0 -1394
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/shape.h +0 -444
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/thread_none.h +0 -21
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/thread_pthread.h +0 -175
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/vm_core.h +0 -2350
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/vm_debug.h +0 -124
- data/lib/datadog/ruby_core_source/ruby-4.0.0-preview2/vm_opts.h +0 -67
- data/spec/datadog/ruby_core_source_spec.rb +0 -85
- data/spec/spec_helper.rb +0 -94
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
#ifndef RUBY_DEBUG_H
|
|
2
|
-
#define RUBY_DEBUG_H
|
|
3
|
-
/**********************************************************************
|
|
4
|
-
|
|
5
|
-
vm_debug.h - YARV Debug function interface
|
|
6
|
-
|
|
7
|
-
$Author$
|
|
8
|
-
created at: 04/08/25 02:33:49 JST
|
|
9
|
-
|
|
10
|
-
Copyright (C) 2004-2007 Koichi Sasada
|
|
11
|
-
|
|
12
|
-
**********************************************************************/
|
|
13
|
-
|
|
14
|
-
#include "ruby/ruby.h"
|
|
15
|
-
|
|
16
|
-
RUBY_SYMBOL_EXPORT_BEGIN
|
|
17
|
-
|
|
18
|
-
#define dpv(h,v) ruby_debug_print_value(-1, 0, (h), (v))
|
|
19
|
-
#define dp(v) ruby_debug_print_value(-1, 0, "", (v))
|
|
20
|
-
#define dpi(i) ruby_debug_print_id(-1, 0, "", (i))
|
|
21
|
-
#define dpn(n) ruby_debug_print_node(-1, 0, "", (n))
|
|
22
|
-
|
|
23
|
-
struct RNode;
|
|
24
|
-
|
|
25
|
-
VALUE ruby_debug_print_value(int level, int debug_level, const char *header, VALUE v);
|
|
26
|
-
void ruby_debug_print_v(VALUE v);
|
|
27
|
-
ID ruby_debug_print_id(int level, int debug_level, const char *header, ID id);
|
|
28
|
-
struct RNode *ruby_debug_print_node(int level, int debug_level, const char *header, const struct RNode *node);
|
|
29
|
-
void ruby_debug_print_n(const struct RNode *node);
|
|
30
|
-
int ruby_debug_print_indent(int level, int debug_level, int indent_level);
|
|
31
|
-
void ruby_debug_gc_check_func(void);
|
|
32
|
-
void ruby_set_debug_option(const char *str);
|
|
33
|
-
|
|
34
|
-
RUBY_SYMBOL_EXPORT_END
|
|
35
|
-
|
|
36
|
-
#ifndef USE_RUBY_DEBUG_LOG
|
|
37
|
-
#define USE_RUBY_DEBUG_LOG 0
|
|
38
|
-
#endif
|
|
39
|
-
|
|
40
|
-
/* RUBY_DEBUG_LOG: Logging debug information mechanism
|
|
41
|
-
*
|
|
42
|
-
* This feature provides a mechanism to store logging information
|
|
43
|
-
* to a file, stderr or memory space with simple macros.
|
|
44
|
-
*
|
|
45
|
-
* The following information will be stored.
|
|
46
|
-
* * (1) __FILE__, __LINE__ in C
|
|
47
|
-
* * (2) __FILE__, __LINE__ in Ruby
|
|
48
|
-
* * (3) __func__ in C (message title)
|
|
49
|
-
* * (4) given string with sprintf format
|
|
50
|
-
* * (5) Thread number (if multiple threads are running)
|
|
51
|
-
*
|
|
52
|
-
* This feature is enabled only USE_RUBY_DEBUG_LOG is enabled.
|
|
53
|
-
* Release version should not enable it.
|
|
54
|
-
*
|
|
55
|
-
* Running with the `RUBY_DEBUG_LOG` environment variable enables
|
|
56
|
-
* this feature.
|
|
57
|
-
*
|
|
58
|
-
* # logging into a file
|
|
59
|
-
* RUBY_DEBUG_LOG=/path/to/file STDERR
|
|
60
|
-
*
|
|
61
|
-
* # logging into STDERR
|
|
62
|
-
* RUBY_DEBUG_LOG=stderr
|
|
63
|
-
*
|
|
64
|
-
* # logging into memory space (check with a debugger)
|
|
65
|
-
* # It will help if the timing is important.
|
|
66
|
-
* RUBY_DEBUG_LOG=mem
|
|
67
|
-
*
|
|
68
|
-
* RUBY_DEBUG_LOG_FILTER environment variable can specify the filter string.
|
|
69
|
-
* If "(3) __func__ in C (message title)" contains the specified string, the
|
|
70
|
-
* information will be stored (example: RUBY_DEBUG_LOG_FILTER=str will enable
|
|
71
|
-
* only on str related information).
|
|
72
|
-
*
|
|
73
|
-
* In a MRI source code, you can use the following macros:
|
|
74
|
-
* * RUBY_DEBUG_LOG(fmt, ...): Above (1) to (4) will be logged.
|
|
75
|
-
* * RUBY_DEBUG_LOG2(file, line, fmt, ...):
|
|
76
|
-
* Same as RUBY_DEBUG_LOG(), but (1) will be replaced with given file, line.
|
|
77
|
-
*/
|
|
78
|
-
|
|
79
|
-
extern enum ruby_debug_log_mode {
|
|
80
|
-
ruby_debug_log_disabled = 0x00,
|
|
81
|
-
ruby_debug_log_memory = 0x01,
|
|
82
|
-
ruby_debug_log_stderr = 0x02,
|
|
83
|
-
ruby_debug_log_file = 0x04,
|
|
84
|
-
} ruby_debug_log_mode;
|
|
85
|
-
|
|
86
|
-
RBIMPL_ATTR_FORMAT(RBIMPL_PRINTF_FORMAT, 4, 5)
|
|
87
|
-
void ruby_debug_log(const char *file, int line, const char *func_name, const char *fmt, ...);
|
|
88
|
-
void ruby_debug_log_print(unsigned int n);
|
|
89
|
-
bool ruby_debug_log_filter(const char *func_name, const char *file_name);
|
|
90
|
-
|
|
91
|
-
#if RBIMPL_COMPILER_IS(GCC) && defined(__OPTIMIZE__)
|
|
92
|
-
# define ruby_debug_log(...) \
|
|
93
|
-
RB_GNUC_EXTENSION_BLOCK( \
|
|
94
|
-
RBIMPL_WARNING_PUSH(); \
|
|
95
|
-
RBIMPL_WARNING_IGNORED(-Wformat-zero-length); \
|
|
96
|
-
ruby_debug_log(__VA_ARGS__); \
|
|
97
|
-
RBIMPL_WARNING_POP())
|
|
98
|
-
#endif
|
|
99
|
-
|
|
100
|
-
// convenient macro to log even if the USE_RUBY_DEBUG_LOG macro is not specified.
|
|
101
|
-
// You can use this macro for temporary usage (you should not commit it).
|
|
102
|
-
#define _RUBY_DEBUG_LOG(...) ruby_debug_log(__FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__)
|
|
103
|
-
|
|
104
|
-
#if USE_RUBY_DEBUG_LOG
|
|
105
|
-
# define RUBY_DEBUG_LOG_ENABLED(func_name, file_name) \
|
|
106
|
-
(ruby_debug_log_mode && ruby_debug_log_filter(func_name, file_name))
|
|
107
|
-
|
|
108
|
-
#define RUBY_DEBUG_LOG(...) do { \
|
|
109
|
-
if (RUBY_DEBUG_LOG_ENABLED(RUBY_FUNCTION_NAME_STRING, __FILE__)) \
|
|
110
|
-
ruby_debug_log(__FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__); \
|
|
111
|
-
} while (0)
|
|
112
|
-
|
|
113
|
-
#define RUBY_DEBUG_LOG2(file, line, ...) do { \
|
|
114
|
-
if (RUBY_DEBUG_LOG_ENABLED(RUBY_FUNCTION_NAME_STRING, file)) \
|
|
115
|
-
ruby_debug_log(file, line, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__); \
|
|
116
|
-
} while (0)
|
|
117
|
-
|
|
118
|
-
#else // USE_RUBY_DEBUG_LOG
|
|
119
|
-
// do nothing
|
|
120
|
-
#define RUBY_DEBUG_LOG(...)
|
|
121
|
-
#define RUBY_DEBUG_LOG2(file, line, ...)
|
|
122
|
-
#endif // USE_RUBY_DEBUG_LOG
|
|
123
|
-
|
|
124
|
-
#endif /* RUBY_DEBUG_H */
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
#ifndef RUBY_VM_OPTS_H/*-*-c-*-*/
|
|
2
|
-
#define RUBY_VM_OPTS_H
|
|
3
|
-
/**********************************************************************
|
|
4
|
-
|
|
5
|
-
vm_opts.h - VM optimize option
|
|
6
|
-
|
|
7
|
-
$Author$
|
|
8
|
-
|
|
9
|
-
Copyright (C) 2004-2007 Koichi Sasada
|
|
10
|
-
|
|
11
|
-
**********************************************************************/
|
|
12
|
-
|
|
13
|
-
/* Compile options.
|
|
14
|
-
* You can change these options at runtime by VM::CompileOption.
|
|
15
|
-
* Following definitions are default values.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
#define OPT_TAILCALL_OPTIMIZATION 0
|
|
19
|
-
#define OPT_PEEPHOLE_OPTIMIZATION 1
|
|
20
|
-
#define OPT_SPECIALISED_INSTRUCTION 1
|
|
21
|
-
#define OPT_INLINE_CONST_CACHE 1
|
|
22
|
-
#define OPT_FROZEN_STRING_LITERAL -1
|
|
23
|
-
#define OPT_DEBUG_FROZEN_STRING_LITERAL 0
|
|
24
|
-
|
|
25
|
-
/* Build Options.
|
|
26
|
-
* You can't change these options at runtime.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/* C compiler dependent */
|
|
30
|
-
|
|
31
|
-
/*
|
|
32
|
-
* 0: direct (using labeled goto using GCC special)
|
|
33
|
-
* 1: token (switch/case)
|
|
34
|
-
* 2: call (function call for each insn dispatch)
|
|
35
|
-
*/
|
|
36
|
-
#ifndef OPT_THREADED_CODE
|
|
37
|
-
#define OPT_THREADED_CODE 0
|
|
38
|
-
#endif
|
|
39
|
-
|
|
40
|
-
#define OPT_DIRECT_THREADED_CODE (OPT_THREADED_CODE == 0)
|
|
41
|
-
#define OPT_TOKEN_THREADED_CODE (OPT_THREADED_CODE == 1)
|
|
42
|
-
#define OPT_CALL_THREADED_CODE (OPT_THREADED_CODE == 2)
|
|
43
|
-
|
|
44
|
-
/* VM running option */
|
|
45
|
-
#define OPT_CHECKED_RUN 1
|
|
46
|
-
#define OPT_INLINE_METHOD_CACHE 1
|
|
47
|
-
#define OPT_GLOBAL_METHOD_CACHE 1
|
|
48
|
-
|
|
49
|
-
#ifndef OPT_IC_FOR_IVAR
|
|
50
|
-
#define OPT_IC_FOR_IVAR 1
|
|
51
|
-
#endif
|
|
52
|
-
|
|
53
|
-
/* architecture independent, affects generated code */
|
|
54
|
-
#define OPT_OPERANDS_UNIFICATION 1
|
|
55
|
-
#define OPT_INSTRUCTIONS_UNIFICATION 0
|
|
56
|
-
#define OPT_UNIFY_ALL_COMBINATION 0
|
|
57
|
-
|
|
58
|
-
/* misc */
|
|
59
|
-
#ifndef OPT_SUPPORT_JOKE
|
|
60
|
-
#define OPT_SUPPORT_JOKE 0
|
|
61
|
-
#endif
|
|
62
|
-
|
|
63
|
-
#ifndef VM_COLLECT_USAGE_DETAILS
|
|
64
|
-
#define VM_COLLECT_USAGE_DETAILS 0
|
|
65
|
-
#endif
|
|
66
|
-
|
|
67
|
-
#endif /* RUBY_VM_OPTS_H */
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
require 'datadog/ruby_core_source'
|
|
3
|
-
|
|
4
|
-
RSpec.describe Datadog::RubyCoreSource do
|
|
5
|
-
describe '.deduce_packaged_source_dir' do
|
|
6
|
-
before do
|
|
7
|
-
stub_const('RUBY_VERSION', ruby_version)
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
context 'when a stable exact match exists' do
|
|
11
|
-
let(:ruby_version) { '3.4.0' }
|
|
12
|
-
let(:ruby_dir) { 'ruby-3.4.0-p0' }
|
|
13
|
-
|
|
14
|
-
it 'returns the exact match directory' do
|
|
15
|
-
result = described_class.deduce_packaged_source_dir(ruby_dir)
|
|
16
|
-
expect(result).to end_with("/#{ruby_dir}")
|
|
17
|
-
expect(File.directory?(result)).to be true
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
context 'when a preview exact match exists' do
|
|
22
|
-
let(:ruby_version) { '4.0.0' } # Important: "preview" label doesn't show up on RUBY_VERSION
|
|
23
|
-
let(:ruby_dir) { 'ruby-4.0.0-preview2' }
|
|
24
|
-
|
|
25
|
-
it 'returns the exact match directory' do
|
|
26
|
-
result = described_class.deduce_packaged_source_dir(ruby_dir)
|
|
27
|
-
expect(result).to end_with('/ruby-4.0.0-preview2')
|
|
28
|
-
expect(File.directory?(result)).to be true
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
context 'when exact match does not exist' do
|
|
33
|
-
context 'with a patch version upgrade and there are no preview headers' do
|
|
34
|
-
let(:ruby_version) { '3.4.1' }
|
|
35
|
-
let(:ruby_dir) { 'ruby-3.4.1-p0' }
|
|
36
|
-
|
|
37
|
-
it 'falls back to the closest older version' do
|
|
38
|
-
expect(described_class).to receive(:fallback_source_warning).with(ruby_dir, 'ruby-3.4.0-p0')
|
|
39
|
-
|
|
40
|
-
result = described_class.deduce_packaged_source_dir(ruby_dir)
|
|
41
|
-
expect(result).to end_with('/ruby-3.4.0-p0')
|
|
42
|
-
expect(File.directory?(result)).to be true
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
context 'with a patch version upgrade and there are preview headers' do
|
|
47
|
-
let(:ruby_version) { '4.0.1' }
|
|
48
|
-
let(:ruby_dir) { 'ruby-4.0.1-p0' }
|
|
49
|
-
|
|
50
|
-
it 'falls back to the closest older version' do
|
|
51
|
-
expect(described_class).to receive(:fallback_source_warning).with(ruby_dir, 'ruby-4.0.0-p0')
|
|
52
|
-
|
|
53
|
-
result = described_class.deduce_packaged_source_dir(ruby_dir)
|
|
54
|
-
expect(result).to end_with('/ruby-4.0.0-p0')
|
|
55
|
-
expect(File.directory?(result)).to be true
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
context 'with a preview version' do
|
|
60
|
-
let(:ruby_version) { '4.0.0' } # Important: "preview" label doesn't show up on RUBY_VERSION
|
|
61
|
-
let(:ruby_dir) { 'ruby-4.0.0-preview3' }
|
|
62
|
-
|
|
63
|
-
it 'falls back to the stable version' do
|
|
64
|
-
expect(described_class).to receive(:fallback_source_warning).with(ruby_dir, 'ruby-4.0.0-p0')
|
|
65
|
-
|
|
66
|
-
result = described_class.deduce_packaged_source_dir(ruby_dir)
|
|
67
|
-
expect(result).to end_with('/ruby-4.0.0-p0')
|
|
68
|
-
expect(File.directory?(result)).to be true
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
end
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
describe '.ruby_source_dir_version' do
|
|
75
|
-
it 'parses stable versions correctly' do
|
|
76
|
-
expect(described_class.ruby_source_dir_version('ruby-2.7.0-p0')).to eq(Gem::Version.new('2.7.0'))
|
|
77
|
-
expect(described_class.ruby_source_dir_version('ruby-3.4.1-p0')).to eq(Gem::Version.new('3.4.1'))
|
|
78
|
-
end
|
|
79
|
-
|
|
80
|
-
it 'parses preview/rc versions correctly' do
|
|
81
|
-
expect(described_class.ruby_source_dir_version('ruby-3.4.0-preview1')).to eq(Gem::Version.new('3.4.0.preview1'))
|
|
82
|
-
expect(described_class.ruby_source_dir_version('ruby-4.0.0-rc2')).to eq(Gem::Version.new('4.0.0.rc2'))
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
end
|
data/spec/spec_helper.rb
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
# This file was generated by the `rspec --init` command. Conventionally, all
|
|
2
|
-
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
|
3
|
-
# The generated `.rspec` file contains `--require spec_helper` which will cause
|
|
4
|
-
# this file to always be loaded, without a need to explicitly require it in any
|
|
5
|
-
# files.
|
|
6
|
-
#
|
|
7
|
-
# Given that it is always loaded, you are encouraged to keep this file as
|
|
8
|
-
# light-weight as possible. Requiring heavyweight dependencies from this file
|
|
9
|
-
# will add to the boot time of your test suite on EVERY test run, even for an
|
|
10
|
-
# individual file that may not need all of that loaded. Instead, consider making
|
|
11
|
-
# a separate helper file that requires the additional dependencies and performs
|
|
12
|
-
# the additional setup, and require it from the spec files that actually need
|
|
13
|
-
# it.
|
|
14
|
-
#
|
|
15
|
-
# See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
|
16
|
-
RSpec.configure do |config|
|
|
17
|
-
# rspec-expectations config goes here. You can use an alternate
|
|
18
|
-
# assertion/expectation library such as wrong or the stdlib/minitest
|
|
19
|
-
# assertions if you prefer.
|
|
20
|
-
config.expect_with :rspec do |expectations|
|
|
21
|
-
# This option will default to `true` in RSpec 4. It makes the `description`
|
|
22
|
-
# and `failure_message` of custom matchers include text for helper methods
|
|
23
|
-
# defined using `chain`, e.g.:
|
|
24
|
-
# be_bigger_than(2).and_smaller_than(4).description
|
|
25
|
-
# # => "be bigger than 2 and smaller than 4"
|
|
26
|
-
# ...rather than:
|
|
27
|
-
# # => "be bigger than 2"
|
|
28
|
-
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
# rspec-mocks config goes here. You can use an alternate test double
|
|
32
|
-
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
|
33
|
-
config.mock_with :rspec do |mocks|
|
|
34
|
-
# Prevents you from mocking or stubbing a method that does not exist on
|
|
35
|
-
# a real object. This is generally recommended, and will default to
|
|
36
|
-
# `true` in RSpec 4.
|
|
37
|
-
mocks.verify_partial_doubles = true
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
# This option will default to `:apply_to_host_groups` in RSpec 4 (and will
|
|
41
|
-
# have no way to turn it off -- the option exists only for backwards
|
|
42
|
-
# compatibility in RSpec 3). It causes shared context metadata to be
|
|
43
|
-
# inherited by the metadata hash of host groups and examples, rather than
|
|
44
|
-
# triggering implicit auto-inclusion in groups with matching metadata.
|
|
45
|
-
config.shared_context_metadata_behavior = :apply_to_host_groups
|
|
46
|
-
|
|
47
|
-
# This allows you to limit a spec run to individual examples or groups
|
|
48
|
-
# you care about by tagging them with `:focus` metadata. When nothing
|
|
49
|
-
# is tagged with `:focus`, all examples get run. RSpec also provides
|
|
50
|
-
# aliases for `it`, `describe`, and `context` that include `:focus`
|
|
51
|
-
# metadata: `fit`, `fdescribe` and `fcontext`, respectively.
|
|
52
|
-
config.filter_run_when_matching :focus
|
|
53
|
-
|
|
54
|
-
# Allows RSpec to persist some state between runs in order to support
|
|
55
|
-
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
|
56
|
-
# you configure your source control system to ignore this file.
|
|
57
|
-
config.example_status_persistence_file_path = "spec/examples.txt"
|
|
58
|
-
|
|
59
|
-
# Limits the available syntax to the non-monkey patched syntax that is
|
|
60
|
-
# recommended. For more details, see:
|
|
61
|
-
# https://rspec.info/features/3-12/rspec-core/configuration/zero-monkey-patching-mode/
|
|
62
|
-
config.disable_monkey_patching!
|
|
63
|
-
|
|
64
|
-
# This setting enables warnings. It's recommended, but in some cases may
|
|
65
|
-
# be too noisy due to issues in dependencies.
|
|
66
|
-
config.warnings = true
|
|
67
|
-
|
|
68
|
-
# Many RSpec users commonly either run the entire suite or an individual
|
|
69
|
-
# file, and it's useful to allow more verbose output when running an
|
|
70
|
-
# individual spec file.
|
|
71
|
-
if config.files_to_run.one?
|
|
72
|
-
# Use the documentation formatter for detailed output,
|
|
73
|
-
# unless a formatter has already been configured
|
|
74
|
-
# (e.g. via a command-line flag).
|
|
75
|
-
config.default_formatter = "doc"
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
# Print the 10 slowest examples and example groups at the
|
|
79
|
-
# end of the spec run, to help surface which specs are running
|
|
80
|
-
# particularly slow.
|
|
81
|
-
config.profile_examples = 1
|
|
82
|
-
|
|
83
|
-
# Run specs in random order to surface order dependencies. If you find an
|
|
84
|
-
# order dependency and want to debug it, you can fix the order by providing
|
|
85
|
-
# the seed, which is printed after each run.
|
|
86
|
-
# --seed 1234
|
|
87
|
-
config.order = :random
|
|
88
|
-
|
|
89
|
-
# Seed global randomization in this process using the `--seed` CLI option.
|
|
90
|
-
# Setting this allows you to use `--seed` to deterministically reproduce
|
|
91
|
-
# test failures related to randomization by passing the same `--seed` value
|
|
92
|
-
# as the one that triggered the failure.
|
|
93
|
-
Kernel.srand config.seed
|
|
94
|
-
end
|