forest_liana 9.17.6 → 9.17.7

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: 9b410ae815afe1b2592a38ab27cb5133198fb76b4624dee5217cdb2c65583a74
4
- data.tar.gz: 2527c8944450bd5348962ef65dea48c6e7e1f1bf434e409bdbb26591d93d03c9
3
+ metadata.gz: 55b4065b5a2334f7fec593dbb43d62558fcd2786cde6765ba60099c3c3ff0b03
4
+ data.tar.gz: ec40d991bf17242d482846b8c2495b4747b0cf590c7a77031624af333b5dbb5a
5
5
  SHA512:
6
- metadata.gz: 87d6d1e526ae2ea81c8eb5f0f4d557ae0cf65e406708cea7d998455f54d7eeee9bf9667efb6637e71b1a5deb4b084fc1fdd1dacb936499b00ab3bdcfdaec9178
7
- data.tar.gz: fc0ee5ba0847140d5830715b861ccab6fe273fa7ea7c5f63ade342fa85645823c77ba51e91e2ef746dd5343c9a65e1d4012bf699fb6990e8b12dcdc344ac18db
6
+ metadata.gz: 90d60f43668a322d66005702e3b079a751d979e65157265cf70ab2bfe1a56f873c9a5cf717cdbadcda75b0d503ef5a237f7b634a1a6e1245314268c41aa23b3f
7
+ data.tar.gz: 9fa2bbce56a9db1ee0ed6fbf62eee6e455d167b8c7f4235fe111fa7c1fdc394f6365c13c10e0db2b2dea1e59144d1489fd9c95a1cfd923c42f0b7ff91a5c3c7c
@@ -64,7 +64,11 @@ module ForestLiana
64
64
  # models mid-migration (crashing on enums backed by a pending column).
65
65
  return true if File.basename($0) == 'rake'
66
66
 
67
- defined?(Rake) && Rake.application.top_level_tasks.any? { |task| task != 'default' }
67
+ # NOTICE: `respond_to?` guard — the Rake constant can be defined with only a
68
+ # partial load (Rails' test_unit requires rake/file_list), leaving
69
+ # Rake.application undefined and crashing boot.
70
+ defined?(Rake) && Rake.respond_to?(:application) &&
71
+ Rake.application.top_level_tasks.any? { |task| task != 'default' }
68
72
  end
69
73
 
70
74
  def database_available?
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "9.17.6"
2
+ VERSION = "9.17.7"
3
3
  end
@@ -45,6 +45,24 @@ module ForestLiana
45
45
  expect(engine.rake?).to be(false)
46
46
  end
47
47
  end
48
+
49
+ context 'when Rake is only partially loaded (Rake constant defined without Rake.application)' do
50
+ # Reproduces the boot crash: Rails' test_unit integration requires
51
+ # `rake/file_list`, which defines the Rake module without loading
52
+ # rake/application. `defined?(Rake)` is then truthy but `Rake.application`
53
+ # is undefined, so the old guard raised NoMethodError at boot.
54
+ it 'returns false instead of raising NoMethodError' do
55
+ $0 = '/usr/local/bin/rails'
56
+ allow(Rake).to receive(:respond_to?).and_call_original
57
+ allow(Rake).to receive(:respond_to?).with(:application).and_return(false)
58
+ allow(Rake).to receive(:application).and_raise(
59
+ NoMethodError.new("undefined method 'application' for module Rake")
60
+ )
61
+
62
+ expect { engine.rake? }.not_to raise_error
63
+ expect(engine.rake?).to be(false)
64
+ end
65
+ end
48
66
  end
49
67
  end
50
68
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.17.6
4
+ version: 9.17.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda