Sha256: a5d5ca4d167b0dbd1b5a8a822365ee4133a8650d850a57d8f6700af774930ad8
Contents?: true
Size: 879 Bytes
Versions: 58
Compression:
Stored size: 879 Bytes
Contents
require 'fileutils' module Jets class Turbo autoload :DatabaseYaml, 'jets/turbo/database_yaml' autoload :Rail, 'jets/turbo/rail' # Turbo charge mode def charge framework = detect case framework when :jets # do nothing when :rails Rail.new.setup else # should never get here end end def detect if rails? :rails elsif jets? :jets else :unknown_framework end end def rails? config_ru_contains?('run Rails.application') end def jets? config_ru_contains?('run Jets.application') end def config_ru_contains?(value) config_ru = "#{Dir.pwd}/config.ru" return false unless File.exist?(config_ru) lines = ::IO.readlines(config_ru) lines.detect { |l| l.include?(value) } end end end
Version data entries
58 entries across 58 versions & 2 rubygems