Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix typo

  • Loading branch information...
commit 23eb5ea1ec39cc8d5bac3fd9b9d2b141f804c7e1 1 parent e31e72f
@zishe zishe authored
View
16 lib/warden/hooks.rb
@@ -25,14 +25,14 @@ def _run_callbacks(kind, *args) #:nodoc:
#
# Parameters:
# <options> Some options which specify when the callback should be executed
- # scope - Executes the callback only if it maches the scope(s) given
+ # scope - Executes the callback only if it matches the scope(s) given
# only - Executes the callback only if it matches the event(s) given
# except - Executes the callback except if it matches the event(s) given
# <block> A block where you can set arbitrary logic to run every time a user is set
# Block Parameters: |user, auth, opts|
# user - The user object that is being set
# auth - The raw authentication proxy object.
- # opts - any options passed into the set_user call includeing :scope
+ # opts - any options passed into the set_user call including :scope
#
# Example:
# Warden::Manager.after_set_user do |user,auth,opts|
@@ -77,7 +77,7 @@ def after_authentication(options = {}, method = :push, &block)
end
# after_fetch is just a wrapper to after_set_user, which is only invoked
- # when the user is fetched from sesion. The options and yielded arguments
+ # when the user is fetched from session. The options and yielded arguments
# are the same as in after_set_user.
#
# :api: public
@@ -85,18 +85,18 @@ def after_fetch(options = {}, method = :push, &block)
after_set_user(options.merge(:event => :fetch), method, &block)
end
- # A callback that runs just prior to the failur application being called.
+ # A callback that runs just prior to the failure application being called.
# This callback occurs after PATH_INFO has been modified for the failure (default /unauthenticated)
# In this callback you can mutate the environment as required by the failure application
# If a Rails controller were used for the failure_app for example, you would need to set request[:params][:action] = :unauthenticated
#
# Parameters:
# <options> Some options which specify when the callback should be executed
- # scope - Executes the callback only if it maches the scope(s) given
+ # scope - Executes the callback only if it matches the scope(s) given
# <block> A block to contain logic for the callback
# Block Parameters: |env, opts|
# env - The rack env hash
- # opts - any options passed into the authenticate call includeing :scope
+ # opts - any options passed into the authenticate call including :scope
#
# Example:
# Warden::Manager.before_failure do |env, opts|
@@ -121,7 +121,7 @@ def _before_failure
#
# Parameters:
# <options> Some options which specify when the callback should be executed
- # scope - Executes the callback only if it maches the scope(s) given
+ # scope - Executes the callback only if it matches the scope(s) given
# <block> A block to contain logic for the callback
# Block Parameters: |user, auth, scope|
# user - The authenticated user for the current scope
@@ -149,7 +149,7 @@ def _after_failed_fetch
#
# Parameters:
# <options> Some options which specify when the callback should be executed
- # scope - Executes the callback only if it maches the scope(s) given
+ # scope - Executes the callback only if it matches the scope(s) given
# <block> A block to contain logic for the callback
# Block Parameters: |user, auth, scope|
# user - The authenticated user for the current scope
View
6 lib/warden/manager.rb
@@ -4,7 +4,7 @@
module Warden
# The middleware for Rack Authentication
- # The middlware requires that there is a session upstream
+ # The middleware requires that there is a session upstream
# The middleware injects an authentication object into
# the rack environment hash
class Manager
@@ -72,8 +72,8 @@ def serialize_into_session(scope = nil, &block)
Warden::SessionSerializer.send :define_method, method_name, &block
end
- # Reconstitues the user from the session.
- # Use the results of user_session_key to reconstitue the user from the session on requests after the initial login
+ # Reconstitutes the user from the session.
+ # Use the results of user_session_key to reconstitute the user from the session on requests after the initial login
# You can supply different methods of de-serialization for different scopes by passing a scope symbol
#
# Example:
View
2  lib/warden/mixins/common.rb
@@ -3,7 +3,7 @@ module Warden
module Mixins
module Common
- # Convinience method to access the session
+ # Convenience method to access the session
# :api: public
def session
env['rack.session']
View
8 lib/warden/proxy.rb
@@ -87,7 +87,7 @@ def lock!
@locked = true
end
- # Run the authentiation strategies for the given strategies.
+ # Run the authentication strategies for the given strategies.
# If there is already a user logged in for a given scope, the strategies are not run
# This does not halt the flow of control and is a passive attempt to authenticate only
# When scope is not specified, the default_scope is assumed.
@@ -181,7 +181,7 @@ def set_user(user, opts = {})
@users[scope]
end
- # Provides acccess to the user object in a given scope for a request.
+ # Provides access to the user object in a given scope for a request.
# Will be nil if not logged in. Please notice that this method does not
# perform strategies.
#
@@ -280,7 +280,7 @@ def message
winning_strategy && winning_strategy.message
end
- # Provides a way to return a 401 without warden defering to the failure app
+ # Provides a way to return a 401 without warden deferring to the failure app
# The result is a direct passthrough of your own response
# :api: public
def custom_failure!
@@ -360,7 +360,7 @@ def _run_strategies_for(scope, args) #:nodoc:
end
end
- # Fetchs strategies and keep them in a hash cache.
+ # Fetches strategies and keep them in a hash cache.
def _fetch_strategy(name, scope)
@strategies[scope][name] ||= if klass = Warden::Strategies[name]
klass.new(@env, scope)
View
12 lib/warden/strategies/base.rb
@@ -11,9 +11,9 @@ module Strategies
#
# The parameters for Warden::Strategies.add method is:
# <label: Symbol> The label is the name given to a strategy. Use the label to refer to the strategy when authenticating
- # <strategy: Class|nil> The optional stragtegy argument if set _must_ be a class that inherits from Warden::Strategies::Base and _must_
+ # <strategy: Class|nil> The optional strategy argument if set _must_ be a class that inherits from Warden::Strategies::Base and _must_
# implement an @authenticate!@ method
- # <block> The block acts as a convinient way to declare your strategy. Inside is the class definition of a strategy.
+ # <block> The block acts as a convenient way to declare your strategy. Inside is the class definition of a strategy.
#
# Examples:
#
@@ -109,7 +109,7 @@ def store?
def pass; end
# Whenever you want to provide a user object as "authenticated" use the +success!+ method.
- # This will halt the strategy, and set the user in the approprieate scope.
+ # This will halt the strategy, and set the user in the appropriate scope.
# It is the "login" method
#
# Parameters:
@@ -133,7 +133,7 @@ def fail!(message = "Failed to Login")
@result = :failure
end
- # Casuses the strategy to fail, but not halt. The strategies will cascade after this failure and warden will check the next strategy. The last strategy to fail will have it's message displayed.
+ # Causes the strategy to fail, but not halt. The strategies will cascade after this failure and warden will check the next strategy. The last strategy to fail will have it's message displayed.
# :api: public
def fail(message = "Failed to Login")
@message = message
@@ -144,8 +144,8 @@ def fail(message = "Failed to Login")
#
# Parameters:
# url <String> - The string representing the URL to be redirected to
- # pararms <Hash> - Any parameters to encode into the URL
- # opts <Hash> - Any options to recirect with.
+ # params <Hash> - Any parameters to encode into the URL
+ # opts <Hash> - Any options to redirect with.
# available options: permanent => (true || false)
#
# :api: public
View
2  lib/warden/test/helpers.rb
@@ -10,7 +10,7 @@ def self.included(base)
::Warden.test_mode!
end
- # A helper method that will peform a login of a user in warden for the next request
+ # A helper method that will perform a login of a user in warden for the next request
# Provide it the same options as you would to Warden::Proxy#set_user
# @see Warden::Proxy#set_user
# @api public
View
2  lib/warden/test/warden_helpers.rb
@@ -32,7 +32,7 @@ def test_reset!
_on_next_request.clear
end
- # A containter for the on_next_request items.
+ # A container for the on_next_request items.
# @api private
def _on_next_request
@_on_next_request ||= []
View
4 spec/warden/authenticated_data_store_spec.rb
@@ -37,7 +37,7 @@
@env['rack.session']['warden.user.foo.session'].should eq({:key => "value"})
end
- it "should store the data seperately" do
+ it "should store the data separately" do
app = lambda do |e|
e['warden'].session[:key] = "value"
e['warden'].session(:foo)[:key] = "another value"
@@ -84,7 +84,7 @@
@env['rack.session']['warden.user.foo.session' ].should be_nil
end
- it "should logout multuiple personas at once" do
+ it "should logout multiple persons at once" do
@env['rack.session']['warden.user.bar.key'] = "bar user"
app = lambda do |e|
View
8 spec/warden/proxy_spec.rb
@@ -26,7 +26,7 @@
app.call(@env).first.should be(200)
end
- it "should check the authentication if it is explicity checked" do
+ it "should check the authentication if it is explicitly checked" do
app = setup_rack(@authd_app)
app.call(@env).first.should be(401)
end
@@ -56,7 +56,7 @@
setup_rack(app).call(env)
end
- it "should allow me to select which strategies I use in my appliction" do
+ it "should allow me to select which strategies I use in my application" do
env = env_with_params("/", :foo => "bar")
app = lambda do |_env|
_env['warden'].authenticate(:failz)
@@ -400,7 +400,7 @@
valid_response
end
setup_rack(app).call(@env)
- end
+ end
end
describe "lock" do
@@ -624,7 +624,7 @@
result.last.should eq(["The Success Strategy Has Accepted You"])
end
- it "should not die when accessing a message from a source where no authentication has occured" do
+ it "should not die when accessing a message from a source where no authentication has occurred" do
app = lambda do |e|
[200, {"Content-Type" => "text/plain"}, [e['warden'].message]]
end
Please sign in to comment.
Something went wrong with that request. Please try again.