Sha256: 80cc3a1d53f8be834ef7713ebc4d930797167bc07c2ba59aa5db973b5285c68f

Contents?: true

Size: 617 Bytes

Versions: 1

Compression:

Stored size: 617 Bytes

Contents

require 'sextant/engine'
require 'rails/routes'

module Sextant

  begin
    require 'rails/application/route_inspector'
    ROUTE_INSPECTOR = Rails::Application::RouteInspector.new
  rescue LoadError
    require 'action_dispatch/routing/inspector'
    ROUTE_INSPECTOR = ActionDispatch::Routing::RoutesInspector.new([])
  end

  def self.format_routes(routes = all_routes)
    # ActionDispatch::Routing::RoutesInspector.new.collect_routes(_routes.routes)
    ROUTE_INSPECTOR.send :collect_routes, routes
  end

  def self.all_routes
    Rails.application.reload_routes!
    Rails.application.routes.routes
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sextant-0.2.4 lib/sextant.rb