Sha256: ac85f47bd83760fc3354d3bbdd7309e72cf66d2b1722bb488d24075df6328420

Contents?: true

Size: 361 Bytes

Versions: 1

Compression:

Stored size: 361 Bytes

Contents

class Servel::CLI
  def start
    Rack::Handler::Puma.run(Servel.build_app(path_map))
  end

  def path_map
    Servel.config.fetch(:listings).map do |listing|
      listing = { listing => nil } if listing.is_a?(String)

      root, url_root = listing.keys.first, listing.values.first || "/"
      [Pathname.new(root).realpath, url_root]
    end.to_h
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
servel-0.31.0 lib/servel/cli.rb