mongoid 9.0.0 → 9.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/Rakefile +44 -21
  4. data/lib/config/locales/en.yml +4 -0
  5. data/lib/mongoid/atomic_update_preparer.rb +7 -6
  6. data/lib/mongoid/config.rb +9 -0
  7. data/lib/mongoid/contextual/aggregable/memory.rb +3 -2
  8. data/lib/mongoid/contextual/aggregable/mongo.rb +5 -2
  9. data/lib/mongoid/criteria/findable.rb +2 -2
  10. data/lib/mongoid/criteria/queryable/extensions/numeric.rb +15 -1
  11. data/lib/mongoid/errors/invalid_around_callback.rb +16 -0
  12. data/lib/mongoid/errors.rb +1 -0
  13. data/lib/mongoid/fields.rb +13 -7
  14. data/lib/mongoid/interceptable.rb +18 -13
  15. data/lib/mongoid/scopable.rb +7 -1
  16. data/lib/mongoid/touchable.rb +1 -7
  17. data/lib/mongoid/version.rb +1 -1
  18. data/spec/mongoid/association_spec.rb +14 -0
  19. data/spec/mongoid/attributes_spec.rb +16 -0
  20. data/spec/mongoid/contextual/aggregable/memory_spec.rb +11 -0
  21. data/spec/mongoid/contextual/aggregable/mongo_spec.rb +11 -0
  22. data/spec/mongoid/contextual/mongo_spec.rb +72 -3
  23. data/spec/mongoid/fields_spec.rb +2 -2
  24. data/spec/mongoid/interceptable_spec.rb +31 -0
  25. data/spec/mongoid/scopable_spec.rb +88 -85
  26. data/spec/mongoid/touchable_spec.rb +75 -0
  27. data/spec/mongoid/touchable_spec_models.rb +16 -0
  28. data/spec/support/models/band.rb +1 -0
  29. data/spec/support/models/lat_lng.rb +6 -0
  30. metadata +8 -80
  31. checksums.yaml.gz.sig +0 -1
  32. data/spec/shared/LICENSE +0 -20
  33. data/spec/shared/bin/get-mongodb-download-url +0 -17
  34. data/spec/shared/bin/s3-copy +0 -45
  35. data/spec/shared/bin/s3-upload +0 -69
  36. data/spec/shared/lib/mrss/child_process_helper.rb +0 -80
  37. data/spec/shared/lib/mrss/cluster_config.rb +0 -231
  38. data/spec/shared/lib/mrss/constraints.rb +0 -378
  39. data/spec/shared/lib/mrss/docker_runner.rb +0 -298
  40. data/spec/shared/lib/mrss/eg_config_utils.rb +0 -51
  41. data/spec/shared/lib/mrss/event_subscriber.rb +0 -210
  42. data/spec/shared/lib/mrss/lite_constraints.rb +0 -238
  43. data/spec/shared/lib/mrss/server_version_registry.rb +0 -113
  44. data/spec/shared/lib/mrss/session_registry.rb +0 -69
  45. data/spec/shared/lib/mrss/session_registry_legacy.rb +0 -60
  46. data/spec/shared/lib/mrss/spec_organizer.rb +0 -179
  47. data/spec/shared/lib/mrss/utils.rb +0 -37
  48. data/spec/shared/share/Dockerfile.erb +0 -281
  49. data/spec/shared/share/haproxy-1.conf +0 -16
  50. data/spec/shared/share/haproxy-2.conf +0 -17
  51. data/spec/shared/shlib/config.sh +0 -27
  52. data/spec/shared/shlib/distro.sh +0 -74
  53. data/spec/shared/shlib/server.sh +0 -417
  54. data/spec/shared/shlib/set_env.sh +0 -146
  55. data.tar.gz.sig +0 -0
  56. metadata.gz.sig +0 -1
@@ -2594,4 +2594,35 @@ describe Mongoid::Interceptable do
2594
2594
  end
2595
2595
  end
2596
2596
  end
2597
+
2598
+ context "when around callbacks for embedded children are enabled" do
2599
+ config_override :around_callbacks_for_embeds, true
2600
+
2601
+ context "when around callback is defined without a yield" do
2602
+ class Mother
2603
+ include Mongoid::Document
2604
+ embeds_many :daughters, cascade_callbacks: true
2605
+ end
2606
+
2607
+ class Daughter
2608
+ include Mongoid::Document
2609
+ embedded_in :mother
2610
+ around_save :log_callback
2611
+
2612
+ private
2613
+
2614
+ def log_callback
2615
+ logger.debug('callback invoked')
2616
+ end
2617
+ end
2618
+
2619
+ let(:mom) { Mother.create(daughters: [ Daughter.new, Daughter.new ]) }
2620
+
2621
+ it "raises an InvalidAroundCallback error" do
2622
+ expect do
2623
+ mom.save
2624
+ end.to raise_error(Mongoid::Errors::InvalidAroundCallback)
2625
+ end
2626
+ end
2627
+ end
2597
2628
  end
@@ -3,6 +3,19 @@
3
3
 
4
4
  require "spec_helper"
5
5
 
6
+ # Retrieve the singleton class for the given class.
7
+ def singleton_class_for(klass)
8
+ class <<klass; self; end
9
+ end
10
+
11
+ # Helper method for removing a declared scope
12
+ def remove_scope(klass, scope)
13
+ if klass._declared_scopes[scope]
14
+ singleton_class_for(klass).remove_method(scope)
15
+ klass._declared_scopes.delete(scope)
16
+ end
17
+ end
18
+
6
19
  describe Mongoid::Scopable do
7
20
 
8
21
  describe ".default_scope" do
@@ -349,6 +362,10 @@ describe Mongoid::Scopable do
349
362
  Band.create!(name: 'testing')
350
363
  end
351
364
 
365
+ after do
366
+ remove_scope(Band, :tests)
367
+ end
368
+
352
369
  it 'applies the collation' do
353
370
  expect(Band.tests.first['name']).to eq('testing')
354
371
  end
@@ -365,10 +382,7 @@ describe Mongoid::Scopable do
365
382
  end
366
383
 
367
384
  after do
368
- class << Band
369
- undef_method :active
370
- end
371
- Band._declared_scopes.clear
385
+ remove_scope(Band, :active)
372
386
  end
373
387
 
374
388
  let(:scope) do
@@ -390,10 +404,7 @@ describe Mongoid::Scopable do
390
404
  end
391
405
 
392
406
  after do
393
- class << Record
394
- undef_method :tool
395
- end
396
- Record._declared_scopes.clear
407
+ remove_scope(Record, :tool)
397
408
  end
398
409
 
399
410
  context "when calling the scope" do
@@ -423,10 +434,7 @@ describe Mongoid::Scopable do
423
434
  end
424
435
 
425
436
  after do
426
- class << Band
427
- undef_method :active
428
- end
429
- Band._declared_scopes.clear
437
+ remove_scope(Band, :active)
430
438
  end
431
439
 
432
440
  it "adds a method for the scope" do
@@ -461,10 +469,7 @@ describe Mongoid::Scopable do
461
469
  end
462
470
 
463
471
  after do
464
- class << Band
465
- undef_method :english
466
- end
467
- Band._declared_scopes.clear
472
+ remove_scope(Band, :english)
468
473
  end
469
474
 
470
475
  let(:scope) do
@@ -527,10 +532,7 @@ describe Mongoid::Scopable do
527
532
  config_override :scope_overwrite_exception, true
528
533
 
529
534
  after do
530
- class << Band
531
- undef_method :active
532
- end
533
- Band._declared_scopes.clear
535
+ remove_scope(Band, :active)
534
536
  end
535
537
 
536
538
  it "raises an exception" do
@@ -545,10 +547,7 @@ describe Mongoid::Scopable do
545
547
  config_override :scope_overwrite_exception, false
546
548
 
547
549
  after do
548
- class << Band
549
- undef_method :active
550
- end
551
- Band._declared_scopes.clear
550
+ remove_scope(Band, :active)
552
551
  end
553
552
 
554
553
  it "raises no exception" do
@@ -589,10 +588,7 @@ describe Mongoid::Scopable do
589
588
  end
590
589
 
591
590
  after do
592
- class << Band
593
- undef_method :active
594
- end
595
- Band._declared_scopes.clear
591
+ remove_scope(Band, :active)
596
592
  end
597
593
 
598
594
  let(:scope) do
@@ -652,11 +648,8 @@ describe Mongoid::Scopable do
652
648
  end
653
649
 
654
650
  after do
655
- class << Band
656
- undef_method :active
657
- undef_method :named_by
658
- end
659
- Band._declared_scopes.clear
651
+ remove_scope(Band, :active)
652
+ remove_scope(Band, :named_by)
660
653
  end
661
654
 
662
655
  it "adds a method for the scope" do
@@ -698,10 +691,7 @@ describe Mongoid::Scopable do
698
691
  end
699
692
 
700
693
  after do
701
- class << Band
702
- undef_method :english
703
- end
704
- Band._declared_scopes.clear
694
+ remove_scope(Band, :english)
705
695
  end
706
696
 
707
697
  let(:scope) do
@@ -775,15 +765,9 @@ describe Mongoid::Scopable do
775
765
  end
776
766
 
777
767
  after do
778
- class << Article
779
- undef_method :is_public
780
- undef_method :authored
781
- end
782
- Article._declared_scopes.clear
783
- class << Author
784
- undef_method :author
785
- end
786
- Author._declared_scopes.clear
768
+ remove_scope(Article, :is_public)
769
+ remove_scope(Article, :authored)
770
+ remove_scope(Author, :author)
787
771
  end
788
772
 
789
773
  context "when calling another model's scope from within a scope" do
@@ -816,10 +800,7 @@ describe Mongoid::Scopable do
816
800
  config_override :scope_overwrite_exception, true
817
801
 
818
802
  after do
819
- class << Band
820
- undef_method :active
821
- end
822
- Band._declared_scopes.clear
803
+ remove_scope(Band, :active)
823
804
  end
824
805
 
825
806
  it "raises an exception" do
@@ -834,10 +815,7 @@ describe Mongoid::Scopable do
834
815
  config_override :scope_overwrite_exception, false
835
816
 
836
817
  after do
837
- class << Band
838
- undef_method :active
839
- end
840
- Band._declared_scopes.clear
818
+ remove_scope(Band, :active)
841
819
  end
842
820
 
843
821
  it "raises no exception" do
@@ -867,11 +845,8 @@ describe Mongoid::Scopable do
867
845
  end
868
846
 
869
847
  after do
870
- class << Band
871
- undef_method :xxx
872
- undef_method :yyy
873
- end
874
- Band._declared_scopes.clear
848
+ remove_scope(Band, :xxx)
849
+ remove_scope(Band, :yyy)
875
850
  end
876
851
 
877
852
  let(:criteria) do
@@ -901,15 +876,8 @@ describe Mongoid::Scopable do
901
876
  end
902
877
 
903
878
  after do
904
- class << Shape
905
- undef_method :located_at
906
- end
907
- Shape._declared_scopes.clear
908
-
909
- class << Circle
910
- undef_method :with_radius
911
- end
912
- Circle._declared_scopes.clear
879
+ remove_scope(Shape, :located_at)
880
+ remove_scope(Circle, :with_radius)
913
881
  end
914
882
 
915
883
  let(:shape_scope_keys) do
@@ -950,16 +918,9 @@ describe Mongoid::Scopable do
950
918
  end
951
919
 
952
920
  after do
953
- class << Shape
954
- undef_method :visible
955
- undef_method :large
956
- end
957
- Shape._declared_scopes.clear
958
-
959
- class << Circle
960
- undef_method :large
961
- end
962
- Circle._declared_scopes.clear
921
+ remove_scope(Shape, :visible)
922
+ remove_scope(Shape, :large)
923
+ remove_scope(Circle, :large)
963
924
  end
964
925
 
965
926
  it "uses subclass context for all the other used scopes" do
@@ -1099,9 +1060,7 @@ describe Mongoid::Scopable do
1099
1060
  end
1100
1061
 
1101
1062
  after do
1102
- class << Band
1103
- undef_method :active
1104
- end
1063
+ remove_scope(Band, :active)
1105
1064
  end
1106
1065
 
1107
1066
  let(:unscoped) do
@@ -1143,10 +1102,7 @@ describe Mongoid::Scopable do
1143
1102
  end
1144
1103
 
1145
1104
  after do
1146
- class << Band
1147
- undef_method :skipped
1148
- end
1149
- Band._declared_scopes.clear
1105
+ remove_scope(Band, :skipped)
1150
1106
  end
1151
1107
 
1152
1108
  it "does not allow the default scope to be applied" do
@@ -1290,4 +1246,51 @@ describe Mongoid::Scopable do
1290
1246
  end
1291
1247
  end
1292
1248
  end
1249
+
1250
+ describe "scoped queries" do
1251
+ context "with a default scope" do
1252
+ let(:criteria) do
1253
+ Band.where(name: "Depeche Mode")
1254
+ end
1255
+
1256
+ before do
1257
+ Band.default_scope ->{ criteria }
1258
+ Band.scope :unscoped_everyone, -> { unscoped }
1259
+ Band.scope :removed_default, -> { scoped.remove_scoping(all) }
1260
+
1261
+ Band.create name: 'Depeche Mode'
1262
+ Band.create name: 'They Might Be Giants'
1263
+ end
1264
+
1265
+ after do
1266
+ Band.default_scoping = nil
1267
+ remove_scope Band, :unscoped_everyone
1268
+ remove_scope Band, :removed_default
1269
+ end
1270
+
1271
+ context "when allow_scopes_to_unset_default_scope == false" do # default for <= 9
1272
+ config_override :allow_scopes_to_unset_default_scope, false
1273
+
1274
+ it 'merges the default scope into the query with unscoped' do
1275
+ expect(Band.unscoped_everyone.selector).to include('name' => 'Depeche Mode')
1276
+ end
1277
+
1278
+ it 'merges the default scope into the query with remove_scoping' do
1279
+ expect(Band.removed_default.selector).to include('name' => 'Depeche Mode')
1280
+ end
1281
+ end
1282
+
1283
+ context "when allow_scopes_to_unset_default_scope == true" do # default for >= 10
1284
+ config_override :allow_scopes_to_unset_default_scope, true
1285
+
1286
+ it 'does not merge the default scope into the query with unscoped' do
1287
+ expect(Band.unscoped_everyone.selector).not_to include('name' => 'Depeche Mode')
1288
+ end
1289
+
1290
+ it 'does not merge merges the default scope into the query with remove_scoping' do
1291
+ expect(Band.removed_default.selector).not_to include('name' => 'Depeche Mode')
1292
+ end
1293
+ end
1294
+ end
1295
+ end
1293
1296
  end
@@ -733,6 +733,81 @@ describe Mongoid::Touchable do
733
733
  end
734
734
  end
735
735
 
736
+ context "when a custom field is specified" do
737
+
738
+ shared_examples "updates the child's updated_at" do
739
+
740
+ let!(:start_time) { Timecop.freeze(Time.at(Time.now.to_i)) }
741
+
742
+ let(:update_time) { Timecop.freeze(Time.at(Time.now.to_i) + 2) }
743
+
744
+ after do
745
+ Timecop.return
746
+ end
747
+
748
+ let!(:label) do
749
+ TouchableSpec::Referenced::Label.create!
750
+ end
751
+
752
+ let(:band) do
753
+ TouchableSpec::Referenced::Band.create!(label: label)
754
+ end
755
+
756
+ before do
757
+ update_time
758
+ band.send(meth)
759
+ end
760
+
761
+ it "updates the child's timestamp" do
762
+ expect(band.updated_at).to eq(update_time)
763
+ expect(band.reload.updated_at).to eq(update_time)
764
+ end
765
+ end
766
+
767
+ shared_examples "updates the parent's custom field and updated_at" do
768
+
769
+ let!(:start_time) { Timecop.freeze(Time.at(Time.now.to_i)) }
770
+
771
+ let(:update_time) { Timecop.freeze(Time.at(Time.now.to_i) + 2) }
772
+
773
+ after do
774
+ Timecop.return
775
+ end
776
+
777
+ let!(:label) do
778
+ TouchableSpec::Referenced::Label.create!
779
+ end
780
+
781
+ let!(:band) do
782
+ TouchableSpec::Referenced::Band.create!(label: label)
783
+ end
784
+
785
+ before do
786
+ update_time
787
+ band.send(meth)
788
+ end
789
+
790
+ it "updates the parent's custom field" do
791
+ expect(label.bands_updated_at).to eq(update_time)
792
+ expect(label.reload.bands_updated_at).to eq(update_time)
793
+ end
794
+
795
+ it "updates the parent's timestamp" do
796
+ expect(label.updated_at).to eq(update_time)
797
+ expect(label.reload.updated_at).to eq(update_time)
798
+ end
799
+
800
+ end
801
+
802
+ [:save, :destroy, :touch].each do |meth|
803
+ context "with #{meth} on referenced associations" do
804
+ let(:meth) { meth }
805
+ include_examples "updates the child's updated_at" unless meth == :destroy
806
+ include_examples "updates the parent's custom field and updated_at"
807
+ end
808
+ end
809
+ end
810
+
736
811
  context 'multi-level' do
737
812
 
738
813
  let!(:start_time) { Timecop.freeze(Time.at(Time.now.to_i)) }
@@ -150,5 +150,21 @@ module TouchableSpec
150
150
 
151
151
  embedded_in :floor, touch: true, class_name: "TouchableSpec::Referenced::Floor"
152
152
  end
153
+
154
+ class Label
155
+ include Mongoid::Document
156
+ include Mongoid::Timestamps
157
+
158
+ field :bands_updated_at, type: DateTime
159
+ has_many :bands, class_name: "TouchableSpec::Referenced::Band"
160
+ end
161
+
162
+ class Band
163
+ include Mongoid::Document
164
+ include Mongoid::Timestamps
165
+
166
+ belongs_to :label, touch: :bands_updated_at, class_name: "TouchableSpec::Referenced::Label"
167
+ end
168
+
153
169
  end
154
170
  end
@@ -26,6 +26,7 @@ class Band
26
26
  field :mojo, type: Object
27
27
  field :tags, type: Hash
28
28
  field :fans
29
+ field :location, type: LatLng
29
30
 
30
31
  alias_attribute :d, :deleted
31
32
 
@@ -5,6 +5,8 @@ class LatLng
5
5
  attr_accessor :lat, :lng
6
6
 
7
7
  def self.demongoize(object)
8
+ return if object.nil?
9
+
8
10
  LatLng.new(object[1], object[0])
9
11
  end
10
12
 
@@ -15,4 +17,8 @@ class LatLng
15
17
  def mongoize
16
18
  [ lng, lat ]
17
19
  end
20
+
21
+ def ==(other)
22
+ lat == other.lat && lng == other.lng
23
+ end
18
24
  end
metadata CHANGED
@@ -1,41 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.0
4
+ version: 9.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - The MongoDB Ruby Team
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
- cert_chain:
11
- - |
12
- -----BEGIN CERTIFICATE-----
13
- MIIEeDCCAuCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBBMREwDwYDVQQDDAhkYngt
14
- cnVieTEXMBUGCgmSJomT8ixkARkWB21vbmdvZGIxEzARBgoJkiaJk/IsZAEZFgNj
15
- b20wHhcNMjQwMjA5MTc0NzIyWhcNMjUwMjA4MTc0NzIyWjBBMREwDwYDVQQDDAhk
16
- YngtcnVieTEXMBUGCgmSJomT8ixkARkWB21vbmdvZGIxEzARBgoJkiaJk/IsZAEZ
17
- FgNjb20wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC0/Veq9l47cTfX
18
- tQ+kHq2NOCwJuJGt1iXWQ/vH/yp7pZ/bLej7gPDl2CfIngAXRjM7r1FkR9ya7VAm
19
- IneBFcVU3HhpIXWi4ByXGjBOXFD1Dfbz4C4zedIWRk/hNzXa+rQY4KPwpOwG/hZg
20
- id+rSXWSbNlkyN97XfonweVh7JsIa9X/2JY9ADYjhCfEZF+b0+Wl7+jgwzLWb46I
21
- 0WH0bZBIZ0BbKAwUXIgvq5mQf9PzukmMVYCwnkJ/P4wrHO22HuwnbMyvJuGjVwqi
22
- j1NRp/2vjmKBFWxIfhlSXEIiqAmeEVNXzhPvTVeyo+rma+7R3Bo+4WHkcnPpXJJZ
23
- Jd63qXMvTB0GplEcMJPztWhrJOmcxIOVoQyigEPSQT8JpzFVXby4SGioizv2eT7l
24
- VYSiCHuc3yEDyq5M+98WGX2etbj6esYtzI3rDevpIAHPB6HQmtoJIA4dSl3gjFb+
25
- D+YQSuB2qYu021FI9zeY9sbZyWysEXBxhwrmTk+XUV0qz+OQZkMCAwEAAaN7MHkw
26
- CQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFH4nnr4tYlatU57RbExW
27
- jG86YM5nMB8GA1UdEQQYMBaBFGRieC1ydWJ5QG1vbmdvZGIuY29tMB8GA1UdEgQY
28
- MBaBFGRieC1ydWJ5QG1vbmdvZGIuY29tMA0GCSqGSIb3DQEBCwUAA4IBgQBKGtHA
29
- fpi3N/BL1J5O4CBsAjtF4jHDiw2r5MwK+66NzMh3uedjgPI7MoosemLy++SB+8BR
30
- SE8bDkb6gfDQQzrI6KSXXyqH2TbQXpY5Tac7/yqXRiu8G2qOrOj4czB/Hq7j09CV
31
- YoH88v6hL11i5jt6jPjFh8hXYG0hDQxhi3atRz5Wwd98tUf2DSbyJXJiRgCBeZjl
32
- rP7AnKsWMu0C+zPlL+nXtQr+nTFtkKXRWfUJMqePpBqtriQvgQ+Y1ItqYVTSLuiM
33
- iwUMcn/rGhdCMBSaKDXdFkIveCHQE2f2WBo2EdErrcTrgEKYYdNfzcb/43j7L1kx
34
- AUwyTtk+HFrviBynQbKN82rjbZE+5gukVea5c7idQPkqacPYsoU37DI+hTlUyJkV
35
- dcTtfEg44lLlfNukBslfiQf54r+uWbyB0m0rDUN/py7/Ghyzt5GLBU91uCO3dGoI
36
- 55uFRHMvEcJMTDeImC/nuucPCAiEGMHggr9+NPC0tqpxjGKTo7lS7GzUFjg=
37
- -----END CERTIFICATE-----
38
- date: 2024-05-01 00:00:00.000000000 Z
10
+ cert_chain: []
11
+ date: 2024-07-29 00:00:00.000000000 Z
39
12
  dependencies:
40
13
  - !ruby/object:Gem::Dependency
41
14
  name: activemodel
@@ -305,6 +278,7 @@ files:
305
278
  - lib/mongoid/errors/empty_config_file.rb
306
279
  - lib/mongoid/errors/immutable_attribute.rb
307
280
  - lib/mongoid/errors/in_memory_collation_not_supported.rb
281
+ - lib/mongoid/errors/invalid_around_callback.rb
308
282
  - lib/mongoid/errors/invalid_async_query_executor.rb
309
283
  - lib/mongoid/errors/invalid_auto_encryption_configuration.rb
310
284
  - lib/mongoid/errors/invalid_collection.rb
@@ -912,29 +886,6 @@ files:
912
886
  - spec/mongoid_spec.rb
913
887
  - spec/rails/controller_extension/controller_runtime_spec.rb
914
888
  - spec/rails/mongoid_spec.rb
915
- - spec/shared/LICENSE
916
- - spec/shared/bin/get-mongodb-download-url
917
- - spec/shared/bin/s3-copy
918
- - spec/shared/bin/s3-upload
919
- - spec/shared/lib/mrss/child_process_helper.rb
920
- - spec/shared/lib/mrss/cluster_config.rb
921
- - spec/shared/lib/mrss/constraints.rb
922
- - spec/shared/lib/mrss/docker_runner.rb
923
- - spec/shared/lib/mrss/eg_config_utils.rb
924
- - spec/shared/lib/mrss/event_subscriber.rb
925
- - spec/shared/lib/mrss/lite_constraints.rb
926
- - spec/shared/lib/mrss/server_version_registry.rb
927
- - spec/shared/lib/mrss/session_registry.rb
928
- - spec/shared/lib/mrss/session_registry_legacy.rb
929
- - spec/shared/lib/mrss/spec_organizer.rb
930
- - spec/shared/lib/mrss/utils.rb
931
- - spec/shared/share/Dockerfile.erb
932
- - spec/shared/share/haproxy-1.conf
933
- - spec/shared/share/haproxy-2.conf
934
- - spec/shared/shlib/config.sh
935
- - spec/shared/shlib/distro.sh
936
- - spec/shared/shlib/server.sh
937
- - spec/shared/shlib/set_env.sh
938
889
  - spec/spec_helper.rb
939
890
  - spec/support/authorization.rb
940
891
  - spec/support/client_registry.rb
@@ -1229,7 +1180,7 @@ metadata:
1229
1180
  documentation_uri: https://www.mongodb.com/docs/mongoid/
1230
1181
  homepage_uri: https://mongoid.org/
1231
1182
  source_code_uri: https://github.com/mongodb/mongoid
1232
- post_install_message:
1183
+ post_install_message:
1233
1184
  rdoc_options: []
1234
1185
  require_paths:
1235
1186
  - lib
@@ -1244,8 +1195,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1244
1195
  - !ruby/object:Gem::Version
1245
1196
  version: 1.3.6
1246
1197
  requirements: []
1247
- rubygems_version: 3.3.15
1248
- signing_key:
1198
+ rubygems_version: 3.4.19
1199
+ signing_key:
1249
1200
  specification_version: 4
1250
1201
  summary: Elegant Persistence in Ruby for MongoDB.
1251
1202
  test_files:
@@ -1655,29 +1606,6 @@ test_files:
1655
1606
  - spec/mongoid_spec.rb
1656
1607
  - spec/rails/controller_extension/controller_runtime_spec.rb
1657
1608
  - spec/rails/mongoid_spec.rb
1658
- - spec/shared/LICENSE
1659
- - spec/shared/bin/get-mongodb-download-url
1660
- - spec/shared/bin/s3-copy
1661
- - spec/shared/bin/s3-upload
1662
- - spec/shared/lib/mrss/child_process_helper.rb
1663
- - spec/shared/lib/mrss/cluster_config.rb
1664
- - spec/shared/lib/mrss/constraints.rb
1665
- - spec/shared/lib/mrss/docker_runner.rb
1666
- - spec/shared/lib/mrss/eg_config_utils.rb
1667
- - spec/shared/lib/mrss/event_subscriber.rb
1668
- - spec/shared/lib/mrss/lite_constraints.rb
1669
- - spec/shared/lib/mrss/server_version_registry.rb
1670
- - spec/shared/lib/mrss/session_registry.rb
1671
- - spec/shared/lib/mrss/session_registry_legacy.rb
1672
- - spec/shared/lib/mrss/spec_organizer.rb
1673
- - spec/shared/lib/mrss/utils.rb
1674
- - spec/shared/share/Dockerfile.erb
1675
- - spec/shared/share/haproxy-1.conf
1676
- - spec/shared/share/haproxy-2.conf
1677
- - spec/shared/shlib/config.sh
1678
- - spec/shared/shlib/distro.sh
1679
- - spec/shared/shlib/server.sh
1680
- - spec/shared/shlib/set_env.sh
1681
1609
  - spec/spec_helper.rb
1682
1610
  - spec/support/authorization.rb
1683
1611
  - spec/support/client_registry.rb
checksums.yaml.gz.sig DELETED
@@ -1 +0,0 @@
1
- :6����K�ZP�����恦��gO��h3yL���yٍA=��Pve�����T����HߺL�*�m(F!t1�]����\
data/spec/shared/LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright (c) 2020 MongoDB, Inc.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- desired_version, arch = ARGV
4
- if arch.nil?
5
- STDERR.puts "Usage: get-mongodb-download-url desired-version arch"
6
- exit 1
7
- end
8
-
9
- $: << File.join(File.dirname(__FILE__), '../lib')
10
- require 'mrss/server_version_registry'
11
-
12
- begin
13
- puts Mrss::ServerVersionRegistry.new(desired_version, arch).download_url
14
- rescue Mrss::ServerVersionRegistry::Error => exc
15
- STDERR.puts "Error: #{exc}"
16
- exit 2
17
- end
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'optparse'
4
- require 'aws-sdk-s3'
5
-
6
- options = {}
7
- OptionParser.new do |opts|
8
- opts.banner = "Usage: s3-copy options"
9
-
10
- opts.on("-r", "--region=REGION", "AWS region to use (default us-east-1)") do |v|
11
- options[:region] = v
12
- end
13
-
14
- opts.on("-p", "--param=KEY=VALUE", "Specify parameter for new files") do |v|
15
- options[:params] ||= {}
16
- k, v = v.split('=', 2)
17
- options[:params][k.to_sym] = v
18
- end
19
-
20
- opts.on("-f", "--from=BUCKET:PATH", "Bucket name and key (or path) to copy from") do |v|
21
- options[:from] = v
22
- end
23
-
24
- opts.on("-t", "--to=BUCKET:PATH", "Bucket name and key (or path) to write to (may be specified more than once)") do |v|
25
- options[:to] ||= []
26
- options[:to] << v
27
- end
28
- end.parse!
29
-
30
- ENV['AWS_REGION'] ||= options[:region] || 'us-east-1'
31
-
32
- bucket, key = options.fetch(:from).split(':', 2)
33
-
34
- s3 = Aws::S3::Client.new
35
-
36
- options.fetch(:to).each do |dest|
37
- STDERR.puts "Copying to #{dest}"
38
- dbucket, dkey = dest.split(':', 2)
39
- s3.copy_object(
40
- bucket: dbucket,
41
- key: dkey,
42
- copy_source: "/#{bucket}/#{key}",
43
- **options[:params] || {},
44
- )
45
- end