base_auth 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/.gitignore +1 -0
  2. data/README.rdoc +130 -0
  3. data/Rakefile +52 -0
  4. data/VERSION +1 -0
  5. data/base_auth.gemspec +118 -0
  6. data/init.rb +1 -0
  7. data/lib/base_auth.rb +175 -0
  8. data/tasks/base_auth_tasks.rake +4 -0
  9. data/test/helper.rb +16 -0
  10. data/test/models/user.rb +3 -0
  11. data/test/rails_app/README +243 -0
  12. data/test/rails_app/Rakefile +10 -0
  13. data/test/rails_app/app/controllers/application_controller.rb +10 -0
  14. data/test/rails_app/app/helpers/application_helper.rb +3 -0
  15. data/test/rails_app/config/boot.rb +110 -0
  16. data/test/rails_app/config/database.yml +22 -0
  17. data/test/rails_app/config/environment.rb +41 -0
  18. data/test/rails_app/config/environments/development.rb +17 -0
  19. data/test/rails_app/config/environments/production.rb +28 -0
  20. data/test/rails_app/config/environments/test.rb +28 -0
  21. data/test/rails_app/config/initializers/backtrace_silencers.rb +7 -0
  22. data/test/rails_app/config/initializers/inflections.rb +10 -0
  23. data/test/rails_app/config/initializers/mime_types.rb +5 -0
  24. data/test/rails_app/config/initializers/new_rails_defaults.rb +21 -0
  25. data/test/rails_app/config/initializers/session_store.rb +15 -0
  26. data/test/rails_app/config/locales/en.yml +5 -0
  27. data/test/rails_app/config/routes.rb +43 -0
  28. data/test/rails_app/db/seeds.rb +7 -0
  29. data/test/rails_app/db/test.sqlite3 +0 -0
  30. data/test/rails_app/doc/README_FOR_APP +2 -0
  31. data/test/rails_app/log/development.log +0 -0
  32. data/test/rails_app/log/production.log +0 -0
  33. data/test/rails_app/log/server.log +0 -0
  34. data/test/rails_app/log/test.log +34 -0
  35. data/test/rails_app/public/404.html +30 -0
  36. data/test/rails_app/public/422.html +30 -0
  37. data/test/rails_app/public/500.html +30 -0
  38. data/test/rails_app/public/favicon.ico +0 -0
  39. data/test/rails_app/public/images/rails.png +0 -0
  40. data/test/rails_app/public/index.html +275 -0
  41. data/test/rails_app/public/javascripts/application.js +2 -0
  42. data/test/rails_app/public/javascripts/controls.js +963 -0
  43. data/test/rails_app/public/javascripts/dragdrop.js +973 -0
  44. data/test/rails_app/public/javascripts/effects.js +1128 -0
  45. data/test/rails_app/public/javascripts/prototype.js +4320 -0
  46. data/test/rails_app/public/robots.txt +5 -0
  47. data/test/rails_app/script/about +4 -0
  48. data/test/rails_app/script/console +3 -0
  49. data/test/rails_app/script/dbconsole +3 -0
  50. data/test/rails_app/script/destroy +3 -0
  51. data/test/rails_app/script/generate +3 -0
  52. data/test/rails_app/script/performance/benchmarker +3 -0
  53. data/test/rails_app/script/performance/profiler +3 -0
  54. data/test/rails_app/script/plugin +3 -0
  55. data/test/rails_app/script/runner +3 -0
  56. data/test/rails_app/script/server +3 -0
  57. data/test/rails_app/test/performance/browsing_test.rb +9 -0
  58. data/test/rails_app/test/test_helper.rb +38 -0
  59. data/test/schema.rb +5 -0
  60. data/test/test_base_auth.rb +20 -0
  61. metadata +140 -0
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -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,9 @@
1
+ require 'test_helper'
2
+ require 'performance_test_help'
3
+
4
+ # Profiling results for each test method are written to tmp/performance.
5
+ class BrowsingTest < ActionController::PerformanceTest
6
+ def test_homepage
7
+ get '/'
8
+ end
9
+ end
@@ -0,0 +1,38 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
3
+ require 'test_help'
4
+
5
+ class ActiveSupport::TestCase
6
+ # Transactional fixtures accelerate your tests by wrapping each test method
7
+ # in a transaction that's rolled back on completion. This ensures that the
8
+ # test database remains unchanged so your fixtures don't have to be reloaded
9
+ # between every test method. Fewer database queries means faster tests.
10
+ #
11
+ # Read Mike Clark's excellent walkthrough at
12
+ # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
13
+ #
14
+ # Every Active Record database supports transactions except MyISAM tables
15
+ # in MySQL. Turn off transactional fixtures in this case; however, if you
16
+ # don't care one way or the other, switching from MyISAM to InnoDB tables
17
+ # is recommended.
18
+ #
19
+ # The only drawback to using transactional fixtures is when you actually
20
+ # need to test transactions. Since your test is bracketed by a transaction,
21
+ # any transactions started in your code will be automatically rolled back.
22
+ self.use_transactional_fixtures = true
23
+
24
+ # Instantiated fixtures are slow, but give you @david where otherwise you
25
+ # would need people(:david). If you don't want to migrate your existing
26
+ # test cases which use the @david style and don't mind the speed hit (each
27
+ # instantiated fixtures translates to a database query per test method),
28
+ # then set this back to true.
29
+ self.use_instantiated_fixtures = false
30
+
31
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
32
+ #
33
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
34
+ # -- they do not yet inherit this setting
35
+ fixtures :all
36
+
37
+ # Add more helper methods to be used by all tests here...
38
+ end
data/test/schema.rb ADDED
@@ -0,0 +1,5 @@
1
+ ActiveRecord::Schema.define(:version => 0) do
2
+ create_table :users, :force => true do |t|
3
+ t.column :name, :string
4
+ end
5
+ end
@@ -0,0 +1,20 @@
1
+ require 'helper'
2
+
3
+ class UsersController < ActionController::Base
4
+ def index
5
+ render( :text => "test" )
6
+ end
7
+ end
8
+
9
+ class BaseAuthInControllerTest < ActionController::TestCase
10
+ def setup
11
+ @controller = UsersController.new
12
+ @request = ActionController::TestRequest.new
13
+ @response = ActionController::TestResponse.new
14
+ end
15
+
16
+ def test_index
17
+ get( :index )
18
+ assert_response( :success )
19
+ end
20
+ end
metadata ADDED
@@ -0,0 +1,140 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: base_auth
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 1
9
+ version: 0.2.1
10
+ platform: ruby
11
+ authors:
12
+ - Piotr Sarnacki
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-03-15 00:00:00 +01:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: A simple and elegant solution to authorization suitable for most small and medium-sized projects.
22
+ email: drogus@gmail.com
23
+ executables: []
24
+
25
+ extensions: []
26
+
27
+ extra_rdoc_files:
28
+ - README.rdoc
29
+ files:
30
+ - .gitignore
31
+ - README.rdoc
32
+ - Rakefile
33
+ - VERSION
34
+ - base_auth.gemspec
35
+ - init.rb
36
+ - lib/base_auth.rb
37
+ - tasks/base_auth_tasks.rake
38
+ - test/helper.rb
39
+ - test/models/user.rb
40
+ - test/rails_app/README
41
+ - test/rails_app/Rakefile
42
+ - test/rails_app/app/controllers/application_controller.rb
43
+ - test/rails_app/app/helpers/application_helper.rb
44
+ - test/rails_app/config/boot.rb
45
+ - test/rails_app/config/database.yml
46
+ - test/rails_app/config/environment.rb
47
+ - test/rails_app/config/environments/development.rb
48
+ - test/rails_app/config/environments/production.rb
49
+ - test/rails_app/config/environments/test.rb
50
+ - test/rails_app/config/initializers/backtrace_silencers.rb
51
+ - test/rails_app/config/initializers/inflections.rb
52
+ - test/rails_app/config/initializers/mime_types.rb
53
+ - test/rails_app/config/initializers/new_rails_defaults.rb
54
+ - test/rails_app/config/initializers/session_store.rb
55
+ - test/rails_app/config/locales/en.yml
56
+ - test/rails_app/config/routes.rb
57
+ - test/rails_app/db/seeds.rb
58
+ - test/rails_app/db/test.sqlite3
59
+ - test/rails_app/doc/README_FOR_APP
60
+ - test/rails_app/log/development.log
61
+ - test/rails_app/log/production.log
62
+ - test/rails_app/log/server.log
63
+ - test/rails_app/log/test.log
64
+ - test/rails_app/public/404.html
65
+ - test/rails_app/public/422.html
66
+ - test/rails_app/public/500.html
67
+ - test/rails_app/public/favicon.ico
68
+ - test/rails_app/public/images/rails.png
69
+ - test/rails_app/public/index.html
70
+ - test/rails_app/public/javascripts/application.js
71
+ - test/rails_app/public/javascripts/controls.js
72
+ - test/rails_app/public/javascripts/dragdrop.js
73
+ - test/rails_app/public/javascripts/effects.js
74
+ - test/rails_app/public/javascripts/prototype.js
75
+ - test/rails_app/public/robots.txt
76
+ - test/rails_app/script/about
77
+ - test/rails_app/script/console
78
+ - test/rails_app/script/dbconsole
79
+ - test/rails_app/script/destroy
80
+ - test/rails_app/script/generate
81
+ - test/rails_app/script/performance/benchmarker
82
+ - test/rails_app/script/performance/profiler
83
+ - test/rails_app/script/plugin
84
+ - test/rails_app/script/runner
85
+ - test/rails_app/script/server
86
+ - test/rails_app/test/performance/browsing_test.rb
87
+ - test/rails_app/test/test_helper.rb
88
+ - test/schema.rb
89
+ - test/test_base_auth.rb
90
+ has_rdoc: true
91
+ homepage: http://github.com/drogus/base_auth
92
+ licenses: []
93
+
94
+ post_install_message:
95
+ rdoc_options:
96
+ - --charset=UTF-8
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ segments:
104
+ - 0
105
+ version: "0"
106
+ required_rubygems_version: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ segments:
111
+ - 0
112
+ version: "0"
113
+ requirements: []
114
+
115
+ rubyforge_project:
116
+ rubygems_version: 1.3.6
117
+ signing_key:
118
+ specification_version: 3
119
+ summary: A simple and elegant solution to authorization suitable for most small and medium-sized projects.
120
+ test_files:
121
+ - test/helper.rb
122
+ - test/models/user.rb
123
+ - test/rails_app/app/controllers/application_controller.rb
124
+ - test/rails_app/app/helpers/application_helper.rb
125
+ - test/rails_app/config/boot.rb
126
+ - test/rails_app/config/environment.rb
127
+ - test/rails_app/config/environments/development.rb
128
+ - test/rails_app/config/environments/production.rb
129
+ - test/rails_app/config/environments/test.rb
130
+ - test/rails_app/config/initializers/backtrace_silencers.rb
131
+ - test/rails_app/config/initializers/inflections.rb
132
+ - test/rails_app/config/initializers/mime_types.rb
133
+ - test/rails_app/config/initializers/new_rails_defaults.rb
134
+ - test/rails_app/config/initializers/session_store.rb
135
+ - test/rails_app/config/routes.rb
136
+ - test/rails_app/db/seeds.rb
137
+ - test/rails_app/test/performance/browsing_test.rb
138
+ - test/rails_app/test/test_helper.rb
139
+ - test/schema.rb
140
+ - test/test_base_auth.rb