Permalink
Browse files

Bulk rename Bcsec -> Aker.

  • Loading branch information...
1 parent 9c00072 commit eac882673df395923d193c63b0c0b2c7a1c2f96b @rsutphin rsutphin committed Jul 18, 2011
View
@@ -1,6 +1,6 @@
.bundle
Gemfile.lock
-bcsec-rails*.gem
+aker-rails*.gem
reports
coverage
View
2 .rvmrc
@@ -1 +1 @@
-rvm_gemset_create_on_use_flag=1; rvm gemset use bcsec-rails
+rvm_gemset_create_on_use_flag=1; rvm gemset use aker-rails
View
@@ -3,7 +3,7 @@ source "http://download.bioinformatics.northwestern.edu/gems/"
gemspec
-gem 'bcsec', :git => 'git+ssh://code.bioinformatics.northwestern.edu/git/bcsec.git'
+gem 'aker', :git => 'git://github.com/NUBIC/aker.git'
group :resolver_hacks do
gem 'builder', '~> 2.1.2'
View
@@ -1,37 +1,37 @@
-Bcsec-Rails
+Aker-Rails
===========
-`bcsec-rails` is the Rails plugin for Bcsec 2.1 and later. It is a
-thin wrapper around Bcsec's rack support.
+`aker-rails` is the Rails plugin for Aker 2.1 and later. It is a
+thin wrapper around Aker's rack support.
Setup
-----
### Prerequisites
-`bcsec-rails` requires Rails ~> 3.0.
+`aker-rails` requires Rails ~> 3.0.
### Get the gem
-`bcsec-rails` is a gem plugin. In order to use it, include it in your
+`aker-rails` is a gem plugin. In order to use it, include it in your
application's Gemfile:
source 'http://download.bioinformatics.northwestern.edu/gems'
- gem 'bcsec-rails'
+ gem 'aker-rails'
Between this and the `Bundler.require` that most Rails 3 applications do
as part of their initialization process, that's all you usually need to
-do to get bcsec and bcsec-rails loaded in your Rails application.
+do to get aker and aker-rails loaded in your Rails application.
-### Add an initializer for bcsec
+### Add an initializer for aker
Put your global configuration in an initializer. By _global
configuration_ I mean the parts that are the same no matter which
environment you are using, like the portal name and the modes.
- # In config/initializers/bcsec.rb
- Bcsec.configure do
+ # In config/initializers/aker.rb
+ Aker.configure do
# The authentication protocol to use for interactive access.
# `:form` is the default.
ui_mode :form
@@ -45,34 +45,34 @@ environment you are using, like the portal name and the modes.
end
For more information on the configuration syntax and options, see the
-bcsec API documentation for {Bcsec::Configuration}.
+aker API documentation for {Aker::Configuration}.
### Add per-environment configurations
In the environment initializer for each of your application's
-environments, put the parts of the Bcsec configuration which are
+environments, put the parts of the Aker configuration which are
env-specific. E.g., you might only use the `netid` authority in staging
and production since full access to the NU LDAP servers is only
available from behind the firewall. This means that the `authorities`
line will be env-specific.
# In config/environments/production.rb, for example
config.after_initialize do
- Bcsec.configure do
- # The authorities to use. See the bcsec API documentation
- # for `Bcsec::Authorities` for options.
+ Aker.configure do
+ # The authorities to use. See the aker API documentation
+ # for `Aker::Authorities` for options.
authorities :netid, :pers
# The server-central parameters file for cc_pers, NU LDAP,
# CAS, and policy parameters.
- central '/etc/nubic/bcsec-prod.yml'
+ central '/etc/nubic/aker-prod.yml'
end
end
Integration into your app
-------------------------
-With the plugin installed, Bcsec provides a general infrastructure for
+With the plugin installed, Aker provides a general infrastructure for
supporting authentication and authorization in your application. If
you want to _require_ authentication or authorization for particular
resources (and I think you do), you need to do a bit more
@@ -81,24 +81,24 @@ configuration.
### Securing pages
In any controller which authentication is required, include
-{Bcsec::Rails::SecuredController}. If authentication is required for
+{Aker::Rails::SecuredController}. If authentication is required for
all controllers, you can include this module in
`ApplicationController`.
If you want to further require that all actions in a controller
require that the user be a member of a certain group, you can use the
-{Bcsec::Rails::SecuredController::ClassMethods#permit permit} method:
+{Aker::Rails::SecuredController::ClassMethods#permit permit} method:
class ManuscriptController < ApplicationController
- include Bcsec::Rails::SecuredController
+ include Aker::Rails::SecuredController
permit :editor
end
### Partial authorization
-Bcsec also supports resources which are only partially limited to a
+Aker also supports resources which are only partially limited to a
particular group or groups. The helper for this is also called
-{Bcsec::Rails::Application#permit? permit}:
+{Aker::Rails::Application#permit? permit}:
# In a controller action
class DashboardController < ApplicationController
@@ -117,15 +117,15 @@ particular group or groups. The helper for this is also called
This permit helper is available to all subclasses of
`ApplicationController`, not just ones that mix in
-{Bcsec::Rails::SecuredController}. This means you can have a
+{Aker::Rails::SecuredController}. This means you can have a
publically-accessible page which has additional/different content for a
logged-in user.
### The current user
-Bcsec provides a method {Bcsec::Rails::Application#current_user
+Aker provides a method {Aker::Rails::Application#current_user
current_user} to all controllers and views. It will return a
-{Bcsec::User} object for the current user, or `nil` if there isn't
+{Aker::User} object for the current user, or `nil` if there isn't
one.
### Overriding the unauthorized view
@@ -145,12 +145,12 @@ and `/logout`:
match '/login' => 'accounts#login'
match '/logout' => 'accounts#logout'
-Bcsec will now use the views provided by `AccountsController#login` and
+Aker will now use the views provided by `AccountsController#login` and
`AccountsController#logout`; however, credential verification and session
-management is still performed by Bcsec.
+management is still performed by Aker.
When overriding the login view, you are responsible for providing a login form
-that satisfies the interface for Bcsec's credential verifier. Your login form
+that satisfies the interface for Aker's credential verifier. Your login form
should, at minimum, look like this:
# In app/views/accounts/login.html.erb
View
@@ -13,9 +13,9 @@ require 'net/scp'
require 'ci/reporter/rake/rspec'
-require 'bcsec/rails'
+require 'aker/rails'
-gemspec = eval(File.read('bcsec-rails.gemspec'), binding, 'bcsec-rails.gemspec')
+gemspec = eval(File.read('aker-rails.gemspec'), binding, 'aker-rails.gemspec')
Gem::PackageTask.new(gemspec).define
@@ -69,7 +69,7 @@ desc "Build API documentation with yard"
docsrc = %w(lib/**/*.rb -) + Dir.glob("{CHANGELOG,MIGRATION}-rails")
YARD::Rake::YardocTask.new do |t|
t.options = %w(--no-private --markup markdown --hide-void-return)
- t.options += ["--title", "bcsec-rails #{Bcsec::Rails::VERSION}"]
+ t.options += ["--title", "aker-rails #{Aker::Rails::VERSION}"]
t.files = docsrc
end
@@ -132,8 +132,8 @@ end
namespace :deploy do
task :check do
- if Bcsec::Rails::VERSION.split('.').any? { |v| v =~ /\D/i }
- puts "#{Bcsec::Rails::VERSION} is a prerelease version. " <<
+ if Aker::Rails::VERSION.split('.').any? { |v| v =~ /\D/i }
+ puts "#{Aker::Rails::VERSION} is a prerelease version. " <<
"Are you sure you want to deploy?\n" <<
"Press ^C to abort or enter to continue deploying."
STDIN.readline
@@ -157,8 +157,8 @@ namespace :deploy do
desc "Tag the final version of a release"
task :tag => [:check] do
- tagname = Bcsec::Rails::VERSION
- system("git tag -a #{tagname} -m 'Bcsec-Rails #{Bcsec::Rails::VERSION}'")
+ tagname = Aker::Rails::VERSION
+ system("git tag -a #{tagname} -m 'Aker-Rails #{Aker::Rails::VERSION}'")
fail "Tagging failed" unless $? == 0
system("git push origin : #{tagname}")
end
@@ -2,23 +2,23 @@
lib = File.expand_path('../lib/', __FILE__)
$:.unshift lib unless $:.include?(lib)
-require 'bcsec/rails/version'
+require 'aker/rails/version'
Gem::Specification.new do |s|
- s.name = 'bcsec-rails'
- s.version = Bcsec::Rails::VERSION
+ s.name = 'aker-rails'
+ s.version = Aker::Rails::VERSION
s.platform = Gem::Platform::RUBY
s.summary = "Bioinformatics core security infrastructure plugin for rails"
s.require_path = 'lib'
s.files = Dir.glob("{CHANGELOG,README,VERSION,{lib,spec,rails}/**/*}")
s.authors = ["David Yip", "Rhett Sutphin", "Peter Nyberg"]
s.email = "r-sutphin@northwestern.edu"
- s.homepage = "https://code.bioinformatics.northwestern.edu/redmine/projects/bcsec-ruby"
+ s.homepage = "https://code.bioinformatics.northwestern.edu/redmine/projects/aker-ruby"
s.add_runtime_dependency "rails", "~> 3.0"
# This is deliberately open -- I expect that this rails plugin will
# change much less frequently than the library.
- s.add_runtime_dependency "bcsec", ">= 2.1.0"
+ s.add_runtime_dependency "aker", ">= 2.1.0"
end
View
@@ -1,6 +1,6 @@
######
# This is not an executable script. It selects and configures rvm for
-# bcsec-rails' CI process.
+# aker-rails' CI process.
#
# Use it by sourcing it:
#
@@ -18,12 +18,12 @@ echo ". ~/.rvm/scripts/rvm"
. ~/.rvm/scripts/rvm
set -x
-BCSEC_RVM_RUBY='ree-1.8.7-2011.03'
-GEMSET="bcsec-rails-${JOB_NAME}"
+AKER_RVM_RUBY='ree-1.8.7-2011.03'
+GEMSET="aker-rails-${JOB_NAME}"
-echo "Switching to ${BCSEC_RVM_RUBY}"
+echo "Switching to ${AKER_RVM_RUBY}"
set +xe
-rvm use "$BCSEC_RVM_RUBY"
+rvm use "$AKER_RVM_RUBY"
if [ $? -ne 0 ]; then
echo "Switch failed"
exit 2;
View
@@ -13,10 +13,10 @@
# Note: there is additional boot-time configuration after the world
# definition
-module Bcsec::Rails
+module Aker::Rails
module Cucumber
class World
- include Bcsec::Rails::Cucumber::MechanizeTest
+ include Aker::Rails::Cucumber::MechanizeTest
include FileUtils
include Spec::Matchers
@@ -87,7 +87,7 @@ def app_url(path)
end
def tmpdir
- @tmpdir ||= "/tmp/bcsec-rails-rails3-integrated-tests"
+ @tmpdir ||= "/tmp/aker-rails-rails3-integrated-tests"
unless File.exist?(@tmpdir)
mkdir_p @tmpdir
puts "Using tmpdir #{@tmpdir}"
@@ -99,14 +99,14 @@ def tmpdir
end
World do
- Bcsec::Rails::Cucumber::World.new
+ Aker::Rails::Cucumber::World.new
end
# The application uses a separate bundle, so it needs to run in a
# completely separate process. However, it doesn't change from test
# to test, so it doesn't need to be started and stopped with each
# test.
at_exit do
- Bcsec::Rails::Cucumber::World.stop
+ Aker::Rails::Cucumber::World.stop
end
-Bcsec::Rails::Cucumber::World.start
+Aker::Rails::Cucumber::World.start
@@ -1,7 +1,7 @@
require 'mechanize'
require 'logger'
-module Bcsec::Rails::Cucumber
+module Aker::Rails::Cucumber
##
# Provides helpers & a DSL for testing a deployed set of
# applications with Mechanize.
@@ -7,6 +7,6 @@
# via a subclassing callback. See `Rails::Railtie.inherited`.)
#
# If you change the `Bundler.require` behavior in your application's
-# `config/application.rb` such that `bcsec-rails` is not loaded, you will have
-# to load `bcsec/rails/railtie` yourself.
-require 'bcsec/rails/railtie'
+# `config/application.rb` such that `aker-rails` is not loaded, you will have
+# to load `aker/rails/railtie` yourself.
+require 'aker/rails/railtie'
View
@@ -0,0 +1,20 @@
+require 'aker'
+
+module Aker
+ ##
+ # Rails integration for aker. In general, it is a thin wrapper
+ # around aker's rack integration.
+ #
+ # Everything in this module is in the `aker-rails` gem plugin.
+ module Rails
+ autoload :VERSION, 'aker/rails/version'
+
+ autoload :Application, 'aker/rails/application'
+ autoload :Railtie, 'aker/rails/railtie'
+ autoload :SecuredController, 'aker/rails/secured_controller'
+ autoload :Test, 'aker/rails/test'
+ end
+
+ # TODO: deprecate this somehow
+ autoload :SecuredController, 'aker/rails/secured_controller'
+end
Oops, something went wrong.

0 comments on commit eac8826

Please sign in to comment.