the_role 2.5.4 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +178 -526
- data/gem_version.rb +3 -0
- data/lib/the_role/version.rb +1 -3
- data/lib/the_role.rb +3 -41
- data/the_role.gemspec +5 -5
- metadata +20 -231
- data/.ruby-gemset.example +0 -1
- data/.ruby-version.example +0 -1
- data/.rvmrc.example +0 -1
- data/.travis.yml +0 -5
- data/Bye_bye_CanCan_I_got_the_Role.png +0 -0
- data/app/controllers/admin/role_sections_controller.rb +0 -90
- data/app/controllers/admin/roles_controller.rb +0 -74
- data/app/controllers/concerns/controller.rb +0 -23
- data/app/models/_templates_/role.rb +0 -3
- data/app/models/concerns/base.rb +0 -37
- data/app/models/concerns/role.rb +0 -156
- data/app/models/concerns/user.rb +0 -57
- data/config/locales/en.yml +0 -44
- data/config/locales/es.yml +0 -42
- data/config/locales/nl.yml +0 -44
- data/config/locales/pl.yml +0 -43
- data/config/locales/pt_BR.yml +0 -43
- data/config/locales/ru.yml +0 -43
- data/config/locales/zh_CN.yml +0 -42
- data/config/routes.rb +0 -23
- data/db/migrate/20111025025129_create_roles.rb +0 -23
- data/docs/2.1.1.png +0 -0
- data/lib/generators/the_role/USAGE +0 -32
- data/lib/generators/the_role/templates/the_role.rb +0 -11
- data/lib/generators/the_role/the_role_generator.rb +0 -64
- data/lib/tasks/roles.rake +0 -137
- data/lib/the_role/activerecord.rb +0 -11
- data/lib/the_role/config.rb +0 -30
- data/lib/the_role/hash.rb +0 -58
- data/lib/the_role/the_class_exists.rb +0 -8
- data/pic.png +0 -0
- data/spec/dummy_app/.gitignore +0 -18
- data/spec/dummy_app/.rspec +0 -1
- data/spec/dummy_app/Gemfile +0 -43
- data/spec/dummy_app/README.md +0 -39
- data/spec/dummy_app/Rakefile +0 -6
- data/spec/dummy_app/app/assets/images/.keep +0 -0
- data/spec/dummy_app/app/assets/javascripts/application.js +0 -17
- data/spec/dummy_app/app/assets/stylesheets/app/style.css.scss +0 -23
- data/spec/dummy_app/app/assets/stylesheets/application.css +0 -3
- data/spec/dummy_app/app/controllers/application_controller.rb +0 -38
- data/spec/dummy_app/app/controllers/concerns/.keep +0 -0
- data/spec/dummy_app/app/controllers/pages_controller.rb +0 -75
- data/spec/dummy_app/app/controllers/users_controller.rb +0 -32
- data/spec/dummy_app/app/controllers/welcome_controller.rb +0 -13
- data/spec/dummy_app/app/helpers/application_helper.rb +0 -2
- data/spec/dummy_app/app/mailers/.keep +0 -0
- data/spec/dummy_app/app/models/.keep +0 -0
- data/spec/dummy_app/app/models/concerns/.keep +0 -0
- data/spec/dummy_app/app/models/page.rb +0 -24
- data/spec/dummy_app/app/models/role.rb +0 -4
- data/spec/dummy_app/app/models/user.rb +0 -21
- data/spec/dummy_app/app/views/layouts/_current_user_info.html.haml +0 -17
- data/spec/dummy_app/app/views/layouts/application.html.haml +0 -68
- data/spec/dummy_app/app/views/pages/_form.html.haml +0 -19
- data/spec/dummy_app/app/views/pages/edit.html.haml +0 -7
- data/spec/dummy_app/app/views/pages/index.html.haml +0 -27
- data/spec/dummy_app/app/views/pages/manage.html.haml +0 -23
- data/spec/dummy_app/app/views/pages/my.html.haml +0 -10
- data/spec/dummy_app/app/views/pages/new.html.haml +0 -5
- data/spec/dummy_app/app/views/pages/show.html.haml +0 -15
- data/spec/dummy_app/app/views/users/edit.html.haml +0 -34
- data/spec/dummy_app/app/views/welcome/index.html.haml +0 -38
- data/spec/dummy_app/app/views/welcome/profile.html.haml +0 -2
- data/spec/dummy_app/bin/bundle +0 -3
- data/spec/dummy_app/bin/rails +0 -4
- data/spec/dummy_app/bin/rake +0 -4
- data/spec/dummy_app/config/application.rb +0 -25
- data/spec/dummy_app/config/boot.rb +0 -4
- data/spec/dummy_app/config/database.yml +0 -17
- data/spec/dummy_app/config/environment.rb +0 -5
- data/spec/dummy_app/config/environments/development.rb +0 -29
- data/spec/dummy_app/config/environments/production.rb +0 -80
- data/spec/dummy_app/config/environments/test.rb +0 -36
- data/spec/dummy_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy_app/config/initializers/devise.rb +0 -227
- data/spec/dummy_app/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy_app/config/initializers/inflections.rb +0 -16
- data/spec/dummy_app/config/initializers/mime_types.rb +0 -5
- data/spec/dummy_app/config/initializers/secret_token.rb +0 -12
- data/spec/dummy_app/config/initializers/session_store.rb +0 -3
- data/spec/dummy_app/config/initializers/the_role.rb +0 -6
- data/spec/dummy_app/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy_app/config/locales/devise.en.yml +0 -57
- data/spec/dummy_app/config/locales/en.yml +0 -7
- data/spec/dummy_app/config/locales/ru.yml +0 -4
- data/spec/dummy_app/config/routes.rb +0 -26
- data/spec/dummy_app/config.ru +0 -4
- data/spec/dummy_app/db/migrate/20120212061952_devise_create_users.rb +0 -63
- data/spec/dummy_app/db/migrate/20120212063249_create_roles.rb +0 -18
- data/spec/dummy_app/db/migrate/20120314061307_create_pages.rb +0 -14
- data/spec/dummy_app/db/schema.rb +0 -59
- data/spec/dummy_app/db/seeds.rb +0 -85
- data/spec/dummy_app/lib/assets/.keep +0 -0
- data/spec/dummy_app/lib/tasks/.keep +0 -0
- data/spec/dummy_app/lib/tasks/assets.rake +0 -15
- data/spec/dummy_app/lib/tasks/db_bootstrap.rake +0 -16
- data/spec/dummy_app/log/.keep +0 -0
- data/spec/dummy_app/public/404.html +0 -58
- data/spec/dummy_app/public/422.html +0 -58
- data/spec/dummy_app/public/500.html +0 -57
- data/spec/dummy_app/public/favicon.ico +0 -0
- data/spec/dummy_app/public/robots.txt +0 -5
- data/spec/dummy_app/spec/controllers/admin_roles_controller_spec.rb +0 -52
- data/spec/dummy_app/spec/controllers/pages_controller_spec.rb +0 -141
- data/spec/dummy_app/spec/controllers/welcome_controller_spec.rb +0 -66
- data/spec/dummy_app/spec/factories/page.rb +0 -6
- data/spec/dummy_app/spec/factories/role.rb +0 -55
- data/spec/dummy_app/spec/factories/user.rb +0 -11
- data/spec/dummy_app/spec/models/hash_spec.rb +0 -272
- data/spec/dummy_app/spec/models/param_process_spec.rb +0 -39
- data/spec/dummy_app/spec/models/role_spec.rb +0 -218
- data/spec/dummy_app/spec/models/user_spec.rb +0 -164
- data/spec/dummy_app/spec/routing/admin_roles_routing_spec.rb +0 -41
- data/spec/dummy_app/spec/routing/pages_routing_spec.rb +0 -35
- data/spec/dummy_app/spec/spec_helper.rb +0 -68
- data/spec/dummy_app/vendor/assets/javascripts/.keep +0 -0
- data/spec/dummy_app/vendor/assets/stylesheets/.keep +0 -0
- data/the_role.yml.teamocil.example +0 -11
@@ -1,41 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Admin::RolesController do
|
4
|
-
describe "routing" do
|
5
|
-
describe "collection block" do
|
6
|
-
|
7
|
-
describe "get" do
|
8
|
-
it "admin_roles_path routes to #index" do
|
9
|
-
get(admin_roles_path).should route_to("admin/roles#index")
|
10
|
-
end
|
11
|
-
|
12
|
-
it "new_admin_role_path routes to #new" do
|
13
|
-
get(new_admin_role_path).should route_to("admin/roles#new")
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe "member block" do
|
19
|
-
before(:all) do
|
20
|
-
@role = FactoryGirl.create(:role_user)
|
21
|
-
end
|
22
|
-
|
23
|
-
after(:all) do
|
24
|
-
Role.destroy_all
|
25
|
-
end
|
26
|
-
|
27
|
-
describe "post" do
|
28
|
-
it "CREATE SECTION PATH" do
|
29
|
-
be_routed = route_to(:controller => "admin/role_sections", :action => 'create', :role_id => @role.to_param)
|
30
|
-
post(admin_role_sections_path(@role)).should be_routed
|
31
|
-
end
|
32
|
-
|
33
|
-
it "CREATE RULE PATH" do
|
34
|
-
be_routed = route_to(:controller => "admin/role_sections", :action => 'create_rule', :role_id => @role.to_param)
|
35
|
-
post(create_rule_admin_role_sections_path(@role)).should be_routed
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
41
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe PagesController do
|
4
|
-
describe "routing" do
|
5
|
-
|
6
|
-
it "routes to #index" do
|
7
|
-
get("/pages").should route_to("pages#index")
|
8
|
-
end
|
9
|
-
|
10
|
-
it "routes to #new" do
|
11
|
-
get("/pages/new").should route_to("pages#new")
|
12
|
-
end
|
13
|
-
|
14
|
-
it "routes to #show" do
|
15
|
-
get("/pages/1").should route_to("pages#show", :id => "1")
|
16
|
-
end
|
17
|
-
|
18
|
-
it "routes to #edit" do
|
19
|
-
get("/pages/1/edit").should route_to("pages#edit", :id => "1")
|
20
|
-
end
|
21
|
-
|
22
|
-
it "routes to #create" do
|
23
|
-
post("/pages").should route_to("pages#create")
|
24
|
-
end
|
25
|
-
|
26
|
-
it "routes to #update" do
|
27
|
-
put("/pages/1").should route_to("pages#update", :id => "1")
|
28
|
-
end
|
29
|
-
|
30
|
-
it "routes to #destroy" do
|
31
|
-
delete("/pages/1").should route_to("pages#destroy", :id => "1")
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
@@ -1,68 +0,0 @@
|
|
1
|
-
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
2
|
-
ENV["RAILS_ENV"] ||= 'test'
|
3
|
-
require File.expand_path("../../config/environment", __FILE__)
|
4
|
-
|
5
|
-
require 'rspec/rails'
|
6
|
-
require 'rspec/autorun'
|
7
|
-
|
8
|
-
# Requires supporting ruby files with custom matchers and macros, etc,
|
9
|
-
# in spec/support/ and its subdirectories.
|
10
|
-
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
|
11
|
-
|
12
|
-
# Checks for pending migrations before tests are run.
|
13
|
-
# If you are not using ActiveRecord, you can remove this line.
|
14
|
-
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
|
15
|
-
|
16
|
-
# Return default text on "Access Denied" page
|
17
|
-
def access_denied_match
|
18
|
-
"redirected"
|
19
|
-
end
|
20
|
-
|
21
|
-
RSpec.configure do |config|
|
22
|
-
# Devise Addons for Testing
|
23
|
-
config.include Devise::TestHelpers, type: :controller
|
24
|
-
|
25
|
-
# If true, the base class of anonymous controllers will be inferred automatically.
|
26
|
-
# This will be the default behavior in future versions of rspec-rails.
|
27
|
-
config.infer_base_class_for_anonymous_controllers = false
|
28
|
-
|
29
|
-
# DatabaseCleaner
|
30
|
-
config.before(:suite) do
|
31
|
-
DatabaseCleaner.strategy = :truncation
|
32
|
-
end
|
33
|
-
|
34
|
-
config.before(:each) do
|
35
|
-
DatabaseCleaner.start
|
36
|
-
end
|
37
|
-
|
38
|
-
config.after(:each) do
|
39
|
-
DatabaseCleaner.clean
|
40
|
-
end
|
41
|
-
|
42
|
-
# Run specs in random order to surface order dependencies. If you find an
|
43
|
-
# order dependency and want to debug it, you can fix the order by providing
|
44
|
-
# the seed, which is printed after each run.
|
45
|
-
# --seed 1234
|
46
|
-
config.order = "random"
|
47
|
-
|
48
|
-
# ## Mock Framework
|
49
|
-
#
|
50
|
-
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
51
|
-
#
|
52
|
-
# config.mock_with :mocha
|
53
|
-
# config.mock_with :flexmock
|
54
|
-
# config.mock_with :rr
|
55
|
-
|
56
|
-
# Exclusion Filter
|
57
|
-
# config.exclusion_filter = { :ruby => lambda {|version|
|
58
|
-
# !(RUBY_VERSION.to_s =~ /^#{version.to_s}/)
|
59
|
-
# }}
|
60
|
-
|
61
|
-
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
62
|
-
# config.fixture_path = "#{::Rails.root}/spec/factories"
|
63
|
-
|
64
|
-
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
65
|
-
# examples within a transaction, remove the following line or assign false
|
66
|
-
# instead of true.
|
67
|
-
# config.use_transactional_fixtures = true
|
68
|
-
end
|
File without changes
|
File without changes
|
@@ -1,11 +0,0 @@
|
|
1
|
-
windows:
|
2
|
-
- name: "TheRole"
|
3
|
-
root: "~/rails/opensource/the_role"
|
4
|
-
filters:
|
5
|
-
before: "rvm use ruby-2.0.0-p353; rvm gemset use the_role"
|
6
|
-
layout: tiled
|
7
|
-
panes:
|
8
|
-
- cmd: "clear;"
|
9
|
-
- cmd: "clear;"
|
10
|
-
- cmd: "cd spec/dummy_app; clear"
|
11
|
-
- cmd: "cd spec/dummy_app; clear; rake db:bootstrap RAILS_ENV=test; rspec"
|