Permalink
Browse files

branch rails3 created which is compatible with Rails 3.0.0.beta2

  • Loading branch information...
Satish committed Apr 15, 2010
1 parent 7235d91 commit ce9761c8f0ad2c60b69b09b62e4f3f71b99767dd
Showing with 653 additions and 662 deletions.
  1. +0 −1 generators/authenticated/USAGE
  2. +0 −478 generators/authenticated/authenticated_generator.rb
  3. +0 −54 generators/authenticated/lib/insert_routes.rb
  4. +0 −25 generators/authenticated/templates/mailer.rb
  5. +0 −11 generators/authenticated/templates/observer.rb
  6. +0 −31 generators/authenticated/templates/test/mailer_test.rb
  7. +3 −1 init.rb
  8. +1 −0 lib/generators/authenticated/USAGE
  9. +522 −0 lib/generators/authenticated/authenticated_generator.rb
  10. 0 { → lib}/generators/authenticated/templates/_model_partial.html.erb
  11. +1 −1 { → lib}/generators/authenticated/templates/activation.erb
  12. +3 −3 { → lib}/generators/authenticated/templates/authenticated_system.rb
  13. +1 −1 { → lib}/generators/authenticated/templates/authenticated_test_helper.rb
  14. +3 −5 { → lib}/generators/authenticated/templates/controller.rb
  15. 0 { → lib}/generators/authenticated/templates/features/accounts.feature
  16. 0 { → lib}/generators/authenticated/templates/features/sessions.feature
  17. 0 { → lib}/generators/authenticated/templates/features/step_definitions/ra_env.rb
  18. 0 { → lib}/generators/authenticated/templates/features/step_definitions/ra_navigation_steps.rb
  19. 0 { → lib}/generators/authenticated/templates/features/step_definitions/ra_resource_steps.rb
  20. 0 { → lib}/generators/authenticated/templates/features/step_definitions/ra_response_steps.rb
  21. 0 { → lib}/generators/authenticated/templates/features/step_definitions/rest_auth_features_helper.rb
  22. 0 { → lib}/generators/authenticated/templates/features/step_definitions/user_steps.rb
  23. 0 { → lib}/generators/authenticated/templates/helper.rb
  24. +1 −1 { → lib}/generators/authenticated/templates/login.html.erb
  25. +26 −0 lib/generators/authenticated/templates/mailer.rb
  26. +2 −2 { → lib}/generators/authenticated/templates/migration.rb
  27. +27 −23 { → lib}/generators/authenticated/templates/model.rb
  28. +13 −15 { → lib}/generators/authenticated/templates/model_controller.rb
  29. 0 { → lib}/generators/authenticated/templates/model_helper.rb
  30. 0 { → lib}/generators/authenticated/templates/model_helper_spec.rb
  31. +11 −0 lib/generators/authenticated/templates/observer.rb
  32. +1 −1 { → lib}/generators/authenticated/templates/signup.html.erb
  33. +1 −1 { → lib}/generators/authenticated/templates/signup_notification.erb
  34. 0 { → lib}/generators/authenticated/templates/site_keys.rb
  35. 0 { → lib}/generators/authenticated/templates/spec/controllers/access_control_spec.rb
  36. 0 { → lib}/generators/authenticated/templates/spec/controllers/authenticated_system_spec.rb
  37. 0 { → lib}/generators/authenticated/templates/spec/controllers/sessions_controller_spec.rb
  38. +2 −2 { → lib}/generators/authenticated/templates/spec/controllers/users_controller_spec.rb
  39. 0 { → lib}/generators/authenticated/templates/spec/fixtures/users.yml
  40. 0 { → lib}/generators/authenticated/templates/spec/helpers/users_helper_spec.rb
  41. 0 { → lib}/generators/authenticated/templates/spec/models/user_spec.rb
  42. +1 −1 { → lib}/generators/authenticated/templates/test/functional_test.rb
  43. +32 −0 lib/generators/authenticated/templates/test/mailer_test.rb
  44. +1 −1 { → lib}/generators/authenticated/templates/test/model_functional_test.rb
  45. +1 −1 { → lib}/generators/authenticated/templates/test/unit_test.rb
  46. 0 { → lib}/tasks/auth.rake
  47. +0 −3 rails/init.rb
@@ -1 +0,0 @@
-./script/generate authenticated USERMODEL CONTROLLERNAME

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,54 +0,0 @@
-Rails::Generator::Commands::Create.class_eval do
- def route_resource(*resources)
- resource_list = resources.map { |r| r.to_sym.inspect }.join(', ')
- sentinel = 'ActionController::Routing::Routes.draw do |map|'
-
- logger.route "map.resource #{resource_list}"
- unless options[:pretend]
- gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
- "#{match}\n map.resource #{resource_list}\n"
- end
- end
- end
-
- def route_name(name, path, route_options = {})
- sentinel = 'ActionController::Routing::Routes.draw do |map|'
-
- logger.route "map.#{name} '#{path}', :controller => '#{route_options[:controller]}', :action => '#{route_options[:action]}'"
- unless options[:pretend]
- gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
- "#{match}\n map.#{name} '#{path}', :controller => '#{route_options[:controller]}', :action => '#{route_options[:action]}'"
- end
- end
- end
-end
-
-Rails::Generator::Commands::Destroy.class_eval do
- def route_resource(*resources)
- resource_list = resources.map { |r| r.to_sym.inspect }.join(', ')
- look_for = "\n map.resource #{resource_list}\n"
- logger.route "map.resource #{resource_list}"
- unless options[:pretend]
- gsub_file 'config/routes.rb', /(#{look_for})/mi, ''
- end
- end
-
- def route_name(name, path, route_options = {})
- look_for = "\n map.#{name} '#{path}', :controller => '#{route_options[:controller]}', :action => '#{route_options[:action]}'"
- logger.route "map.#{name} '#{path}', :controller => '#{route_options[:controller]}', :action => '#{route_options[:action]}'"
- unless options[:pretend]
- gsub_file 'config/routes.rb', /(#{look_for})/mi, ''
- end
- end
-end
-
-Rails::Generator::Commands::List.class_eval do
- def route_resource(*resources)
- resource_list = resources.map { |r| r.to_sym.inspect }.join(', ')
- logger.route "map.resource #{resource_list}"
- end
-
- def route_name(name, path, options = {})
- logger.route "map.#{name} '#{path}', :controller => '{options[:controller]}', :action => '#{options[:action]}'"
- end
-end
@@ -1,25 +0,0 @@
-class <%= class_name %>Mailer < ActionMailer::Base
- def signup_notification(<%= file_name %>)
- setup_email(<%= file_name %>)
- @subject += 'Please activate your new account'
- <% if options[:include_activation] %>
- @body[:url] = "http://YOURSITE/activate/#{<%= file_name %>.activation_code}"
- <% else %>
- @body[:url] = "http://YOURSITE/login/" <% end %>
- end
-
- def activation(<%= file_name %>)
- setup_email(<%= file_name %>)
- @subject += 'Your account has been activated!'
- @body[:url] = "http://YOURSITE/"
- end
-
- protected
- def setup_email(<%= file_name %>)
- @recipients = "#{<%= file_name %>.email}"
- @from = "ADMINEMAIL"
- @subject = "[YOURSITE] "
- @sent_on = Time.now
- @body[:<%= file_name %>] = <%= file_name %>
- end
-end
@@ -1,11 +0,0 @@
-class <%= class_name %>Observer < ActiveRecord::Observer
- def after_create(<%= file_name %>)
- <%= class_name %>Mailer.deliver_signup_notification(<%= file_name %>)
- end
-
- def after_save(<%= file_name %>)
- <% if options[:include_activation] %>
- <%= class_name %>Mailer.deliver_activation(<%= file_name %>) if <%= file_name %>.recently_activated?
- <% end %>
- end
-end
@@ -1,31 +0,0 @@
-require File.dirname(__FILE__) + '/../test_helper'
-require '<%= file_name %>_mailer'
-
-class <%= class_name %>MailerTest < Test::Unit::TestCase
- FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures'
- CHARSET = "utf-8"
-
- include ActionMailer::Quoting
-
- def setup
- ActionMailer::Base.delivery_method = :test
- ActionMailer::Base.perform_deliveries = true
- ActionMailer::Base.deliveries = []
-
- @expected = TMail::Mail.new
- @expected.set_content_type "text", "plain", { "charset" => CHARSET }
- end
-
- def test_dummy_test
- #do nothing
- end
-
- private
- def read_fixture(action)
- IO.readlines("#{FIXTURES_PATH}/<%= file_name %>_mailer/#{action}")
- end
-
- def encode(subject)
- quoted_printable(subject, CHARSET)
- end
-end
View
@@ -1 +1,3 @@
-require File.join(File.dirname(__FILE__), "rails", "init")
+require File.join(File.dirname(__FILE__), "lib", "authentication")
+require File.join(File.dirname(__FILE__), "lib", "authentication", "by_password")
+require File.join(File.dirname(__FILE__), "lib", "authentication", "by_cookie_token")
@@ -0,0 +1 @@
+rails g(generate) authenticated USERMODEL CONTROLLERNAME
Oops, something went wrong.

0 comments on commit ce9761c

Please sign in to comment.