registrar-rails 0.0.1.alpha

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 (35) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +31 -0
  3. data/app/controllers/authentication_controller.rb +11 -0
  4. data/config/initializers/registrar.rb +5 -0
  5. data/config/routes.rb +7 -0
  6. data/lib/registrar/rails/controller_extensions.rb +99 -0
  7. data/lib/registrar/rails/engine.rb +28 -0
  8. data/lib/registrar/rails/version.rb +5 -0
  9. data/lib/registrar-rails.rb +10 -0
  10. data/test/controller_extensions/current_profile_test.rb +14 -0
  11. data/test/dummy/README.rdoc +28 -0
  12. data/test/dummy/Rakefile +6 -0
  13. data/test/dummy/app/controllers/application_controller.rb +5 -0
  14. data/test/dummy/app/controllers/some_controller.rb +5 -0
  15. data/test/dummy/bin/bundle +3 -0
  16. data/test/dummy/bin/rails +4 -0
  17. data/test/dummy/bin/rake +4 -0
  18. data/test/dummy/bin/setup +29 -0
  19. data/test/dummy/config/application.rb +29 -0
  20. data/test/dummy/config/boot.rb +5 -0
  21. data/test/dummy/config/environment.rb +5 -0
  22. data/test/dummy/config/environments/development.rb +38 -0
  23. data/test/dummy/config/environments/production.rb +76 -0
  24. data/test/dummy/config/environments/test.rb +42 -0
  25. data/test/dummy/config/initializers/assets.rb +11 -0
  26. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  27. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  28. data/test/dummy/config/initializers/session_store.rb +3 -0
  29. data/test/dummy/config/initializers/wrap_parameters.rb +9 -0
  30. data/test/dummy/config/routes.rb +5 -0
  31. data/test/dummy/config/secrets.yml +22 -0
  32. data/test/dummy/config.ru +4 -0
  33. data/test/dummy/log/test.log +90 -0
  34. data/test/test_helper.rb +12 -0
  35. metadata +130 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ca380903e0f191b41af79e552972af187a877c1a
4
+ data.tar.gz: 62605fa5ca9b084efb6d80a64e4b40838431ea50
5
+ SHA512:
6
+ metadata.gz: 32ec347dfc454e09b663c7506bfd7f9d72c621046f161e1a3eba3332792aa56cadcd9e11a69b9fe80cb3ea6b87056f213d14aa086e96e9e40c729747ec466b11
7
+ data.tar.gz: 963cfef86cc79e3a91b8cf33feb4632fe01534ce9fc063f09cbc34719b1d716bbdca4b25c2b29828327447491204670b3d72745d8b56653863764cdc08e2fce4
data/Rakefile ADDED
@@ -0,0 +1,31 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Registrar::Rails'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ load 'rails/tasks/statistics.rake'
18
+
19
+ Bundler::GemHelper.install_tasks
20
+
21
+ require 'rake/testtask'
22
+
23
+ Rake::TestTask.new(:test) do |t|
24
+ t.libs << 'lib'
25
+ t.libs << 'test'
26
+ t.pattern = 'test/**/*_test.rb'
27
+ t.verbose = false
28
+ end
29
+
30
+
31
+ task default: :test
@@ -0,0 +1,11 @@
1
+ class AuthenticationController < ApplicationController
2
+ def sign_in
3
+ end
4
+
5
+ def sign_up
6
+ end
7
+
8
+ def authenticate
9
+ render :text => "<pre>#{presentable_authentication.to_yaml}</pre>"
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ require 'registrar'
2
+
3
+ ActiveSupport.on_load(:action_controller) do
4
+ include Registrar::Rails::ControllerExtensions
5
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,7 @@
1
+ Rails.application.routes.draw do
2
+ get 'sign_up', :to => 'authentication#sign_up', :as => 'sign_up'
3
+ get 'sign_in', :to => 'authentication#sign_in', :as => 'sign_in'
4
+
5
+ # Auth through OmniAuth strategy
6
+ post 'auth/:strategy/callback' => 'authentication#authenticate', :as => 'authenticate'
7
+ end
@@ -0,0 +1,99 @@
1
+ module Registrar
2
+ class Profile < Delegator
3
+ def initialize(obj)
4
+ super
5
+ @delegate_sd_obj = obj
6
+ end
7
+
8
+ def __getobj__
9
+ @delegate_sd_obj
10
+ end
11
+
12
+ def __setobj__(obj)
13
+ @delegate_sd_obj = obj
14
+ end
15
+ end
16
+
17
+ module Rails
18
+ module ControllerExtensions
19
+ def self.included(klass)
20
+ klass.include InstanceMethods
21
+ klass.before_action :try_to_store_registrar_profile
22
+
23
+ klass.class_eval do
24
+ helper_method :current_profile
25
+ helper_method :current_profile?
26
+ helper_method :logged_in?
27
+
28
+ helper_method :registrar_profile
29
+ helper_method :registrar_profile?
30
+
31
+ helper_method :authentication_phase?
32
+
33
+ helper_method :logout
34
+ helper_method :presentable_authentication
35
+ end
36
+ end
37
+
38
+ module InstanceMethods
39
+ REGISTRAR_PROFILE_KEY = 'registrar.profile'
40
+
41
+ def try_to_store_registrar_profile
42
+ if registrar_profile = request.env['registrar.profile']
43
+ store_registrar_profile(registrar_profile)
44
+ end
45
+ end
46
+
47
+ def store_registrar_profile(registrar_profile)
48
+ session[REGISTRAR_PROFILE_KEY] = registrar_profile
49
+ end
50
+
51
+ def current_profile
52
+ return @current_profile if @current_profile
53
+ try_to_set_current_profile
54
+ end
55
+
56
+ def logout
57
+ @current_profile = nil
58
+ end
59
+
60
+ def current_profile?
61
+ !!current_profile
62
+ end
63
+ alias_method :logged_in?, :current_profile?
64
+
65
+ def try_to_set_current_profile
66
+ if registrar_profile?
67
+ @current_user = build_profile(registrar_profile)
68
+ end
69
+ end
70
+
71
+ def registrar_profile?
72
+ !!registrar_profile
73
+ end
74
+
75
+ def registrar_profile
76
+ session[REGISTRAR_PROFILE_KEY]
77
+ end
78
+
79
+ def build_profile(profile)
80
+ ::Registrar::Profile.new(profile)
81
+ end
82
+
83
+ def authentication_phase?
84
+ params[:controller] == 'authentication' && params[:action] = 'callback'
85
+ end
86
+
87
+ def presentable_authentication
88
+ {
89
+ 'env.omniauth.auth' => request.env['omniauth.auth'],
90
+ 'env.registrar.auth' => request.env['registrar.auth'],
91
+ 'env.registrar.profile' => request.env['registrar.profile'],
92
+ 'session.registrar_profile' => registrar_profile,
93
+ 'runtime.current_profile' => current_profile
94
+ }
95
+ end
96
+ end
97
+ end
98
+ end
99
+ end
@@ -0,0 +1,28 @@
1
+ require "registrar"
2
+
3
+ module Registrar
4
+ module Rails
5
+ class Engine < ::Rails::Engine
6
+ @@configuration = nil
7
+
8
+ initializer "registrar.rails",
9
+ :after => :load_config_initializers,
10
+ :before => :build_middleware_stack do |app|
11
+ if @@configuration
12
+ @@configuration.call
13
+ end
14
+ end
15
+
16
+ def self.configure(&configuration)
17
+ block = lambda do |config|
18
+ configuration.call config
19
+ config.middleware(::Rails.application.config.middleware)
20
+ end
21
+
22
+ @@configuration = lambda do
23
+ Registrar::Middleware.configure(&block)
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,5 @@
1
+ module Registrar
2
+ module Rails
3
+ VERSION = "0.0.1.alpha"
4
+ end
5
+ end
@@ -0,0 +1,10 @@
1
+ require "registrar/rails/engine"
2
+ require "registrar/rails/controller_extensions"
3
+
4
+ module Registrar
5
+ module Rails
6
+ def self.configure(&configuration)
7
+ Registrar::Rails::Engine.configure(&configuration)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class CurrentProfileTest < ActionController::TestCase
4
+ tests SomeController
5
+
6
+ test 'no current profile by default' do
7
+ get :index
8
+
9
+ refute @controller.current_profile
10
+ refute @controller.current_profile?
11
+ refute @controller.logged_in?
12
+ end
13
+
14
+ end
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
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
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
@@ -0,0 +1,5 @@
1
+ class SomeController < ApplicationController
2
+ def index
3
+ render :text => 'Hello World!'
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+
7
+ Dir.chdir APP_ROOT do
8
+ # This script is a starting point to setup your application.
9
+ # Add necessary setup steps to this file:
10
+
11
+ puts "== Installing dependencies =="
12
+ system "gem install bundler --conservative"
13
+ system "bundle check || bundle install"
14
+
15
+ # puts "\n== Copying sample files =="
16
+ # unless File.exist?("config/database.yml")
17
+ # system "cp config/database.yml.sample config/database.yml"
18
+ # end
19
+
20
+ puts "\n== Preparing database =="
21
+ system "bin/rake db:setup"
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system "rm -f log/*"
25
+ system "rm -rf tmp/cache"
26
+
27
+ puts "\n== Restarting application server =="
28
+ system "touch tmp/restart.txt"
29
+ end
@@ -0,0 +1,29 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ # Pick the frameworks you want:
4
+ # require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_mailer/railtie"
7
+ require "action_view/railtie"
8
+ # require "sprockets/railtie"
9
+ require "rails/test_unit/railtie"
10
+
11
+ Bundler.require(*Rails.groups)
12
+ require "registrar-rails"
13
+
14
+ module Dummy
15
+ class Application < Rails::Application
16
+ # Settings in config/environments/* take precedence over those specified here.
17
+ # Application configuration should go into files in config/initializers
18
+ # -- all .rb files in that directory are automatically loaded.
19
+
20
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
21
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
22
+ # config.time_zone = 'Central Time (US & Canada)'
23
+
24
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
25
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
26
+ # config.i18n.default_locale = :de
27
+ end
28
+ end
29
+
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.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
+ Rails.application.initialize!
@@ -0,0 +1,38 @@
1
+ Rails.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
+ # Do not eager load code on boot.
10
+ config.eager_load = false
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
+ # Debug mode disables concatenation and preprocessing of assets.
23
+ # This option may cause significant delays in view rendering with a large
24
+ # number of complex assets.
25
+ config.assets.debug = true
26
+
27
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
28
+ # yet still be able to expire them through the digest params.
29
+ config.assets.digest = true
30
+
31
+ # Adds additional error checking when serving assets at runtime.
32
+ # Checks for improperly declared sprockets dependencies.
33
+ # Raises helpful error messages.
34
+ config.assets.raise_runtime_errors = true
35
+
36
+ # Raises error for missing translations
37
+ # config.action_view.raise_on_missing_translations = true
38
+ end
@@ -0,0 +1,76 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like
20
+ # NGINX, varnish or squid.
21
+ # config.action_dispatch.rack_cache = true
22
+
23
+ # Disable serving static files from the `/public` folder by default since
24
+ # Apache or NGINX already handles this.
25
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26
+
27
+ # Compress JavaScripts and CSS.
28
+ config.assets.js_compressor = :uglifier
29
+ # config.assets.css_compressor = :sass
30
+
31
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
32
+ config.assets.compile = false
33
+
34
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35
+ # yet still be able to expire them through the digest params.
36
+ config.assets.digest = true
37
+
38
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
39
+
40
+ # Specifies the header that your server uses for sending files.
41
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
43
+
44
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45
+ # config.force_ssl = true
46
+
47
+ # Use the lowest log level to ensure availability of diagnostic information
48
+ # when problems arise.
49
+ config.log_level = :debug
50
+
51
+ # Prepend all log lines with the following tags.
52
+ # config.log_tags = [ :subdomain, :uuid ]
53
+
54
+ # Use a different logger for distributed setups.
55
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
56
+
57
+ # Use a different cache store in production.
58
+ # config.cache_store = :mem_cache_store
59
+
60
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61
+ # config.action_controller.asset_host = 'http://assets.example.com'
62
+
63
+ # Ignore bad email addresses and do not raise email delivery errors.
64
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
65
+ # config.action_mailer.raise_delivery_errors = false
66
+
67
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
68
+ # the I18n.default_locale when a translation cannot be found).
69
+ config.i18n.fallbacks = true
70
+
71
+ # Send deprecation notices to registered listeners.
72
+ config.active_support.deprecation = :notify
73
+
74
+ # Use default logging formatter so that PID and timestamp are not suppressed.
75
+ config.log_formatter = ::Logger::Formatter.new
76
+ end
@@ -0,0 +1,42 @@
1
+ Rails.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
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static file server for tests with Cache-Control for performance.
16
+ config.serve_static_files = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Randomize the order test cases are executed.
35
+ config.active_support.test_order = :random
36
+
37
+ # Print deprecation notices to the stderr.
38
+ config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
42
+ end
@@ -0,0 +1,11 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -0,0 +1,9 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
+ end
@@ -0,0 +1,5 @@
1
+ Rails.application.routes.draw do
2
+ mount Registrar::Rails::Engine => "/registrar"
3
+
4
+ get "some/index" => "some#index"
5
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: 4e57c5699458e9e98a8ca37f4557df13c27040a1771896e2cafa857dbb99bd86debd5ddbec85d70618014c6ed93257bcb782b8f3e3d77191f4fb2013b99ba8ea
15
+
16
+ test:
17
+ secret_key_base: fc29a941a781abc3b242bea3cd6e0907379d211e55707c44fb379c32a4dda080ac9a5dc3584ac909a142bd42b098df463df671dbed8866636a9c69d4b48cf8cb
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,90 @@
1
+ ------------------------------------------------------
2
+ CurrentProfileTest: test_no_current_profile_by_default
3
+ ------------------------------------------------------
4
+ Processing by SomeController#index as HTML
5
+ Rendered text template (0.0ms)
6
+ Completed 200 OK in 4ms (Views: 4.0ms)
7
+ ------------------------------------------------------
8
+ CurrentProfileTest: test_no_current_profile_by_default
9
+ ------------------------------------------------------
10
+ Processing by SomeController#index as HTML
11
+ Rendered text template (0.0ms)
12
+ Completed 200 OK in 4ms (Views: 3.6ms)
13
+ ------------------------------------------------------
14
+ CurrentProfileTest: test_no_current_profile_by_default
15
+ ------------------------------------------------------
16
+ Processing by SomeController#index as HTML
17
+ Rendered text template (0.0ms)
18
+ Completed 200 OK in 4ms (Views: 3.7ms)
19
+ ------------------------------------------------------
20
+ CurrentProfileTest: test_no_current_profile_by_default
21
+ ------------------------------------------------------
22
+ Processing by SomeController#index as HTML
23
+ Rendered text template (0.0ms)
24
+ Completed 200 OK in 4ms (Views: 3.8ms)
25
+ ------------------------------------------------------
26
+ CurrentProfileTest: test_no_current_profile_by_default
27
+ ------------------------------------------------------
28
+ Processing by SomeController#index as HTML
29
+ Rendered text template (0.0ms)
30
+ Completed 200 OK in 6ms (Views: 5.4ms)
31
+ ------------------------------------------------------
32
+ CurrentProfileTest: test_no_current_profile_by_default
33
+ ------------------------------------------------------
34
+ Processing by SomeController#index as HTML
35
+ Rendered text template (0.0ms)
36
+ Completed 200 OK in 4ms (Views: 3.8ms)
37
+ ------------------------------------------------------
38
+ CurrentProfileTest: test_no_current_profile_by_default
39
+ ------------------------------------------------------
40
+ Processing by SomeController#index as HTML
41
+ Rendered text template (0.0ms)
42
+ Completed 200 OK in 4ms (Views: 3.5ms)
43
+ ------------------------------------------------------
44
+ CurrentProfileTest: test_no_current_profile_by_default
45
+ ------------------------------------------------------
46
+ Processing by SomeController#index as HTML
47
+ Rendered text template (0.0ms)
48
+ Completed 200 OK in 3ms (Views: 3.2ms)
49
+ ------------------------------------------------------
50
+ CurrentProfileTest: test_no_current_profile_by_default
51
+ ------------------------------------------------------
52
+ Processing by SomeController#index as HTML
53
+ Rendered text template (0.0ms)
54
+ Completed 200 OK in 3ms (Views: 3.3ms)
55
+ ------------------------------------------------------
56
+ CurrentProfileTest: test_no_current_profile_by_default
57
+ ------------------------------------------------------
58
+ Processing by SomeController#index as HTML
59
+ Rendered text template (0.0ms)
60
+ Completed 200 OK in 3ms (Views: 3.3ms)
61
+ ------------------------------------------------------
62
+ CurrentProfileTest: test_no_current_profile_by_default
63
+ ------------------------------------------------------
64
+ Processing by SomeController#index as HTML
65
+ Rendered text template (0.0ms)
66
+ Completed 200 OK in 4ms (Views: 3.5ms)
67
+ ------------------------------------------------------
68
+ CurrentProfileTest: test_no_current_profile_by_default
69
+ ------------------------------------------------------
70
+ Processing by SomeController#index as HTML
71
+ Rendered text template (0.0ms)
72
+ Completed 200 OK in 3ms (Views: 2.6ms)
73
+ ------------------------------------------------------
74
+ CurrentProfileTest: test_no_current_profile_by_default
75
+ ------------------------------------------------------
76
+ Processing by SomeController#index as HTML
77
+ Rendered text template (0.0ms)
78
+ Completed 200 OK in 3ms (Views: 2.6ms)
79
+ ------------------------------------------------------
80
+ CurrentProfileTest: test_no_current_profile_by_default
81
+ ------------------------------------------------------
82
+ Processing by SomeController#index as HTML
83
+ Rendered text template (0.0ms)
84
+ Completed 200 OK in 3ms (Views: 2.7ms)
85
+ ------------------------------------------------------
86
+ CurrentProfileTest: test_no_current_profile_by_default
87
+ ------------------------------------------------------
88
+ Processing by SomeController#index as HTML
89
+ Rendered text template (0.0ms)
90
+ Completed 200 OK in 3ms (Views: 2.7ms)
@@ -0,0 +1,12 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ # Filter out Minitest backtrace while allowing backtrace from other libraries
8
+ # to be shown.
9
+ Minitest.backtrace_filter = Minitest::BacktraceFilter.new
10
+
11
+ # Load support files
12
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
metadata ADDED
@@ -0,0 +1,130 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: registrar-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1.alpha
5
+ platform: ruby
6
+ authors:
7
+ - Jan Owiesniak
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 4.2.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 4.2.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: registrar
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description:
42
+ email:
43
+ - jan@featurefabrik.de
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - Rakefile
49
+ - app/controllers/authentication_controller.rb
50
+ - config/initializers/registrar.rb
51
+ - config/routes.rb
52
+ - lib/registrar-rails.rb
53
+ - lib/registrar/rails/controller_extensions.rb
54
+ - lib/registrar/rails/engine.rb
55
+ - lib/registrar/rails/version.rb
56
+ - test/controller_extensions/current_profile_test.rb
57
+ - test/dummy/README.rdoc
58
+ - test/dummy/Rakefile
59
+ - test/dummy/app/controllers/application_controller.rb
60
+ - test/dummy/app/controllers/some_controller.rb
61
+ - test/dummy/bin/bundle
62
+ - test/dummy/bin/rails
63
+ - test/dummy/bin/rake
64
+ - test/dummy/bin/setup
65
+ - test/dummy/config.ru
66
+ - test/dummy/config/application.rb
67
+ - test/dummy/config/boot.rb
68
+ - test/dummy/config/environment.rb
69
+ - test/dummy/config/environments/development.rb
70
+ - test/dummy/config/environments/production.rb
71
+ - test/dummy/config/environments/test.rb
72
+ - test/dummy/config/initializers/assets.rb
73
+ - test/dummy/config/initializers/cookies_serializer.rb
74
+ - test/dummy/config/initializers/filter_parameter_logging.rb
75
+ - test/dummy/config/initializers/session_store.rb
76
+ - test/dummy/config/initializers/wrap_parameters.rb
77
+ - test/dummy/config/routes.rb
78
+ - test/dummy/config/secrets.yml
79
+ - test/dummy/log/test.log
80
+ - test/test_helper.rb
81
+ homepage:
82
+ licenses:
83
+ - ''
84
+ metadata: {}
85
+ post_install_message:
86
+ rdoc_options: []
87
+ require_paths:
88
+ - lib
89
+ required_ruby_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ required_rubygems_version: !ruby/object:Gem::Requirement
95
+ requirements:
96
+ - - ">"
97
+ - !ruby/object:Gem::Version
98
+ version: 1.3.1
99
+ requirements: []
100
+ rubyforge_project:
101
+ rubygems_version: 2.2.2
102
+ signing_key:
103
+ specification_version: 4
104
+ summary: Rails Engine to integrate Registrar
105
+ test_files:
106
+ - test/controller_extensions/current_profile_test.rb
107
+ - test/test_helper.rb
108
+ - test/dummy/config.ru
109
+ - test/dummy/config/routes.rb
110
+ - test/dummy/config/environments/development.rb
111
+ - test/dummy/config/environments/test.rb
112
+ - test/dummy/config/environments/production.rb
113
+ - test/dummy/config/environment.rb
114
+ - test/dummy/config/initializers/cookies_serializer.rb
115
+ - test/dummy/config/initializers/assets.rb
116
+ - test/dummy/config/initializers/wrap_parameters.rb
117
+ - test/dummy/config/initializers/session_store.rb
118
+ - test/dummy/config/initializers/filter_parameter_logging.rb
119
+ - test/dummy/config/application.rb
120
+ - test/dummy/config/boot.rb
121
+ - test/dummy/config/secrets.yml
122
+ - test/dummy/log/test.log
123
+ - test/dummy/README.rdoc
124
+ - test/dummy/Rakefile
125
+ - test/dummy/app/controllers/application_controller.rb
126
+ - test/dummy/app/controllers/some_controller.rb
127
+ - test/dummy/bin/rails
128
+ - test/dummy/bin/rake
129
+ - test/dummy/bin/setup
130
+ - test/dummy/bin/bundle