datadog-ruby_core_source 3.5.0 → 3.5.1

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: f1d89e58df1d0a5264e3e88f624b7834cba980d62d2f7adf78015a0b73fe439c
4
- data.tar.gz: 5c9a24d20414775c879b62d03e37b0aa4b5a7d93ad943894c9d8f3b49472b80e
3
+ metadata.gz: 516e509afa1920fd3ed7cf382e06006d2ce680e00ba16ecd1a39f7f2dc417dbe
4
+ data.tar.gz: 87af7c48459a9d8d45d99ab063329352a529f5089cab54afff9c4dd34c03a182
5
5
  SHA512:
6
- metadata.gz: ec54a6bf9b7d188300dd61cdf0c80b6390bbdc7a8550a189725ffebb0426aad3860d8c9d8431449b25411ea5cbc307ef6c005d1c0c8c0165f6eccef82d6dd1db
7
- data.tar.gz: ead80b734e3eb351fbe1cd5e74b68e0034368fe2a2f1ecdee0817a38b8fef2d10de45e185465f8e283a40ee0d130c1dac66897a701d67c505021ff8528072091
6
+ metadata.gz: 3bf0c620ee078694ac52f390f7cd40e0408c19ce4b751c7383c74750152bd887baa461bf8df3ac837555150b67bf33b4466f06cb3718116a3c60063a389584a8
7
+ data.tar.gz: 810028e9bcdec7d9696acd62d16b1156e54ce68fd15e41f6461d46e30b47996067fd13d458ded3ad884b4880fb0bce480fb7f4805599bf6b6d3f3ed8e145efdc
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
@@ -1,5 +1,5 @@
1
1
  module Datadog
2
2
  module RubyCoreSource
3
- VERSION = '3.5.0'
3
+ VERSION = '3.5.1'
4
4
  end
5
5
  end
@@ -70,7 +70,14 @@ module Datadog
70
70
 
71
71
  def self.ruby_source_dir_version(dir)
72
72
  match = /ruby-([0-9\.]+)-((p|rc|preview)[0-9]+)\z/.match(dir)
73
- Gem::Version.new("#{match[1]}.#{match[2]}")
73
+
74
+ # Strip the `pN` suffix if it's a stable version; this ensures that it's treated correctly by the version sorting,
75
+ # otherwise for instance `4.0.0.preview2` > `4.0.0.p0` as far as `Gem::Version is concerned`
76
+ if match[2].match?(/p[0-9]+/)
77
+ Gem::Version.new("#{match[1]}")
78
+ else
79
+ Gem::Version.new("#{match[1]}.#{match[2]}")
80
+ end
74
81
  end
75
82
 
76
83
  def self.fallback_source_warning(ruby_version, fallback_version)
@@ -0,0 +1,85 @@
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
@@ -0,0 +1,94 @@
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datadog-ruby_core_source
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.0
4
+ version: 3.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Moseley
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2026-01-08 00:00:00.000000000 Z
14
+ date: 2026-01-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: archive-tar-minitar
@@ -62,6 +62,7 @@ extensions: []
62
62
  extra_rdoc_files:
63
63
  - README.md
64
64
  files:
65
+ - ".rspec"
65
66
  - LEGAL
66
67
  - LICENSE.txt
67
68
  - README.md
@@ -636,6 +637,8 @@ files:
636
637
  - lib/datadog/ruby_core_source/ruby-4.0.0-preview2/vm_debug.h
637
638
  - lib/datadog/ruby_core_source/ruby-4.0.0-preview2/vm_opts.h
638
639
  - lib/datadog/ruby_core_source/version.rb
640
+ - spec/datadog/ruby_core_source_spec.rb
641
+ - spec/spec_helper.rb
639
642
  homepage: https://github.com/DataDog/datadog-ruby_core_source
640
643
  licenses:
641
644
  - MIT