before_actions 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +106 -0
  3. data/Rakefile +13 -19
  4. data/app/controllers/before_actions/foo_controller.rb +8 -0
  5. data/lib/before_actions.rb +7 -1
  6. data/lib/before_actions/controller.rb +29 -20
  7. data/lib/before_actions/engine.rb +7 -0
  8. data/lib/before_actions/version.rb +1 -1
  9. data/spec/controllers/admin_foos_controller_spec.rb +78 -0
  10. data/spec/controllers/foos_controller_spec.rb +139 -0
  11. data/{test → spec}/dummy/README.rdoc +0 -0
  12. data/{test → spec}/dummy/Rakefile +0 -0
  13. data/{test → spec}/dummy/app/assets/javascripts/application.js +0 -3
  14. data/{test → spec}/dummy/app/assets/stylesheets/application.css +0 -0
  15. data/spec/dummy/app/controllers/admin_foos_controller.rb +53 -0
  16. data/{test → spec}/dummy/app/controllers/application_controller.rb +0 -0
  17. data/spec/dummy/app/controllers/foos_controller.rb +92 -0
  18. data/{test → spec}/dummy/app/helpers/application_helper.rb +0 -0
  19. data/spec/dummy/app/models/admin_foo.rb +2 -0
  20. data/spec/dummy/app/models/foo.rb +3 -0
  21. data/spec/dummy/app/views/admin_foos/_form.html.erb +21 -0
  22. data/spec/dummy/app/views/admin_foos/edit.html.erb +6 -0
  23. data/spec/dummy/app/views/admin_foos/index.html.erb +25 -0
  24. data/spec/dummy/app/views/admin_foos/new.html.erb +5 -0
  25. data/spec/dummy/app/views/admin_foos/show.html.erb +9 -0
  26. data/spec/dummy/app/views/foos/_form.html.erb +21 -0
  27. data/spec/dummy/app/views/foos/edit.html.erb +6 -0
  28. data/spec/dummy/app/views/foos/index.html.erb +25 -0
  29. data/spec/dummy/app/views/foos/new.html.erb +5 -0
  30. data/spec/dummy/app/views/foos/show.html.erb +9 -0
  31. data/{test → spec}/dummy/app/views/layouts/application.html.erb +0 -0
  32. data/{test → spec}/dummy/bin/bundle +0 -0
  33. data/{test → spec}/dummy/bin/rails +0 -0
  34. data/{test → spec}/dummy/bin/rake +0 -0
  35. data/{test → spec}/dummy/config.ru +0 -0
  36. data/{test → spec}/dummy/config/application.rb +8 -0
  37. data/{test → spec}/dummy/config/boot.rb +0 -0
  38. data/{test → spec}/dummy/config/database.yml +0 -0
  39. data/{test → spec}/dummy/config/environment.rb +0 -0
  40. data/{test → spec}/dummy/config/environments/development.rb +0 -0
  41. data/{test → spec}/dummy/config/environments/production.rb +0 -0
  42. data/{test → spec}/dummy/config/environments/test.rb +0 -0
  43. data/{test → spec}/dummy/config/initializers/backtrace_silencers.rb +0 -0
  44. data/{test → spec}/dummy/config/initializers/filter_parameter_logging.rb +0 -0
  45. data/{test → spec}/dummy/config/initializers/inflections.rb +0 -0
  46. data/{test → spec}/dummy/config/initializers/mime_types.rb +0 -0
  47. data/{test → spec}/dummy/config/initializers/secret_token.rb +0 -0
  48. data/spec/dummy/config/initializers/session_store.rb +3 -0
  49. data/{test → spec}/dummy/config/initializers/wrap_parameters.rb +0 -0
  50. data/{test → spec}/dummy/config/locales/en.yml +0 -0
  51. data/{test → spec}/dummy/config/routes.rb +4 -0
  52. data/spec/dummy/db/development.sqlite3 +0 -0
  53. data/spec/dummy/db/migrate/20140912040816_create_foos.rb +9 -0
  54. data/spec/dummy/db/migrate/20140912042735_create_admin_foos.rb +9 -0
  55. data/spec/dummy/db/schema.rb +28 -0
  56. data/spec/dummy/db/test.sqlite3 +0 -0
  57. data/spec/dummy/lib/templates/rails/scaffold_controller/controller.rb +97 -0
  58. data/spec/dummy/log/development.log +15 -0
  59. data/spec/dummy/log/test.log +1590 -0
  60. data/{test → spec}/dummy/public/404.html +0 -0
  61. data/{test → spec}/dummy/public/422.html +0 -0
  62. data/{test → spec}/dummy/public/500.html +0 -0
  63. data/{test → spec}/dummy/public/favicon.ico +0 -0
  64. data/spec/rails_helper.rb +54 -0
  65. data/spec/spec_helper.rb +85 -0
  66. metadata +168 -74
  67. data/README.rdoc +0 -60
  68. data/lib/before_actions/command.rb +0 -15
  69. data/test/before_actions_test.rb +0 -7
  70. data/test/dummy/config/initializers/session_store.rb +0 -3
  71. data/test/integration/navigation_test.rb +0 -10
  72. data/test/test_helper.rb +0 -15
@@ -1,15 +0,0 @@
1
- module BeforeActions
2
- class Command
3
-
4
- def initialize(controller)
5
- @controller = controller
6
- end
7
-
8
- def actions(*actions, &block)
9
- if actions.empty? || actions.map(&:to_s).include?(@controller.action_name)
10
- @controller.instance_eval(&block)
11
- end
12
- end
13
-
14
- end
15
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class BeforeActionsTest < ActiveSupport::TestCase
4
- test "truth" do
5
- assert_kind_of Module, BeforeActions
6
- end
7
- end
@@ -1,3 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Dummy::Application.config.session_store :encrypted_cookie_store, key: '_dummy_session'
@@ -1,10 +0,0 @@
1
- require 'test_helper'
2
-
3
- class NavigationTest < ActionDispatch::IntegrationTest
4
- fixtures :all
5
-
6
- # test "the truth" do
7
- # assert true
8
- # end
9
- end
10
-
@@ -1,15 +0,0 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
- require "rails/test_help"
6
-
7
- Rails.backtrace_cleaner.remove_silencers!
8
-
9
- # Load support files
10
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
-
12
- # Load fixtures from the engine
13
- if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
- ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15
- end