ability_engine 0.0.1

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 (64) hide show
  1. data/.gitignore +18 -0
  2. data/.rvmrc +1 -0
  3. data/Gemfile +8 -0
  4. data/Gemfile.lock +118 -0
  5. data/LICENSE +22 -0
  6. data/README.md +57 -0
  7. data/Rakefile +2 -0
  8. data/ability_engine.gemspec +22 -0
  9. data/app/controllers/current_ability_controller.rb +7 -0
  10. data/config/routes.rb +3 -0
  11. data/lib/ability_engine.rb +6 -0
  12. data/lib/ability_engine/version.rb +3 -0
  13. data/spec/controllers/current_ability_controller_spec.rb +16 -0
  14. data/spec/dummy/.gitignore +1 -0
  15. data/spec/dummy/Rakefile +8 -0
  16. data/spec/dummy/app/assets/javascripts/application.js +47 -0
  17. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  18. data/spec/dummy/app/controllers/home_controller.rb +9 -0
  19. data/spec/dummy/app/helpers/application_helper.rb +13 -0
  20. data/spec/dummy/app/mailers/.gitkeep +0 -0
  21. data/spec/dummy/app/models/.gitkeep +0 -0
  22. data/spec/dummy/app/views/layouts/application.html.haml +22 -0
  23. data/spec/dummy/app/views/layouts/common/_agent_banner.html.haml +14 -0
  24. data/spec/dummy/app/views/layouts/common/_footer.html.haml +16 -0
  25. data/spec/dummy/app/views/layouts/common/_login_banner.html.haml +12 -0
  26. data/spec/dummy/app/views/layouts/common/_login_footer.html.haml +26 -0
  27. data/spec/dummy/app/views/layouts/devise/sessions.html.haml +18 -0
  28. data/spec/dummy/config.ru +7 -0
  29. data/spec/dummy/config/application.rb +50 -0
  30. data/spec/dummy/config/boot.rb +17 -0
  31. data/spec/dummy/config/environment.rb +5 -0
  32. data/spec/dummy/config/environments/development.rb +25 -0
  33. data/spec/dummy/config/environments/test.rb +39 -0
  34. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  35. data/spec/dummy/config/initializers/inflections.rb +10 -0
  36. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  37. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  38. data/spec/dummy/config/initializers/session_store.rb +8 -0
  39. data/spec/dummy/config/locales/devise.en.yml +56 -0
  40. data/spec/dummy/config/locales/en.yml +7 -0
  41. data/spec/dummy/config/routes.rb +67 -0
  42. data/spec/dummy/lib/tasks/.gitkeep +0 -0
  43. data/spec/dummy/log/.gitkeep +0 -0
  44. data/spec/dummy/public/404.html +26 -0
  45. data/spec/dummy/public/422.html +26 -0
  46. data/spec/dummy/public/500.html +26 -0
  47. data/spec/dummy/public/favicon.ico +0 -0
  48. data/spec/dummy/public/login.html +1 -0
  49. data/spec/dummy/public/robots.txt +5 -0
  50. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  51. data/spec/dummy/public/stylesheets/application.css +4702 -0
  52. data/spec/dummy/public/stylesheets/home.css.css +0 -0
  53. data/spec/dummy/public/stylesheets/ie.css +122 -0
  54. data/spec/dummy/public/stylesheets/ie7.css +199 -0
  55. data/spec/dummy/public/stylesheets/ie8.css +14 -0
  56. data/spec/dummy/public/stylesheets/jquery/fileuploader.css +99 -0
  57. data/spec/dummy/public/stylesheets/jquery/ui-lightness/jquery.ui.autocomplete.css +70 -0
  58. data/spec/dummy/public/stylesheets/jquery/ui-lightness/jquery.ui.datepicker.css +1562 -0
  59. data/spec/dummy/public/stylesheets/jquery/ui-lightness/jquery.ui.dialog.css +131 -0
  60. data/spec/dummy/public/stylesheets/users.css.css +0 -0
  61. data/spec/dummy/script/rails +6 -0
  62. data/spec/dummy/vendor/plugins/.gitkeep +0 -0
  63. data/spec/spec_helper.rb +39 -0
  64. metadata +221 -0
@@ -0,0 +1,16 @@
1
+ .footer-container
2
+ .footer
3
+ .footer-left.light
4
+ Agent Administration © REA Group 2011, All rights reserved
5
+ .footer-right
6
+ %p
7
+ = link_to "About Us", "http://www.rea-group.com/irm/content/about-rea.html", :target => "_blank"
8
+ %span.divider.light
9
+ |
10
+ = link_to "Feedback", "http://www.realestate.com.au/cgi-bin/rsearch?a=feedback&t=ao-wel&to=suggestions", :target => "_blank"
11
+ %span.divider.light
12
+ |
13
+ = link_to "Legal", "http://www.rs.realestate.com.au/terms", :target => "_blank"
14
+ %span.divider.light
15
+ |
16
+ = link_to "Privacy", "http://www.realestate.com.au/cgi-bin/rsearch?a=v&t=ao-wel&id=587", :target => "_blank"
@@ -0,0 +1,12 @@
1
+ #header.ruiClearFix
2
+ %ul
3
+ %li.adHeader
4
+ %img(src="/auth/assets/login/gfk_hdr_aadmin.gif" alt="Agent Administration")
5
+ %li.rea
6
+ %a(href="http://www.realestate.com.au/" target="_blank")
7
+ %img(src="/auth/assets/login/gfk_hdr_lgo_rea.gif" alt="realestate.com.au" title="Visit realestate.com.au")
8
+ %li.rca
9
+ %a(href="http://www.realcommercial.com.au/" target="_blank")
10
+ %img(src="/auth/assets/login/gfk_hdr_lgo_rcm.gif" alt="realcommercial.com.au" title="Visit realcommercial.com.au")
11
+ %li.headerRightClear
12
+ %img(src="/auth/assets/login/gfk_hdr_lgo_clear.gif")
@@ -0,0 +1,26 @@
1
+ #footer
2
+ %ul
3
+ %li.rea-link
4
+ %span.footer ©
5
+ %a.footer(href="http://www.realestate.com.au/" target="_blank") realestate.com.au
6
+ %span.footer Ltd
7
+ %li.divider
8
+ %img(src="/auth/assets/login/spacer.gif" width="2" height="1")
9
+ %li.footer_margin
10
+ %a.footer_red(href="http://www.realestate.com.au/cgi-bin/rsearch?a=v&t=ao-wel&id=573" target="_blank") About Us
11
+ %span.footer_divider  | 
12
+ %li
13
+ %a.footer_red(href="http://www.realestate.com.au/cgi-bin/rsearch?a=v&t=ao-wel&id=583" target="_blank") Advertise With Us
14
+ %span.footer_divider  | 
15
+ %li
16
+ %a.footer_red(href="http://www.realestate.com.au/cgi-bin/rsearch?a=v&t=ao-wel&id=65" target="_blank") Contact Us
17
+ %span.footer_divider  | 
18
+ %li
19
+ %a.footer_red(href="http://www.realestate.com.au/cgi-bin/rsearch?a=feedback&t=ao-wel&to=suggestions" target="_blank") Feedback
20
+ %span.footer_divider  | 
21
+ %li
22
+ %a.footer_red(href="http://www.realestate.com.au/cgi-bin/rsearch?a=v&t=ao-wel&id=13" target="_blank") Legal
23
+ %span.footer_divider  | 
24
+ %li
25
+ %a.footer_red(href="http://www.realestate.com.au/cgi-bin/rsearch?a=v&t=ao-wel&id=587" target="_blank") Privacy
26
+ %span.footer_divider  | 
@@ -0,0 +1,18 @@
1
+ !!! 5
2
+ %html
3
+ %head
4
+ %title Login Agent Administration - realestate.com.au
5
+ != stylesheet_link_tag "auth_login"
6
+ /[if IE ]
7
+ = stylesheet_link_tag 'auth_login_ie'
8
+ /[if gt IE 7]
9
+ = stylesheet_link_tag 'auth_login_ie8'
10
+ != javascript_include_tag "application"
11
+ != csrf_meta_tags
12
+ %body
13
+ = render :partial => "layouts/common/login_banner"
14
+ #wrapper
15
+ = yield
16
+ = render :partial => "layouts/common/login_footer"
17
+
18
+ = yield :scripts
@@ -0,0 +1,7 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+
5
+ run Rack::URLMap.new(
6
+ '/' => Dummy::Application
7
+ )
@@ -0,0 +1,50 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require "action_controller/railtie"
4
+ require "action_mailer/railtie"
5
+ require "active_resource/railtie"
6
+ require "rails/test_unit/railtie"
7
+
8
+ #if defined?(Bundler)
9
+ # # If you precompile assets before deploying to production, use this line
10
+ # Bundler.require(*Rails.groups(:assets => %w(development test)))
11
+ # # If you want your assets lazily compiled in production, use this line
12
+ # # Bundler.require(:default, :assets, Rails.env)
13
+ #end
14
+
15
+ Bundler.require
16
+ require 'ability_engine'
17
+
18
+ module Dummy
19
+ class Application < Rails::Application
20
+ # Settings in config/environments/* take precedence over those specified here.
21
+ # Application configuration should go into files in config/initializers
22
+ # -- all .rb files in that directory are automatically loaded.
23
+
24
+ # Custom directories with classes and modules you want to be autoloadable.
25
+ # config.autoload_paths += %W(#{config.root}/extras)
26
+
27
+ # Only load the plugins named here, in the order given (default is alphabetical).
28
+ # :all can be used as a placeholder for all plugins not explicitly named.
29
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
30
+
31
+ # Activate observers that should always be running.
32
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
33
+
34
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
35
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
36
+ # config.time_zone = 'Central Time (US & Canada)'
37
+ config.time_zone = 'Melbourne'
38
+
39
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
40
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
41
+ # config.i18n.default_locale = :de
42
+
43
+ # Configure the default encoding used in templates for Ruby 1.9.
44
+ config.encoding = "utf-8"
45
+
46
+ # Configure sensitive parameters which will be filtered from the log file.
47
+ config.filter_parameters += [:password, :password_confirmation]
48
+
49
+ end
50
+ end
@@ -0,0 +1,17 @@
1
+ #require 'rubygems'
2
+ #
3
+ ## Set up gems listed in the Gemfile.
4
+ #ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
+ #
6
+ #require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
7
+
8
+ require 'rubygems'
9
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
10
+
11
+ if File.exist?(gemfile)
12
+ ENV['BUNDLE_GEMFILE'] = gemfile
13
+ require 'bundler'
14
+ Bundler.setup
15
+ end
16
+
17
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,25 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger
20
+ config.active_support.deprecation = :log
21
+
22
+ # Only use best-standards-support built into browsers
23
+ config.action_dispatch.best_standards_support = :builtin
24
+
25
+ end
@@ -0,0 +1,39 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
33
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
34
+ # like if you have constraints or database-specific column types
35
+ # config.active_record.schema_format = :sql
36
+
37
+ # Print deprecation notices to the stderr
38
+ config.active_support.deprecation = :stderr
39
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = '510e483184f24a71f9512616ef34c1c821cd36337b32bab6eb1902a3a12e363beb5606db9ee8439fe4fd9bd1fa35252c4cfd4d4a499905c93bb42dae18133589'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, :key => '_cp-auth_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,56 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ errors:
5
+ messages:
6
+ expired: "has expired, please request a new one"
7
+ not_found: "not found"
8
+ already_confirmed: "was already confirmed, please try signing in"
9
+ not_locked: "was not locked"
10
+ not_saved:
11
+ one: "1 error prohibited this %{resource} from being saved:"
12
+ other: "%{count} errors prohibited this %{resource} from being saved:"
13
+
14
+ devise:
15
+ failure:
16
+ already_authenticated: 'You are already signed in.'
17
+ unauthenticated: ''
18
+ unconfirmed: 'You have to confirm your account before continuing.'
19
+ locked: 'Your account is locked.'
20
+ invalid: 'Invalid email or password.'
21
+ invalid_token: 'Invalid authentication token.'
22
+ timeout: 'Your session expired, please sign in again to continue.'
23
+ inactive: 'Your account was not activated yet.'
24
+ sessions:
25
+ signed_in: 'Signed in successfully.'
26
+ signed_out: 'Signed out successfully.'
27
+ passwords:
28
+ send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
29
+ updated: 'Your password was changed successfully. You are now signed in.'
30
+ updated_not_active: 'Your password was changed successfully.'
31
+ send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
32
+ confirmations:
33
+ send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
34
+ send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
35
+ confirmed: 'Your account was successfully confirmed. You are now signed in.'
36
+ registrations:
37
+ signed_up: 'Welcome! You have signed up successfully.'
38
+ updated: 'You updated your account successfully.'
39
+ destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
40
+ signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.'
41
+ signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.'
42
+ signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.'
43
+ unlocks:
44
+ send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
45
+ unlocked: 'Your account was successfully unlocked. You are now signed in.'
46
+ send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
47
+ omniauth_callbacks:
48
+ success: 'Successfully authorized from %{kind} account.'
49
+ failure: 'Could not authorize you from %{kind} because "%{reason}".'
50
+ mailer:
51
+ confirmation_instructions:
52
+ subject: 'Confirmation instructions'
53
+ reset_password_instructions:
54
+ subject: 'Reset password instructions'
55
+ unlock_instructions:
56
+ subject: 'Unlock Instructions'
@@ -0,0 +1,7 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ will_paginate:
6
+ models:
7
+ cp_user: 'users'
@@ -0,0 +1,67 @@
1
+ Dummy::Application.routes.draw do
2
+
3
+ root :to => "home#index"
4
+ mount AbilityEngine::Engine, :at => "ability_engine"
5
+
6
+
7
+ ###############
8
+ # Test routes #
9
+ ###############
10
+
11
+ # The priority is based upon order of creation:
12
+ # first created -> highest priority.
13
+
14
+ # Sample of regular route:
15
+ # match 'products/:id' => 'catalog#view'
16
+ # Keep in mind you can assign values other than :controller and :action
17
+
18
+ # Sample of named route:
19
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
20
+ # This route can be invoked with purchase_url(:id => product.id)
21
+
22
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
23
+ # resources :products
24
+
25
+ # Sample resource route with options:
26
+ # resources :products do
27
+ # member do
28
+ # get 'short'
29
+ # post 'toggle'
30
+ # end
31
+ #
32
+ # collection do
33
+ # get 'sold'
34
+ # end
35
+ # end
36
+
37
+ # Sample resource route with sub-resources:
38
+ # resources :products do
39
+ # resources :comments, :sales
40
+ # resource :seller
41
+ # end
42
+
43
+ # Sample resource route with more complex sub-resources
44
+ # resources :products do
45
+ # resources :comments
46
+ # resources :sales do
47
+ # get 'recent', :on => :collection
48
+ # end
49
+ # end
50
+
51
+ # Sample resource route within a namespace:
52
+ # namespace :admin do
53
+ # # Directs /admin/products/* to Admin::ProductsController
54
+ # # (app/controllers/admin/products_controller.rb)
55
+ # resources :products
56
+ # end
57
+
58
+ # You can have the root of your site routed with "root"
59
+ # just remember to delete public/index.html.
60
+ # root :to => 'welcome#index'
61
+
62
+ # See how all your routes lay out with "rake routes"
63
+
64
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
65
+ # Note: This route will make all actions in every controller accessible via GET requests.
66
+ # match ':controller(/:action(/:id(.:format)))'
67
+ end
File without changes
File without changes
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>