Sha256: 322f9c91a8223e09b7b1dc802b7453503f918dcf483ec1052ac95a7dcbca39a2

Contents?: true

Size: 776 Bytes

Versions: 10

Compression:

Stored size: 776 Bytes

Contents

rails_version = "#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}"

case rails_version
  when '2.3'
    ActionController::Routing.module_eval "remove_const(:Routes); Routes = Usher::Interface.for(:rails23)"

  when '2.2'
    class Usher::Interface::Rails22::Mapper
      include ActionController::Resources
    end
    ActionController::Routing.module_eval "remove_const(:Routes); Routes = Usher::Interface.for(:rails22)"

  when '2.0'
    class Usher::Interface::Rails20::Mapper
      include ActionController::Resources
    end

    ActionController::Routing.module_eval <<CODE
      remove_const(:Routes);
      interface = Usher::Interface.for(:rails20);
      interface.configuration_file = File.join(RAILS_ROOT, 'config', 'routes.rb')
      Routes = interface;
CODE
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
usher-0.6.7 rails/init.rb
usher-0.6.6 rails/init.rb
usher-0.6.5 rails/init.rb
usher-0.6.4 rails/init.rb
usher-0.6.3 rails/init.rb
usher-0.6.2 rails/init.rb
usher-0.6.1 rails/init.rb
usher-0.6.0 rails/init.rb
usher-0.5.13 rails/init.rb
usher-0.5.12 rails/init.rb