horse_power 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +34 -0
  5. data/app/assets/javascripts/horse_power/application.js +13 -0
  6. data/app/assets/stylesheets/horse_power/application.css +15 -0
  7. data/app/controllers/horse_power/application_controller.rb +4 -0
  8. data/app/helpers/horse_power/application_helper.rb +4 -0
  9. data/app/views/layouts/horse_power/application.html.erb +14 -0
  10. data/config/routes.rb +2 -0
  11. data/lib/generators/horse_power/app_environment/USAGE +8 -0
  12. data/lib/generators/horse_power/app_environment/app_environment_generator.rb +128 -0
  13. data/lib/generators/horse_power/authorization/USAGE +8 -0
  14. data/lib/generators/horse_power/authorization/authorization_generator.rb +20 -0
  15. data/lib/generators/horse_power/authorization/templates/auth_file.rb.erb +59 -0
  16. data/lib/generators/horse_power/controller/USAGE +8 -0
  17. data/lib/generators/horse_power/controller/controller_generator.rb +15 -0
  18. data/lib/generators/horse_power/controller/templates/controller_template.rb.erb +96 -0
  19. data/lib/generators/horse_power/make_admin/USAGE +8 -0
  20. data/lib/generators/horse_power/make_admin/make_admin_generator.rb +67 -0
  21. data/lib/generators/horse_power/make_admin/templates/dashboard.rb.erb +25 -0
  22. data/lib/generators/horse_power/make_admin/templates/defcon_admin_register.rb.erb +99 -0
  23. data/lib/generators/horse_power/model/USAGE +8 -0
  24. data/lib/generators/horse_power/model/model_generator.rb +21 -0
  25. data/lib/generators/horse_power/model/templates/model.rb.erb +5 -0
  26. data/lib/generators/horse_power/scaffold/USAGE +8 -0
  27. data/lib/generators/horse_power/scaffold/scaffold_generator.rb +54 -0
  28. data/lib/generators/horse_power/scaffold/templates/active_admin_register.rb.erb +6 -0
  29. data/lib/generators/horse_power/serializer/USAGE +8 -0
  30. data/lib/generators/horse_power/serializer/serializer_generator.rb +15 -0
  31. data/lib/generators/horse_power/serializer/templates/serializer.rb.erb +38 -0
  32. data/lib/generators/horse_power/setup/USAGE +8 -0
  33. data/lib/generators/horse_power/setup/setup_generator.rb +188 -0
  34. data/lib/generators/horse_power/setup/templates/active_admin_token_register.rb.erb +102 -0
  35. data/lib/generators/horse_power/setup/templates/app_index_controller.rb +6 -0
  36. data/lib/generators/horse_power/setup/templates/application_controller.rb +45 -0
  37. data/lib/generators/horse_power/setup/templates/hidden_rspec.rb +3 -0
  38. data/lib/generators/horse_power/setup/templates/json_helpers.rb +7 -0
  39. data/lib/generators/horse_power/setup/templates/rspec_factory_girl.rb +16 -0
  40. data/lib/generators/horse_power/setup/templates/views/app +0 -0
  41. data/lib/generators/horse_power/setup/templates/views/app_index +9 -0
  42. data/lib/generators/horse_power/tests/USAGE +8 -0
  43. data/lib/generators/horse_power/tests/templates/factory.rb.erb +12 -0
  44. data/lib/generators/horse_power/tests/templates/model.rb.erb +35 -0
  45. data/lib/generators/horse_power/tests/templates/request.rb.erb +136 -0
  46. data/lib/generators/horse_power/tests/templates/routing.rb.erb +46 -0
  47. data/lib/generators/horse_power/tests/tests_generator.rb +18 -0
  48. data/lib/generators/horse_power/user/USAGE +8 -0
  49. data/lib/generators/horse_power/user/templates/admin.rb.erb +20 -0
  50. data/lib/generators/horse_power/user/templates/authorization.rb.erb +97 -0
  51. data/lib/generators/horse_power/user/templates/controller.rb.erb +135 -0
  52. data/lib/generators/horse_power/user/templates/model.rb.erb +56 -0
  53. data/lib/generators/horse_power/user/templates/serializer.rb.erb +44 -0
  54. data/lib/generators/horse_power/user/templates/specs/factory.rb.erb +14 -0
  55. data/lib/generators/horse_power/user/templates/specs/model.rb.erb +61 -0
  56. data/lib/generators/horse_power/user/templates/specs/requests.rb.erb +220 -0
  57. data/lib/generators/horse_power/user/templates/specs/routing.rb.erb +58 -0
  58. data/lib/generators/horse_power/user/user_generator.rb +67 -0
  59. data/lib/horse_power/engine.rb +5 -0
  60. data/lib/horse_power/version.rb +3 -0
  61. data/lib/horse_power.rb +72 -0
  62. data/lib/tasks/horse_power_tasks.rake +4 -0
  63. data/test/dummy/README.rdoc +28 -0
  64. data/test/dummy/Rakefile +6 -0
  65. data/test/dummy/app/assets/javascripts/application.js +13 -0
  66. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  67. data/test/dummy/app/controllers/application_controller.rb +5 -0
  68. data/test/dummy/app/helpers/application_helper.rb +2 -0
  69. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  70. data/test/dummy/bin/bundle +3 -0
  71. data/test/dummy/bin/rails +4 -0
  72. data/test/dummy/bin/rake +4 -0
  73. data/test/dummy/config/application.rb +23 -0
  74. data/test/dummy/config/boot.rb +5 -0
  75. data/test/dummy/config/database.yml +25 -0
  76. data/test/dummy/config/environment.rb +5 -0
  77. data/test/dummy/config/environments/development.rb +37 -0
  78. data/test/dummy/config/environments/production.rb +78 -0
  79. data/test/dummy/config/environments/test.rb +39 -0
  80. data/test/dummy/config/initializers/assets.rb +8 -0
  81. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  82. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  83. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  84. data/test/dummy/config/initializers/inflections.rb +16 -0
  85. data/test/dummy/config/initializers/mime_types.rb +4 -0
  86. data/test/dummy/config/initializers/session_store.rb +3 -0
  87. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  88. data/test/dummy/config/locales/en.yml +23 -0
  89. data/test/dummy/config/routes.rb +4 -0
  90. data/test/dummy/config/secrets.yml +22 -0
  91. data/test/dummy/config.ru +4 -0
  92. data/test/dummy/public/404.html +67 -0
  93. data/test/dummy/public/422.html +67 -0
  94. data/test/dummy/public/500.html +66 -0
  95. data/test/dummy/public/favicon.ico +0 -0
  96. data/test/fresh/test_app/Gemfile +41 -0
  97. data/test/fresh/test_app/Gemfile.lock +127 -0
  98. data/test/fresh/test_app/README.rdoc +28 -0
  99. data/test/fresh/test_app/Rakefile +6 -0
  100. data/test/fresh/test_app/app/assets/javascripts/application.js +16 -0
  101. data/test/fresh/test_app/app/assets/stylesheets/application.css +15 -0
  102. data/test/fresh/test_app/app/controllers/application_controller.rb +5 -0
  103. data/test/fresh/test_app/app/helpers/application_helper.rb +2 -0
  104. data/test/fresh/test_app/app/views/layouts/application.html.erb +14 -0
  105. data/test/fresh/test_app/bin/bundle +3 -0
  106. data/test/fresh/test_app/bin/rails +8 -0
  107. data/test/fresh/test_app/bin/rake +8 -0
  108. data/test/fresh/test_app/bin/spring +18 -0
  109. data/test/fresh/test_app/config/application.rb +23 -0
  110. data/test/fresh/test_app/config/boot.rb +4 -0
  111. data/test/fresh/test_app/config/database.yml +25 -0
  112. data/test/fresh/test_app/config/environment.rb +5 -0
  113. data/test/fresh/test_app/config/environments/development.rb +37 -0
  114. data/test/fresh/test_app/config/environments/production.rb +78 -0
  115. data/test/fresh/test_app/config/environments/test.rb +39 -0
  116. data/test/fresh/test_app/config/initializers/assets.rb +8 -0
  117. data/test/fresh/test_app/config/initializers/backtrace_silencers.rb +7 -0
  118. data/test/fresh/test_app/config/initializers/cookies_serializer.rb +3 -0
  119. data/test/fresh/test_app/config/initializers/filter_parameter_logging.rb +4 -0
  120. data/test/fresh/test_app/config/initializers/inflections.rb +16 -0
  121. data/test/fresh/test_app/config/initializers/mime_types.rb +4 -0
  122. data/test/fresh/test_app/config/initializers/session_store.rb +3 -0
  123. data/test/fresh/test_app/config/initializers/wrap_parameters.rb +14 -0
  124. data/test/fresh/test_app/config/locales/en.yml +23 -0
  125. data/test/fresh/test_app/config/routes.rb +56 -0
  126. data/test/fresh/test_app/config/secrets.yml +22 -0
  127. data/test/fresh/test_app/config.ru +4 -0
  128. data/test/fresh/test_app/db/seeds.rb +7 -0
  129. data/test/fresh/test_app/public/404.html +67 -0
  130. data/test/fresh/test_app/public/422.html +67 -0
  131. data/test/fresh/test_app/public/500.html +66 -0
  132. data/test/fresh/test_app/public/favicon.ico +0 -0
  133. data/test/fresh/test_app/public/robots.txt +5 -0
  134. data/test/fresh/test_app/test/test_helper.rb +10 -0
  135. data/test/horse_power_test.rb +7 -0
  136. data/test/integration/navigation_test.rb +10 -0
  137. data/test/lib/generators/horse_power/app_environment_generator_test.rb +16 -0
  138. data/test/lib/generators/horse_power/authorization_generator_test.rb +16 -0
  139. data/test/lib/generators/horse_power/controller_generator_test.rb +16 -0
  140. data/test/lib/generators/horse_power/make_admin_generator_test.rb +16 -0
  141. data/test/lib/generators/horse_power/model_generator_test.rb +16 -0
  142. data/test/lib/generators/horse_power/scaffold_generator_test.rb +16 -0
  143. data/test/lib/generators/horse_power/serializer_generator_test.rb +16 -0
  144. data/test/lib/generators/horse_power/setup_generator_test.rb +16 -0
  145. data/test/lib/generators/horse_power/tests_generator_test.rb +16 -0
  146. data/test/lib/generators/horse_power/user_generator_test.rb +16 -0
  147. data/test/test_helper.rb +15 -0
  148. metadata +313 -0
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-agent: *
5
+ # Disallow: /
@@ -0,0 +1,10 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+ require File.expand_path('../../config/environment', __FILE__)
3
+ require 'rails/test_help'
4
+
5
+ class ActiveSupport::TestCase
6
+ # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
7
+ fixtures :all
8
+
9
+ # Add more helper methods to be used by all tests here...
10
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class HorsePowerTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, HorsePower
6
+ end
7
+ end
@@ -0,0 +1,10 @@
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
+
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+ require 'generators/app_environment/app_environment_generator'
3
+
4
+ module HorsePower
5
+ class AppEnvironmentGeneratorTest < Rails::Generators::TestCase
6
+ tests AppEnvironmentGenerator
7
+ destination Rails.root.join('tmp/generators')
8
+ setup :prepare_destination
9
+
10
+ # test "generator runs without errors" do
11
+ # assert_nothing_raised do
12
+ # run_generator ["arguments"]
13
+ # end
14
+ # end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+ require 'generators/authorization/authorization_generator'
3
+
4
+ module HorsePower
5
+ class AuthorizationGeneratorTest < Rails::Generators::TestCase
6
+ tests AuthorizationGenerator
7
+ destination Rails.root.join('tmp/generators')
8
+ setup :prepare_destination
9
+
10
+ # test "generator runs without errors" do
11
+ # assert_nothing_raised do
12
+ # run_generator ["arguments"]
13
+ # end
14
+ # end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+ require 'generators/controller/controller_generator'
3
+
4
+ module HorsePower
5
+ class ControllerGeneratorTest < Rails::Generators::TestCase
6
+ tests ControllerGenerator
7
+ destination Rails.root.join('tmp/generators')
8
+ setup :prepare_destination
9
+
10
+ # test "generator runs without errors" do
11
+ # assert_nothing_raised do
12
+ # run_generator ["arguments"]
13
+ # end
14
+ # end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+ require 'generators/make_admin/make_admin_generator'
3
+
4
+ module HorsePower
5
+ class MakeAdminGeneratorTest < Rails::Generators::TestCase
6
+ tests MakeAdminGenerator
7
+ destination Rails.root.join('tmp/generators')
8
+ setup :prepare_destination
9
+
10
+ # test "generator runs without errors" do
11
+ # assert_nothing_raised do
12
+ # run_generator ["arguments"]
13
+ # end
14
+ # end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+ require 'generators/model/model_generator'
3
+
4
+ module HorsePower
5
+ class ModelGeneratorTest < Rails::Generators::TestCase
6
+ tests ModelGenerator
7
+ destination Rails.root.join('tmp/generators')
8
+ setup :prepare_destination
9
+
10
+ # test "generator runs without errors" do
11
+ # assert_nothing_raised do
12
+ # run_generator ["arguments"]
13
+ # end
14
+ # end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+ require 'generators/scaffold/scaffold_generator'
3
+
4
+ module HorsePower
5
+ class ScaffoldGeneratorTest < Rails::Generators::TestCase
6
+ tests ScaffoldGenerator
7
+ destination Rails.root.join('tmp/generators')
8
+ setup :prepare_destination
9
+
10
+ # test "generator runs without errors" do
11
+ # assert_nothing_raised do
12
+ # run_generator ["arguments"]
13
+ # end
14
+ # end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+ require 'generators/serializer/serializer_generator'
3
+
4
+ module HorsePower
5
+ class SerializerGeneratorTest < Rails::Generators::TestCase
6
+ tests SerializerGenerator
7
+ destination Rails.root.join('tmp/generators')
8
+ setup :prepare_destination
9
+
10
+ # test "generator runs without errors" do
11
+ # assert_nothing_raised do
12
+ # run_generator ["arguments"]
13
+ # end
14
+ # end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+ require 'generators/setup/setup_generator'
3
+
4
+ module HorsePower
5
+ class SetupGeneratorTest < Rails::Generators::TestCase
6
+ tests SetupGenerator
7
+ destination Rails.root.join('tmp/generators')
8
+ setup :prepare_destination
9
+
10
+ # test "generator runs without errors" do
11
+ # assert_nothing_raised do
12
+ # run_generator ["arguments"]
13
+ # end
14
+ # end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+ require 'generators/tests/tests_generator'
3
+
4
+ module HorsePower
5
+ class TestsGeneratorTest < Rails::Generators::TestCase
6
+ tests TestsGenerator
7
+ destination Rails.root.join('tmp/generators')
8
+ setup :prepare_destination
9
+
10
+ # test "generator runs without errors" do
11
+ # assert_nothing_raised do
12
+ # run_generator ["arguments"]
13
+ # end
14
+ # end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ require 'test_helper'
2
+ require 'generators/user/user_generator'
3
+
4
+ module HorsePower
5
+ class UserGeneratorTest < Rails::Generators::TestCase
6
+ tests UserGenerator
7
+ destination Rails.root.join('tmp/generators')
8
+ setup :prepare_destination
9
+
10
+ # test "generator runs without errors" do
11
+ # assert_nothing_raised do
12
+ # run_generator ["arguments"]
13
+ # end
14
+ # end
15
+ end
16
+ end
@@ -0,0 +1,15 @@
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