auto_hash 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. data/.document +5 -0
  2. data/.gitignore +22 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +54 -0
  5. data/Rakefile +41 -0
  6. data/VERSION +1 -0
  7. data/auto_hash.gemspec +160 -0
  8. data/created.rid +1 -0
  9. data/init.rb +4 -0
  10. data/lib/auto_hash.rb +85 -0
  11. data/log/test.log +0 -0
  12. data/test/common/user_test.rb +59 -0
  13. data/test/rails2x_root/Rakefile +10 -0
  14. data/test/rails2x_root/app/controllers/application_controller.rb +10 -0
  15. data/test/rails2x_root/app/helpers/application_helper.rb +3 -0
  16. data/test/rails2x_root/app/models/user.rb +5 -0
  17. data/test/rails2x_root/config/boot.rb +110 -0
  18. data/test/rails2x_root/config/database.yml +22 -0
  19. data/test/rails2x_root/config/environment.rb +29 -0
  20. data/test/rails2x_root/config/environments/development.rb +17 -0
  21. data/test/rails2x_root/config/environments/production.rb +28 -0
  22. data/test/rails2x_root/config/environments/test.rb +28 -0
  23. data/test/rails2x_root/config/initializers/backtrace_silencers.rb +7 -0
  24. data/test/rails2x_root/config/initializers/cookie_verification_secret.rb +7 -0
  25. data/test/rails2x_root/config/initializers/inflections.rb +10 -0
  26. data/test/rails2x_root/config/initializers/mime_types.rb +5 -0
  27. data/test/rails2x_root/config/initializers/new_rails_defaults.rb +21 -0
  28. data/test/rails2x_root/config/initializers/session_store.rb +15 -0
  29. data/test/rails2x_root/config/locales/en.yml +5 -0
  30. data/test/rails2x_root/config/routes.rb +43 -0
  31. data/test/rails2x_root/db/development.sqlite3 +0 -0
  32. data/test/rails2x_root/db/migrate/20100803040436_create_users.rb +13 -0
  33. data/test/rails2x_root/db/schema.rb +21 -0
  34. data/test/rails2x_root/db/seeds.rb +7 -0
  35. data/test/rails2x_root/db/test.sqlite3 +0 -0
  36. data/test/rails2x_root/log/development.log +1362 -0
  37. data/test/rails2x_root/log/production.log +0 -0
  38. data/test/rails2x_root/log/server.log +0 -0
  39. data/test/rails2x_root/log/test.log +74 -0
  40. data/test/rails2x_root/script/about +4 -0
  41. data/test/rails2x_root/script/console +3 -0
  42. data/test/rails2x_root/script/dbconsole +3 -0
  43. data/test/rails2x_root/script/destroy +3 -0
  44. data/test/rails2x_root/script/generate +3 -0
  45. data/test/rails2x_root/script/performance/benchmarker +3 -0
  46. data/test/rails2x_root/script/performance/profiler +3 -0
  47. data/test/rails2x_root/script/plugin +3 -0
  48. data/test/rails2x_root/script/runner +3 -0
  49. data/test/rails2x_root/script/server +3 -0
  50. data/test/rails2x_root/test/test_helper.rb +39 -0
  51. data/test/rails2x_root/test/unit/user_test.rb +59 -0
  52. data/test/rails3x_root/.gitignore +4 -0
  53. data/test/rails3x_root/Gemfile +33 -0
  54. data/test/rails3x_root/Gemfile.lock +81 -0
  55. data/test/rails3x_root/Rakefile +7 -0
  56. data/test/rails3x_root/app/controllers/application_controller.rb +3 -0
  57. data/test/rails3x_root/app/helpers/application_helper.rb +2 -0
  58. data/test/rails3x_root/app/models/user.rb +6 -0
  59. data/test/rails3x_root/app/views/layouts/application.html.erb +14 -0
  60. data/test/rails3x_root/config/application.rb +42 -0
  61. data/test/rails3x_root/config/boot.rb +13 -0
  62. data/test/rails3x_root/config/database.yml +22 -0
  63. data/test/rails3x_root/config/environment.rb +6 -0
  64. data/test/rails3x_root/config/environments/development.rb +22 -0
  65. data/test/rails3x_root/config/environments/production.rb +49 -0
  66. data/test/rails3x_root/config/environments/test.rb +35 -0
  67. data/test/rails3x_root/config/initializers/backtrace_silencers.rb +7 -0
  68. data/test/rails3x_root/config/initializers/inflections.rb +10 -0
  69. data/test/rails3x_root/config/initializers/mime_types.rb +5 -0
  70. data/test/rails3x_root/config/initializers/secret_token.rb +7 -0
  71. data/test/rails3x_root/config/initializers/session_store.rb +8 -0
  72. data/test/rails3x_root/config/locales/en.yml +5 -0
  73. data/test/rails3x_root/config/routes.rb +58 -0
  74. data/test/rails3x_root/db/migrate/20100804020911_create_users.rb +13 -0
  75. data/test/rails3x_root/db/schema.rb +22 -0
  76. data/test/rails3x_root/db/seeds.rb +7 -0
  77. data/test/rails3x_root/script/rails +6 -0
  78. data/test/rails3x_root/test/test_helper.rb +13 -0
  79. data/test/rails3x_root/test/unit/user_test.rb +59 -0
  80. metadata +188 -0
File without changes
File without changes
@@ -0,0 +1,74 @@
1
+ SQL (0.3ms)  SELECT name
2
+ FROM sqlite_master
3
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
4
+ 
5
+ SQL (0.1ms)  SELECT name
6
+ FROM sqlite_master
7
+ WHERE type = 'table' AND NOT name = 'sqlite_sequence'
8
+ 
9
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-03 05:39:48', '2010-08-03 05:39:48', 'kevin', '8cd6043fd98dd5fc002b35e418170d6d8c5d6b47d042b61329a887c7dc32b827-5d572e661b562ed3af7a')
10
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
11
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-03 05:41:29', '2010-08-03 05:41:29', 'kevin', 'aa781656a17637a8618fe27155f963f0c48db95916e3833ed794dfb6d8777369-9f21f73cf07cab0991d8')
12
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
13
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-03 05:42:12', '2010-08-03 05:42:12', 'kevin', '02166d7e39749b35efd61b9b0133bc15d00546dc443fc50783b2bff35c5159a1-7affebcfd828b0ab7442')
14
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
15
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-03 05:42:34', '2010-08-03 05:42:34', 'kevin', 'bcddc66f30269bfed1828f72268f7da27dff666be3d854e316a5c29d87fe2852-94ffcd296a5a307ac06b')
16
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
17
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-03 05:42:57', '2010-08-03 05:42:57', 'kevin', 'f48910e5170eb2bddab8976f9a22817fffe945b1314843d842b9be0db9aac64b-c7da8d4f9a66adb6a10f')
18
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
19
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-03 05:45:47', '2010-08-03 05:45:47', 'kevin', '93f45fcffbaf79e6280222ea4fa890602c00ed0f0d511d4febc80764808e5aee-79eb5501be702735baa6')
20
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
21
+ User Create (0.5ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-03 05:45:54', '2010-08-03 05:45:54', 'kevin', '73b304eaa6ea1007903d241f200636ff3b316a6b0e2eb762dc6b7fbb93833b43-b3fcf344a285145a7f6b')
22
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
23
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-03 06:15:57', '2010-08-03 06:15:57', 'kevin', 'f6cd28714f08908f3b205deaa2681e1a8b2d86c46979811c62f7cac5bb5acd6c-c6c5fde1f08f30c3fe9f')
24
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
25
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 03:42:10', '2010-08-04 03:42:10', 'kevin', 'e4b11994151d282e8ee7b5067cb7dcaaa8f0ac90a1cbb1bb65b165398803db0e-b4c4d99afe269bf22227')
26
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
27
+ User Create (1.8ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 10:08:39', '2010-08-04 10:08:39', 'kevin', '051a503dbe73675a9236e963dcab119c80ac6a6574b14fe13bec215e9d9806cb-3840b200a4ce7c16d791')
28
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
29
+ User Create (0.5ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 10:10:28', '2010-08-04 10:10:28', 'kevin', 'f52ca98a0272255634fa87e505118ee9aa6b5e8966da8fa8adb2816ca4002fbf-ee7cef251ed7ef47e8f7')
30
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
31
+ User Create (0.7ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 10:11:14', '2010-08-04 10:11:14', 'kevin', 'e692a87a4a5cfd0e1e0b6629895b230921610f885860bc3202e38027044740ba-7ab78d262b76bd92bb72')
32
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
33
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 10:12:18', '2010-08-04 10:12:18', 'kevin', '8014c0899ab97cc0c8707c6e6cd2752fc647cec2fd52f96645929c0286559e73-a24b304ab62680c54e86')
34
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
35
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 10:15:43', '2010-08-04 10:15:43', 'kevin', 'dc6e1c0b046cd3918204f07ae350dc49f55c1c9a32ddbd9863bf3f7ad2213d6b-c562aa3bfb150bf763c5')
36
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
37
+ User Create (0.5ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 10:15:58', '2010-08-04 10:15:58', 'kevin', '917f67821a3343664e62abedf77aff8777f44f7f3db0b9547f9686cb5989e5df-375218a667df04ef978d')
38
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
39
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 10:17:36', '2010-08-04 10:17:36', 'kevin', 'a489ffbd23616eb390f4d141b4d586312d6812cef0cafb536c52aebe02f7b8f7-72c6458d490f2abcced6')
40
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
41
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 10:21:54', '2010-08-04 10:21:54', 'kevin', 'ce870401f0d54a9977b958b8196160d467bf746b5851e507d5e1ca1222dfc58e-4163e69305b0bb562c47')
42
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
43
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 10:25:17', '2010-08-04 10:25:17', 'kevin', '93f2c746790422e85376b0a5039421b0bd2ded7b3ef0cab147d6e009a49fcc51-7cbca3c95c585afb5558')
44
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
45
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 10:25:47', '2010-08-04 10:25:47', 'kevin', '495b01c61c7157e5ad361c6e77cab309fc91c0cb9ce452398f479a38ed7f4112-1cda1a6a4912f32eea54')
46
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
47
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 10:32:11', '2010-08-04 10:32:11', 'kevin', 'bc4ae3f19c74c8980cd175b3f789883cb01a6830c09c7d5954cdfc3608a49a66-1ad41bebb3ec8b4ae66a')
48
+ User Load (0.1ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
49
+ User Create (0.5ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 10:48:12', '2010-08-04 10:48:12', 'kevin', '9b98eb1ce894808363b83232a5dbc8816359d5cde66cf73f281d4bd6f4a444b3-e88c697080a866153163')
50
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
51
+ User Create (0.5ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 11:09:39', '2010-08-04 11:09:39', 'kevin', 'c14cec1eaa7430ee6a509f4e69af388818f4ea9bde4761fd15c5d4d20e539539-fc98b565277f4d1ffb92')
52
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
53
+ User Create (0.5ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 11:09:52', '2010-08-04 11:09:52', 'kevin', '8b63b9e7f72a9e53f5166416c8b0eb71216e0fab4f57d493558f3b06efdb42d8-09af1457c680c56a068b')
54
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
55
+ User Create (0.5ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 11:10:01', '2010-08-04 11:10:01', 'kevin', 'dcbbc4badafeeed8000024d81e143e39ad30e8ed21da896a84edf761f597ffa2-9df407f50593efbae2c9')
56
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
57
+ User Create (0.5ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 11:10:12', '2010-08-04 11:10:12', 'kevin', 'a43b1e1b12f8fb357272ca47e972b292fc1006879bed15af1914523668a8dac0-ecdc4499ad89fc29483e')
58
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
59
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-04 11:40:09', '2010-08-04 11:40:09', 'kevin', 'ea344807fdf5ee6669a60314156196e058c76804323a7825462fce2611ecf7cc-8a130f23238def4631a9')
60
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
61
+ User Create (0.5ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-05 04:24:46', '2010-08-05 04:24:46', 'kevin', 'd85790b6b51e4093b6bc33899d3f3ffc853c4d5446988679265ec0d0ceeae741-6401e7cbc904fb71bc74')
62
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
63
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-05 04:25:10', '2010-08-05 04:25:10', 'kevin', 'e9a8dc7945d01a5b642d5053f55f3142605b22879da1a8d5d90be8fcc0a9fd6a-a959326a7619a9d76067')
64
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
65
+ User Create (0.5ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-05 04:26:33', '2010-08-05 04:26:33', 'kevin', 'b48fdeb943dc098e84d37329229e69162d28b6c2267b7f8bb36cd3b173fa0246-6343e5163181de54fe7d')
66
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
67
+ User Create (0.5ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-05 07:12:57', '2010-08-05 07:12:57', 'kevin', '373a2f3405b5f4db2982d49f476a4cc5318be8b2744a2985a4457bdca66de0bd-43eace0dcbf635661813')
68
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
69
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-05 07:14:32', '2010-08-05 07:14:32', 'kevin', 'e559c11444438bc0a4bc26382afc522fdc724e33d54f39665e0167cc31490f98-35a1f9e5412cb90ad78b')
70
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
71
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-05 07:15:12', '2010-08-05 07:15:12', 'kevin', 'd131b6ea13e2916b75e311e9ce39c708ee466fd5377bd3cd6473a6dff5cfccd4-1a53ce917d3c2643f861')
72
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
73
+ User Create (0.4ms) INSERT INTO "users" ("created_at", "updated_at", "username", "password") VALUES('2010-08-05 07:15:37', '2010-08-05 07:15:37', 'kevin', '73867a8694041cbeea4877407d5fa3440dcfe10ff2432274dc8f5a76276dd630-9b1a7d9044121d1126e8')
74
+ User Load (0.2ms) SELECT * FROM "users" WHERE ("users"."username" = 'kevin') LIMIT 1
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ $LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
4
+ require 'commands/about'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/console'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/dbconsole'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/destroy'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/generate'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../../config/boot', __FILE__)
3
+ require 'commands/performance/benchmarker'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../../config/boot', __FILE__)
3
+ require 'commands/performance/profiler'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/plugin'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/runner'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.expand_path('../../config/boot', __FILE__)
3
+ require 'commands/server'
@@ -0,0 +1,39 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
3
+ require 'test_help'
4
+ require "redgreen"
5
+
6
+ class ActiveSupport::TestCase
7
+ # Transactional fixtures accelerate your tests by wrapping each test method
8
+ # in a transaction that's rolled back on completion. This ensures that the
9
+ # test database remains unchanged so your fixtures don't have to be reloaded
10
+ # between every test method. Fewer database queries means faster tests.
11
+ #
12
+ # Read Mike Clark's excellent walkthrough at
13
+ # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
14
+ #
15
+ # Every Active Record database supports transactions except MyISAM tables
16
+ # in MySQL. Turn off transactional fixtures in this case; however, if you
17
+ # don't care one way or the other, switching from MyISAM to InnoDB tables
18
+ # is recommended.
19
+ #
20
+ # The only drawback to using transactional fixtures is when you actually
21
+ # need to test transactions. Since your test is bracketed by a transaction,
22
+ # any transactions started in your code will be automatically rolled back.
23
+ self.use_transactional_fixtures = true
24
+
25
+ # Instantiated fixtures are slow, but give you @david where otherwise you
26
+ # would need people(:david). If you don't want to migrate your existing
27
+ # test cases which use the @david style and don't mind the speed hit (each
28
+ # instantiated fixtures translates to a database query per test method),
29
+ # then set this back to true.
30
+ self.use_instantiated_fixtures = false
31
+
32
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
33
+ #
34
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
35
+ # -- they do not yet inherit this setting
36
+ fixtures :all
37
+
38
+ # Add more helper methods to be used by all tests here...
39
+ end
@@ -0,0 +1,59 @@
1
+ require 'test_helper'
2
+
3
+ # Note: all these test depend on "autotest :password" being in the User model
4
+
5
+ class UserTest < ActiveSupport::TestCase
6
+
7
+ test "simple instantiation" do
8
+
9
+ @user = User.new(:username => "kevin", :password => "asdf")
10
+ assert @user
11
+
12
+ end
13
+
14
+ # We can't exactly test if the new password is a correctly hashed
15
+ # password until running the comparer method, but we can check if
16
+ # its nil or blank, or its not still the clear text password - which
17
+ # would be quite a bug.
18
+ test "password hashed" do
19
+
20
+ original_password = "asdf"
21
+ @user = User.new(:username => "kevin", :password => original_password)
22
+
23
+ assert_equal "kevin", @user.username # make sure other fields untouched
24
+ assert_not_equal nil, @user.password
25
+ assert_not_equal "", @user.password
26
+ assert_not_equal original_password, @user.password
27
+
28
+ end
29
+
30
+ # Finally test the comparer method
31
+ test "matching" do
32
+
33
+ original_password = "asdf"
34
+ @user = User.new(:username => "kevin", :password => original_password)
35
+
36
+ assert @user.password_hash_match?(original_password)
37
+ assert ! @user.password_hash_match?("banana")
38
+ assert ! @user.password_hash_match?("")
39
+ assert ! @user.password_hash_match?(nil)
40
+
41
+ end
42
+
43
+ # Test whole circuit, including writing and reading from database.
44
+ test "write, find, match" do
45
+
46
+ original_password = "asdf"
47
+ @user = User.new(:username => "kevin", :password => original_password)
48
+ @user.save
49
+
50
+ user = User.find_by_username("kevin")
51
+
52
+ assert user.password_hash_match?(original_password)
53
+ assert ! user.password_hash_match?("banana")
54
+ assert ! user.password_hash_match?("")
55
+ assert ! user.password_hash_match?(nil)
56
+
57
+ end
58
+
59
+ end
@@ -0,0 +1,4 @@
1
+ .bundle
2
+ db/*.sqlite3
3
+ log/*.log
4
+ tmp/**/*
@@ -0,0 +1,33 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rails', '3.0.0.rc'
4
+
5
+ # Bundle edge Rails instead:
6
+ # gem 'rails', :git => 'git://github.com/rails/rails.git'
7
+
8
+ gem 'sqlite3-ruby', :require => 'sqlite3'
9
+
10
+ # Use unicorn as the web server
11
+ # gem 'unicorn'
12
+
13
+ # Deploy with Capistrano
14
+ # gem 'capistrano'
15
+
16
+ # To use debugger
17
+ # gem 'ruby-debug'
18
+
19
+ # Bundle the extra gems:
20
+ # gem 'bj'
21
+ # gem 'nokogiri', '1.4.1'
22
+ # gem 'sqlite3-ruby', :require => 'sqlite3'
23
+ # gem 'aws-s3', :require => 'aws/s3'
24
+
25
+ # Bundle gems for the local environment. Make sure to
26
+ # put test-only gems in this group so their generators
27
+ # and rake tasks are available in development mode:
28
+ # group :development, :test do
29
+ # gem 'webrat'
30
+ # end
31
+
32
+ gem "auto_hash", :path => "../.."
33
+ gem "redgreen"
@@ -0,0 +1,81 @@
1
+ PATH
2
+ remote: /Users/kevin/Development/auto_hash
3
+ specs:
4
+ auto_hash (0.1)
5
+
6
+ GEM
7
+ remote: http://rubygems.org/
8
+ specs:
9
+ abstract (1.0.0)
10
+ actionmailer (3.0.0.rc)
11
+ actionpack (= 3.0.0.rc)
12
+ mail (~> 2.2.5)
13
+ actionpack (3.0.0.rc)
14
+ activemodel (= 3.0.0.rc)
15
+ activesupport (= 3.0.0.rc)
16
+ builder (~> 2.1.2)
17
+ erubis (~> 2.6.6)
18
+ i18n (~> 0.4.1)
19
+ rack (~> 1.2.1)
20
+ rack-mount (~> 0.6.9)
21
+ rack-test (~> 0.5.4)
22
+ tzinfo (~> 0.3.22)
23
+ activemodel (3.0.0.rc)
24
+ activesupport (= 3.0.0.rc)
25
+ builder (~> 2.1.2)
26
+ i18n (~> 0.4.1)
27
+ activerecord (3.0.0.rc)
28
+ activemodel (= 3.0.0.rc)
29
+ activesupport (= 3.0.0.rc)
30
+ arel (~> 0.4.0)
31
+ tzinfo (~> 0.3.22)
32
+ activeresource (3.0.0.rc)
33
+ activemodel (= 3.0.0.rc)
34
+ activesupport (= 3.0.0.rc)
35
+ activesupport (3.0.0.rc)
36
+ arel (0.4.0)
37
+ activesupport (>= 3.0.0.beta)
38
+ builder (2.1.2)
39
+ erubis (2.6.6)
40
+ abstract (>= 1.0.0)
41
+ i18n (0.4.1)
42
+ mail (2.2.5)
43
+ activesupport (>= 2.3.6)
44
+ mime-types
45
+ treetop (>= 1.4.5)
46
+ mime-types (1.16)
47
+ polyglot (0.3.1)
48
+ rack (1.2.1)
49
+ rack-mount (0.6.9)
50
+ rack (>= 1.0.0)
51
+ rack-test (0.5.4)
52
+ rack (>= 1.0)
53
+ rails (3.0.0.rc)
54
+ actionmailer (= 3.0.0.rc)
55
+ actionpack (= 3.0.0.rc)
56
+ activerecord (= 3.0.0.rc)
57
+ activeresource (= 3.0.0.rc)
58
+ activesupport (= 3.0.0.rc)
59
+ bundler (>= 1.0.0.rc.1)
60
+ railties (= 3.0.0.rc)
61
+ railties (3.0.0.rc)
62
+ actionpack (= 3.0.0.rc)
63
+ activesupport (= 3.0.0.rc)
64
+ rake (>= 0.8.3)
65
+ thor (~> 0.14.0)
66
+ rake (0.8.7)
67
+ redgreen (1.2.2)
68
+ sqlite3-ruby (1.3.0)
69
+ thor (0.14.0)
70
+ treetop (1.4.8)
71
+ polyglot (>= 0.3.1)
72
+ tzinfo (0.3.22)
73
+
74
+ PLATFORMS
75
+ ruby
76
+
77
+ DEPENDENCIES
78
+ auto_hash!
79
+ rails (= 3.0.0.rc)
80
+ redgreen
81
+ sqlite3-ruby
@@ -0,0 +1,7 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+ require 'rake'
6
+
7
+ Rails3xRoot::Application.load_tasks
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,6 @@
1
+
2
+ class User < ActiveRecord::Base
3
+
4
+ auto_hash :password
5
+
6
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Rails3xRoot</title>
5
+ <%= stylesheet_link_tag :all %>
6
+ <%= javascript_include_tag :defaults %>
7
+ <%= csrf_meta_tag %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,42 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ # If you have a Gemfile, require the gems listed there, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(:default, Rails.env) if defined?(Bundler)
8
+
9
+ module Rails3xRoot
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Custom directories with classes and modules you want to be autoloadable.
16
+ # config.autoload_paths += %W(#{config.root}/extras)
17
+
18
+ # Only load the plugins named here, in the order given (default is alphabetical).
19
+ # :all can be used as a placeholder for all plugins not explicitly named.
20
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
21
+
22
+ # Activate observers that should always be running.
23
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
24
+
25
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
26
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
27
+ # config.time_zone = 'Central Time (US & Canada)'
28
+
29
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
30
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
31
+ # config.i18n.default_locale = :de
32
+
33
+ # JavaScript files you want as :defaults (application.js is always included).
34
+ # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
35
+
36
+ # Configure the default encoding used in templates for Ruby 1.9.
37
+ config.encoding = "utf-8"
38
+
39
+ # Configure sensitive parameters which will be filtered from the log file.
40
+ config.filter_parameters += [:password]
41
+ end
42
+ end
@@ -0,0 +1,13 @@
1
+ require 'rubygems'
2
+
3
+ # Set up gems listed in the Gemfile.
4
+ gemfile = File.expand_path('../../Gemfile', __FILE__)
5
+ begin
6
+ ENV['BUNDLE_GEMFILE'] = gemfile
7
+ require 'bundler'
8
+ Bundler.setup
9
+ rescue Bundler::GemNotFound => e
10
+ STDERR.puts e.message
11
+ STDERR.puts "Try running `bundle install`."
12
+ exit!
13
+ end if File.exist?(gemfile)