authlogic 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. data/.gitignore +9 -0
  2. data/CHANGELOG.rdoc +107 -2
  3. data/{MIT-LICENSE → LICENSE} +1 -1
  4. data/README.rdoc +136 -159
  5. data/Rakefile +47 -18
  6. data/VERSION.yml +4 -0
  7. data/authlogic.gemspec +205 -0
  8. data/init.rb +1 -1
  9. data/lib/authlogic/acts_as_authentic/base.rb +33 -12
  10. data/lib/authlogic/acts_as_authentic/email.rb +47 -14
  11. data/lib/authlogic/acts_as_authentic/logged_in_status.rb +20 -14
  12. data/lib/authlogic/acts_as_authentic/login.rb +84 -8
  13. data/lib/authlogic/acts_as_authentic/password.rb +216 -87
  14. data/lib/authlogic/acts_as_authentic/perishable_token.rb +9 -4
  15. data/lib/authlogic/acts_as_authentic/persistence_token.rb +4 -2
  16. data/lib/authlogic/acts_as_authentic/restful_authentication.rb +5 -4
  17. data/lib/authlogic/acts_as_authentic/session_maintenance.rb +17 -5
  18. data/lib/authlogic/acts_as_authentic/single_access_token.rb +10 -3
  19. data/lib/authlogic/acts_as_authentic/validations_scope.rb +2 -2
  20. data/lib/authlogic/controller_adapters/abstract_adapter.rb +13 -1
  21. data/lib/authlogic/controller_adapters/rails_adapter.rb +1 -1
  22. data/lib/authlogic/crypto_providers/aes256.rb +2 -2
  23. data/lib/authlogic/crypto_providers/bcrypt.rb +3 -1
  24. data/lib/authlogic/crypto_providers/sha1.rb +2 -2
  25. data/lib/authlogic/i18n.rb +10 -1
  26. data/lib/authlogic/regex.rb +25 -0
  27. data/lib/authlogic/session/activation.rb +2 -0
  28. data/lib/authlogic/session/active_record_trickery.rb +19 -3
  29. data/lib/authlogic/session/brute_force_protection.rb +26 -11
  30. data/lib/authlogic/session/callbacks.rb +16 -6
  31. data/lib/authlogic/session/cookies.rb +15 -11
  32. data/lib/authlogic/session/existence.rb +4 -2
  33. data/lib/authlogic/session/foundation.rb +1 -1
  34. data/lib/authlogic/session/http_auth.rb +46 -11
  35. data/lib/authlogic/session/magic_columns.rb +25 -6
  36. data/lib/authlogic/session/magic_states.rb +4 -4
  37. data/lib/authlogic/session/params.rb +14 -9
  38. data/lib/authlogic/session/password.rb +86 -24
  39. data/lib/authlogic/session/priority_record.rb +1 -1
  40. data/lib/authlogic/session/session.rb +2 -2
  41. data/lib/authlogic/session/timeout.rb +1 -1
  42. data/lib/authlogic/session/validation.rb +9 -5
  43. data/lib/authlogic/test_case/mock_controller.rb +45 -0
  44. data/lib/authlogic/test_case/mock_cookie_jar.rb +14 -0
  45. data/lib/authlogic/test_case/mock_logger.rb +10 -0
  46. data/lib/authlogic/test_case/mock_request.rb +19 -0
  47. data/lib/authlogic/test_case/rails_request_adapter.rb +30 -0
  48. data/lib/authlogic/test_case.rb +114 -0
  49. data/lib/authlogic.rb +1 -1
  50. data/rails/init.rb +1 -0
  51. data/shoulda_macros/authlogic.rb +2 -1
  52. data/test/acts_as_authentic_test/base_test.rb +6 -0
  53. data/test/acts_as_authentic_test/email_test.rb +25 -7
  54. data/test/acts_as_authentic_test/login_test.rb +37 -7
  55. data/test/acts_as_authentic_test/magic_columns_test.rb +4 -4
  56. data/test/acts_as_authentic_test/password_test.rb +64 -40
  57. data/test/acts_as_authentic_test/perishable_token_test.rb +36 -2
  58. data/test/acts_as_authentic_test/restful_authentication_test.rb +40 -0
  59. data/test/acts_as_authentic_test/session_maintenance_test.rb +34 -18
  60. data/test/acts_as_authentic_test/single_access_test.rb +6 -1
  61. data/test/libs/affiliate.rb +7 -0
  62. data/test/libs/ldaper.rb +3 -0
  63. data/test/random_test.rb +2 -2
  64. data/test/session_test/activation_test.rb +1 -1
  65. data/test/session_test/active_record_trickery_test.rb +2 -1
  66. data/test/session_test/brute_force_protection_test.rb +34 -9
  67. data/test/session_test/cookies_test.rb +3 -3
  68. data/test/session_test/http_auth_test.rb +20 -8
  69. data/test/session_test/magic_columns_test.rb +7 -4
  70. data/test/session_test/magic_states_test.rb +3 -3
  71. data/test/session_test/params_test.rb +4 -4
  72. data/test/session_test/password_test.rb +8 -0
  73. data/test/session_test/session_test.rb +9 -9
  74. data/test/session_test/timeout_test.rb +10 -1
  75. data/test/test_helper.rb +46 -24
  76. metadata +38 -27
  77. data/Manifest.txt +0 -111
  78. data/lib/authlogic/testing/test_unit_helpers.rb +0 -39
  79. data/lib/authlogic/version.rb +0 -56
  80. data/test/libs/mock_controller.rb +0 -35
  81. data/test/libs/mock_cookie_jar.rb +0 -10
  82. data/test/libs/mock_request.rb +0 -5
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ .DS_Store
2
+ .swp
3
+ *.log
4
+ *.sqlite3
5
+ pkg/*
6
+ coverage/*
7
+ doc/*
8
+ benchmarks/*
9
+
data/CHANGELOG.rdoc CHANGED
@@ -1,4 +1,109 @@
1
- == 2.0.0
1
+ == 2.1.0 released 2009-6-27
2
+
3
+ * Fixed bug when using act_like_restful_authentication and setting passwords, needed to add a 2nd parameter to tell if to check against the database or not.
4
+ * Don't save record if they are read only.
5
+
6
+ == 2.0.14 released 2009-6-13
7
+
8
+ * Fixed issue with using brute force protection AND generalize_credentials_error_messages. Brute force protection was looking to see if there were password errors, which generalize_credentials_error_messages was obfuscating.
9
+ * Added db_setup? method to avoid errors during rake tasks where the db might not be set up. Ex: migrations
10
+ * Stop using errors.on(key) since that is now deprecated in Rails. Use errors[key] instead.
11
+ * Use valid_password? for the method name to validate a password instead of valid_#{password_field}?.
12
+
13
+ == 2.0.13 released 2009-5-13
14
+
15
+ * Add authlogic/regex.rb to manifest
16
+
17
+ == 2.0.12 released 2009-5-13
18
+
19
+ * Added the ability to add a last_request_update_allowed? method in your controller to pragmatically tell Authlogic when and when not to update the last_request_at field in your database. This only takes effect if the method if present.
20
+ * Extracted Authlogic's regular expressions into it's own module to allow easy use of them outside of Authlogic. See Authlogic::Regex for more info.
21
+ * Made being_brute_force_protected? true for the Authlogic::Session::BruteForceProtection module.
22
+ * Added the configuration option generalize_credentials_error_messages for the Authlogic::Session::Password module. This allows you to generalize your login / password errors messages as to not reveal was the problem was when authenticating. If enabled, when an invalid login is supplied it will use the same exact error message when an invalid password is supplied.
23
+ * Update email regular expression to use A-Z0-9 instead of /w as to not allow for diacritical marks in an email address.
24
+ * Changed config() convenience method to rw_config() to be more descriptive and less vague.
25
+
26
+ == 2.0.11 released 2009-4-25
27
+
28
+ * Fix bug when password is turned off and the SingleAccessToken module calls the after_password_set callback.
29
+ * HTTP basic auth can now be toggled on or off. It also checks for the existence of a standard username and password before enabling itself.
30
+ * Added option check_passwords_against_database for Authlogic::ActsAsAuthentic::Password to toggle between checking the password against the database value or the object value. Also added the same functionality to the instance method: valid_password?("password", true), where the second argument tells Authlogic to check the password against the database value. The default for this new feature is true.
31
+ * Add a maintain_sessions configuration option to Authlogic::ActsAsAuthentic::SessionMaintenance as a "clearer" option to disable automatic session maintenance.
32
+ * single_access_allowed_request_types can also be equal to :all instead of just [:all].
33
+ * Refactor params_enabled? so that the single_access_allowed? method in controllers takes precedence.
34
+ * Added testing comments in the README and expanded on the documentation in Authlogic::TestCase
35
+
36
+ == 2.0.10 released 2009-4-21
37
+
38
+ * Mock request is now transparent to non existent methods. Since the methods calls really have no functional value when testing authlogic.
39
+ * Allow password confirmation to be disabled.
40
+ * Modified login format validation to allow for the + character since emails addresses allow that as a valid character.
41
+ * Added merge_* configuration methods for acts_as_authentic to make merging options into configuration options that default to hashes. Just a few convenience methods.
42
+
43
+ == 2.0.9 released 2009-4-9
44
+
45
+ * Fixed bug where hooks provided by the password module were called when the password module was not being used due to the fact that the password field did not exist.
46
+ * Fixed bug where the find_with_login method was not being aliased if you were using an alternate field besides login.
47
+
48
+ == 2.0.8 release 2009-4-9
49
+
50
+ * Dont reset the @password_changed instance variable to false because its halts the callback chain, instead reset it to nil.
51
+
52
+ == 2.0.7 released 2009-4-9
53
+
54
+ * Rename TestCase::ControllerAdapter to TestCase::RailsRequestAdapter to help clarify it's usage and fix a constant typo.
55
+
56
+ == 2.0.6 released 2009-4-9
57
+
58
+ * Don't use second, use [1] instead so older rails versions don't complain.
59
+ * Update email regular expression to be less TLD specific: (?:[A-Z]{2,4}|museum|travel)
60
+ * Update shoulda macro for 2.0
61
+ * validates_length_of_password_confirmation_field_options defaults to validates_confirmation_of_password_field_options
62
+ * Use MockCookieJar in tests instead of a Hash in the MockController.
63
+ * Cookies now store the record id as well, for faster lookup. Also to avoid the need to use sessions since sessions are lazily loaded in rails 2.3+
64
+ * Add configuration option for Authlogic::ActsAsAuthentic: ignore_blank_passwords
65
+ * Fix cookie_domain in rails adapter
66
+ * Make password and login fields optional. This allows you to have an alternate authentication method as your main authentication source. Such as OpenID, LDAP, or whatever you want.
67
+ * Reset the @password_changed instance variable after the record has been saved.
68
+ * Add referer and user_agent to mock requests for testing purposes.
69
+ * Add :case_sensitive => false to validates_uniqueness_of calls on the login and email fields.
70
+ * MockRequest not tries to use controller.env['REMOTE_ADDR'] for the IP address in tests.
71
+ * Add in custom find_with_email and find_with_login methods to perform case insensitive searches for databases that are case sensitive by default. This is only done if the :case_insensitive option for validates_uniqueness_of_login_field_options or validates_uniqueness_of_email_field_options is set to false. Which, as of this version, it is. If you are using MySQL this has been the default behavior all along. If you are using SQLite or Postgres this has NOT been the default behavior.
72
+ * Added in exception explaining that you are using the old configuration for acts_as_authentic with an example of the new format.
73
+
74
+ == 2.0.5 released 2009-3-30
75
+
76
+ * Stub out authenticate_with_http_basic for TestCase::ControllerAdapter.
77
+ * Added second parameter for add_acts_as_authentic module to specify the position: append or prepend.
78
+
79
+ == 2.0.4 released 2009-3-28
80
+
81
+ * Added validates_uniqueness_of_login_field_options and validates_uniqueness_of_email_field_options configuration options
82
+ * Add in checks to make sure session_class is not nil.
83
+ * Cleaned up TestCase some more and added functionality to log users in during functional tests.
84
+
85
+ == 2.0.3 released 2009-3-26
86
+
87
+ * Fixed error where default session class does not exist.
88
+ * Fixed human_name for the model to use its own human name and not delegate to the associated model. Translation should be under authlogic.models.user_session (or whatever the name of your session is).
89
+ * Fixed human_attribute_name to use Authlogic keys for translation instead of ActiveRecord: authlogic.attributes.user_session.login
90
+ * For transitioning from restful_authentication, set the REST_AUTH_SITE_KEY to '' if it doesn't exist, instead of nil.
91
+ * Completely rewrote Authlogic::Testing, it's now called Authlogic::TestCase. Testing Authlogic is much easier now. Please see Authlogic::TestCase for more info.
92
+
93
+ == 2.0.2 released 2009-3-24
94
+
95
+ * Reset failed_login_count if consecutive_failed_logins_limit has been exceed and the failed_login_ban_for has passed.
96
+ * Update test helpers to use the new configuration scheme.
97
+ * Fixed issue when logging doesn't update last_request_at, so the next persistence try would fail.
98
+
99
+ == 2.0.1 released 2009-3-23
100
+
101
+ * Validate length of password.
102
+ * Dont save sessions with a ! during session maintenance.
103
+ * Add self_and_descendants_from_active_record for Rails 2.3
104
+ * Abort acts_as_authentic if there is no DB connection or table.
105
+
106
+ == 2.0.0 released 2009-3-23
2
107
 
3
108
  * Refactored nearly all code and tests, especially acts_as_authentic. Got rid of the meta programming and rewrote to use modules and hooks. Also moved all configuration into their related modules.
4
109
  * Set up a strong API with hooks to allow you to modify behavior and most importantly, easily create "add on" modules or alternate authentication methods, etc.
@@ -10,7 +115,7 @@
10
115
  * Added MD5 crypto provider for legacy systems.
11
116
  * Make password salt field optional for legacy systems.
12
117
 
13
- == 1.4.4
118
+ == 1.4.4 released 2009-3-2
14
119
 
15
120
  * Moved session maintenance to a before_save, to save on queries executed and to skip an unexpected / additional save on the user object.
16
121
  * Extracted random string generation into its own class and leverages SecureRandom if it is available
@@ -1,4 +1,4 @@
1
- Copyright (c) 2007 Ben Johnson of Binary Logic (binarylogic.com)
1
+ Copyright (c) 2009 Ben Johnson of Binary Logic
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.rdoc CHANGED
@@ -2,93 +2,142 @@
2
2
 
3
3
  Authlogic is a clean, simple, and unobtrusive ruby authentication solution.
4
4
 
5
- What inspired me to create Authlogic was the messiness of the current authentication solutions. Put simply, they just didn't feel right. They felt wrong because the logic was not organized properly. As you may know, a common misconception with the MVC design pattern is that the model "M" is only for data access logic, which is wrong. A model is a place for domain logic. This is why the RESTful design pattern and the current authentication solutions don't play nice. Authlogic solves this by placing the session maintenance logic into its own domain (aka "model"). Moving session maintenance into its own domain has its benefits:
5
+ A code example can replace a thousand words...
6
6
 
7
- 1. It's easier to update and stay current with the latest security practices. Since authlogic sits in between you and your session it can assist in keeping your security top notch. Such as upgrading your hashing algorithm, helping you transition to a new algorithm, etc. Also, Authlogic is a gem, which means you get all of these benefits easily, through a rubygems update.
8
- 2. It ties everything together on the domain level. Take a new user registration for example, no reason to manually log the user in, authlogic handles this for you via callbacks. The same applies to a user changing their password. Authlogic handles maintaining the session for you.
9
- 3. Your application can stay clean and focused and free of redundant authentication code from app to app. Meaning generators are *NOT* necessary at all.
10
- 4. A byproduct of #3 is that you don't have to test the same code over and over in each of your apps. You don't test the internals of ActiveRecord in each of your apps, so why would you test the internals of Authlogic? It's already been thoroughly tested for you. Focus on your application, and get rid of the noise by testing your application specific code and not generated code that you didn't write.
11
- 5. You get to write your own code, just like you do for any other model. Meaning the code you write is specific to your application, the way you want it, and more importantly you understand it.
12
- 6. You are not restricted to a single session. Think about Apple's me.com, where they need you to authenticate a second time before changing your billing information. Why not just create a second session for this? It works just like your initial session. Then your billing controller can require an "ultra secure" session.
7
+ Authlogic introduces a new type of model. You can have as many as you want, and name them whatever you want, just like your other models. In this example, we want to authenticate with the User model, which is inferred by the name:
13
8
 
14
- Authlogic can do all of this and much more, keep reading to see...
9
+ class UserSession < Authlogic::Session::Base
10
+ # specify configuration here, such as:
11
+ # logout_on_timeout true
12
+ # ...many more options in the documentation
13
+ end
14
+
15
+ Log in with any of the following. Create a UserSessionsController and use it just like your other models:
16
+
17
+ UserSession.create(:login => "bjohnson", :password => "my password", :remember_me => true)
18
+ session = UserSession.new(:login => "bjohnson", :password => "my password", :remember_me => true); session.save
19
+ UserSession.create(:openid_identifier => "identifier", :remember_me => true) # requires the authlogic-oid "add on" gem
20
+ UserSession.create(my_user_object, true) # skip authentication and log the user in directly, the true means "remember me"
21
+
22
+ The above handles the entire authentication process for you. It first authenticates, then it sets up the proper session values and cookies to persist the session. Just like you would if you rolled your own authentication solution.
23
+
24
+ You can also log out / destroy the session:
25
+
26
+ session.destroy
27
+
28
+ After a session has been created, you can persist it across requests. Thus keeping the user logged in:
29
+
30
+ session = UserSession.find
31
+
32
+ To get all of the nice authentication functionality in your model just do this:
33
+
34
+ class User < ActiveRecord::Base
35
+ acts_as_authentic do |c|
36
+ c.my_config_option = my_value
37
+ end # the configuration block is optional
38
+ end
39
+
40
+ This handles validations, etc. It is also "smart" in the sense that it if a login field is present it will use that to authenticate, if not it will look for an email field, etc. This is all configurable, but for 99% of cases that above is all you will need to do.
41
+
42
+ Also, sessions are automatically maintained. You can switch this on and off with configuration, but the following will automatically log a user in after a successful registration:
43
+
44
+ User.create(params[:user])
45
+
46
+ This also updates the session when the user changes his/her password.
47
+
48
+ Authlogic is very flexible, it has a strong public API and a plethora of hooks to allow you to modify behavior and extend it. Check out the helpful links below to dig deeper.
15
49
 
16
50
  == Helpful links
17
51
 
18
- * <b>Documentation:</b> http://authlogic.rubyforge.org
19
- * <b>Tutorial: Authlogic basic setup:</b> http://www.binarylogic.com/2008/11/3/tutorial-authlogic-basic-setup
20
- * <b>Tutorial: Reset passwords with Authlogic the RESTful way:</b> http://www.binarylogic.com/2008/11/16/tutorial-reset-passwords-with-authlogic
21
- * <b>Tutorial: Using OpenID with Authlogic:</b> http://www.binarylogic.com/2008/11/21/tutorial-using-openid-with-authlogic
22
- * <b>Live example of the tutorials above (with source):</b> http://authlogicexample.binarylogic.com
23
- * <b>Tutorial: Easily migrate from restful_authentication:</b> http://www.binarylogic.com/2008/11/23/tutorial-easily-migrate-from-restful_authentication-to-authlogic
24
- * <b>Tutorial: Upgrade passwords easily with Authlogic:</b> http://www.binarylogic.com/2008/11/23/tutorial-upgrade-passwords-easily-with-authlogic
52
+ * <b>Documentation:</b> http://rdoc.info/projects/binarylogic/authlogic
53
+ * <b>Repository:</b> http://github.com/binarylogic/authlogic/tree/master
54
+ * <b>Railscasts Screencast:</b> http://railscasts.com/episodes/160-authlogic
55
+ * <b>Live example with OpenID "add on":</b> http://authlogicexample.binarylogic.com
56
+ * <b>Live example repository with tutorial in README:</b> http://github.com/binarylogic/authlogic_example/tree/master
57
+ * <b>Tutorial: Reset passwords with Authlogic the RESTful way:</b> http://www.binarylogic.com/2008/11/16/tutorial-reset-passwords-with-authlogic
25
58
  * <b>Bugs / feature suggestions:</b> http://binarylogic.lighthouseapp.com/projects/18752-authlogic
26
59
  * <b>Google group:</b> http://groups.google.com/group/authlogic
27
60
 
28
- **Before contacting me, please read:**
29
- If you find a bug or a problem please post it on lighthouse. If you need help with something, please use google groups. I check both regularly and get emails when anything happens, so that is the best place to get help. Please do not email me directly, with issues regarding Authlogic.
61
+ <b>Before contacting me directly, please read:</b>
62
+
63
+ If you find a bug or a problem please post it on lighthouse. If you need help with something, please use google groups. I check both regularly and get emails when anything happens, so that is the best place to get help. This also benefits other people in the future with the same questions / problems. Thank you.
64
+
65
+ == Authlogic "add ons"
66
+
67
+ * <b>Authlogic OpenID addon:</b> http://github.com/binarylogic/authlogic_openid
68
+ * <b>Authlogic LDAP addon:</b> http://github.com/binarylogic/authlogic_ldap
69
+ * <b>Authlogic Facebook Connect:</b> http://github.com/kalasjocke/authlogic_facebook_connect
70
+ * <b>Authlogic OAuth (Twitter):</b> http://github.com/jrallison/authlogic_oauth
71
+
72
+ If you create one of your own, please let me know about it so I can add it to this list. Or just fork the project, add your link, and send me a pull request.
30
73
 
31
- == Documentation
74
+ == Session bugs (please read if you are having issues with logging in / out)
32
75
 
33
- You can find anything you want about Authlogic in the documentation, all that you need to do is understand the basic design behind it.
76
+ Apparently there is a bug with apache / passenger for v2.1.X with sessions not working properly. This is most likely your problem if you are having trouble logging in / out. This is *not* an Authlogic issue. This can be solved by updating passener or using an alternative session store solution, such as active record store.
34
77
 
35
- That being said, Authlogic is split into 2 main parts:
78
+ == Documentation explanation
36
79
 
37
- 1. Authlogic::Session, which manages sessions.
38
- 2. Authlogic::ActsAsAuthentic, which adds in functionality to your ActiveRecord model.
80
+ You can find anything you want about Authlogic in the {documentation}[http://authlogic.rubyforge.org], all that you need to do is understand the basic design behind it.
39
81
 
40
- Each of the above has its various sub modules that contain common logic. The sub modules are responsible for including everything related to it: configuration, class methods, instance methods, etc.
82
+ That being said, there are 2 models involved during authentication. Your Authlogic model and your ActiveRecord model:
41
83
 
42
- For example, if you want to timeout users after a certain period of inactivity, you would look in Authlogic::Session::Timeout. To help you out, I listed the following "publicly relevant" modules with short descriptions. For the sake of brevity, there are more modules than listed here, the ones not listed are more for internal use, but you can easily read up on them in the documentation.
84
+ 1. <b>Authlogic::Session</b>, your session models that extend Authlogic::Session::Base.
85
+ 2. <b>Authlogic::ActsAsAuthentic</b>, which adds in functionality to your ActiveRecord model when you call acts_as_authentic.
86
+
87
+ Each of the above has its various sub modules that contain common logic. The sub modules are responsible for including *everything* related to it: configuration, class methods, instance methods, etc.
88
+
89
+ For example, if you want to timeout users after a certain period of inactivity, you would look in <b>Authlogic::Session::Timeout</b>. To help you out, I listed the following publicly relevant modules with short descriptions. For the sake of brevity, there are more modules than listed here, the ones not listed are more for internal use, but you can easily read up on them in the {documentation}[http://authlogic.rubyforge.org].
43
90
 
44
91
  === Authlogic::ActsAsAuthentic sub modules
45
92
 
46
- These modules are for the acts_as_authentic method you call in your model. It contains all code for the "model side" of the authentication.
47
-
48
- * Authlogic::ActsAsAuthentic::Base - Provides the acts_as_authentic class method and includes all of the submodules.
49
- * Authlogic::ActsAsAuthentic::Email - Handles everything related to the email field.
50
- * Authlogic::ActsAsAuthentic::LoggedInStatus - Provides handy named scopes and methods for determining if the user is logged in or out.
51
- * Authlogic::ActsAsAuthentic::Login - Handles everything related to the login field.
52
- * Authlogic::ActsAsAuthentic::MagicColumns - Handles everything related to the "magic" fields: login_count, failed_login_count, etc.
53
- * Authlogic::ActsAsAuthentic::Password - This one is important. It handles encrypting your password, salting it, etc. It also has support for transitioning password algorithms.
54
- * Authlogic::ActsAsAuthentic::PerishableToken - Handles maintaining the perishable token field, also provides a class level method for finding record using the token.
55
- * Authlogic::ActsAsAuthentic::PersistenceToken - Handles maintaining the persistence token. This is the token stored in cookies and sessions to persist the users session.
56
- * Authlogic::ActsAsAuthentic::RestfulAuthentication - Provides configuration options to easily migrate from the restful_authentication plugin.
57
- * Authlogic::ActsAsAuthentic::Scope - Allows you to scope validations, etc. Just like the :scope option for validates_uniqueness_of
58
- * Authlogic::ActsAsAuthentic::SessionMaintenance - Handles automatically logging the user in. EX: a new user registers, automatically log them in.
59
- * Authlogic::ActsAsAuthentic::SingleAccessToken - Handles maintaining the single access token.
93
+ These modules are for the ActiveRecord side of things, the models that call acts_as_authentic.
94
+
95
+ * <b>Authlogic::ActsAsAuthentic::Base</b> - Provides the acts_as_authentic class method and includes all of the submodules.
96
+ * <b>Authlogic::ActsAsAuthentic::Email</b> - Handles everything related to the email field.
97
+ * <b>Authlogic::ActsAsAuthentic::LoggedInStatus</b> - Provides handy named scopes and methods for determining if the user is logged in or out.
98
+ * <b>Authlogic::ActsAsAuthentic::Login</b> - Handles everything related to the login field.
99
+ * <b>Authlogic::ActsAsAuthentic::MagicColumns</b> - Handles everything related to the "magic" fields: login_count, failed_login_count, last_request_at, etc.
100
+ * <b>Authlogic::ActsAsAuthentic::Password</b> - This one is important. It handles encrypting your password, salting it, etc. It also has support for transitioning password algorithms.
101
+ * <b>Authlogic::ActsAsAuthentic::PerishableToken</b> - Handles maintaining the perishable token field, also provides a class level method for finding record using the token.
102
+ * <b>Authlogic::ActsAsAuthentic::PersistenceToken</b> - Handles maintaining the persistence token. This is the token stored in cookies and sessions to persist the users session.
103
+ * <b>Authlogic::ActsAsAuthentic::RestfulAuthentication</b> - Provides configuration options to easily migrate from the restful_authentication plugin.
104
+ * <b>Authlogic::ActsAsAuthentic::SessionMaintenance</b> - Handles automatic session maintenance. EX: a new user registers, automatically log them in. Or a user changes their password, update their session.
105
+ * <b>Authlogic::ActsAsAuthentic::SingleAccessToken</b> - Handles maintaining the single access token.
106
+ * <b>Authlogic::ActsAsAuthentic::ValidationsScope</b> - Allows you to scope all validations, etc. Just like the :scope option for validates_uniqueness_of
60
107
 
61
108
  === Authlogic::Session sub modules
62
109
 
63
- These modules are for the "session side" of authentication. They create a new domain for session logic, allowing you to create, destroy, and ultimately manage your sessions.
64
-
65
- * Authlogic::Session::BruteForceProtection - Disables accounts after a certain number of consecutive failed login attempted.
66
- * Authlogic::Session::Callbacks - Your tools to extend Authlogic, lets you hook in and add/modify behavior, on top of overriding methods.
67
- * Authlogic::Session::Cookies - Authentication via cookies.
68
- * Authlogic::Session::Existence - Creating, saving, and destroying objects.
69
- * Authlogic::Session::HttpAuth - Authentication via basic HTTP authentication.
70
- * Authlogic::Session::Id - Allows sessions to be separated by an id, letting you have multiple sessions for a single user.
71
- * Authlogic::Session::MagicColumns - Maintains "magic" database columns, similar to created_at and updated_at for ActiveRecord.
72
- * Authlogic::Session::MagicStates - Automatically validates based on the records states: active, approved, and confirmed.
73
- * Authlogic::Session::Params - Authentication via params, aka single access token.
74
- * Authlogic::Session::Password - Authentication via a traditional username and password.
75
- * Authlogic::Session::Persistence - Persisting sessions / finding sessions.
76
- * Authlogic::Session::Session - Authentication via the session.
77
- * Authlogic::Session::Timeout - Automatically logging out after a certain period of inactivity.
78
- * Authlogic::Session::UnauthorizedRecord - Handles authentication by passing an ActiveRecord object.
79
- * Authlogic::Session::Validation - Validation / errors.
110
+ These modules are for the models that extend Authlogic::Session::Base.
111
+
112
+ * <b>Authlogic::Session::BruteForceProtection</b> - Disables accounts after a certain number of consecutive failed logins attempted.
113
+ * <b>Authlogic::Session::Callbacks</b> - Your tools to extend, change, or add onto Authlogic. Lets you hook in and do just about anything you want. Start here if you want to write a plugin or add-on for Authlogic
114
+ * <b>Authlogic::Session::Cookies</b> - Authentication via cookies.
115
+ * <b>Authlogic::Session::Existence</b> - Creating, saving, and destroying objects.
116
+ * <b>Authlogic::Session::HttpAuth</b> - Authentication via basic HTTP authentication.
117
+ * <b>Authlogic::Session::Id</b> - Allows sessions to be separated by an id, letting you have multiple sessions for a single user.
118
+ * <b>Authlogic::Session::MagicColumns</b> - Maintains "magic" database columns, similar to created_at and updated_at for ActiveRecord.
119
+ * <b>Authlogic::Session::MagicStates</b> - Automatically validates based on the records states: active?, approved?, and confirmed?. If those methods exist for the record.
120
+ * <b>Authlogic::Session::Params</b> - Authentication via params, aka single access token.
121
+ * <b>Authlogic::Session::Password</b> - Authentication via a traditional username and password.
122
+ * <b>Authlogic::Session::Persistence</b> - Persisting sessions / finding sessions.
123
+ * <b>Authlogic::Session::Session</b> - Authentication via the session, the controller session that is.
124
+ * <b>Authlogic::Session::Timeout</b> - Automatically logging out after a certain period of inactivity.
125
+ * <b>Authlogic::Session::UnauthorizedRecord</b> - Handles authentication by passing an ActiveRecord object directly.
126
+ * <b>Authlogic::Session::Validation</b> - Validation / errors.
80
127
 
81
128
  === Miscellaneous modules
82
129
 
83
- Miscellaneous modules that don't really belong solely to either the session or model aspect.
130
+ Miscellaneous modules that shared across the authentication process and are more "utility" modules and classes.
84
131
 
85
- * Authlogic::AuthenticatesMany - Responsible for allowing you to scope sessions to a parent record. Similar to a has_many and belongs_to relationship. This lets you do the same thing with sessions.
86
- * Authlogic::CryptoProviders - Contains various encryption algorithms that Authlogic uses, allowing you to choose your encryption method.
87
- * Authlogic::I18n - Acts JUST LIKE the rails I18n library, and provides internationalization to Authlogic.
88
- * Authlogic::Testing - Various helper methods for testing frameworks to help you test your code.
89
- * Authlogic::Version - A handy class for determine the version of Authlogic in a number of ways.
132
+ * <b>Authlogic::AuthenticatesMany</b> - Responsible for allowing you to scope sessions to a parent record. Similar to a has_many and belongs_to relationship. This lets you do the same thing with sessions.
133
+ * <b>Authlogic::CryptoProviders</b> - Contains various encryption algorithms that Authlogic uses, allowing you to choose your encryption method.
134
+ * <b>Authlogic::I18n</b> - Acts JUST LIKE the rails I18n library, and provides internationalization to Authlogic.
135
+ * <b>Authlogic::Random</b> - A simple class to generate random tokens.
136
+ * <b>Authlogic::Regex</b> - Contains regular expressions used in Authlogic. Such as those to validate the format of the log or email.
137
+ * <b>Authlogic::TestCase</b> - Various helper methods for testing frameworks to help you test your code.
138
+ * <b>Authlogic::Version</b> - A handy class for determine the version of Authlogic in a number of ways.
90
139
 
91
- == Quick example
140
+ == Quick Rails example
92
141
 
93
142
  What if creating sessions worked like an ORM library on the surface...
94
143
 
@@ -146,123 +195,51 @@ Or how about persisting the session...
146
195
  end
147
196
  end
148
197
 
149
- == Install and use
150
-
151
- === 1. Install the gem
198
+ == Install & Use
152
199
 
153
200
  Install the gem / plugin (recommended)
154
201
 
202
+ From rubyforge:
203
+
155
204
  $ sudo gem install authlogic
156
205
 
157
- Now add the gem dependency in your config:
206
+ OR from github:
158
207
 
159
- # config/environment.rb
160
- config.gem "authlogic"
208
+ $ sudo gem install binarylogic-authlogic
209
+
210
+ Now just add the gem dependency in your projects configuration.
161
211
 
162
212
  Or you install this as a plugin (for older versions of rails)
163
213
 
164
214
  script/plugin install git://github.com/binarylogic/authlogic.git
165
215
 
166
- === 2. Create your session
167
-
168
- Lets assume you are setting up a session for your User model.
169
-
170
- Create your user_session.rb file:
171
-
172
- $ script/generate session user_session
173
-
174
- This will create a file that looks similar to:
175
-
176
- # app/models/user_session.rb
177
- class UserSession < Authlogic::Session::Base
178
- # configuration here, see sub modules of Authlogic::Session
179
- end
180
-
181
- === 3. Ensure proper database fields
182
-
183
- The user model should have the following columns. The names of these columns can be changed with configuration. Better yet, Authlogic tries to guess these names by checking for the existence of common names. See the sub modules of Authlogic::Session for more details, but chances are you won't have to specify any configuration for your field names, even if they aren't the same names as below.
184
-
185
- t.string :login, :null => false # optional, you can use email instead, or both
186
- t.string :crypted_password, :null => false
187
- t.string :password_salt, :null => false # optional, but highly recommended
188
- t.string :persistence_token, :null => false
189
- t.string :single_access_token, :null => false # optional, see Authlogic::Session::Params
190
- t.string :perishable_token, :null => false # optional, see Authlogic::Session::Perishability
191
- t.integer :login_count, :null => false, :default => 0 # optional, see Authlogic::Session::MagicColumns
192
- t.integer :failed_login_count, :null => false, :default => 0 # optional, see Authlogic::Session::MagicColumns
193
- t.datetime :last_request_at # optional, see Authlogic::Session::MagicColumns
194
- t.datetime :current_login_at # optional, see Authlogic::Session::MagicColumns
195
- t.datetime :last_login_at # optional, see Authlogic::Session::MagicColumns
196
- t.string :current_login_ip # optional, see Authlogic::Session::MagicColumns
197
- t.string :last_login_ip # optional, see Authlogic::Session::MagicColumns
198
-
199
- === 4. Set up your model
200
-
201
- Make sure you have a model that you will be authenticating with. Since we are using the User model it should look something like:
202
-
203
- class User < ActiveRecord::Base
204
- acts_as_authentic do |c|
205
- c.my_config_option = my_value # for available options see documentation in: Authlogic::ActsAsAuthentic
206
- end # block optional
207
- end
208
-
209
- You are all set.
210
-
211
- === 5. Next Steps
212
-
213
- Here are some common next steps. They might or might not apply to you. For a complete list of everything Authlogic can do please read the documentation or see the sub module list above.
214
-
215
- 1. Want to use another encryption algorithm, such as BCrypt? See Authlogic::ActsAsAuthentic::Password::Config
216
- 2. Migrating from restful_authentication? See Authlogic::ActsAsAuthentic::RestfulAuthentication::Config
217
- 3. Want to timeout sessions after a period if inactivity? See Authlogic::Session::Timeout
218
- 4. Need to scope your sessions to an account or parent model? See Authlogic::AuthenticatesMany
219
- 5. Need multiple session types in your app? Check out Authlogic::Session::Id
220
- 6. Need to reset passwords or activate accounts? Use the perishable token. See Authlogic::ActsAsAuthentic::PerishableToken
221
- 7. Need to give API access or access to a private feed? Use basic HTTP auth or authentication by params. See Authlogic::Session::HttpAuth or Authlogic::Session::Params
222
- 8. Need to internationalize your app? See Authlogic::I18n
223
- 9. Need help testing? See the Authlogic::Testing
224
-
225
- == Interesting in how it works?
226
-
227
- Interested in how all of this all works? Basically a before filter is automatically set in your controller which lets Authlogic know about the current controller object. This "activates" Authlogic and allows Authlogic to set sessions, cookies, login via basic http auth, etc. If you are using your framework in a multiple thread environment, don't worry. I kept that in mind and made this thread safe.
228
-
229
- From there it is pretty simple. When you try to create a new session the record is authenticated and then all of the session / cookie magic is done for you. The sky is the limit.
230
-
231
- == What's wrong with the current solutions?
232
-
233
- You probably don't care, but I think releasing the millionth ruby authentication solution requires a little explanation.
234
-
235
- I don't necessarily think the current solutions are "wrong", nor am I saying Authlogic is the answer to your prayers. But, to me, the current solutions were lacking something. Here's what I came up with...
236
-
237
- === Generators are messy
238
-
239
- Generators have their place, and it is not to add authentication to an app. It doesn't make sense. Generators are meant to be a starting point for repetitive tasks that have no sustainable pattern. Take controllers, the set up is the same thing over and over, but they eventually evolve to a point where there is no clear cut pattern. Trying to extract a pattern out into a library would be extremely hard, messy, and overly complicated. As a result, generators make sense here.
240
-
241
- Authentication is a one time set up process for your app. It's the same thing over and over and the pattern never really changes. The only time it changes is to conform with newer / stricter security techniques. This is exactly why generators should not be an authentication solution. Generators add code to your application, once code crosses that line, you are responsible for maintaining it. You get to make sure it stays up with the latest and greatest security techniques. And when the plugin you used releases some major update, you can't just re-run the generator, you get to sift through the code to see what changed. You don't really have a choice either, because you can't ignore security updates.
242
-
243
- Using a library that hundreds of other people use has it advantages. Probably one of the biggest advantages if that you get to benefit from other people using the same code. When Bob in California figures out a new awesome security technique and adds it into Authlogic, you get to benefit from that with a single update. The catch is that this benefit is limited to code that is not "generated" or added into your app. As I said above, once code is "generated" and added into your app, it's your responsibility.
244
-
245
- Lastly, there is a pattern here, why clutter up all of your applications with the same code over and over?
216
+ == Detailed Setup Tutorial
246
217
 
247
- === Security gets outdated
218
+ See the {authlogic example}[http://github.com/binarylogic/authlogic_example/tree/master] for a detailed setup tutorial. I did this because not only do you have a tutorial to go by, but you have an example app that uses the same tutorial, so you can play around with with the code. If you have problems you can compare the code to see what you are doing differently.
248
219
 
249
- Just as I stated in the above section, you can't stay up to date with your security since the code is generated and updating the plugin does nothing. If there is one thing you should stay up to date with, it's security. But it's not just the fact that there is no reasonable method for receiving updates. It's the fact that they tie you down to an encryption algorithm *AND* they use a bad one at that. Every single solution I've seen uses Sha1, which is joining the party with MD5. Sha1 is not as secure as it used to be. But that's the nature of algorithms, they eventually get phased out, which is fine. Everyone knows this, why not accommodate for this? Authlogic does this with the :transition_from_crypto_provider option. It takes care of transitioning all of your users to a new algorithm. Even better, it provides BCrypt as an option which should, in theory, never require you to switch since you can adjust the cost and make the encryption stronger. At the same time, still compatible with older passwords using the lower cost.
220
+ == Testing
250
221
 
251
- === Why test the same code over and over?
222
+ I think one of the best aspects of Authlogic is testing. For one, it cuts out <b>a lot</b> of redundant tests in your applications because Authlogic is already thoroughly tested for you. It doesn't include a bunch of tests into your application, because it comes tested, just like any other library.
252
223
 
253
- I've noticed my apps get cluttered with authentication tests, and they are the same exact tests! This irritates me. When you have identical tests across your apps thats a red flag that code can be extracted into a library. What's great about Authlogic is that I tested it for you. You don't write tests that test the internals of ActiveRecord do you? The same applies for Authlogic. Only test code that you've written. Essentially testing authentication is similar to testing any another RESTful controller. This makes your tests focused and easier to understand.
224
+ For example, think about ActiveRecord. You don't test the internals of ActiveRecord, because the creators of ActiveRecord have already tested the internals for you. It wouldn't make sense for ActiveRecord to copy it's hundreds of tests into your applications. The same concept applies to Authlogic. You only need to test code you write that is specific to your application, just like everything else in your application.
254
225
 
255
- === Limited to a single authentication
226
+ That being said, testing your code that uses Authlogic is easy. Since everyone uses different testing suites, I created a helpful module called Authlogic::TestCase, which is basically a set of tools for testing code using Authlogic. I explain testing Authlogic thoroughly in the {Authlogic::TestCase section of the documentation}[http://authlogic.rubyforge.org/classes/Authlogic/TestCase.html]. It should answer any questions you have in regards to testing Authlogic.
256
227
 
257
- I recently had an app where you could log in as a user and also log in as an employee. I won't go into the specifics of the app, but it made the most sense to do it this way. So I had two sessions in one app. None of the current solutions I found easily supported this. They all assumed a single session. One session was messy enough, adding another just put me over the edge and eventually forced me to write Authlogic. Authlogic can support 100 different sessions easily and in a clean format. Just like an app can support 100 different models and 100 different records of each model.
228
+ == Tell me quickly how Authlogic works
258
229
 
259
- === Too presumptuous
230
+ Interested in how all of this all works? Think about an ActiveRecord model. A database connection must be established before you can use it. In the case of Authlogic, a controller connection must be established before you can use it. It uses that controller connection to modify cookies, the current session, login with HTTP basic, etc. It connects to the controller through a before filter that is automatically set in your controller which lets Authlogic know about the current controller object. Then Authlogic leverages that to do everything, it's a pretty simple design. Nothing crazy going on, Authlogic is just leveraging the tools your framework provides in the controller object.
260
231
 
261
- A lot of them forced me to name my password column as "this", or the key of my cookie had to be "this". They were a little too presumptuous. I am probably overly picky, but little details like that should be configurable. This also made it very hard to implement into an existing app.
232
+ == What sets Authlogic apart and why I created it
262
233
 
263
- === Disclaimer
234
+ What inspired me to create Authlogic was the messiness of the current authentication solutions. Put simply, they just didn't feel right, because the logic was not organized properly. As you may know, a common misconception with the MVC design pattern is that the model "M" is only for data access logic, which is wrong. A model is a place for domain logic. This is why the RESTful design pattern and the current authentication solutions don't play nice. Authlogic solves this by placing the session maintenance logic into its own domain (aka "model"). Moving session maintenance into its own domain has its benefits:
264
235
 
265
- I am not trying to "bash" any other authentication solutions. These are just my opinions, formulate your own opinion. I released Authlogic because I was "scratching my own itch". It has made my life easier and I enjoy using it, hopefully it does the same for you.
236
+ 1. <b>It's cleaner.</b> There are no generators in Authlogic. Authlogic provides a class that you can use, it's plain and simple ruby. More importantly, the code in your app is code you write, written the way you want, nice and clean. It's code that should be in your app and is specific to your app, not a redundant authentication pattern.
237
+ 2. <b>Easier to stay up-to-date.</b> To make my point, take a look at the commits to any other authentication solution, then look at the {commits for authlogic}[http://github.com/binarylogic/authlogic/commits/master]. How many commits could you easily start using if you already had an app using that solution? With an alternate solution, very few, if any. All of those cool new features and bug fixes are going to have be manually added or wait for your next application. Which is the main reason a generator is not suitable as an authentication solution. With Authlogic you can start using the latest code with a simple update of a gem. No generators, no mess.
238
+ 3. <b>It ties everything together on the domain level.</b> Take a new user registration for example, no reason to manually log the user in, authlogic handles this for you via callbacks. The same applies to a user changing their password. Authlogic handles maintaining the session for you.
239
+ 4. <b>No redundant tests.</b> Because Authlogic doesn't use generators, #1 also applies to tests. Authlogic is *thoroughly* tested for you. You don't go and test the internals of ActiveRecord in each of your apps do you? So why do the same for Authlogic? Your application tests should be for application specific code. Get rid of the noise and make your tests focused and concise, no reason to copy tests from app to app.
240
+ 5. <b>Framework agnostic</b>. Authlogic can be used in *any* ruby framework you want: Rails, Merb, Sinatra, Mack, your own framework, whatever. It's not tied down to Rails. It does this by abstracting itself from these framework's controllers by using a controller adapter. Thanks to {Rack}[http://rack.rubyforge.org/], there is a defined standard for controller structure, and that's what Authlogic's abstract adapter follows. So if your controller follows the rack standards, you don't need to do anything. Any place it deviates from this is solved by a simple adapter for your framework that closes these gaps. For an example, checkout the Authlogic::ControllerAdapters::MerbAdapter.
241
+ 5. <b>You are not restricted to a single session.</b> Think about Apple's me.com, where they need you to authenticate a second time before changing your billing information. Why not just create a second session for this? It works just like your initial session. Then your billing controller can require an "ultra secure" session.
242
+ 6. <b>Easily extendable.</b> One of the distinct advantages of using a library is the ability to use it's API, assuming it has one. Authlogic has an *excellent* public API, meaning it can easily be extended and grow beyond the core library. Checkout the "add ons" list above to see what I mean.
266
243
 
267
244
 
268
- Copyright (c) 2008 Ben Johnson of [Binary Logic](http://www.binarylogic.com), released under the MIT license
245
+ Copyright (c) 2009 {Ben Johnson of Binary Logic}[http://www.binarylogic.com], released under the MIT license
data/Rakefile CHANGED
@@ -1,20 +1,49 @@
1
- ENV['RDOCOPT'] = "-S -f html -T hanna"
1
+ require 'rubygems'
2
+ require 'rake'
2
3
 
3
- require "rubygems"
4
- require "hoe"
5
- require File.dirname(__FILE__) << "/lib/authlogic/version"
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "authlogic"
8
+ gem.summary = "A clean, simple, and unobtrusive ruby authentication solution."
9
+ gem.email = "bjohnson@binarylogic.com"
10
+ gem.homepage = "http://github.com/binarylogic/authlogic"
11
+ gem.authors = ["Ben Johnson of Binary Logic"]
12
+ gem.rubyforge_project = "authlogic"
13
+ gem.add_dependency "activesupport"
14
+ end
15
+ rescue LoadError
16
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
17
+ end
6
18
 
7
- Hoe.new("Authlogic", Authlogic::Version::STRING) do |p|
8
- p.name = "authlogic"
9
- p.author = "Ben Johnson of Binary Logic"
10
- p.email = 'bjohnson@binarylogic.com'
11
- p.summary = "A clean, simple, and unobtrusive ruby authentication solution."
12
- p.description = "A clean, simple, and unobtrusive ruby authentication solution."
13
- p.url = "http://github.com/binarylogic/authlogic"
14
- p.history_file = "CHANGELOG.rdoc"
15
- p.readme_file = "README.rdoc"
16
- p.extra_rdoc_files = ["CHANGELOG.rdoc", "README.rdoc"]
17
- p.test_globs = ["test/*/test_*.rb", "test/*/*_test.rb"]
18
- p.extra_deps = %w(activesupport)
19
- p.post_install_message = "Version 2.0 introduces some changes that break backwards compatibility. The big change is how acts_as_authentic accepts configuration options. Instead of a hash, it now accepts a block: acts_as_authentic { |c| c.my_config_option = my_value}. See the docs for more details."
20
- end
19
+ require 'rake/testtask'
20
+ Rake::TestTask.new(:test) do |test|
21
+ test.libs << 'lib' << 'test'
22
+ test.pattern = 'test/**/*_test.rb'
23
+ test.verbose = true
24
+ end
25
+
26
+ begin
27
+ require 'rcov/rcovtask'
28
+ Rcov::RcovTask.new do |test|
29
+ test.libs << 'test'
30
+ test.pattern = 'test/**/*_test.rb'
31
+ test.verbose = true
32
+ end
33
+ rescue LoadError
34
+ task :rcov do
35
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
36
+ end
37
+ end
38
+
39
+ task :default => :test
40
+
41
+ begin
42
+ require 'rake/contrib/sshpublisher'
43
+ namespace :rubyforge do
44
+ desc "Release gem to RubyForge"
45
+ task :release => ["rubyforge:release:gem"]
46
+ end
47
+ rescue LoadError
48
+ puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
49
+ end
data/VERSION.yml ADDED
@@ -0,0 +1,4 @@
1
+ ---
2
+ :patch: 0
3
+ :major: 2
4
+ :minor: 1