Class: Everywhere::Framework::Rails
- Inherits:
-
Framework
- Object
- Framework
- Everywhere::Framework::Rails
- Defined in:
- lib/everywhere/framework.rb
Overview
---- build/dev (CLI side) ------------------------------------------------
Instance Method Summary collapse
- #boot!(port:) ⇒ Object
-
#boot_stub ⇒ Object
Rails loads its bundle through config/boot.rb (with bootsnap guarded).
- #cleanup_command ⇒ Object
-
#dev_command ⇒ Object
CLI.
-
#env_exports ⇒ Object
Install.
- #name ⇒ Object
- #precompile_command ⇒ Object
- #precompile_env ⇒ Object
-
#prepare_runtime_env ⇒ Object
Runtime.
Instance Method Details
#boot!(port:) ⇒ Object
137 138 139 140 141 142 143 144 145 |
# File 'lib/everywhere/framework.rb', line 137 def boot!(port:) # Normally defined by bin/rails; the server command requires it. ::Object.const_set(:APP_PATH, File.join(root, "config/application")) unless defined?(::APP_PATH) require File.join(root, "config/environment") Everywhere::Database.prepare!(root) require "rails/command" ::Rails::Command.invoke :server, ["--binding=127.0.0.1", "--port=#{port}"] end |
#boot_stub ⇒ Object
Rails loads its bundle through config/boot.rb (with bootsnap guarded).
151 152 153 |
# File 'lib/everywhere/framework.rb', line 151 def boot_stub render_boot_stub(env_exports, "require_relative \"config/boot\"") end |
#cleanup_command ⇒ Object
129 |
# File 'lib/everywhere/framework.rb', line 129 def cleanup_command = "bin/rails assets:clobber" |
#dev_command ⇒ Object
CLI
119 120 121 |
# File 'lib/everywhere/framework.rb', line 119 def dev_command File.exist?(File.join(root, "bin", "dev")) ? "bin/dev" : "bundle exec rails server" end |
#env_exports ⇒ Object
Install
148 |
# File 'lib/everywhere/framework.rb', line 148 def env_exports = { "RAILS_ENV" => "production" } |
#name ⇒ Object
116 |
# File 'lib/everywhere/framework.rb', line 116 def name = "rails" |
#precompile_command ⇒ Object
127 |
# File 'lib/everywhere/framework.rb', line 127 def precompile_command = "bin/rails assets:precompile" |
#precompile_env ⇒ Object
123 124 125 |
# File 'lib/everywhere/framework.rb', line 123 def precompile_env { "RAILS_ENV" => "production", "SECRET_KEY_BASE" => "precompile-only" } end |
#prepare_runtime_env ⇒ Object
Runtime
132 133 134 135 |
# File 'lib/everywhere/framework.rb', line 132 def prepare_runtime_env ENV["RAILS_ENV"] ||= "production" ENV["SOLID_QUEUE_IN_PUMA"] ||= "1" end |