Sha256: 9421e8e96f861c7e670af00f1121c290897c96f41c4337f1fe58c1a7b4327ed0

Contents?: true

Size: 727 Bytes

Versions: 16

Compression:

Stored size: 727 Bytes

Contents

module Desert
  module Rails
    module RouteSet
      # Loads the set of routes from within a plugin and evaluates them at this
      # point within an application's main <tt>routes.rb</tt> file.
      #
      # Plugin routes are loaded from <tt><plugin_root>/routes.rb</tt>.
      def routes_from_plugin(name)
        name = name.to_s
        routes_path = File.join(
          Desert::Manager.plugin_path(name),
          "config/routes.rb"
        )
        RAILS_DEFAULT_LOGGER.debug "Loading routes from #{routes_path}."
        eval(IO.read(routes_path), binding, routes_path) if File.file?(routes_path)
      end
    end
  end
end

class ActionController::Routing::RouteSet::Mapper
  include Desert::Rails::RouteSet
end

Version data entries

16 entries across 16 versions & 5 rubygems

Version Path
aaalex-desert-0.3.5.2 lib/desert/rails/route_set.rb
aaalex-desert-0.3.5.3 lib/desert/rails/route_set.rb
ikhono-desert-0.3.2 lib/desert/rails/route_set.rb
ikhono-ikhono-desert-0.3.2 lib/desert/rails/route_set.rb
tog-desert-0.3.4 lib/desert/rails/route_set.rb
tog-desert-0.3.5.1 lib/desert/rails/route_set.rb
tog-desert-0.3.5 lib/desert/rails/route_set.rb
desert-0.3.2 lib/desert/rails/route_set.rb
desert-0.1.1 lib/desert/rails/route_set.rb
desert-0.3.3 lib/desert/rails/route_set.rb
desert-0.2.1 lib/desert/rails/route_set.rb
desert-0.3.4 lib/desert/rails/route_set.rb
desert-0.4.1 lib/desert/rails/route_set.rb
desert-0.2.0 lib/desert/rails/route_set.rb
desert-0.2.2 lib/desert/rails/route_set.rb
desert-0.3.0 lib/desert/rails/route_set.rb