json_voorhees 0.2.3 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +13 -14
- data/lib/generators/json_voorhees/app_make_admin/USAGE +8 -0
- data/lib/generators/json_voorhees/app_make_admin/app_make_admin_generator.rb +39 -0
- data/lib/generators/json_voorhees/{setup_app → app_make_admin}/templates/views/_footer.html.erb +0 -0
- data/lib/generators/json_voorhees/{setup_app → app_make_admin}/templates/views/_header.html.erb +10 -6
- data/lib/generators/json_voorhees/{setup_app → app_make_admin}/templates/views/admin_home_no_user +0 -0
- data/lib/generators/json_voorhees/{setup_app → app_make_admin}/templates/views/admin_home_with_user +0 -0
- data/lib/generators/json_voorhees/{setup_app → app_make_admin}/templates/views/application +0 -0
- data/lib/generators/json_voorhees/{setup_app → app_make_admin}/templates/views/application.css.scss +0 -0
- data/lib/generators/json_voorhees/app_make_authorizations/app_make_authorizations_generator.rb +2 -2
- data/lib/generators/json_voorhees/app_make_authorizations/templates/auth_file.rb.erb +2 -2
- data/lib/generators/json_voorhees/app_make_tests/app_make_tests_generator.rb +5 -5
- data/lib/generators/json_voorhees/app_make_tests/templates/factory.rb.erb +1 -1
- data/lib/generators/json_voorhees/app_make_tests/templates/model.rb.erb +9 -9
- data/lib/generators/json_voorhees/app_make_tests/templates/no_auth_request.rb.erb +16 -16
- data/lib/generators/json_voorhees/app_make_tests/templates/request.rb.erb +24 -24
- data/lib/generators/json_voorhees/app_make_user/USAGE +8 -0
- data/lib/generators/json_voorhees/app_make_user/app_make_user_generator.rb +66 -0
- data/lib/generators/json_voorhees/app_make_user/templates/user/include_authorization.rb +4 -0
- data/lib/generators/json_voorhees/{setup_app → app_make_user}/templates/user/specs/factory_girl.rb +1 -1
- data/lib/generators/json_voorhees/{setup_app → app_make_user}/templates/user/specs/model_specs.rb +14 -14
- data/lib/generators/json_voorhees/{setup_app → app_make_user}/templates/user/specs/request_specs.rb +31 -31
- data/lib/generators/json_voorhees/{setup_app → app_make_user}/templates/user/specs/route_specs.rb +0 -0
- data/lib/generators/json_voorhees/{setup_app → app_make_user}/templates/user/user_authorizations.rb +3 -3
- data/lib/generators/json_voorhees/{setup_app → app_make_user}/templates/user/user_controller.rb +10 -10
- data/lib/generators/json_voorhees/{setup_app → app_make_user}/templates/user/user_model.rb +2 -1
- data/lib/generators/json_voorhees/{setup_app → app_make_user}/templates/user/user_routes.rb +0 -0
- data/lib/generators/json_voorhees/{setup_app → app_make_user}/templates/user/user_serializer.rb +7 -7
- data/lib/generators/json_voorhees/engine_create_controller/templates/controller_template.rb.erb +8 -8
- data/lib/generators/json_voorhees/engine_create_model/USAGE +8 -0
- data/lib/generators/json_voorhees/engine_create_model/engine_create_model_generator.rb +36 -0
- data/lib/generators/json_voorhees/engine_create_model/templates/model.rb +8 -0
- data/lib/generators/json_voorhees/engine_create_serializer/engine_create_serializer_generator.rb +1 -1
- data/lib/generators/json_voorhees/engine_create_serializer/templates/serializer.rb.erb +7 -7
- data/lib/generators/json_voorhees/engine_scaffold/engine_scaffold_generator.rb +5 -1
- data/lib/generators/json_voorhees/massive_scaffold/massive_scaffold_generator.rb +7 -2
- data/lib/generators/json_voorhees/setup_app/setup_app_generator.rb +69 -129
- data/lib/json_voorhees/version.rb +1 -1
- data/test/fresh_copy/test_app/Gemfile +46 -0
- data/test/fresh_copy/test_app/Gemfile.lock +125 -0
- data/test/{test_app/engines/people/test/dummy → fresh_copy/test_app}/README.rdoc +0 -0
- data/test/{test_app/gems/authorization/test/dummy → fresh_copy/test_app}/Rakefile +1 -1
- data/test/{test_app → fresh_copy/test_app}/app/assets/javascripts/application.js +0 -0
- data/test/{test_app/engines/people/test/dummy → fresh_copy/test_app}/app/assets/stylesheets/application.css +3 -5
- data/test/{test_app/engines/people/test/dummy → fresh_copy/test_app}/app/controllers/application_controller.rb +0 -0
- data/test/{test_app → fresh_copy/test_app}/app/helpers/application_helper.rb +0 -0
- data/test/{test_app → fresh_copy/test_app}/app/views/layouts/application.html.erb +1 -6
- data/test/{test_app → fresh_copy/test_app}/bin/bundle +0 -0
- data/test/{test_app/engines/people/test/dummy → fresh_copy/test_app}/bin/rails +0 -0
- data/test/{test_app/engines/people/test/dummy → fresh_copy/test_app}/bin/rake +0 -0
- data/test/{test_app → fresh_copy/test_app}/config.ru +0 -0
- data/test/{test_app → fresh_copy/test_app}/config/application.rb +0 -4
- data/test/{test_app → fresh_copy/test_app}/config/boot.rb +0 -0
- data/test/{test_app → fresh_copy/test_app}/config/database.yml +8 -8
- data/test/{test_app → fresh_copy/test_app}/config/environment.rb +1 -1
- data/test/{test_app/engines/people/test/dummy → fresh_copy/test_app}/config/environments/development.rb +2 -10
- data/test/{test_app/engines/people/test/dummy → fresh_copy/test_app}/config/environments/production.rb +5 -7
- data/test/{test_app/gems/authorization/test/dummy → fresh_copy/test_app}/config/environments/test.rb +2 -5
- data/test/{test_app → fresh_copy/test_app}/config/initializers/backtrace_silencers.rb +0 -0
- data/test/{test_app → fresh_copy/test_app}/config/initializers/filter_parameter_logging.rb +0 -0
- data/test/{test_app → fresh_copy/test_app}/config/initializers/inflections.rb +0 -0
- data/test/{test_app/engines/people/test/dummy → fresh_copy/test_app}/config/initializers/mime_types.rb +1 -0
- data/test/fresh_copy/test_app/config/initializers/secret_token.rb +12 -0
- data/test/fresh_copy/test_app/config/initializers/session_store.rb +3 -0
- data/test/{test_app → fresh_copy/test_app}/config/initializers/wrap_parameters.rb +0 -0
- data/test/{test_app → fresh_copy/test_app}/config/locales/en.yml +0 -0
- data/test/{test_app/gems/authorization/test/dummy → fresh_copy/test_app}/config/routes.rb +1 -1
- data/test/{test_app → fresh_copy/test_app}/db/seeds.rb +0 -0
- data/test/{test_app/gems/authorization/test/dummy → fresh_copy/test_app}/public/404.html +11 -20
- data/test/{test_app/engines/people/test/dummy → fresh_copy/test_app}/public/422.html +11 -20
- data/test/{test_app → fresh_copy/test_app}/public/500.html +10 -19
- data/test/{test_app/engines/people/test/dummy → fresh_copy/test_app}/public/favicon.ico +0 -0
- data/test/{test_app → fresh_copy/test_app}/public/robots.txt +0 -0
- data/test/fresh_copy/test_app/test/test_helper.rb +15 -0
- data/test/lib/generators/json_voorhees/app_make_admin_generator_test.rb +16 -0
- data/test/lib/generators/json_voorhees/app_make_user_generator_test.rb +16 -0
- data/test/lib/generators/json_voorhees/engine_create_model_generator_test.rb +16 -0
- data/test/lib/generators/json_voorhees/engine_make_model_generator_test.rb +16 -0
- metadata +105 -520
- data/lib/generators/json_voorhees/setup_app/templates/user/include_authorization.rb +0 -3
- data/test/test_app/Gemfile +0 -65
- data/test/test_app/Gemfile.lock +0 -230
- data/test/test_app/README.md +0 -1
- data/test/test_app/Rakefile +0 -6
- data/test/test_app/app/assets/stylesheets/application.css +0 -15
- data/test/test_app/app/controllers/api/v1/api_controller.rb +0 -26
- data/test/test_app/app/controllers/app_index_controller.rb +0 -4
- data/test/test_app/app/controllers/application_controller.rb +0 -10
- data/test/test_app/app/controllers/main_controller.rb +0 -4
- data/test/test_app/app/views/app_index/app.html.erb +0 -0
- data/test/test_app/app/views/layouts/app_index.html.erb +0 -9
- data/test/test_app/app/views/main/admin.html.erb +0 -9
- data/test/test_app/bin/rails +0 -8
- data/test/test_app/bin/rake +0 -8
- data/test/test_app/bin/spring +0 -18
- data/test/test_app/config/environments/development.rb +0 -37
- data/test/test_app/config/environments/production.rb +0 -82
- data/test/test_app/config/environments/test.rb +0 -39
- data/test/test_app/config/initializers/assets.rb +0 -8
- data/test/test_app/config/initializers/cookies_serializer.rb +0 -3
- data/test/test_app/config/initializers/mime_types.rb +0 -4
- data/test/test_app/config/initializers/session_store.rb +0 -3
- data/test/test_app/config/routes.rb +0 -64
- data/test/test_app/config/secrets.yml +0 -22
- data/test/test_app/db/development.sqlite3 +0 -0
- data/test/test_app/db/migrate/20140905145354_create_people_users.people.rb +0 -12
- data/test/test_app/db/migrate/20140905145355_create_arcadex_tokens.arcadex.rb +0 -12
- data/test/test_app/db/migrate/20140905145356_add_index_to_token.arcadex.rb +0 -6
- data/test/test_app/db/schema.rb +0 -16
- data/test/test_app/engines/people/Gemfile +0 -14
- data/test/test_app/engines/people/Gemfile.lock +0 -92
- data/test/test_app/engines/people/MIT-LICENSE +0 -20
- data/test/test_app/engines/people/README.md +0 -1
- data/test/test_app/engines/people/Rakefile +0 -34
- data/test/test_app/engines/people/app/assets/javascripts/people/application.js +0 -13
- data/test/test_app/engines/people/app/assets/javascripts/people/users.js +0 -2
- data/test/test_app/engines/people/app/assets/stylesheets/people/application.css +0 -15
- data/test/test_app/engines/people/app/assets/stylesheets/people/users.css +0 -4
- data/test/test_app/engines/people/app/assets/stylesheets/scaffold.css +0 -56
- data/test/test_app/engines/people/app/controllers/people/api/v1/application_controller.rb +0 -5
- data/test/test_app/engines/people/app/controllers/people/api/v1/users_controller.rb +0 -124
- data/test/test_app/engines/people/app/controllers/people/application_controller.rb +0 -4
- data/test/test_app/engines/people/app/controllers/people/users_controller.rb +0 -62
- data/test/test_app/engines/people/app/helpers/people/application_helper.rb +0 -4
- data/test/test_app/engines/people/app/helpers/people/users_helper.rb +0 -4
- data/test/test_app/engines/people/app/models/people/user.rb +0 -26
- data/test/test_app/engines/people/app/serializers/people/user_serializer.rb +0 -39
- data/test/test_app/engines/people/app/views/layouts/people/default/application.html.erb +0 -14
- data/test/test_app/engines/people/app/views/people/users/_form.html.erb +0 -29
- data/test/test_app/engines/people/app/views/people/users/edit.html.erb +0 -6
- data/test/test_app/engines/people/app/views/people/users/index.html.erb +0 -29
- data/test/test_app/engines/people/app/views/people/users/new.html.erb +0 -5
- data/test/test_app/engines/people/app/views/people/users/show.html.erb +0 -19
- data/test/test_app/engines/people/bin/rails +0 -12
- data/test/test_app/engines/people/config/routes.rb +0 -24
- data/test/test_app/engines/people/db/migrate/20140905145341_create_people_users.rb +0 -11
- data/test/test_app/engines/people/lib/people.rb +0 -4
- data/test/test_app/engines/people/lib/people/engine.rb +0 -5
- data/test/test_app/engines/people/lib/people/version.rb +0 -3
- data/test/test_app/engines/people/lib/tasks/people_tasks.rake +0 -4
- data/test/test_app/engines/people/people.gemspec +0 -31
- data/test/test_app/engines/people/test/controllers/people/users_controller_test.rb +0 -51
- data/test/test_app/engines/people/test/dummy/Rakefile +0 -6
- data/test/test_app/engines/people/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/test_app/engines/people/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/test_app/engines/people/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/test_app/engines/people/test/dummy/bin/bundle +0 -3
- data/test/test_app/engines/people/test/dummy/config.ru +0 -4
- data/test/test_app/engines/people/test/dummy/config/application.rb +0 -23
- data/test/test_app/engines/people/test/dummy/config/boot.rb +0 -5
- data/test/test_app/engines/people/test/dummy/config/database.yml +0 -25
- data/test/test_app/engines/people/test/dummy/config/environment.rb +0 -5
- data/test/test_app/engines/people/test/dummy/config/environments/test.rb +0 -39
- data/test/test_app/engines/people/test/dummy/config/initializers/assets.rb +0 -8
- data/test/test_app/engines/people/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/test_app/engines/people/test/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/test/test_app/engines/people/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/test_app/engines/people/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/test_app/engines/people/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/test_app/engines/people/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/test_app/engines/people/test/dummy/config/locales/en.yml +0 -23
- data/test/test_app/engines/people/test/dummy/config/routes.rb +0 -4
- data/test/test_app/engines/people/test/dummy/config/secrets.yml +0 -22
- data/test/test_app/engines/people/test/dummy/db/development.sqlite3 +0 -0
- data/test/test_app/engines/people/test/dummy/db/schema.rb +0 -24
- data/test/test_app/engines/people/test/dummy/log/development.log +0 -0
- data/test/test_app/engines/people/test/dummy/public/404.html +0 -67
- data/test/test_app/engines/people/test/dummy/public/500.html +0 -66
- data/test/test_app/engines/people/test/fixtures/people/users.yml +0 -11
- data/test/test_app/engines/people/test/helpers/people/users_helper_test.rb +0 -6
- data/test/test_app/engines/people/test/integration/navigation_test.rb +0 -10
- data/test/test_app/engines/people/test/models/people/user_test.rb +0 -9
- data/test/test_app/engines/people/test/people_test.rb +0 -7
- data/test/test_app/engines/people/test/test_helper.rb +0 -15
- data/test/test_app/gems/authorization/Gemfile +0 -14
- data/test/test_app/gems/authorization/Gemfile.lock +0 -92
- data/test/test_app/gems/authorization/MIT-LICENSE +0 -20
- data/test/test_app/gems/authorization/README.rdoc +0 -3
- data/test/test_app/gems/authorization/Rakefile +0 -32
- data/test/test_app/gems/authorization/authorization.gemspec +0 -23
- data/test/test_app/gems/authorization/lib/authorization.rb +0 -3
- data/test/test_app/gems/authorization/lib/authorization/people/user.rb +0 -82
- data/test/test_app/gems/authorization/lib/authorization/version.rb +0 -3
- data/test/test_app/gems/authorization/lib/tasks/authorization_tasks.rake +0 -4
- data/test/test_app/gems/authorization/test/authorization_test.rb +0 -7
- data/test/test_app/gems/authorization/test/dummy/README.rdoc +0 -28
- data/test/test_app/gems/authorization/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/test_app/gems/authorization/test/dummy/app/assets/stylesheets/application.css +0 -15
- data/test/test_app/gems/authorization/test/dummy/app/controllers/application_controller.rb +0 -5
- data/test/test_app/gems/authorization/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/test_app/gems/authorization/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/test_app/gems/authorization/test/dummy/bin/bundle +0 -3
- data/test/test_app/gems/authorization/test/dummy/bin/rails +0 -4
- data/test/test_app/gems/authorization/test/dummy/bin/rake +0 -4
- data/test/test_app/gems/authorization/test/dummy/config.ru +0 -4
- data/test/test_app/gems/authorization/test/dummy/config/application.rb +0 -23
- data/test/test_app/gems/authorization/test/dummy/config/boot.rb +0 -5
- data/test/test_app/gems/authorization/test/dummy/config/database.yml +0 -25
- data/test/test_app/gems/authorization/test/dummy/config/environment.rb +0 -5
- data/test/test_app/gems/authorization/test/dummy/config/environments/development.rb +0 -37
- data/test/test_app/gems/authorization/test/dummy/config/environments/production.rb +0 -82
- data/test/test_app/gems/authorization/test/dummy/config/initializers/assets.rb +0 -8
- data/test/test_app/gems/authorization/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/test_app/gems/authorization/test/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/test/test_app/gems/authorization/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/test_app/gems/authorization/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/test_app/gems/authorization/test/dummy/config/initializers/mime_types.rb +0 -4
- data/test/test_app/gems/authorization/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/test_app/gems/authorization/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/test_app/gems/authorization/test/dummy/config/locales/en.yml +0 -23
- data/test/test_app/gems/authorization/test/dummy/config/secrets.yml +0 -22
- data/test/test_app/gems/authorization/test/dummy/public/422.html +0 -67
- data/test/test_app/gems/authorization/test/dummy/public/500.html +0 -66
- data/test/test_app/gems/authorization/test/dummy/public/favicon.ico +0 -0
- data/test/test_app/gems/authorization/test/test_helper.rb +0 -15
- data/test/test_app/log/development.log +0 -1803
- data/test/test_app/log/production.log +0 -97
- data/test/test_app/log/test.log +0 -23337
- data/test/test_app/public/404.html +0 -67
- data/test/test_app/public/422.html +0 -67
- data/test/test_app/public/favicon.ico +0 -0
- data/test/test_app/spec/controllers/app_index_controller_spec.rb +0 -12
- data/test/test_app/spec/engines/people/api/v1/models/user_spec.rb +0 -59
- data/test/test_app/spec/engines/people/api/v1/requests/user_spec.rb +0 -154
- data/test/test_app/spec/engines/people/api/v1/routing/user_spec.rb +0 -77
- data/test/test_app/spec/factories/people_user_factory.rb +0 -14
- data/test/test_app/spec/rails_helper.rb +0 -47
- data/test/test_app/spec/spec_helper.rb +0 -78
- data/test/test_app/spec/support/factory_girl.rb +0 -16
- data/test/test_app/spec/support/request_helpers.rb +0 -7
- data/test/test_app/tmp/cache/assets/development/sprockets/055b16b21481c5603eab51f88bce614e +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/2c8821d40541c62f65d0a77d6d737a59 +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/381d73d62d2e34310ff5e02a60e2e6b5 +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/6cfd8687a851913292b638daebcf0c3b +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/72539eb249ff535aa9679adf93578a3a +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/7288979cc8fd497d915d19732930197f +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/af6f30b38676f9ac87b6c15260d702d6 +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/c1e06c98ebb85a26421cf34d75787365 +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/c636869dd0df678775f14b9e86cb147d +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/test_app/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/test_engine/Gemfile +0 -17
- data/test/test_engine/Gemfile.lock +0 -128
- data/test/test_engine/MIT-LICENSE +0 -20
- data/test/test_engine/README.md +0 -1
- data/test/test_engine/Rakefile +0 -34
- data/test/test_engine/app/assets/javascripts/test_engine/application.js +0 -13
- data/test/test_engine/app/assets/stylesheets/test_engine/application.css +0 -15
- data/test/test_engine/app/controllers/test_engine/api/v1/application_controller.rb +0 -5
- data/test/test_engine/app/controllers/test_engine/application_controller.rb +0 -4
- data/test/test_engine/app/helpers/test_engine/application_helper.rb +0 -4
- data/test/test_engine/app/views/layouts/test_engine/default/application.html.erb +0 -14
- data/test/test_engine/bin/rails +0 -12
- data/test/test_engine/config/routes.rb +0 -23
- data/test/test_engine/lib/tasks/test_engine_tasks.rake +0 -4
- data/test/test_engine/lib/test_engine.rb +0 -4
- data/test/test_engine/lib/test_engine/engine.rb +0 -5
- data/test/test_engine/lib/test_engine/version.rb +0 -3
- data/test/test_engine/test/dummy/README.rdoc +0 -28
- data/test/test_engine/test/dummy/Rakefile +0 -6
- data/test/test_engine/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/test_engine/test/dummy/app/assets/stylesheets/application.css +0 -15
- data/test/test_engine/test/dummy/app/controllers/application_controller.rb +0 -5
- data/test/test_engine/test/dummy/app/helpers/application_helper.rb +0 -2
- data/test/test_engine/test/dummy/app/views/layouts/application.html.erb +0 -14
- data/test/test_engine/test/dummy/bin/bundle +0 -3
- data/test/test_engine/test/dummy/bin/rails +0 -4
- data/test/test_engine/test/dummy/bin/rake +0 -4
- data/test/test_engine/test/dummy/config.ru +0 -4
- data/test/test_engine/test/dummy/config/application.rb +0 -23
- data/test/test_engine/test/dummy/config/boot.rb +0 -5
- data/test/test_engine/test/dummy/config/database.yml +0 -25
- data/test/test_engine/test/dummy/config/environment.rb +0 -5
- data/test/test_engine/test/dummy/config/environments/development.rb +0 -37
- data/test/test_engine/test/dummy/config/environments/production.rb +0 -82
- data/test/test_engine/test/dummy/config/environments/test.rb +0 -39
- data/test/test_engine/test/dummy/config/initializers/assets.rb +0 -8
- data/test/test_engine/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/test/test_engine/test/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/test/test_engine/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/test/test_engine/test/dummy/config/initializers/inflections.rb +0 -16
- data/test/test_engine/test/dummy/config/initializers/mime_types.rb +0 -4
- data/test/test_engine/test/dummy/config/initializers/session_store.rb +0 -3
- data/test/test_engine/test/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/test/test_engine/test/dummy/config/locales/en.yml +0 -23
- data/test/test_engine/test/dummy/config/routes.rb +0 -4
- data/test/test_engine/test/dummy/config/secrets.yml +0 -22
- data/test/test_engine/test/dummy/log/development.log +0 -0
- data/test/test_engine/test/dummy/public/404.html +0 -67
- data/test/test_engine/test/dummy/public/422.html +0 -67
- data/test/test_engine/test/dummy/public/500.html +0 -66
- data/test/test_engine/test/dummy/public/favicon.ico +0 -0
- data/test/test_engine/test/integration/navigation_test.rb +0 -10
- data/test/test_engine/test/test_engine_test.rb +0 -7
- data/test/test_engine/test/test_helper.rb +0 -15
- data/test/test_engine/test_engine.gemspec +0 -31
@@ -1 +0,0 @@
|
|
1
|
-
# Describe your engine here
|
@@ -1,34 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'bundler/setup'
|
3
|
-
rescue LoadError
|
4
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
-
end
|
6
|
-
|
7
|
-
require 'rdoc/task'
|
8
|
-
|
9
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
-
rdoc.rdoc_dir = 'rdoc'
|
11
|
-
rdoc.title = 'People'
|
12
|
-
rdoc.options << '--line-numbers'
|
13
|
-
rdoc.rdoc_files.include('README.rdoc')
|
14
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
|
-
end
|
16
|
-
|
17
|
-
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
18
|
-
load 'rails/tasks/engine.rake'
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
Bundler::GemHelper.install_tasks
|
23
|
-
|
24
|
-
require 'rake/testtask'
|
25
|
-
|
26
|
-
Rake::TestTask.new(:test) do |t|
|
27
|
-
t.libs << 'lib'
|
28
|
-
t.libs << 'test'
|
29
|
-
t.pattern = 'test/**/*_test.rb'
|
30
|
-
t.verbose = false
|
31
|
-
end
|
32
|
-
|
33
|
-
|
34
|
-
task default: :test
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require_tree .
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
-
* listed below.
|
4
|
-
*
|
5
|
-
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
-
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
-
*
|
8
|
-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
|
9
|
-
* compiled file so the styles you add here take precedence over styles defined in any styles
|
10
|
-
* defined in the other CSS/SCSS files in this directory. It is generally better to create a new
|
11
|
-
* file per style scope.
|
12
|
-
*
|
13
|
-
*= require_tree .
|
14
|
-
*= require_self
|
15
|
-
*/
|
@@ -1,56 +0,0 @@
|
|
1
|
-
body { background-color: #fff; color: #333; }
|
2
|
-
|
3
|
-
body, p, ol, ul, td {
|
4
|
-
font-family: verdana, arial, helvetica, sans-serif;
|
5
|
-
font-size: 13px;
|
6
|
-
line-height: 18px;
|
7
|
-
}
|
8
|
-
|
9
|
-
pre {
|
10
|
-
background-color: #eee;
|
11
|
-
padding: 10px;
|
12
|
-
font-size: 11px;
|
13
|
-
}
|
14
|
-
|
15
|
-
a { color: #000; }
|
16
|
-
a:visited { color: #666; }
|
17
|
-
a:hover { color: #fff; background-color:#000; }
|
18
|
-
|
19
|
-
div.field, div.actions {
|
20
|
-
margin-bottom: 10px;
|
21
|
-
}
|
22
|
-
|
23
|
-
#notice {
|
24
|
-
color: green;
|
25
|
-
}
|
26
|
-
|
27
|
-
.field_with_errors {
|
28
|
-
padding: 2px;
|
29
|
-
background-color: red;
|
30
|
-
display: table;
|
31
|
-
}
|
32
|
-
|
33
|
-
#error_explanation {
|
34
|
-
width: 450px;
|
35
|
-
border: 2px solid red;
|
36
|
-
padding: 7px;
|
37
|
-
padding-bottom: 0;
|
38
|
-
margin-bottom: 20px;
|
39
|
-
background-color: #f0f0f0;
|
40
|
-
}
|
41
|
-
|
42
|
-
#error_explanation h2 {
|
43
|
-
text-align: left;
|
44
|
-
font-weight: bold;
|
45
|
-
padding: 5px 5px 5px 15px;
|
46
|
-
font-size: 12px;
|
47
|
-
margin: -7px;
|
48
|
-
margin-bottom: 0px;
|
49
|
-
background-color: #c00;
|
50
|
-
color: #fff;
|
51
|
-
}
|
52
|
-
|
53
|
-
#error_explanation ul li {
|
54
|
-
font-size: 12px;
|
55
|
-
list-style: square;
|
56
|
-
}
|
@@ -1,124 +0,0 @@
|
|
1
|
-
require_dependency "people/api/v1/application_controller"
|
2
|
-
require 'authorization'
|
3
|
-
|
4
|
-
module People
|
5
|
-
class Api::V1::UsersController < Api::V1::ApplicationController
|
6
|
-
skip_before_filter :authenticate_user, :only => [:register, :login]
|
7
|
-
before_action :set_user, only: [:show, :edit, :update]
|
8
|
-
before_action :register_authorize, only: [:register]
|
9
|
-
before_action :login_authorize, only: [:login]
|
10
|
-
before_action :logout_authorize, only: [:logout]
|
11
|
-
before_action :index_authorize, only: [:index]
|
12
|
-
before_action :show_authorize, only: [:show]
|
13
|
-
before_action :update_authorize, only: [:update]
|
14
|
-
|
15
|
-
# POST /api/1/users/register
|
16
|
-
def register
|
17
|
-
#Create a new user
|
18
|
-
user = ::People::User.new(user_params)
|
19
|
-
if user.save
|
20
|
-
#If the user is saved, return a token
|
21
|
-
token = user.tokens[0]
|
22
|
-
render :json => {user: user, token: token}
|
23
|
-
else
|
24
|
-
#Return an error if not saved
|
25
|
-
render :json => {errors: user.errors}, status: :unprocessable_entity
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
# POST /api/1/users/login
|
30
|
-
def login
|
31
|
-
#Should I delete the current token or ignore it?
|
32
|
-
#Find user from email and password. Create and return a new token
|
33
|
-
user = ::People::User.find_by(email: params[:email])
|
34
|
-
if user && user.authenticate(params[:password])
|
35
|
-
token = user.tokens.create
|
36
|
-
render :json => {user: user, token: token}
|
37
|
-
else
|
38
|
-
render :json => {errors: "Email and/or Password is incorrect"}, status: :unauthorized
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
# GET /api/1/users/logout
|
43
|
-
def logout
|
44
|
-
#Destroy the current token
|
45
|
-
token = current_token
|
46
|
-
token.destroy
|
47
|
-
render json: {}
|
48
|
-
end
|
49
|
-
|
50
|
-
# GET /api/1/users
|
51
|
-
def index
|
52
|
-
@users = ::People::User.all
|
53
|
-
render json: @users
|
54
|
-
end
|
55
|
-
|
56
|
-
# GET /api/1/users/1
|
57
|
-
def show
|
58
|
-
render json: @user
|
59
|
-
end
|
60
|
-
|
61
|
-
# PATCH/PUT /api/1/users/1
|
62
|
-
def update
|
63
|
-
if @user.update(user_params)
|
64
|
-
render json: @user
|
65
|
-
else
|
66
|
-
render :json => {errors: @user.errors}, status: :unprocessable_entity
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
private
|
71
|
-
# Use callbacks to share common setup or constraints between actions.
|
72
|
-
|
73
|
-
def set_user
|
74
|
-
@user = ::People::User.find_by_id(params[:id])
|
75
|
-
if @user.nil?
|
76
|
-
render :json => {errors: "User was not found"}, status: :not_found
|
77
|
-
end
|
78
|
-
end
|
79
|
-
|
80
|
-
# Only allow a trusted parameter "white list" through.
|
81
|
-
|
82
|
-
def user_params
|
83
|
-
params.require(:user).permit(:username, :email, :password, :password_confirmation)
|
84
|
-
end
|
85
|
-
|
86
|
-
# Authorizations below here
|
87
|
-
|
88
|
-
def register_authorize
|
89
|
-
if !::Authorization::People::User.register?
|
90
|
-
render :json => {errors: "User is not authorized for this action"}, status: :forbidden
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
def login_authorize
|
95
|
-
if !::Authorization::People::User.login?
|
96
|
-
render :json => {errors: "User is not authorized for this action"}, status: :forbidden
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
def logout_authorize
|
101
|
-
if !::Authorization::People::User.logout?(current_user)
|
102
|
-
render :json => {errors: "User is not authorized for this action"}, status: :forbidden
|
103
|
-
end
|
104
|
-
end
|
105
|
-
|
106
|
-
def index_authorize
|
107
|
-
if !::Authorization::People::User.index?(current_user)
|
108
|
-
render :json => {errors: "User is not authorized for this action"}, status: :forbidden
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
def show_authorize
|
113
|
-
if !::Authorization::People::User.show?(@user,current_user)
|
114
|
-
render :json => {errors: "User is not authorized for this action"}, status: :forbidden
|
115
|
-
end
|
116
|
-
end
|
117
|
-
|
118
|
-
def update_authorize
|
119
|
-
if !::Authorization::People::User.update?(@user,current_user)
|
120
|
-
render :json => {errors: "User is not authorized for this action"}, status: :forbidden
|
121
|
-
end
|
122
|
-
end
|
123
|
-
end
|
124
|
-
end
|
@@ -1,62 +0,0 @@
|
|
1
|
-
require_dependency "people/application_controller"
|
2
|
-
|
3
|
-
module People
|
4
|
-
class UsersController < ApplicationController
|
5
|
-
before_action :set_user, only: [:show, :edit, :update, :destroy]
|
6
|
-
|
7
|
-
# GET /users
|
8
|
-
def index
|
9
|
-
@users = User.all
|
10
|
-
end
|
11
|
-
|
12
|
-
# GET /users/1
|
13
|
-
def show
|
14
|
-
end
|
15
|
-
|
16
|
-
# GET /users/new
|
17
|
-
def new
|
18
|
-
@user = User.new
|
19
|
-
end
|
20
|
-
|
21
|
-
# GET /users/1/edit
|
22
|
-
def edit
|
23
|
-
end
|
24
|
-
|
25
|
-
# POST /users
|
26
|
-
def create
|
27
|
-
@user = User.new(user_params)
|
28
|
-
|
29
|
-
if @user.save
|
30
|
-
redirect_to @user, notice: 'User was successfully created.'
|
31
|
-
else
|
32
|
-
render :new
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
# PATCH/PUT /users/1
|
37
|
-
def update
|
38
|
-
if @user.update(user_params)
|
39
|
-
redirect_to @user, notice: 'User was successfully updated.'
|
40
|
-
else
|
41
|
-
render :edit
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
# DELETE /users/1
|
46
|
-
def destroy
|
47
|
-
@user.destroy
|
48
|
-
redirect_to users_url, notice: 'User was successfully destroyed.'
|
49
|
-
end
|
50
|
-
|
51
|
-
private
|
52
|
-
# Use callbacks to share common setup or constraints between actions.
|
53
|
-
def set_user
|
54
|
-
@user = User.find(params[:id])
|
55
|
-
end
|
56
|
-
|
57
|
-
# Only allow a trusted parameter "white list" through.
|
58
|
-
def user_params
|
59
|
-
params.require(:user).permit(:username, :email, :password_digest)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
require 'type_cartographer'
|
2
|
-
|
3
|
-
module People
|
4
|
-
class User < ActiveRecord::Base
|
5
|
-
|
6
|
-
has_many :tokens, :as => :imageable, :class_name => "::Arcadex::Token"
|
7
|
-
|
8
|
-
has_secure_password
|
9
|
-
|
10
|
-
after_create :setup_user
|
11
|
-
|
12
|
-
validates :username, presence: true
|
13
|
-
#validates_format_of :username, :with => /\A[A-Za-z0-9\d]+\Z/i
|
14
|
-
validates :email, presence: true
|
15
|
-
#Might need a regex for emails, or just rather confirm them
|
16
|
-
|
17
|
-
def setup_user
|
18
|
-
create_token
|
19
|
-
end
|
20
|
-
|
21
|
-
def create_token
|
22
|
-
self.tokens.create!
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require 'authorization'
|
2
|
-
|
3
|
-
module People
|
4
|
-
class UserSerializer < ActiveModel::Serializer
|
5
|
-
embed :ids, include: true
|
6
|
-
|
7
|
-
attributes :id
|
8
|
-
attributes :username
|
9
|
-
attributes :email
|
10
|
-
attributes :created_at
|
11
|
-
attributes :updated_at
|
12
|
-
has_many :tokens
|
13
|
-
|
14
|
-
def include_id?
|
15
|
-
return ::Authorization::People::User.include_id?(current_user,object,@options)
|
16
|
-
end
|
17
|
-
|
18
|
-
def include_email?
|
19
|
-
return ::Authorization::People::User.include_email?(current_user,object,@options)
|
20
|
-
end
|
21
|
-
|
22
|
-
def include_username?
|
23
|
-
return ::Authorization::People::User.include_username?(current_user,object,@options)
|
24
|
-
end
|
25
|
-
|
26
|
-
def include_created_at?
|
27
|
-
return ::Authorization::People::User.include_created_at?(current_user,object,@options)
|
28
|
-
end
|
29
|
-
|
30
|
-
def include_updated_at?
|
31
|
-
return ::Authorization::People::User.include_updated_at?(current_user,object,@options)
|
32
|
-
end
|
33
|
-
|
34
|
-
def include_associations!
|
35
|
-
include! :tokens if ::Authorization::People::User.include_tokens?(current_user,object,@options)
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
end
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>People</title>
|
5
|
-
<%= stylesheet_link_tag "people/application", media: "all" %>
|
6
|
-
<%= javascript_include_tag "people/application" %>
|
7
|
-
<%= csrf_meta_tags %>
|
8
|
-
</head>
|
9
|
-
<body>
|
10
|
-
|
11
|
-
<%= yield %>
|
12
|
-
|
13
|
-
</body>
|
14
|
-
</html>
|
@@ -1,29 +0,0 @@
|
|
1
|
-
<%= form_for(@user) do |f| %>
|
2
|
-
<% if @user.errors.any? %>
|
3
|
-
<div id="error_explanation">
|
4
|
-
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
|
5
|
-
|
6
|
-
<ul>
|
7
|
-
<% @user.errors.full_messages.each do |message| %>
|
8
|
-
<li><%= message %></li>
|
9
|
-
<% end %>
|
10
|
-
</ul>
|
11
|
-
</div>
|
12
|
-
<% end %>
|
13
|
-
|
14
|
-
<div class="field">
|
15
|
-
<%= f.label :username %><br>
|
16
|
-
<%= f.text_field :username %>
|
17
|
-
</div>
|
18
|
-
<div class="field">
|
19
|
-
<%= f.label :email %><br>
|
20
|
-
<%= f.text_field :email %>
|
21
|
-
</div>
|
22
|
-
<div class="field">
|
23
|
-
<%= f.label :password_digest %><br>
|
24
|
-
<%= f.text_field :password_digest %>
|
25
|
-
</div>
|
26
|
-
<div class="actions">
|
27
|
-
<%= f.submit %>
|
28
|
-
</div>
|
29
|
-
<% end %>
|