injector 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +7 -0
  2. data/{MIT-LICENSE → LICENSE.md} +1 -1
  3. data/README.md +71 -42
  4. data/lib/injector.rb +89 -3
  5. data/lib/injector/identity.rb +22 -0
  6. metadata +130 -174
  7. data/Rakefile +0 -38
  8. data/lib/injector/controller_method.rb +0 -15
  9. data/lib/injector/resolver.rb +0 -55
  10. data/lib/injector/version.rb +0 -3
  11. data/lib/tasks/injector_tasks.rake +0 -4
  12. data/test/dummy/README.rdoc +0 -261
  13. data/test/dummy/Rakefile +0 -7
  14. data/test/dummy/app/assets/javascripts/application.js +0 -15
  15. data/test/dummy/app/assets/javascripts/cars.js +0 -2
  16. data/test/dummy/app/assets/javascripts/dogs.js +0 -2
  17. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  18. data/test/dummy/app/assets/stylesheets/cars.css +0 -4
  19. data/test/dummy/app/assets/stylesheets/dogs.css +0 -4
  20. data/test/dummy/app/assets/stylesheets/scaffold.css +0 -56
  21. data/test/dummy/app/controllers/application_controller.rb +0 -4
  22. data/test/dummy/app/controllers/cars_controller.rb +0 -47
  23. data/test/dummy/app/controllers/dogs_controller.rb +0 -50
  24. data/test/dummy/app/helpers/application_helper.rb +0 -2
  25. data/test/dummy/app/helpers/cars_helper.rb +0 -2
  26. data/test/dummy/app/helpers/dogs_helper.rb +0 -2
  27. data/test/dummy/app/models/car.rb +0 -3
  28. data/test/dummy/app/models/dog.rb +0 -3
  29. data/test/dummy/app/views/cars/_form.html.erb +0 -0
  30. data/test/dummy/app/views/cars/edit.html.erb +0 -0
  31. data/test/dummy/app/views/cars/index.html.erb +0 -0
  32. data/test/dummy/app/views/cars/new.html.erb +0 -0
  33. data/test/dummy/app/views/cars/show.html.erb +0 -0
  34. data/test/dummy/app/views/dogs/_form.html.erb +0 -0
  35. data/test/dummy/app/views/dogs/edit.html.erb +0 -0
  36. data/test/dummy/app/views/dogs/index.html.erb +0 -0
  37. data/test/dummy/app/views/dogs/new.html.erb +0 -0
  38. data/test/dummy/app/views/dogs/show.html.erb +0 -0
  39. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  40. data/test/dummy/config.ru +0 -4
  41. data/test/dummy/config/application.rb +0 -56
  42. data/test/dummy/config/boot.rb +0 -10
  43. data/test/dummy/config/database.yml +0 -25
  44. data/test/dummy/config/environment.rb +0 -5
  45. data/test/dummy/config/environments/development.rb +0 -37
  46. data/test/dummy/config/environments/production.rb +0 -67
  47. data/test/dummy/config/environments/test.rb +0 -37
  48. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  49. data/test/dummy/config/initializers/inflections.rb +0 -15
  50. data/test/dummy/config/initializers/mime_types.rb +0 -5
  51. data/test/dummy/config/initializers/secret_token.rb +0 -7
  52. data/test/dummy/config/initializers/session_store.rb +0 -8
  53. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  54. data/test/dummy/config/locales/en.yml +0 -5
  55. data/test/dummy/config/routes.rb +0 -60
  56. data/test/dummy/db/development.sqlite3 +0 -0
  57. data/test/dummy/db/migrate/20120517025757_create_cars.rb +0 -9
  58. data/test/dummy/db/migrate/20120517043520_create_dogs.rb +0 -9
  59. data/test/dummy/db/schema.rb +0 -28
  60. data/test/dummy/db/test.sqlite3 +0 -0
  61. data/test/dummy/development.sqlite3 +0 -0
  62. data/test/dummy/log/development.log +0 -202
  63. data/test/dummy/log/test.log +0 -3135
  64. data/test/dummy/public/404.html +0 -26
  65. data/test/dummy/public/422.html +0 -26
  66. data/test/dummy/public/500.html +0 -25
  67. data/test/dummy/public/favicon.ico +0 -0
  68. data/test/dummy/script/rails +0 -6
  69. data/test/dummy/test/fixtures/cars.yml +0 -7
  70. data/test/dummy/test/fixtures/dogs.yml +0 -7
  71. data/test/dummy/test/functional/cars_controller_test.rb +0 -46
  72. data/test/dummy/test/functional/dogs_controller_test.rb +0 -46
  73. data/test/dummy/test/unit/car_test.rb +0 -7
  74. data/test/dummy/test/unit/dog_test.rb +0 -7
  75. data/test/dummy/test/unit/helpers/cars_helper_test.rb +0 -4
  76. data/test/dummy/test/unit/helpers/dogs_helper_test.rb +0 -4
  77. data/test/injector_test.rb +0 -7
  78. data/test/test_helper.rb +0 -15
@@ -1,26 +0,0 @@
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>
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</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/422.html -->
21
- <div class="dialog">
22
- <h1>The change you wanted was rejected.</h1>
23
- <p>Maybe you tried to change something you didn't have access to.</p>
24
- </div>
25
- </body>
26
- </html>
@@ -1,25 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</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/500.html -->
21
- <div class="dialog">
22
- <h1>We're sorry, but something went wrong.</h1>
23
- </div>
24
- </body>
25
- </html>
File without changes
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
@@ -1,7 +0,0 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
-
3
- one:
4
- model: MyString
5
-
6
- two:
7
- model: MyString
@@ -1,7 +0,0 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
-
3
- one:
4
- name: MyString
5
-
6
- two:
7
- name: MyString
@@ -1,46 +0,0 @@
1
- require 'test_helper'
2
-
3
- class CarsControllerTest < ActionController::TestCase
4
- tests CarsController
5
-
6
- def setup
7
- class << @controller
8
- attr_accessor :cars, :car
9
- end
10
-
11
- @car = Car.new(model: "Camaro")
12
- @car.save
13
- end
14
-
15
- def test_inject_to_index
16
- get :index
17
- assert @controller.cars.first == @car
18
- end
19
-
20
- def test_inject_to_show
21
- get :show, id: @car.id
22
- assert @controller.car == @car
23
- end
24
-
25
- def test_inject_to_new
26
- get :new
27
- assert !@controller.car.model?
28
- end
29
-
30
- def test_inject_to_edit
31
- put :edit, id: @car.id
32
- assert @controller.car == @car
33
- end
34
-
35
- def test_inject_to_create
36
- car_model = "Mustang"
37
- post :create, car: {model: car_model}
38
- assert @controller.car.model == car_model
39
- end
40
-
41
- def test_inject_to_update
42
- car_model = "Mustang"
43
- put :update, {car: {model: car_model}, id: @car.id}
44
- assert @controller.car.model == car_model
45
- end
46
- end
@@ -1,46 +0,0 @@
1
- require 'test_helper'
2
-
3
- class DogsControllerTest < ActionController::TestCase
4
- tests DogsController
5
-
6
- def setup
7
- class << @controller
8
- attr_accessor :dogs, :dog
9
- end
10
-
11
- @dog = Dog.new(name: "Dog")
12
- @dog.save
13
- end
14
-
15
- def test_should_not_inject_to_index
16
- get :index
17
- assert @controller.dogs.nil?
18
- end
19
-
20
- def test_should_not_inject_to_show
21
- get :show, id: @dog.id
22
- assert @controller.dog.nil?
23
- end
24
-
25
- def test_should_not_inject_to_new
26
- get :new
27
- assert @controller.dog.nil?
28
- end
29
-
30
- def test_should_not_inject_to_edit
31
- put :edit, id: @dog.id
32
- assert @controller.dog.nil?
33
- end
34
-
35
- def test_should_not_inject_to_create
36
- dog_name = "Goku"
37
- post :create, dog: {name: dog_name}
38
- assert @controller.dog.nil?
39
- end
40
-
41
- def test_should_not_inject_to_update
42
- dog_name = "Goku"
43
- put :update, {dog: {name: dog_name}, id: @dog.id}
44
- assert @controller.dog.nil?
45
- end
46
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class CarTest < ActiveSupport::TestCase
4
- # test "the truth" do
5
- # assert true
6
- # end
7
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class DogTest < ActiveSupport::TestCase
4
- # test "the truth" do
5
- # assert true
6
- # end
7
- end
@@ -1,4 +0,0 @@
1
- require 'test_helper'
2
-
3
- class CarsHelperTest < ActionView::TestCase
4
- end
@@ -1,4 +0,0 @@
1
- require 'test_helper'
2
-
3
- class DogsHelperTest < ActionView::TestCase
4
- end
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class InjectorTest < ActiveSupport::TestCase
4
- test "truth" do
5
- car = Car.new
6
- end
7
- end
@@ -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