bullet_train 1.12.0 → 1.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd6fdf70fe639d436c4c3a30bdb7334486a06fd164cc1143cfb7c61f594807a1
4
- data.tar.gz: 26bfbb1745af219cc5e1a88c63960091e988060b99e6d8c663849a182a2e2d75
3
+ metadata.gz: 7a7d2a3ad862f57f8b91e0db97982d672c8c73c896f24f1af13a398ccb3b2a96
4
+ data.tar.gz: 3ec97fc6cc70d9701ad1b4cef65276d14b8e188b0b3fcf63e3a7151b8c976d4f
5
5
  SHA512:
6
- metadata.gz: 405d7b2680925803f52982019d1311f494b4bfb0d798b45898fc98afe6a2a0e2ce49e83af6ed2dc73fe6ba6f693a699a439e923d9ace5715e35fd68d3c4b2c59
7
- data.tar.gz: 1889ac585f748aaf37f4917750e5d4d26e8214a7aa164d8fe45354eab0f24d182ee3dc7bde4b2f45be3c3fe2b08a6d4788539b6bc95b5c14f66c969b79d55397
6
+ metadata.gz: 72de63a2467f4753c80706dac5b23d51afc7d197c4e6fbc43945e447a19dd0b3cf90372eb2aa1dfb0fdf9a08d6f11986615606a7fc72c669e786e274c9870ca8
7
+ data.tar.gz: f95130d7f6e2fd446e532239bc6543c4581cf1f63958969e3ae2855d1bb7f057ebea73247a53f3c2bef61832114742e916edb1fd8b523c2b0c1243efb3006162
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.12.0"
2
+ VERSION = "1.12.1"
3
3
  end
data/lib/bullet_train.rb CHANGED
@@ -73,7 +73,33 @@ def default_url_options_from_base_url
73
73
  end
74
74
 
75
75
  def heroku?
76
- ENV["HEROKU_APP_NAME"].present?
76
+ # This is a value we set in `app.json` so anyone using the "Deploy to Heroku" button
77
+ # should have it. This is kind of a brute force method that should be future-proofed
78
+ # against changes that Heroku might make to their runtime environment. We'll fallback
79
+ # to some additional checks if this isn't here, to maintain backwards compatibility
80
+ # for existing apps.
81
+ if ENV["BT_IS_IN_HEROKU"].present?
82
+ ENV["BT_IS_IN_HEROKU"] == "true"
83
+ else
84
+ # This requires the app to run `heroku labs:enable runtime-dyno-metadata` and then
85
+ # deploy at least once before the ENV var is set. Many existing BT apps have enabled
86
+ # this feature, and this used to be the only detection method that we had. We're
87
+ # keeping it for backwards compability reasons because it's probably more stable
88
+ # than the following fallbacks.
89
+ ENV["HEROKU_APP_NAME"].present? ||
90
+ # And finally we fallback to checking for some artifacts that Heroku happens to leave
91
+ # lying around. These may change in the future, so who knows how long they'll be good.
92
+ #
93
+ # If there's a `DYNO` ENV var, then we're probably on Heroku. Will they _always_ set
94
+ # this variable?
95
+ ENV["DYNO"].present? ||
96
+ # Finally we look for the the existence of the `/app/.heroku` directory.
97
+ # This should make detection work for apps that don't have any of the above ENV vars, for
98
+ # whatever reasons. But, in the future Heroku could decide to remove `/app/.heroku`
99
+ # which will break this fallback method and then we'll have to come up with something else.
100
+ # This is currently our last line of defense.
101
+ File.directory?("/app/.heroku")
102
+ end
77
103
  end
78
104
 
79
105
  def inbound_email_enabled?
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-10 00:00:00.000000000 Z
11
+ date: 2024-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard