bullet_train 1.2.15 → 1.2.17

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: c463276e19b14feeb9f7ccf1cb5f50942fa77e89a3023a4d51606f42c18a2dea
4
- data.tar.gz: d56d1491bb9412849f63b371c0d4f0d3c2b7da60d912d5dca232d2ceaa8273ac
3
+ metadata.gz: db64e5d7fcc268dc9ce6f416f7fe118421806cbd2a182e5555454f02aeef5e0e
4
+ data.tar.gz: 7016b846224bc4287b7ea79a4527e8d5aea2a230d746eb11801cf8d335592e1c
5
5
  SHA512:
6
- metadata.gz: 39ec0403861c83a9494675744a649eed2bf24d4cbf4f6b0fd53bc9d22c5a81ea91c8cafdd221f39059424a6db9fbdde800f48a175639b481185e709ebe599634
7
- data.tar.gz: f1225aa6d34108876c6398d7c5062b713d85e42c9cd4de24363f6dd0b734ad7cc72bd6d9489d9ee27e7d64431ce374dd4a04db141a927553119e4e21c1f3c6cc
6
+ metadata.gz: af7b95318cf456e148e6dd4ebbb150bf1546fc8fcdfac00b628934d5b1ae2d17936055b1d1d5979662310c5b1f7a948b4d5c545b331b8f149129c8f6b72ef1cd
7
+ data.tar.gz: 8d713f56429fc441dfb463e84e74fad2fb95697111e4f00f8d2cef4dbd55f632b8f9afd44c261421a1e3c73c83e4a168f728d016285b13ab9714a09b7a00c7c8
data/docs/heroku.md CHANGED
@@ -36,29 +36,21 @@ After this, you'll be able to deploy updates to your app like so:
36
36
  git push heroku main
37
37
  ````
38
38
 
39
- ### 2. Running Database Migrations and Seeds
40
- We've decided not to configure the application to automatically run database migrations after a deploy for the time being. For that reason, you'll need to run the migrations and seeds manually, like so:
41
-
42
- ```
43
- heroku run rake db:migrate
44
- heroku run rake db:seed
45
- ```
46
-
47
- ### 3. Enabling Runtime Dyno Metadata
39
+ ### 2. Enabling Runtime Dyno Metadata
48
40
  We include [Honeybadger](http://honeybadger.io) and Sentry (both at a free tier) for redundant error tracking by default. Sentry requires the following Heroku labs feature to be enabled:
49
41
 
50
42
  ```
51
43
  heroku labs:enable runtime-dyno-metadata
52
44
  ```
53
45
 
54
- ### 4. Improve Boot Time
46
+ ### 3. Improve Boot Time
55
47
  You can cut your application boot time in half by enabling the following Heroku Labs feature. See [this blog post](https://dev.to/dbackeus/cut-your-rails-boot-times-on-heroku-in-half-with-a-single-command-514d) for more details.
56
48
 
57
49
  ```
58
50
  heroku labs:enable build-in-app-dir
59
51
  ```
60
52
 
61
- ### 5. Adding Your Actual Domain
53
+ ### 4. Adding Your Actual Domain
62
54
 
63
55
  The most common use case for Bullet Train applications is to be hosted at some appropriate subdomain (e.g. `app.YOURDOMAIN.COM`) while a marketing site is hosted with a completely different service at the apex domain (e.g. just `YOURDOMAIN.COM`) or `www.YOURDOMAIN.COM`. To accomplish this, do the following in your shell:
64
56
 
@@ -1,3 +1,3 @@
1
1
  module BulletTrain
2
- VERSION = "1.2.15"
2
+ VERSION = "1.2.17"
3
3
  end
data/lib/bullet_train.rb CHANGED
@@ -50,14 +50,12 @@ module BulletTrain
50
50
  end
51
51
 
52
52
  def default_url_options_from_base_url
53
- ENV["BASE_URL"] ||= if ENV["HEROKU_APP_NAME"]
54
- "https://#{ENV["HEROKU_APP_NAME"]}.herokuapp.com"
55
- elsif ENV["RENDER_EXTERNAL_URL"]
56
- ENV["RENDER_EXTERNAL_URL"]
57
- elsif Rails.env.development?
58
- "http://localhost:3000"
59
- else
60
- raise "you need to define the value of ENV['BASE_URL'] in your environment. if you're on heroku, you can do this with `heroku config:add BASE_URL=https://your-app-name.herokuapp.com` (or whatever your configured domain is)."
53
+ unless ENV["BASE_URL"].present?
54
+ if Rails.env.development?
55
+ ENV["BASE_URL"] = "http://localhost:3000"
56
+ else
57
+ return {}
58
+ end
61
59
  end
62
60
 
63
61
  parsed_base_url = URI.parse(ENV["BASE_URL"])
@@ -74,6 +72,10 @@ def default_url_options_from_base_url
74
72
  default_url_options
75
73
  end
76
74
 
75
+ def heroku?
76
+ ENV["PATH"]&.include?("/app/.heroku/")
77
+ end
78
+
77
79
  def inbound_email_enabled?
78
80
  ENV["INBOUND_EMAIL_DOMAIN"].present?
79
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.15
4
+ version: 1.2.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver