mongory 2.0.0-x86_64-linux → 2.0.1-x86_64-linux

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7962701ff00626932360c9cc22319eb2e6d05eda1fecf03519ffdf71a95141b
4
- data.tar.gz: f3cd343120122c310f84d7721e5c2d2ad5549ae66dea51bda631627e2d7dc86b
3
+ metadata.gz: 38b0a037f33288ffb095a7461cb9409e4f9411a586fbbbf850abebaf86361ff6
4
+ data.tar.gz: 261250a90f30d4a2167eda54fa0ce5c5c7fa3b4bf643bb072f804edb249ba156
5
5
  SHA512:
6
- metadata.gz: bca990c63b9c2ee92106fa6748b521cf68f055b46561d673bd9f545c27ebfe4f93e3e786201496438673cdd8e4aca4a9d783f80a2af2af479922e5d5a91e5610
7
- data.tar.gz: 464df9807c24e8ab99025b1a4007e70a325f1d8cad35f307061ecb40532cbdc89ea44b6997ea6d55299f027c1ee998b1f300a45b9d65a78c284f20408c33ecf4
6
+ metadata.gz: df5258cd5e555e487e34dcc4b85e72ef266d6e4d40baec391bd0eaf39b9115c0c67f2cd5edc4b53f15b934a46deb86951710dc555e049b52b95095ddb541f14e
7
+ data.tar.gz: 765e7a8b488c5d050facd1d78a5c300c44705f7fd4c1fc137480c56c208556c3263a4e0a41c0dc13c7635cab5280318b7b5634314dd7bf6ca273f8507b25b0a7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.1] - 2026-11-22
4
+
5
+ Aligns with `mongory-core` `v0.3.0` and finishes v2.0.0 cleanup.
6
+
7
+ ### Fixes
8
+ - **C Extension (`rb_mongory_value.c`)**: Zero-initialize `rb_mongory_table_t` and `rb_mongory_array_t` lazy wrappers with OOM `NULL` guards and implement `.each` vtable methods (`rb_hash_foreach` / `RARRAY`) so every `mongory-core` container traversal contract is satisfied.
9
+
10
+ ### Cleanup
11
+ - Removed stateful `Matcher#enable_trace`, `#disable_trace`, `#print_trace`, and no-op `Matcher.trace_result_colorful=` (all tracing uses stateless, thread-safe `#trace` / `#trace_tree`).
12
+ - Removed remaining legacy Pure-Ruby dead code (`TreeRenderer.mark_skipped`, `Utils::Context#need_convert`, `QueryBuilder#fast`, and stale `cJSON` comments).
13
+ - Synced `ext/mongory_ext/mongory-core` submodule to `v0.3.0`.
14
+
3
15
  ## [2.0.0] - 2026-11-22
4
16
 
5
17
  Unifies `mongory-rb` on the `mongory-core` C99 native extension as the sole matching engine, eliminating Pure-Ruby dual-engine maintenance.
@@ -52,7 +52,7 @@ sudo yum groupinstall "Development Tools" || sudo dnf groupinstall "Development
52
52
  sudo yum install ruby-devel || sudo dnf install ruby-devel
53
53
  ```
54
54
 
55
- > Optional: CMake and cJSON are only needed if you want to run the core tests/benchmarks inside the `mongory-core` submodule (e.g., via CMake/ctest).
55
+ > Optional: CMake is only needed if you want to run the core C tests/benchmarks inside the `mongory-core` submodule (e.g., via CMake/ctest).
56
56
 
57
57
  ### 3. Build the project
58
58
 
@@ -97,7 +97,6 @@ If you prefer to control the build manually:
97
97
  git submodule update --init --recursive
98
98
 
99
99
  # 2. (Optional) Only needed if you run core tests/benchmarks inside the submodule
100
- # Note: This step requires cJSON; typical mongory-rb usage does not.
101
100
  # cd ext/mongory_ext/mongory-core
102
101
  # ./build.sh --test
103
102
  # cd ../../..
@@ -196,26 +195,14 @@ matcher.explain
196
195
  git submodule update --init --recursive
197
196
  ```
198
197
 
199
- **2. cJSON library not found (only required if you run mongory-core CMake tests)**
200
- ```bash
201
- # macOS
202
- brew install cjson
203
-
204
- # Ubuntu/Debian
205
- sudo apt install libcjson-dev
206
-
207
- # Verify installation
208
- pkg-config --exists libcjson && echo "Found" || echo "Not found"
209
- ```
210
-
211
- **3. Build errors**
198
+ **2. Build errors**
212
199
  ```bash
213
200
  # Clean and rebuild
214
201
  ./scripts/build_with_core.sh --clean
215
202
  ./scripts/build_with_core.sh --debug
216
203
  ```
217
204
 
218
- **4. C extension fails to load**
205
+ **3. C extension fails to load**
219
206
  - Check Ruby version compatibility (>= 2.6.0)
220
207
  - Ensure all system deps are installed
221
208
  - Inspect error messages and compiler warnings
@@ -281,8 +268,8 @@ jobs:
281
268
  run: bundle exec rspec
282
269
 
283
270
  # Only needed if you also run mongory-core C tests/benchmarks (optional):
284
- # - name: Install CMake & cJSON (only if running core tests)
285
- # run: sudo apt install -y cmake libcjson-dev
271
+ # - name: Install CMake (only if running core tests)
272
+ # run: sudo apt install -y cmake
286
273
  # - name: Build mongory-core tests (optional)
287
274
  # run: |
288
275
  # cd ext/mongory_ext/mongory-core
data/docs/clang_bridge.md CHANGED
@@ -49,12 +49,8 @@ records.select { |r| matcher.match?(r) }
49
49
 
50
50
  ```ruby
51
51
  matcher = Mongory::Matcher.new(:$or => [{ :name.regex => /^J/ }, { :age.gt => 20 }])
52
- matcher.enable_trace
53
- records.each { |r| matcher.match?(r) }
54
- matcher.print_trace # prints detailed trace
55
- matcher.disable_trace
56
52
 
57
- # Structured explain/trace trees on a single Matcher
53
+ # Structured explain/trace trees on a single Matcher (stateless & thread-safe)
58
54
  plan = matcher.explain_tree # => Hash ({ name:, condition:, priority:, children:, ... })
59
55
  tree = matcher.trace_tree(records.first) # => Hash ({ ..., record:, result: :pass | :fail | :skip })
60
56
 
@@ -120,22 +120,6 @@ end
120
120
  raise "count mismatch" if builder.count != count_of_complex_query
121
121
  end
122
122
 
123
- # Complex query (Mongory) test
124
- puts "\nComplex query (Mongory) fast mode (#{size} records):"
125
- gc_handler do
126
- builder = records.mongory.or(
127
- { :age.gte => 18 },
128
- { status: 'active' }
129
- ).fast
130
- 5.times do
131
- result = Benchmark.measure do
132
- builder.to_a
133
- end
134
- puts result
135
- end
136
- raise "count mismatch" if builder.count != count_of_complex_query
137
- end
138
-
139
123
  puts "\nComplex query (Mongory) use Matcher (#{size} records):"
140
124
  gc_handler do
141
125
  matcher = Mongory::Matcher.new({
@@ -17,7 +17,7 @@ unless Dir.exist?(core_dir)
17
17
  exit 1
18
18
  end
19
19
 
20
- # mongory-rb does not require cJSON; only mongory-core's tests use it, so we don't check cJSON here
20
+ # mongory-core itself has zero third-party C library dependencies; extconf.rb compiles it directly
21
21
 
22
22
  # Normalize compiler flags across GCC/Clang on CI (Ruby 2.6 on Ubuntu may inject clang-only warn flags)
23
23
  def scrub_flags_from_config!(keys, patterns)
@@ -28,7 +28,6 @@ typedef struct rb_mongory_matcher_t {
28
28
  mongory_value *condition;
29
29
  mongory_memory_pool *pool;
30
30
  rb_mongory_memory_pool_t *scratch_free_list;
31
- mongory_memory_pool *trace_pool;
32
31
  mongory_table *string_map;
33
32
  mongory_table *symbol_map;
34
33
  mongory_array *mark_list;
@@ -31,10 +31,6 @@ static void rb_mongory_matcher_release_pools(rb_mongory_matcher_t *wrapper) {
31
31
  scratch->next_scratch = NULL;
32
32
  scratch->base.free(&scratch->base);
33
33
  }
34
- if (wrapper->trace_pool) {
35
- wrapper->trace_pool->free(wrapper->trace_pool);
36
- wrapper->trace_pool = NULL;
37
- }
38
34
  wrapper->matcher = NULL;
39
35
  wrapper->condition = NULL;
40
36
  wrapper->string_map = NULL;
@@ -216,7 +212,6 @@ static VALUE rb_mongory_matcher_match_body(VALUE arg) {
216
212
  rb_mongory_matcher_t *self_wrapper = call->wrapper;
217
213
  mongory_matcher *matcher = self_wrapper->matcher;
218
214
  mongory_memory_pool *scratch_pool = call->scratch_pool;
219
- mongory_memory_pool *trace_pool = self_wrapper->trace_pool;
220
215
  mongory_value *data_value = rb_to_mongory_value_shallow(scratch_pool, call->data);
221
216
 
222
217
  if (rb_mongory_error_handling(scratch_pool, "Match failed")) {
@@ -224,13 +219,6 @@ static VALUE rb_mongory_matcher_match_body(VALUE arg) {
224
219
  }
225
220
 
226
221
  bool result = mongory_matcher_match(matcher, data_value);
227
-
228
- if (trace_pool) {
229
- mongory_matcher_print_trace(matcher);
230
- trace_pool->reset(trace_pool);
231
- mongory_matcher_enable_trace(matcher, trace_pool);
232
- }
233
-
234
222
  return result ? Qtrue : Qfalse;
235
223
  }
236
224
 
@@ -422,62 +410,6 @@ static VALUE rb_mongory_matcher_trace(VALUE self, VALUE data) {
422
410
  return res == ID2SYM(rb_intern("pass")) ? Qtrue : Qfalse;
423
411
  }
424
412
 
425
- // Mongory::Matcher#enable_trace
426
- static VALUE rb_mongory_matcher_enable_trace(VALUE self) {
427
- rb_mongory_matcher_t *wrapper = get_initialized_matcher(self);
428
- if (wrapper->trace_pool) {
429
- wrapper->trace_pool->free(wrapper->trace_pool);
430
- wrapper->trace_pool = NULL;
431
- }
432
- rb_mongory_memory_pool_t *trace_pool = rb_mongory_memory_pool_new();
433
- trace_pool->owner = wrapper;
434
- mongory_memory_pool *trace_pool_base = &trace_pool->base;
435
- mongory_matcher_enable_trace(wrapper->matcher, trace_pool_base);
436
-
437
- if (trace_pool_base->error) {
438
- char err_msg[256];
439
- snprintf(err_msg, sizeof(err_msg), "%s",
440
- trace_pool_base->error->message ? trace_pool_base->error->message : "Unknown error");
441
- trace_pool_base->free(trace_pool_base);
442
- rb_raise(rb_mongory_e_type_error, "Enable trace failed: %s", err_msg);
443
- }
444
- wrapper->trace_pool = trace_pool_base;
445
-
446
- return Qnil;
447
- }
448
-
449
- // Mongory::Matcher#disable_trace
450
- static VALUE rb_mongory_matcher_disable_trace(VALUE self) {
451
- rb_mongory_matcher_t *wrapper = get_initialized_matcher(self);
452
- mongory_memory_pool *trace_pool = wrapper->trace_pool;
453
- mongory_matcher_disable_trace(wrapper->matcher);
454
- if (trace_pool) {
455
- wrapper->trace_pool = NULL;
456
- if (trace_pool->error) {
457
- char err_msg[256];
458
- snprintf(err_msg, sizeof(err_msg), "%s",
459
- trace_pool->error->message ? trace_pool->error->message : "Unknown error");
460
- trace_pool->free(trace_pool);
461
- rb_raise(rb_mongory_e_type_error, "Disable trace failed: %s", err_msg);
462
- }
463
- trace_pool->free(trace_pool);
464
- }
465
-
466
- return Qnil;
467
- }
468
-
469
- // Mongory::Matcher#print_trace
470
- static VALUE rb_mongory_matcher_print_trace(VALUE self) {
471
- rb_mongory_matcher_t *wrapper = get_initialized_matcher(self);
472
- if (!wrapper->trace_pool) {
473
- return Qnil;
474
- }
475
- mongory_matcher_print_trace(wrapper->matcher);
476
- rb_mongory_error_handling(wrapper->trace_pool, "Print trace failed");
477
-
478
- return Qnil;
479
- }
480
-
481
413
  // Mongory::Matcher#condition
482
414
  static VALUE rb_mongory_matcher_condition(VALUE self) {
483
415
  rb_mongory_matcher_t *wrapper = get_initialized_matcher(self);
@@ -492,21 +424,12 @@ static VALUE rb_mongory_matcher_context(VALUE self) {
492
424
  return wrapper->ctx ? wrapper->ctx : Qnil;
493
425
  }
494
426
 
495
- // Mongory::Matcher.trace_result_colorful=(colorful)
496
- static VALUE rb_mongory_matcher_trace_result_colorful(VALUE self, VALUE colorful) {
497
- (void)self;
498
- mongory_matcher_trace_result_colorful_set(RTEST(colorful));
499
-
500
- return Qnil;
501
- }
502
-
503
427
  void rb_mongory_init_matcher(void) {
504
428
  rb_mongory_c_matcher = rb_define_class_under(rb_mongory_m_mongory, "Matcher", rb_cObject);
505
429
  rb_define_alloc_func(rb_mongory_c_matcher, rb_mongory_matcher_alloc);
506
430
 
507
431
  rb_define_method(rb_mongory_c_matcher, "initialize", rb_mongory_matcher_initialize, -1);
508
432
  rb_define_method(rb_mongory_c_matcher, "initialize_copy", rb_mongory_matcher_initialize_copy, 1);
509
- rb_define_singleton_method(rb_mongory_c_matcher, "trace_result_colorful=", rb_mongory_matcher_trace_result_colorful, 1);
510
433
  rb_define_method(rb_mongory_c_matcher, "match?", rb_mongory_matcher_match, 1);
511
434
  rb_define_method(rb_mongory_c_matcher, "explain_tree", rb_mongory_matcher_explain_tree, 0);
512
435
  rb_define_method(rb_mongory_c_matcher, "explain", rb_mongory_matcher_explain, 0);
@@ -514,7 +437,4 @@ void rb_mongory_init_matcher(void) {
514
437
  rb_define_method(rb_mongory_c_matcher, "context", rb_mongory_matcher_context, 0);
515
438
  rb_define_method(rb_mongory_c_matcher, "trace_tree", rb_mongory_matcher_trace_tree, 1);
516
439
  rb_define_method(rb_mongory_c_matcher, "trace", rb_mongory_matcher_trace, 1);
517
- rb_define_method(rb_mongory_c_matcher, "enable_trace", rb_mongory_matcher_enable_trace, 0);
518
- rb_define_method(rb_mongory_c_matcher, "disable_trace", rb_mongory_matcher_disable_trace, 0);
519
- rb_define_method(rb_mongory_c_matcher, "print_trace", rb_mongory_matcher_print_trace, 0);
520
440
  }
@@ -181,15 +181,61 @@ static mongory_value *rb_mongory_table_get(mongory_table *self, char *key) {
181
181
  return rb_to_mongory_value_shallow(table->base.pool, rb_value);
182
182
  }
183
183
 
184
+ typedef struct {
185
+ mongory_memory_pool *pool;
186
+ void *acc;
187
+ mongory_table_each_pair_callback_func callback;
188
+ bool completed;
189
+ } rb_table_each_ctx_t;
190
+
191
+ static int rb_mongory_table_each_cb(VALUE key, VALUE val, VALUE arg) {
192
+ rb_table_each_ctx_t *ctx = (rb_table_each_ctx_t *)arg;
193
+ const char *key_cstr;
194
+ if (RB_TYPE_P(key, T_SYMBOL)) {
195
+ key_cstr = rb_id2name(rb_sym2id(key));
196
+ } else if (RB_TYPE_P(key, T_STRING)) {
197
+ key_cstr = StringValueCStr(key);
198
+ } else {
199
+ VALUE key_str = rb_funcall(key, rb_intern("to_s"), 0);
200
+ key_cstr = StringValueCStr(key_str);
201
+ }
202
+ mongory_value *mg_val = rb_to_mongory_value_shallow(ctx->pool, val);
203
+ if (!ctx->callback((char *)key_cstr, mg_val, ctx->acc)) {
204
+ ctx->completed = false;
205
+ return ST_STOP;
206
+ }
207
+ return ST_CONTINUE;
208
+ }
209
+
210
+ static bool rb_mongory_table_each(mongory_table *self, void *acc, mongory_table_each_pair_callback_func callback) {
211
+ rb_mongory_table_t *table = (rb_mongory_table_t *)self;
212
+ rb_table_each_ctx_t ctx = {
213
+ .pool = self->pool,
214
+ .acc = acc,
215
+ .callback = callback,
216
+ .completed = true,
217
+ };
218
+ rb_hash_foreach(table->rb_hash, rb_mongory_table_each_cb, (VALUE)&ctx);
219
+ return ctx.completed;
220
+ }
221
+
184
222
  mongory_value *rb_mongory_table_wrap(mongory_memory_pool *pool, VALUE rb_hash) {
185
223
  rb_mongory_table_t *table = MG_ALLOC_PTR(pool, rb_mongory_table_t);
224
+ if (!table) {
225
+ return NULL;
226
+ }
227
+ memset(table, 0, sizeof(rb_mongory_table_t));
186
228
  rb_mongory_memory_pool_t *rb_pool = (rb_mongory_memory_pool_t *)pool;
187
229
  table->base.pool = pool;
188
230
  table->base.get = rb_mongory_table_get;
231
+ table->base.each = rb_mongory_table_each;
189
232
  table->rb_hash = rb_hash;
190
233
  table->base.count = RHASH_SIZE(rb_hash);
191
234
  table->owner = rb_pool->owner;
192
235
  mongory_value *mg_value = mongory_value_wrap_t(pool, &table->base);
236
+ if (!mg_value) {
237
+ return NULL;
238
+ }
193
239
  mg_value->origin = (void *)rb_hash;
194
240
  mg_value->to_str = rb_mongory_value_to_cstr;
195
241
  return mg_value;
@@ -205,15 +251,36 @@ static mongory_value *rb_mongory_array_get(mongory_array *self, size_t index) {
205
251
  return rb_to_mongory_value_shallow(self->pool, rb_value);
206
252
  }
207
253
 
254
+ static bool rb_mongory_array_each(mongory_array *self, void *acc, mongory_array_callback_func callback) {
255
+ rb_mongory_array_t *array = (rb_mongory_array_t *)self;
256
+ VALUE rb_array = array->rb_array;
257
+ long len = RARRAY_LEN(rb_array);
258
+ for (long i = 0; i < len; i++) {
259
+ mongory_value *mg_val = rb_to_mongory_value_shallow(self->pool, rb_ary_entry(rb_array, i));
260
+ if (!callback(mg_val, acc)) {
261
+ return false;
262
+ }
263
+ }
264
+ return true;
265
+ }
266
+
208
267
  mongory_value *rb_mongory_array_wrap(mongory_memory_pool *pool, VALUE rb_array) {
209
268
  rb_mongory_array_t *array = MG_ALLOC_PTR(pool, rb_mongory_array_t);
269
+ if (!array) {
270
+ return NULL;
271
+ }
272
+ memset(array, 0, sizeof(rb_mongory_array_t));
210
273
  rb_mongory_memory_pool_t *rb_pool = (rb_mongory_memory_pool_t *)pool;
211
274
  array->base.pool = pool;
212
275
  array->base.get = rb_mongory_array_get;
276
+ array->base.each = rb_mongory_array_each;
213
277
  array->rb_array = rb_array;
214
278
  array->base.count = RARRAY_LEN(rb_array);
215
279
  array->owner = rb_pool->owner;
216
280
  mongory_value *mg_value = mongory_value_wrap_a(pool, &array->base);
281
+ if (!mg_value) {
282
+ return NULL;
283
+ }
217
284
  mg_value->origin = (void *)rb_array;
218
285
  mg_value->to_str = rb_mongory_value_to_cstr;
219
286
  return mg_value;
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -5,7 +5,7 @@ module Mongory
5
5
  # ConditionConverter transforms a flat condition hash into nested hash form.
6
6
  # This is used internally by ValueConverter to normalize condition structures
7
7
  # like { "foo.bar" => 1, "foo.baz" => 2 } into nested Mongo-style conditions.
8
- # Used by QueryMatcher to normalize condition input for internal matching.
8
+ # Used by Matcher to normalize condition input for internal matching.
9
9
  #
10
10
  # Combines key transformation (via KeyConverter) and
11
11
  # value normalization (via ValueConverter), and merges overlapping keys.
@@ -14,10 +14,6 @@ module Mongory
14
14
  # @param context [Utils::Context] optional query context
15
15
  # @return [Mongory::Matcher] a new matcher
16
16
  # @note This method is implemented in the C extension
17
- # @!method self.trace_result_colorful=(colorful)
18
- # @param colorful [Boolean] whether to enable colorful trace result
19
- # @return [void]
20
- # @note This method is implemented in the C extension
21
17
  #
22
18
  # @!method match?(record)
23
19
  # @param record [Object] the record to match against
@@ -39,15 +35,6 @@ module Mongory
39
35
  # @return [Boolean] true if the record matches the condition, false otherwise
40
36
  # @note Prints the matching process to STDOUT
41
37
  # @note This method is implemented in the C extension
42
- # @!method enable_trace
43
- # @return [void]
44
- # @note This method is implemented in the C extension
45
- # @!method disable_trace
46
- # @return [void]
47
- # @note This method is implemented in the C extension
48
- # @!method print_trace
49
- # @return [void]
50
- # @note This method is implemented in the C extension
51
38
  # @!method condition
52
39
  # @return [Hash] the normalized condition
53
40
  # @note This method is implemented in the C extension
@@ -49,8 +49,6 @@ module Mongory
49
49
  end
50
50
  end
51
51
 
52
- alias_method :fast, :each
53
-
54
52
  # Traces matcher evaluation for all records and returns an Array of structured trace tree Hashes.
55
53
  # If a block is given, matched records are also yielded.
56
54
  #
@@ -193,7 +191,7 @@ module Mongory
193
191
  # @return [QueryBuilder] A new query builder instance with merged context
194
192
  # @note Creates a new query builder with the current matcher's condition and merged context
195
193
  # @example
196
- # query.with_context(need_convert: false) #=> Returns a new query builder with conversion disabled
194
+ # query.with_context(tenant: current_tenant) #=> Returns a new query builder with merged context
197
195
  def with_context(addon_context = {})
198
196
  dup_instance_exec do
199
197
  @context = @context.dup
@@ -2,35 +2,31 @@
2
2
 
3
3
  module Mongory
4
4
  module Utils
5
- # Context is a utility class that provides a stable but mutatable
6
- # shared context for the Mongory query builder. It holds the configuration
7
- # and the current record being matcher tree processed.
5
+ # Context is a utility class that provides a stable, mutable shared context
6
+ # for the Mongory query builder and custom matchers. It holds user-defined
7
+ # configuration and the current record being processed.
8
8
  #
9
9
  # @example
10
- # context = Mongory::Utils::Context.new(config)
10
+ # context = Mongory::Utils::Context.new(tenant: current_tenant)
11
11
  # context.current_record = record
12
- # context.config = new_config
13
12
  #
14
- # @attr [Config] config The configuration object for the context
15
- # @attr [Record] current_record The current record being processed in the matcher tree
16
- # @attr [Boolean] need_convert Whether the record needs to be converted before matching
13
+ # @attr [Hash] config The configuration hash for the context
14
+ # @attr [Object] current_record The current record being processed
17
15
  class Context
18
- attr_accessor :config, :current_record, :need_convert
16
+ attr_accessor :config, :current_record
19
17
 
20
18
  # Initializes a new Context instance with the given configuration.
21
19
  #
22
- # @param config [Config] The configuration object for the context.
20
+ # @param config [Hash] The configuration hash for the context.
23
21
  # @return [Context] A new Context instance.
24
22
  def initialize(config = {})
25
23
  @config = config
26
24
  @current_record = nil
27
- @need_convert = true
28
25
  end
29
26
 
30
- # Creates a duplicate of the context with its own configuration.
27
+ # Creates a duplicate of the context with its own configuration hash.
31
28
  #
32
29
  # @return [Context] A new context instance with duplicated configuration
33
- # @note The new context shares the same configuration object but has its own state
34
30
  def dup
35
31
  new_context = super
36
32
  new_context.config = @config.dup
@@ -39,8 +35,7 @@ module Mongory
39
35
 
40
36
  def to_hash
41
37
  {
42
- config: @config,
43
- need_convert: @need_convert
38
+ config: @config
44
39
  }
45
40
  end
46
41
  end
@@ -18,16 +18,6 @@ module Mongory
18
18
 
19
19
  module_function
20
20
 
21
- # Recursively marks an explain_tree node and all descendants with `result: :skip`.
22
- #
23
- # @param node [Hash] structured explain_tree node
24
- # @return [Hash] structured trace_tree node with `result: :skip`
25
- def mark_skipped(node)
26
- skipped = node.merge(result: :skip)
27
- skipped[:children] = (node[:children] || []).map { |child| mark_skipped(child) }
28
- skipped
29
- end
30
-
31
21
  # Prints a structured explain_tree Hash to STDOUT.
32
22
  #
33
23
  # @param node [Hash] root explain_tree node
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mongory
4
- VERSION = '2.0.0'
4
+ VERSION = '2.0.1'
5
5
  end
@@ -99,7 +99,6 @@ init_submodules() {
99
99
  # Function to build mongory-core if needed
100
100
  build_core() {
101
101
  # mongory-rb 直接由 extconf.rb 編譯 mongory-core 的源碼,不需要獨立建置靜態庫
102
- # 同時避免觸發 mongory-core 的 CMake(其需要 cJSON 僅用於測試)
103
102
  log $YELLOW "Skipping mongory-core standalone build (not required for mongory-rb)"
104
103
  }
105
104
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongory
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - koten0224
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-21 00:00:00.000000000 Z
11
+ date: 2026-11-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A Mongo-like in-memory query DSL for Ruby
14
14
  email: