Sha256: 9e9c4f95564f5ed14968dd8eac44001aaf73bf89531be104bec3566f587f92e5
Contents?: true
Size: 1017 Bytes
Versions: 57
Compression:
Stored size: 1017 Bytes
Contents
require 'generators/hobo_support/eval_template' module Hobo class RoutesGenerator < Rails::Generators::Base source_root File.expand_path('../templates', __FILE__) include Generators::HoboSupport::EvalTemplate def self.banner "rails generate hobo:routes #{self.arguments.map(&:usage).join(' ')} [options]" end def generate_routes Hobo::Routes.reset_linkables h = Hobo::Engine.config.hobo template_name = 'hobo_routes.rb.erb' if h.read_only_file_system # just fill the @linkable_keys without writing any file eval_template template_name else template template_name, h.routes_path end end private def subsites [nil, *Hobo.subsites] end def controllers_for(subsite) Hobo::Controller::Model.all_controllers(subsite, :force).select { |c| c < Hobo::Controller::Model } end def router_for(subsite, controller) Generators::Hobo::Routes::Router.new(subsite, controller) end end end
Version data entries
57 entries across 57 versions & 1 rubygems