From 65ad16568c60dd1a4f5c65d2c97ead7a4c0fb5d5 Mon Sep 17 00:00:00 2001 From: Mikel Lindsaar Date: Mon, 1 Feb 2010 10:10:53 +1100 Subject: Updating copyright dates on all licenses --- actionpack/MIT-LICENSE | 2 +- actionpack/lib/action_dispatch.rb | 2 +- actionpack/lib/action_pack.rb | 2 +- actionpack/lib/action_view.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'actionpack') diff --git a/actionpack/MIT-LICENSE b/actionpack/MIT-LICENSE index e7accc5ea1..a345a2419d 100644 --- a/actionpack/MIT-LICENSE +++ b/actionpack/MIT-LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2004-2009 David Heinemeier Hansson +Copyright (c) 2004-2010 David Heinemeier Hansson Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/actionpack/lib/action_dispatch.rb b/actionpack/lib/action_dispatch.rb index c6eb097ee5..479ea959e6 100644 --- a/actionpack/lib/action_dispatch.rb +++ b/actionpack/lib/action_dispatch.rb @@ -1,5 +1,5 @@ #-- -# Copyright (c) 2004-2009 David Heinemeier Hansson +# Copyright (c) 2004-2010 David Heinemeier Hansson # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff --git a/actionpack/lib/action_pack.rb b/actionpack/lib/action_pack.rb index b90f89be39..1a1497385a 100644 --- a/actionpack/lib/action_pack.rb +++ b/actionpack/lib/action_pack.rb @@ -1,5 +1,5 @@ #-- -# Copyright (c) 2004-2009 David Heinemeier Hansson +# Copyright (c) 2004-2010 David Heinemeier Hansson # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the diff --git a/actionpack/lib/action_view.rb b/actionpack/lib/action_view.rb index 93aa69c060..66fc530bec 100644 --- a/actionpack/lib/action_view.rb +++ b/actionpack/lib/action_view.rb @@ -1,5 +1,5 @@ #-- -# Copyright (c) 2004-2009 David Heinemeier Hansson +# Copyright (c) 2004-2010 David Heinemeier Hansson # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the -- cgit v1.2.3 From 5998dd7bb84c76f4c8a272a71b588e2331989b4b Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Mon, 1 Feb 2010 19:47:31 -0500 Subject: Resolve view paths correctly on CygWin Signed-off-by: Mikel Lindsaar --- actionpack/lib/action_view/template/resolver.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index 6878067f7c..8acfe6cad0 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -104,7 +104,7 @@ module ActionView end def query(path, exts) - query = "#{@path}/#{path}" + query = File.join(@path, path) exts.each do |ext| query << '{' << ext.map {|e| e && ".#{e}" }.join(',') << '}' end -- cgit v1.2.3 From df8852d04d030330efcb86f16977b837473bf022 Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Fri, 29 Jan 2010 15:23:59 -0500 Subject: Make rdoc match current API Signed-off-by: Mikel Lindsaar --- actionpack/lib/action_dispatch/routing.rb | 152 +++++++++--------------------- 1 file changed, 47 insertions(+), 105 deletions(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/routing.rb b/actionpack/lib/action_dispatch/routing.rb index b598d6f7e2..335c9edb98 100644 --- a/actionpack/lib/action_dispatch/routing.rb +++ b/actionpack/lib/action_dispatch/routing.rb @@ -9,17 +9,18 @@ module ActionDispatch # mod_rewrite rules. Best of all, Rails' Routing works with any web server. # Routes are defined in config/routes.rb. # - # Consider the following route, installed by Rails when you generate your - # application: + # Consider the following route, which you will find commented out at the + # bottom of your generated config/routes.rb: # - # map.connect ':controller/:action/:id' + # match ':controller(/:action(/:id(.:format)))' # # This route states that it expects requests to consist of a - # :controller followed by an :action that in turn is fed - # some :id. + # :controller followed optionally by an :action that in + # turn is followed optionally by an :id, which in turn is followed + # optionally by a :format # - # Suppose you get an incoming request for /blog/edit/22, you'll end up - # with: + # Suppose you get an incoming request for /blog/edit/22, you'll end + # up with: # # params = { :controller => 'blog', # :action => 'edit', @@ -29,7 +30,7 @@ module ActionDispatch # Think of creating routes as drawing a map for your requests. The map tells # them where to go based on some predefined pattern: # - # ActionController::Routing::Routes.draw do |map| + # AppName::Applications.routes.draw do |map| # Pattern 1 tells some request to go to one place # Pattern 2 tell them to go to another # ... @@ -42,60 +43,16 @@ module ActionDispatch # # Other names simply map to a parameter as in the case of :id. # - # == Route priority - # - # Not all routes are created equally. Routes have priority defined by the - # order of appearance of the routes in the config/routes.rb file. The priority goes - # from top to bottom. The last route in that file is at the lowest priority - # and will be applied last. If no route matches, 404 is returned. - # - # Within blocks, the empty pattern is at the highest priority. - # In practice this works out nicely: - # - # ActionController::Routing::Routes.draw do |map| - # map.with_options :controller => 'blog' do |blog| - # blog.show '', :action => 'list' - # end - # map.connect ':controller/:action/:view' - # end - # - # In this case, invoking blog controller (with an URL like '/blog/') - # without parameters will activate the 'list' action by default. - # - # == Defaults routes and default parameters - # - # Setting a default route is straightforward in Rails - you simply append a - # Hash at the end of your mapping to set any default parameters. - # - # Example: - # - # ActionController::Routing:Routes.draw do |map| - # map.connect ':controller/:action/:id', :controller => 'blog' - # end - # - # This sets up +blog+ as the default controller if no other is specified. - # This means visiting '/' would invoke the blog controller. - # - # More formally, you can include arbitrary parameters in the route, thus: - # - # map.connect ':controller/:action/:id', :action => 'show', :page => 'Dashboard' - # - # This will pass the :page parameter to all incoming requests that match this route. - # - # Note: The default routes, as provided by the Rails generator, make all actions in every - # controller accessible via GET requests. You should consider removing them or commenting - # them out if you're using named routes and resources. - # # == Named routes # - # Routes can be named with the syntax map.name_of_route options, + # Routes can be named by passing an :as option, # allowing for easy reference within your source as +name_of_route_url+ # for the full URL and +name_of_route_path+ for the URI path. # # Example: # # # In routes.rb - # map.login 'login', :controller => 'accounts', :action => 'login' + # match '/login' => 'accounts#login', :as => 'login' # # # With render, redirect_to, tests, etc. # redirect_to login_url @@ -104,10 +61,10 @@ module ActionDispatch # # redirect_to show_item_path(:id => 25) # - # Use map.root as a shorthand to name a route for the root path "". + # Use root as a shorthand to name a route for the root path "". # # # In routes.rb - # map.root :controller => 'blogs' + # root :to => 'blogs#index' # # # would recognize http://www.example.com/ as # params = { :controller => 'blogs', :action => 'index' } @@ -116,20 +73,14 @@ module ActionDispatch # root_url # => 'http://www.example.com/' # root_path # => '' # - # You can also specify an already-defined named route in your map.root call: - # - # # In routes.rb - # map.new_session :controller => 'sessions', :action => 'new' - # map.root :new_session - # - # Note: when using +with_options+, the route is simply named after the + # Note: when using +controller+, the route is simply named after the # method you call on the block parameter rather than map. # # # In routes.rb - # map.with_options :controller => 'blog' do |blog| - # blog.show '', :action => 'list' - # blog.delete 'delete/:id', :action => 'delete' - # blog.edit 'edit/:id', :action => 'edit' + # controller :blog do + # match 'blog/show' => :list + # match 'blog/delete' => :delete + # match 'blog/edit/:id' => :edit # end # # # provides named routes for show, delete, and edit @@ -139,12 +90,13 @@ module ActionDispatch # # Routes can generate pretty URLs. For example: # - # map.connect 'articles/:year/:month/:day', - # :controller => 'articles', - # :action => 'find_by_date', - # :year => /\d{4}/, - # :month => /\d{1,2}/, - # :day => /\d{1,2}/ + # match '/articles/:year/:month/:day', :constraints => { + # :controller => 'articles', + # :action => 'find_by_date', + # :year => /\d{4}/, + # :month => /\d{1,2}/, + # :day => /\d{1,2}/ + # } # # Using the route above, the URL "http://localhost:3000/articles/2005/11/06" # maps to @@ -154,42 +106,34 @@ module ActionDispatch # == Regular Expressions and parameters # You can specify a regular expression to define a format for a parameter. # - # map.geocode 'geocode/:postalcode', :controller => 'geocode', - # :action => 'show', :postalcode => /\d{5}(-\d{4})?/ - # - # or, more formally: + # controller 'geocode' do + # match 'geocode/:postalcode' => :show', :constraints => { + # :postalcode => /\d{5}(-\d{4})?/ + # } # - # map.geocode 'geocode/:postalcode', :controller => 'geocode', - # :action => 'show', :requirements => { :postalcode => /\d{5}(-\d{4})?/ } - # - # Formats can include the 'ignorecase' and 'extended syntax' regular + # Constraints can include the 'ignorecase' and 'extended syntax' regular # expression modifiers: # - # map.geocode 'geocode/:postalcode', :controller => 'geocode', - # :action => 'show', :postalcode => /hx\d\d\s\d[a-z]{2}/i + # controller 'geocode' do + # match 'geocode/:postalcode' => :show', :constraints => { + # :postalcode => /hx\d\d\s\d[a-z]{2}/i + # } + # end # - # map.geocode 'geocode/:postalcode', :controller => 'geocode', - # :action => 'show',:requirements => { - # :postalcode => /# Postcode format - # \d{5} #Prefix - # (-\d{4})? #Suffix - # /x - # } + # controller 'geocode' do + # match 'geocode/:postalcode' => :show', :constraints => { + # :postalcode => /# Postcode format + # \d{5} #Prefix + # (-\d{4})? #Suffix + # /x + # } + # end # # Using the multiline match modifier will raise an ArgumentError. # Encoding regular expression modifiers are silently ignored. The # match will always use the default encoding or ASCII. # - # == Route globbing - # - # Specifying *[string] as part of a rule like: - # - # map.connect '*path' , :controller => 'blog' , :action => 'unrecognized?' - # - # will glob all remaining parts of the route that were not recognized earlier. - # The globbed values are in params[:path] as an array of path segments. - # - # == Route conditions + # == HTTP Methods # # With conditions you can define restrictions on routes. Currently the only valid condition is :method. # @@ -200,10 +144,8 @@ module ActionDispatch # # Example: # - # map.connect 'post/:id', :controller => 'posts', :action => 'show', - # :conditions => { :method => :get } - # map.connect 'post/:id', :controller => 'posts', :action => 'create_comment', - # :conditions => { :method => :post } + # get 'post/:id' => 'posts#show' + # post 'post/:id' => "posts#create_comment' # # Now, if you POST to /posts/:id, it will route to the create_comment action. A GET on the same # URL will route to the show action. @@ -212,7 +154,7 @@ module ActionDispatch # # You can reload routes if you feel you must: # - # ActionController::Routing::Routes.reload + # Rails::Application.reload_routes! # # This will clear all named routes and reload routes.rb if the file has been modified from # last load. To absolutely force reloading, use reload!. -- cgit v1.2.3