module Inert

Constants

VERSION

Public Instance Methods

build() click to toggle source
# File lib/inert.rb, line 27
def build
  Inert::Builder.new(Inert::Middleware).call("/")
end
building?() click to toggle source
# File lib/inert.rb, line 39
def building?
  !development?
end
config() { |config| ... } click to toggle source
# File lib/inert/config.rb, line 62
def config
  @config ||= Config.new
  yield @config if block_given?
  @config
end
development?() click to toggle source
# File lib/inert.rb, line 35
def development?
  ENV["RACK_ENV"] == "development"
end
start(server: nil, host: nil, port: nil) click to toggle source
# File lib/inert.rb, line 9
def start(server: nil, host: nil, port: nil)
  app = Rack::Builder.app do
    if Inert.development?
      use Rack::ShowExceptions
      use Rack::CommonLogger
    end

    run Inert::Middleware
  end

  Rack::Server.start({
    app: app,
    server: server,
    "Host": host,
    "Port": port
  })
end
view_path() click to toggle source
# File lib/inert.rb, line 31
def view_path
  File.expand_path(Inert.config.views, Dir.pwd)
end