horse_power 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +3 -0
- data/Rakefile +34 -0
- data/app/assets/javascripts/horse_power/application.js +13 -0
- data/app/assets/stylesheets/horse_power/application.css +15 -0
- data/app/controllers/horse_power/application_controller.rb +4 -0
- data/app/helpers/horse_power/application_helper.rb +4 -0
- data/app/views/layouts/horse_power/application.html.erb +14 -0
- data/config/routes.rb +2 -0
- data/lib/generators/horse_power/app_environment/USAGE +8 -0
- data/lib/generators/horse_power/app_environment/app_environment_generator.rb +128 -0
- data/lib/generators/horse_power/authorization/USAGE +8 -0
- data/lib/generators/horse_power/authorization/authorization_generator.rb +20 -0
- data/lib/generators/horse_power/authorization/templates/auth_file.rb.erb +59 -0
- data/lib/generators/horse_power/controller/USAGE +8 -0
- data/lib/generators/horse_power/controller/controller_generator.rb +15 -0
- data/lib/generators/horse_power/controller/templates/controller_template.rb.erb +96 -0
- data/lib/generators/horse_power/make_admin/USAGE +8 -0
- data/lib/generators/horse_power/make_admin/make_admin_generator.rb +67 -0
- data/lib/generators/horse_power/make_admin/templates/dashboard.rb.erb +25 -0
- data/lib/generators/horse_power/make_admin/templates/defcon_admin_register.rb.erb +99 -0
- data/lib/generators/horse_power/model/USAGE +8 -0
- data/lib/generators/horse_power/model/model_generator.rb +21 -0
- data/lib/generators/horse_power/model/templates/model.rb.erb +5 -0
- data/lib/generators/horse_power/scaffold/USAGE +8 -0
- data/lib/generators/horse_power/scaffold/scaffold_generator.rb +54 -0
- data/lib/generators/horse_power/scaffold/templates/active_admin_register.rb.erb +6 -0
- data/lib/generators/horse_power/serializer/USAGE +8 -0
- data/lib/generators/horse_power/serializer/serializer_generator.rb +15 -0
- data/lib/generators/horse_power/serializer/templates/serializer.rb.erb +38 -0
- data/lib/generators/horse_power/setup/USAGE +8 -0
- data/lib/generators/horse_power/setup/setup_generator.rb +188 -0
- data/lib/generators/horse_power/setup/templates/active_admin_token_register.rb.erb +102 -0
- data/lib/generators/horse_power/setup/templates/app_index_controller.rb +6 -0
- data/lib/generators/horse_power/setup/templates/application_controller.rb +45 -0
- data/lib/generators/horse_power/setup/templates/hidden_rspec.rb +3 -0
- data/lib/generators/horse_power/setup/templates/json_helpers.rb +7 -0
- data/lib/generators/horse_power/setup/templates/rspec_factory_girl.rb +16 -0
- data/lib/generators/horse_power/setup/templates/views/app +0 -0
- data/lib/generators/horse_power/setup/templates/views/app_index +9 -0
- data/lib/generators/horse_power/tests/USAGE +8 -0
- data/lib/generators/horse_power/tests/templates/factory.rb.erb +12 -0
- data/lib/generators/horse_power/tests/templates/model.rb.erb +35 -0
- data/lib/generators/horse_power/tests/templates/request.rb.erb +136 -0
- data/lib/generators/horse_power/tests/templates/routing.rb.erb +46 -0
- data/lib/generators/horse_power/tests/tests_generator.rb +18 -0
- data/lib/generators/horse_power/user/USAGE +8 -0
- data/lib/generators/horse_power/user/templates/admin.rb.erb +20 -0
- data/lib/generators/horse_power/user/templates/authorization.rb.erb +97 -0
- data/lib/generators/horse_power/user/templates/controller.rb.erb +135 -0
- data/lib/generators/horse_power/user/templates/model.rb.erb +56 -0
- data/lib/generators/horse_power/user/templates/serializer.rb.erb +44 -0
- data/lib/generators/horse_power/user/templates/specs/factory.rb.erb +14 -0
- data/lib/generators/horse_power/user/templates/specs/model.rb.erb +61 -0
- data/lib/generators/horse_power/user/templates/specs/requests.rb.erb +220 -0
- data/lib/generators/horse_power/user/templates/specs/routing.rb.erb +58 -0
- data/lib/generators/horse_power/user/user_generator.rb +67 -0
- data/lib/horse_power/engine.rb +5 -0
- data/lib/horse_power/version.rb +3 -0
- data/lib/horse_power.rb +72 -0
- data/lib/tasks/horse_power_tasks.rake +4 -0
- data/test/dummy/README.rdoc +28 -0
- data/test/dummy/Rakefile +6 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/test/dummy/app/controllers/application_controller.rb +5 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/bin/bundle +3 -0
- data/test/dummy/bin/rails +4 -0
- data/test/dummy/bin/rake +4 -0
- data/test/dummy/config/application.rb +23 -0
- data/test/dummy/config/boot.rb +5 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +78 -0
- data/test/dummy/config/environments/test.rb +39 -0
- data/test/dummy/config/initializers/assets.rb +8 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/dummy/config/initializers/inflections.rb +16 -0
- data/test/dummy/config/initializers/mime_types.rb +4 -0
- data/test/dummy/config/initializers/session_store.rb +3 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +23 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/config/secrets.yml +22 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/public/404.html +67 -0
- data/test/dummy/public/422.html +67 -0
- data/test/dummy/public/500.html +66 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/fresh/test_app/Gemfile +41 -0
- data/test/fresh/test_app/Gemfile.lock +127 -0
- data/test/fresh/test_app/README.rdoc +28 -0
- data/test/fresh/test_app/Rakefile +6 -0
- data/test/fresh/test_app/app/assets/javascripts/application.js +16 -0
- data/test/fresh/test_app/app/assets/stylesheets/application.css +15 -0
- data/test/fresh/test_app/app/controllers/application_controller.rb +5 -0
- data/test/fresh/test_app/app/helpers/application_helper.rb +2 -0
- data/test/fresh/test_app/app/views/layouts/application.html.erb +14 -0
- data/test/fresh/test_app/bin/bundle +3 -0
- data/test/fresh/test_app/bin/rails +8 -0
- data/test/fresh/test_app/bin/rake +8 -0
- data/test/fresh/test_app/bin/spring +18 -0
- data/test/fresh/test_app/config/application.rb +23 -0
- data/test/fresh/test_app/config/boot.rb +4 -0
- data/test/fresh/test_app/config/database.yml +25 -0
- data/test/fresh/test_app/config/environment.rb +5 -0
- data/test/fresh/test_app/config/environments/development.rb +37 -0
- data/test/fresh/test_app/config/environments/production.rb +78 -0
- data/test/fresh/test_app/config/environments/test.rb +39 -0
- data/test/fresh/test_app/config/initializers/assets.rb +8 -0
- data/test/fresh/test_app/config/initializers/backtrace_silencers.rb +7 -0
- data/test/fresh/test_app/config/initializers/cookies_serializer.rb +3 -0
- data/test/fresh/test_app/config/initializers/filter_parameter_logging.rb +4 -0
- data/test/fresh/test_app/config/initializers/inflections.rb +16 -0
- data/test/fresh/test_app/config/initializers/mime_types.rb +4 -0
- data/test/fresh/test_app/config/initializers/session_store.rb +3 -0
- data/test/fresh/test_app/config/initializers/wrap_parameters.rb +14 -0
- data/test/fresh/test_app/config/locales/en.yml +23 -0
- data/test/fresh/test_app/config/routes.rb +56 -0
- data/test/fresh/test_app/config/secrets.yml +22 -0
- data/test/fresh/test_app/config.ru +4 -0
- data/test/fresh/test_app/db/seeds.rb +7 -0
- data/test/fresh/test_app/public/404.html +67 -0
- data/test/fresh/test_app/public/422.html +67 -0
- data/test/fresh/test_app/public/500.html +66 -0
- data/test/fresh/test_app/public/favicon.ico +0 -0
- data/test/fresh/test_app/public/robots.txt +5 -0
- data/test/fresh/test_app/test/test_helper.rb +10 -0
- data/test/horse_power_test.rb +7 -0
- data/test/integration/navigation_test.rb +10 -0
- data/test/lib/generators/horse_power/app_environment_generator_test.rb +16 -0
- data/test/lib/generators/horse_power/authorization_generator_test.rb +16 -0
- data/test/lib/generators/horse_power/controller_generator_test.rb +16 -0
- data/test/lib/generators/horse_power/make_admin_generator_test.rb +16 -0
- data/test/lib/generators/horse_power/model_generator_test.rb +16 -0
- data/test/lib/generators/horse_power/scaffold_generator_test.rb +16 -0
- data/test/lib/generators/horse_power/serializer_generator_test.rb +16 -0
- data/test/lib/generators/horse_power/setup_generator_test.rb +16 -0
- data/test/lib/generators/horse_power/tests_generator_test.rb +16 -0
- data/test/lib/generators/horse_power/user_generator_test.rb +16 -0
- data/test/test_helper.rb +15 -0
- 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,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,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
|
data/test/test_helper.rb
ADDED
@@ -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
|