diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index d531b8bb..9e8b0131 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -1,6 +1,6 @@ # Be sure to restart your server when you modify this file. -# Add new inflection rules using the following format +# Add new inflection rules using the following format # (all these examples are active by default): # ActiveSupport::Inflector.inflections do |inflect| # inflect.plural /^(ox)$/i, '\1en' diff --git a/config/locales/action_view_ja.yml b/config/locales/action_view_ja.yml index e6d85040..0fd6ac1c 100644 --- a/config/locales/action_view_ja.yml +++ b/config/locales/action_view_ja.yml @@ -9,7 +9,7 @@ ja: delimiter: "," # Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00) precision: 3 - + # Used in number_to_currency() currency: format: @@ -20,15 +20,15 @@ ja: separator: "." delimiter: "," precision: 2 - + # Used in number_to_percentage() percentage: format: # These three are to override number.format and are optional - # separator: + # separator: delimiter: "" - # precision: - + # precision: + # Used in number_to_precision() precision: format: @@ -36,12 +36,12 @@ ja: # separator: delimiter: "" # precision: - + # Used in number_to_human_size() human: format: # These three are to override number.format and are optional - # separator: + # separator: delimiter: "" precision: 1 diff --git a/config/locales/active_record_ja.yml b/config/locales/active_record_ja.yml index 0e7896bb..2e9824bd 100644 --- a/config/locales/active_record_ja.yml +++ b/config/locales/active_record_ja.yml @@ -35,16 +35,16 @@ ja: # attributes: # login: # blank: "This is a custom blank message for User login" - # Will define custom blank validation message for User model and + # Will define custom blank validation message for User model and # custom blank validation message for login attribute of User model. models: - + # Translate model names. Used in Model.human_name(). #models: # For example, # user: "Dude" # will translate User model name to "Dude" - + # Translate model attribute names. Used in Model.human_attribute_name(attribute). #attributes: # For example, diff --git a/config/locales/active_support_ja.yml b/config/locales/active_support_ja.yml index 949b020a..e4181d52 100644 --- a/config/locales/active_support_ja.yml +++ b/config/locales/active_support_ja.yml @@ -7,10 +7,10 @@ ja: default: "%Y/%m/%d" short: "%y/%m/%d" long: "%Y年%m月%d日%A" - + day_names: [日曜日, 月曜日, 火曜日, 水曜日, 木曜日, 金曜日, 土曜日] abbr_day_names: [日, 月, 火, 水, 木, 金, 土] - + # Don't forget the nil at the beginning; there's no such thing as a 0th month month_names: [~, 1月, 2月, 3月, 4月, 5月, 6月, 7月, 8月, 9月, 10月, 11月, 12月] abbr_month_names: [~, 1月, 2月, 3月, 4月, 5月, 6月, 7月, 8月, 9月, 10月, 11月, 12月] @@ -24,7 +24,7 @@ ja: long: "%Y年%m月%d日%A %H時%M分%S秒%Z" am: "午前" pm: "午後" - + # Used in array.to_sentence. support: array: diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 6abb5813..c0e257e9 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1,4 +1,4 @@ -# Japanese translations for Ruby on Rails +# Japanese translations for Ruby on Rails # by Akira Matsuda (ronnie@dio.jp) # AR error messages are basically taken from Ruby-GetText-Package. Thanks to Masao Mutoh. diff --git a/features/support/env.rb b/features/support/env.rb index d2117f47..904d958f 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -9,19 +9,19 @@ require 'cucumber/rails/world' # If you set this to true, each scenario will run in a database transaction. -# You can still turn off transactions on a per-scenario basis, simply tagging -# a feature or scenario with the @no-txn tag. +# You can still turn off transactions on a per-scenario basis, simply tagging +# a feature or scenario with the @no-txn tag. # # If you set this to false, transactions will be off for all scenarios, # regardless of whether you use @no-txn or not. # -# Beware that turning transactions off will leave data in your database -# after each scenario, which can lead to hard-to-debug failures in +# Beware that turning transactions off will leave data in your database +# after each scenario, which can lead to hard-to-debug failures in # subsequent scenarios. If you do this, we recommend you create a Before # block that will explicitly put your database in a known state. Cucumber::Rails::World.use_transactional_fixtures = true -# If you set this to false, any error raised from within your app will bubble +# If you set this to false, any error raised from within your app will bubble # up to your step definition and out to cucumber unless you catch it somewhere # on the way. You can make Rails rescue errors and render error pages on a # per-scenario basis by tagging a scenario or feature with the @allow-rescue tag. @@ -39,7 +39,7 @@ require 'cucumber/rails/rspec' require 'webrat' -require 'webrat/core/matchers' +require 'webrat/core/matchers' Webrat.configure do |config| config.mode = :rails config.open_error_files = false # Set to true if you want error pages to pop up in the browser diff --git a/features/support/version_check.rb b/features/support/version_check.rb index 57439d7e..35368133 100644 --- a/features/support/version_check.rb +++ b/features/support/version_check.rb @@ -1,16 +1,16 @@ if Cucumber::VERSION != '0.4.2' warning = <<-WARNING -(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) +(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) R O T T E N C U C U M B E R A L E R T (::) Your #{__FILE__.gsub(/version_check.rb$/, 'env.rb')} file was generated with Cucumber 0.4.2, -but you seem to be running Cucumber #{Cucumber::VERSION}. If you're running an older -version than #{Cucumber::VERSION}, just upgrade your gem. If you're running a newer +but you seem to be running Cucumber #{Cucumber::VERSION}. If you're running an older +version than #{Cucumber::VERSION}, just upgrade your gem. If you're running a newer version than #{Cucumber::VERSION} you should: 1) Read http://wiki.github.com/aslakhellesoy/cucumber/upgrading - + 2) Regenerate your cucumber environment with the following command: ruby script/generate cucumber @@ -18,11 +18,11 @@ If you get prompted to replace a file, hit 'd' to see the difference. When you're sure you have captured any personal edits, confirm that you want to overwrite #{__FILE__.gsub(/version_check.rb$/, 'env.rb')} by pressing 'y'. Then reapply any -personal changes that may have been overwritten. +personal changes that may have been overwritten. This message will then self destruct. -(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) +(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) WARNING warn(warning) at_exit {warn(warning)} diff --git a/lib/hikidoc.rb b/lib/hikidoc.rb index 3dc1fc5d..e91ec5fd 100644 --- a/lib/hikidoc.rb +++ b/lib/hikidoc.rb @@ -1,11 +1,11 @@ # Copyright (c) 2005, Kazuhiko # Copyright (c) 2007 Minero Aoki # All rights reserved. -# +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: -# +# # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above @@ -15,7 +15,7 @@ # * Neither the name of the HikiDoc nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. -# +# # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake index c537159e..2d4a19da 100644 --- a/lib/tasks/cucumber.rake +++ b/lib/tasks/cucumber.rake @@ -1,4 +1,4 @@ -# This file was generated by +# This file was generated by $LOAD_PATH.unshift(RAILS_ROOT + '/vendor/plugins/cucumber/lib') if File.directory?(RAILS_ROOT + '/vendor/plugins/cucumber/lib') unless ARGV.any? {|a| a =~ /^gems/} diff --git a/lib/tasks/rspec.rake b/lib/tasks/rspec.rake index a0ed7916..f8ff7a2e 100644 --- a/lib/tasks/rspec.rake +++ b/lib/tasks/rspec.rake @@ -114,7 +114,7 @@ namespace :spec do ActiveRecord::Base.establish_connection(Rails.env) base_dir = File.join(Rails.root, 'spec', 'fixtures') fixtures_dir = ENV['FIXTURES_DIR'] ? File.join(base_dir, ENV['FIXTURES_DIR']) : base_dir - + require 'active_record/fixtures' (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/).map {|f| File.join(fixtures_dir, f) } : Dir.glob(File.join(fixtures_dir, '*.{yml,csv}'))).each do |fixture_file| Fixtures.create_fixtures(File.dirname(fixture_file), File.basename(fixture_file, '.*')) @@ -125,7 +125,7 @@ namespace :spec do namespace :server do daemonized_server_pid = File.expand_path("#{RAILS_ROOT}/tmp/pids/spec_server.pid") - + desc "start spec_server." task :start do if File.exist?(daemonized_server_pid) @@ -143,14 +143,14 @@ namespace :spec do $stderr.puts "No server running." else $stderr.puts "Shutting down spec_server ..." - system("kill", "-s", "TERM", File.read(daemonized_server_pid).strip) && + system("kill", "-s", "TERM", File.read(daemonized_server_pid).strip) && File.delete(daemonized_server_pid) end end desc "restart spec_server." task :restart => [:stop, :start] - + desc "check if spec server is running" task :status do if File.exist?(daemonized_server_pid) diff --git a/spec/helpers/accounts_helper_spec.rb b/spec/helpers/accounts_helper_spec.rb index 4c8d6fbf..548ecdd8 100644 --- a/spec/helpers/accounts_helper_spec.rb +++ b/spec/helpers/accounts_helper_spec.rb @@ -1,7 +1,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe AccountsHelper do - + #Delete this example and add some real ones or delete this file it "should be included in the object returned by #helper" do included_modules = (class << helper; self; end).send :included_modules diff --git a/spec/helpers/admin/lightning_talk_submission_helper_spec.rb b/spec/helpers/admin/lightning_talk_submission_helper_spec.rb index 94b1edb7..8ff0666f 100644 --- a/spec/helpers/admin/lightning_talk_submission_helper_spec.rb +++ b/spec/helpers/admin/lightning_talk_submission_helper_spec.rb @@ -1,7 +1,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') describe Admin::LightningTalkSubmissionHelper do - + #Delete this example and add some real ones or delete this file it "should be included in the object returned by #helper" do included_modules = (class << helper; self; end).send :included_modules diff --git a/spec/helpers/exchange_tickets_helper_spec.rb b/spec/helpers/exchange_tickets_helper_spec.rb index 9c608887..e2b04216 100644 --- a/spec/helpers/exchange_tickets_helper_spec.rb +++ b/spec/helpers/exchange_tickets_helper_spec.rb @@ -1,7 +1,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe ExchangeTicketsHelper do - + #Delete this example and add some real ones or delete this file it "should be included in the object returned by #helper" do included_modules = (class << helper; self; end).send :included_modules diff --git a/spec/helpers/paypal_helper_spec.rb b/spec/helpers/paypal_helper_spec.rb index b356839e..a2c9ef38 100644 --- a/spec/helpers/paypal_helper_spec.rb +++ b/spec/helpers/paypal_helper_spec.rb @@ -1,7 +1,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe PaypalHelper do - + #Delete this example and add some real ones or delete this file it "should be included in the object returned by #helper" do included_modules = (class << helper; self; end).send :included_modules diff --git a/spec/helpers/registrations_helper_spec.rb b/spec/helpers/registrations_helper_spec.rb index 2d57dd6d..c4152ff8 100644 --- a/spec/helpers/registrations_helper_spec.rb +++ b/spec/helpers/registrations_helper_spec.rb @@ -1,7 +1,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe RegistrationsHelper do - + #Delete this example and add some real ones or delete this file it "should be included in the object returned by #helper" do included_modules = (class << helper; self; end).send :included_modules diff --git a/spec/helpers/sessions_helper_spec.rb b/spec/helpers/sessions_helper_spec.rb index 050e5a49..d7b64817 100644 --- a/spec/helpers/sessions_helper_spec.rb +++ b/spec/helpers/sessions_helper_spec.rb @@ -1,7 +1,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe SessionsHelper do - + #Delete this example and add some real ones or delete this file it "should be included in the object returned by #helper" do included_modules = (class << helper; self; end).send :included_modules diff --git a/spec/helpers/talks_helper_spec.rb b/spec/helpers/talks_helper_spec.rb index 88761bee..2ad7ffda 100644 --- a/spec/helpers/talks_helper_spec.rb +++ b/spec/helpers/talks_helper_spec.rb @@ -1,11 +1,11 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe TalksHelper do - + #Delete this example and add some real ones or delete this file it "is included in the helper object" do included_modules = (class << helper; self; end).send :included_modules included_modules.should include(TalksHelper) end - + end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index eb903c5b..9e6ea3d3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,20 +2,20 @@ require 'spork' Spork.prefork do - # Loading more in this block will cause your specs to run faster. However, + # Loading more in this block will cause your specs to run faster. However, # if you change any configuration or code from libraries loaded here, you'll # need to restart spork for it take effect. - + end Spork.each_run do # This code will be run each time you run your specs. - + end # --- Instructions --- -# - Sort through your spec_helper file. Place as much environment loading -# code that you don't normally modify during development in the +# - Sort through your spec_helper file. Place as much environment loading +# code that you don't normally modify during development in the # Spork.prefork block. # - Place the rest under Spork.each_run block # - Any code that is left outside of the blocks will be ran during preforking diff --git a/spec/views/sessions/create.html.erb_spec.rb b/spec/views/sessions/create.html.erb_spec.rb index 6c306574..e8b99a20 100644 --- a/spec/views/sessions/create.html.erb_spec.rb +++ b/spec/views/sessions/create.html.erb_spec.rb @@ -4,7 +4,7 @@ before(:each) do render 'sessions/create' end - + #Delete this example and add some real ones or delete this file it "should tell you where to find the file" do response.should have_tag('p', %r[Find me in app/views/sessions/create]) diff --git a/spec/views/sessions/destroy.html.erb_spec.rb b/spec/views/sessions/destroy.html.erb_spec.rb index 802af642..b59ef21e 100644 --- a/spec/views/sessions/destroy.html.erb_spec.rb +++ b/spec/views/sessions/destroy.html.erb_spec.rb @@ -4,7 +4,7 @@ before(:each) do render 'sessions/destroy' end - + #Delete this example and add some real ones or delete this file it "should tell you where to find the file" do response.should have_tag('p', %r[Find me in app/views/sessions/destroy]) diff --git a/test/fixtures/lightning_talk_submissions.yml b/test/fixtures/lightning_talk_submissions.yml index 248ed288..4099fc7a 100644 --- a/test/fixtures/lightning_talk_submissions.yml +++ b/test/fixtures/lightning_talk_submissions.yml @@ -6,7 +6,7 @@ one: email: MyText title: MyText abstract: MyText - has_ticket: + has_ticket: note: MyText two: @@ -15,5 +15,5 @@ two: email: MyText title: MyText abstract: MyText - has_ticket: + has_ticket: note: MyText diff --git a/test/test_helper.rb b/test/test_helper.rb index 9f192695..24e9b856 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -16,7 +16,7 @@ class Test::Unit::TestCase # don't care one way or the other, switching from MyISAM to InnoDB tables # is recommended. # - # The only drawback to using transactional fixtures is when you actually + # The only drawback to using transactional fixtures is when you actually # need to test transactions. Since your test is bracketed by a transaction, # any transactions started in your code will be automatically rolled back. self.use_transactional_fixtures = true diff --git a/vendor/plugins/configatron_rails/README.textile b/vendor/plugins/configatron_rails/README.textile index 33e32c12..7104c94c 100644 --- a/vendor/plugins/configatron_rails/README.textile +++ b/vendor/plugins/configatron_rails/README.textile @@ -1,7 +1,7 @@ h2. "ConfigatronRails":http://www.github.com/cmaggard/configatron-rails ConfigatronRails is a plugin born out of a want for environment-specific -variables using a gem I've grown to appreciate: +variables using a gem I've grown to appreciate: "configatron":http://github.com/markbates/configatron. * "Installation":#INSTALL @@ -17,7 +17,7 @@ h3. Installation / Upgrading

     > sudo gem install configatron
-  
+
     # Or toss this in your environment.rb (preferred method)
     config.gem "configatron"
   
@@ -48,7 +48,7 @@ _In config.yml_ test: <<: *local - + production: site_address: http://www.thebestappev.er/ diff --git a/vendor/plugins/flash-message-conductor/README b/vendor/plugins/flash-message-conductor/README index 7abfef8c..5cb403c3 100644 --- a/vendor/plugins/flash-message-conductor/README +++ b/vendor/plugins/flash-message-conductor/README @@ -24,7 +24,7 @@ flash.keep(:message) Controller helpers included: -add_message( message, options ) +add_message( message, options ) add_notice( message, options ) add_error( message, options ) diff --git a/vendor/plugins/flash-message-conductor/examples/example_jquery.js b/vendor/plugins/flash-message-conductor/examples/example_jquery.js index 47d42cfc..7504d8a3 100644 --- a/vendor/plugins/flash-message-conductor/examples/example_jquery.js +++ b/vendor/plugins/flash-message-conductor/examples/example_jquery.js @@ -1,7 +1,7 @@ $(document).ready(function() { setTimeout(hideFlashes, 25000); }); - + var hideFlashes = function() { $('#flash_messages p.fade').fadeOut(1500); } \ No newline at end of file diff --git a/vendor/plugins/flash-message-conductor/examples/example_prototype.js b/vendor/plugins/flash-message-conductor/examples/example_prototype.js index d81f7d15..4802b208 100644 --- a/vendor/plugins/flash-message-conductor/examples/example_prototype.js +++ b/vendor/plugins/flash-message-conductor/examples/example_prototype.js @@ -1,7 +1,7 @@ document.observe('dom:loaded', function() { setTimeout(hideFlashes, 25000); }); - + var hideFlashes = function() { $$('#flash_messages p.fade').each(function(e) { if (e) Effect.Fade(e, { duration: 1.5 }); diff --git a/vendor/plugins/flash-message-conductor/lib/flash_message_conductor.rb b/vendor/plugins/flash-message-conductor/lib/flash_message_conductor.rb index e0672efc..eb14a604 100644 --- a/vendor/plugins/flash-message-conductor/lib/flash_message_conductor.rb +++ b/vendor/plugins/flash-message-conductor/lib/flash_message_conductor.rb @@ -1,9 +1,9 @@ # ArgonHelpers -module PlanetArgon +module PlanetArgon module FlashMessageConductor FLASH_MESSAGE_TYPES = [ :error, :notice, :message ] - + module ControllerHelpers def add_error(msg, options = {}) set_flash(:error, msg, options ) @@ -16,13 +16,13 @@ def add_notice(msg, options = {}) def add_message(msg, options = {}) set_flash(:message, msg, options ) end - + protected def set_flash(type, msg, options) flash[type] = msg - + options[:state].to_sym if options[:state] - + case options[:state] when :discard flash.discard(type) @@ -31,19 +31,19 @@ def set_flash(type, msg, options) when :keep flash.keep(type) end - + if options[:fade] == true flash[:fade] = 'fade' end end end - + module ViewHelpers - def render_flash_message( css_class, message = "", fade_option = "" ) + def render_flash_message( css_class, message = "", fade_option = "" ) return "" if message.nil? or message.blank? content_tag( "p", message, :class => "#{css_class} #{fade_option}" ) end - + def render_flash_messages( div_id = "flash_messages", div_class = "" ) div_content = '' FLASH_MESSAGE_TYPES.each do |key| @@ -55,7 +55,7 @@ def render_flash_messages( div_id = "flash_messages", div_class = "" ) return content_tag( 'div', div_content, :id => div_id, :class => div_class ) end end - + def flash_message_set? flash_set = false FLASH_MESSAGE_TYPES.each do |key| diff --git a/vendor/plugins/http_accept_language/README.rdoc b/vendor/plugins/http_accept_language/README.rdoc index be3da9ed..08201c73 100644 --- a/vendor/plugins/http_accept_language/README.rdoc +++ b/vendor/plugins/http_accept_language/README.rdoc @@ -16,14 +16,14 @@ See also: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html class SomeController < ApplicationController def some_action - + request.user_preferred_languages # => [ 'nl-NL', 'nl-BE', 'nl', 'en-US', 'en' ] - + available = %w{en en-US nl-BE} request.preferred_language_from(available) # => 'nl-BE' - + request.user_preferred_language # => [ 'en-GB'] available = %w{en-US} diff --git a/vendor/plugins/http_accept_language/lib/http_accept_language.rb b/vendor/plugins/http_accept_language/lib/http_accept_language.rb index bd872974..53ace184 100644 --- a/vendor/plugins/http_accept_language/lib/http_accept_language.rb +++ b/vendor/plugins/http_accept_language/lib/http_accept_language.rb @@ -9,7 +9,7 @@ def user_preferred_languages raise "Not correctly formatted" unless x.first =~ /^[a-z\-]+$/i y.last.to_f <=> x.last.to_f end.collect do |l| - l.first.downcase.gsub(/-[a-z]+$/i){|x| x.upcase} + l.first.downcase.gsub(/-[a-z]+$/i){|x| x.upcase} end rescue [] @@ -17,10 +17,10 @@ def user_preferred_languages def preferred_language_from(array) (user_preferred_languages & array).first end - + def compatible_language_from(array) array.select{|x| lang = x.split("-")[0]; user_preferred_languages.any?{|y| y.split("-")[0] == lang }}.first end - - + + end diff --git a/vendor/plugins/http_accept_language/test/http_accept_language_test.rb b/vendor/plugins/http_accept_language/test/http_accept_language_test.rb index 3649a6cd..2f4a8c24 100644 --- a/vendor/plugins/http_accept_language/test/http_accept_language_test.rb +++ b/vendor/plugins/http_accept_language/test/http_accept_language_test.rb @@ -36,7 +36,7 @@ def test_should_find_first_compatible_language assert_equal 'en-hk', request.compatible_language_from(%w{en-hk}) assert_equal 'en', request.compatible_language_from(%w{en}) end - + private def request diff --git a/vendor/plugins/open_id_authentication/README b/vendor/plugins/open_id_authentication/README index 807cdc75..8895a731 100644 --- a/vendor/plugins/open_id_authentication/README +++ b/vendor/plugins/open_id_authentication/README @@ -29,7 +29,7 @@ Alternatively, you can use the file-based store, which just relies on on tmp/ope OpenIdAuthentication.store = :file This particular plugin also relies on the fact that the authentication action allows for both POST and GET operations. -If you're using RESTful authentication, you'll need to explicitly allow for this in your routes.rb. +If you're using RESTful authentication, you'll need to explicitly allow for this in your routes.rb. The plugin also expects to find a root_url method that points to the home page of your site. You can accomplish this by using a root route in config/routes.rb: @@ -53,7 +53,7 @@ Also of note is the following code block used in the example below: authenticate_with_open_id do |result, identity_url| ... end - + In the above code block, 'identity_url' will need to match user.identity_url exactly. 'identity_url' will be a string in the form of 'http://example.com' - If you are storing just 'example.com' with your user, the lookup will fail. @@ -131,8 +131,8 @@ app/controllers/sessions_controller.rb end end end - - + + private def successful_login session[:user_id] = @current_user.id @@ -171,7 +171,7 @@ You can support it in your app by changing #open_id_authentication def open_id_authentication(identity_url) # Pass optional :required and :optional keys to specify what sreg fields you want. # Be sure to yield registration, a third argument in the #authenticate_with_open_id block. - authenticate_with_open_id(identity_url, + authenticate_with_open_id(identity_url, :required => [ :nickname, :email ], :optional => :fullname) do |result, identity_url, registration| case result.status @@ -199,7 +199,7 @@ You can support it in your app by changing #open_id_authentication end end end - + # registration is a hash containing the valid sreg keys given above # use this to map them to fields of your user model def assign_registration_attributes!(registration) @@ -221,9 +221,9 @@ Some OpenID providers also support the OpenID AX (attribute exchange) protocol f Accessing AX data is very similar to the Simple Registration process, described above -- just add the URI identifier for the AX field to your :optional or :required parameters. For example: - authenticate_with_open_id(identity_url, + authenticate_with_open_id(identity_url, :required => [ :email, 'http://schema.openid.net/birthDate' ]) do |result, identity_url, registration| - + This would provide the sreg data for :email, and the AX data for 'http://schema.openid.net/birthDate' diff --git a/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb b/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb index 6a05ea07..b8c17573 100644 --- a/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb +++ b/vendor/plugins/open_id_authentication/lib/open_id_authentication.rb @@ -138,7 +138,7 @@ def begin_open_id_authentication(identity_url, options = {}) identity_url = normalize_identifier(identity_url) return_to = options.delete(:return_to) method = options.delete(:method) - + options[:required] ||= [] # reduces validation later options[:optional] ||= [] @@ -169,7 +169,7 @@ def complete_open_id_authentication profile_data.merge! data_response.from_success_response( open_id_response ).data end end - + yield Result[:successful], identity_url, profile_data when OpenID::Consumer::CANCEL yield Result[:canceled], identity_url, nil @@ -186,20 +186,20 @@ def open_id_consumer def add_simple_registration_fields(open_id_request, fields) sreg_request = OpenID::SReg::Request.new - + # filter out AX identifiers (URIs) required_fields = fields[:required].collect { |f| f.to_s unless f =~ /^https?:\/\// }.compact optional_fields = fields[:optional].collect { |f| f.to_s unless f =~ /^https?:\/\// }.compact - + sreg_request.request_fields(required_fields, true) unless required_fields.blank? sreg_request.request_fields(optional_fields, false) unless optional_fields.blank? sreg_request.policy_url = fields[:policy_url] if fields[:policy_url] open_id_request.add_extension(sreg_request) end - + def add_ax_fields( open_id_request, fields ) ax_request = OpenID::AX::FetchRequest.new - + # look through the :required and :optional fields for URIs (AX identifiers) fields[:required].each do |f| next unless f =~ /^https?:\/\// @@ -210,10 +210,10 @@ def add_ax_fields( open_id_request, fields ) next unless f =~ /^https?:\/\// ax_request.add( OpenID::AX::AttrInfo.new( f, nil, false ) ) end - + open_id_request.add_extension( ax_request ) end - + def open_id_redirect_url(open_id_request, return_to = nil, method = nil) open_id_request.return_to_args['_method'] = (method || request.method).to_s open_id_request.return_to_args['open_id_complete'] = '1'