Class: Jets::Framework
- Inherits:
-
Object
- Object
- Jets::Framework
- Extended by:
- Memoist
- Defined in:
- lib/jets/framework.rb
Class Method Summary collapse
Class Method Details
.env ⇒ Object
9 10 11 12 |
# File 'lib/jets/framework.rb', line 9 def env return unless env_var ENV[env_var] || "production" # for Dockerfile default to production end |
.env_var ⇒ Object
5 6 7 |
# File 'lib/jets/framework.rb', line 5 def env_var "#{name.upcase}_ENV" if name # can be nil end |
.frameworks ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/jets/framework.rb', line 31 def frameworks %w[ rails sinatra hanami rack puma ] end |
.gems ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/jets/framework.rb', line 41 def gems return [] unless File.exist?("Gemfile") Bundler.with_unbundled_env do gemfile_content = File.read("Gemfile") dsl = Bundler::Dsl.evaluate(Bundler.default_gemfile, gemfile_content, {}) dsl.dependencies.map(&:name) end end |
.name ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/jets/framework.rb', line 14 def name gems.each do |gem| frameworks.each do |framework| if gem == framework # Special case for puma. If puma is detected, it means it is a rack app. if framework == "puma" return "rack" else return framework end end end end nil end |