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
File without changes
|
data/lib/generators/json_voorhees/{setup_app → app_make_user}/templates/user/user_serializer.rb
RENAMED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'authorization'
|
2
2
|
|
3
3
|
module People
|
4
|
-
class UserSerializer < ActiveModel::Serializer
|
4
|
+
class V1::UserSerializer < ActiveModel::Serializer
|
5
5
|
embed :ids, include: true
|
6
6
|
|
7
7
|
attributes :id
|
@@ -14,28 +14,28 @@ module People
|
|
14
14
|
<% end %>
|
15
15
|
|
16
16
|
def include_id?
|
17
|
-
return ::Authorization::V1::
|
17
|
+
return ::Authorization::People::V1::User.include_id?(current_user,object,@options)
|
18
18
|
end
|
19
19
|
|
20
20
|
def include_email?
|
21
|
-
return ::Authorization::V1::
|
21
|
+
return ::Authorization::People::V1::User.include_email?(current_user,object,@options)
|
22
22
|
end
|
23
23
|
|
24
24
|
def include_username?
|
25
|
-
return ::Authorization::V1::
|
25
|
+
return ::Authorization::People::V1::User.include_username?(current_user,object,@options)
|
26
26
|
end
|
27
27
|
|
28
28
|
def include_created_at?
|
29
|
-
return ::Authorization::V1::
|
29
|
+
return ::Authorization::People::V1::User.include_created_at?(current_user,object,@options)
|
30
30
|
end
|
31
31
|
|
32
32
|
def include_updated_at?
|
33
|
-
return ::Authorization::V1::
|
33
|
+
return ::Authorization::People::V1::User.include_updated_at?(current_user,object,@options)
|
34
34
|
end
|
35
35
|
|
36
36
|
def include_associations!
|
37
37
|
<% if options.arcadex? %>
|
38
|
-
include! :tokens if ::Authorization::V1::
|
38
|
+
include! :tokens if ::Authorization::People::V1::User.include_tokens?(current_user,object,@options)
|
39
39
|
<% end %>
|
40
40
|
end
|
41
41
|
|
data/lib/generators/json_voorhees/engine_create_controller/templates/controller_template.rb.erb
CHANGED
@@ -12,7 +12,7 @@ module <%= module_camel %>
|
|
12
12
|
|
13
13
|
# GET /api/<%= api_version %>/<%= resource_plural %>
|
14
14
|
def index
|
15
|
-
@<%= resource_plural %> = ::<%= module_camel %>::<%= resource_camel %>.all
|
15
|
+
@<%= resource_plural %> = ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.all
|
16
16
|
render json: @<%= resource_plural %>
|
17
17
|
end
|
18
18
|
|
@@ -23,7 +23,7 @@ module <%= module_camel %>
|
|
23
23
|
|
24
24
|
# POST /api/<%= api_version %>/<%= resource_plural %>
|
25
25
|
def create
|
26
|
-
@<%= resource_singular %> = ::<%= module_camel %>::<%= resource_camel %>.new(<%= resource_singular %>_params)
|
26
|
+
@<%= resource_singular %> = ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.new(<%= resource_singular %>_params)
|
27
27
|
if @<%= resource_singular %>.save
|
28
28
|
render json: @<%= resource_singular %>
|
29
29
|
else
|
@@ -51,7 +51,7 @@ module <%= module_camel %>
|
|
51
51
|
# Use callbacks to share common setup or constraints between actions.
|
52
52
|
|
53
53
|
def set_<%= resource_singular %>
|
54
|
-
@<%= resource_singular %> = ::<%= module_camel %>::<%= resource_camel %>.find_by_id(params[:id])
|
54
|
+
@<%= resource_singular %> = ::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.find_by_id(params[:id])
|
55
55
|
if @<%= resource_singular %>.nil?
|
56
56
|
render :json => {errors: "<%= resource_camel %> was not found"}, status: :not_found
|
57
57
|
end
|
@@ -66,31 +66,31 @@ module <%= module_camel %>
|
|
66
66
|
# Authorizations below here
|
67
67
|
|
68
68
|
def index_authorize
|
69
|
-
if !::Authorization
|
69
|
+
if !::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.index?(current_user)
|
70
70
|
render :json => {errors: "User is not authorized for this action"}, status: :forbidden
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
74
|
def show_authorize
|
75
|
-
if !::Authorization
|
75
|
+
if !::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.show?(@<%= resource_singular %>,current_user)
|
76
76
|
render :json => {errors: "User is not authorized for this action"}, status: :forbidden
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
80
|
def create_authorize
|
81
|
-
if !::Authorization
|
81
|
+
if !::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.create?(current_user)
|
82
82
|
render :json => {errors: "User is not authorized for this action"}, status: :forbidden
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
86
|
def update_authorize
|
87
|
-
if !::Authorization
|
87
|
+
if !::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.update?(@<%= resource_singular %>,current_user)
|
88
88
|
render :json => {errors: "User is not authorized for this action"}, status: :forbidden
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
92
|
def destroy_authorize
|
93
|
-
if !::Authorization
|
93
|
+
if !::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.destroy?(@<%= resource_singular %>,current_user)
|
94
94
|
render :json => {errors: "User is not authorized for this action"}, status: :forbidden
|
95
95
|
end
|
96
96
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module JsonVoorhees
|
2
|
+
class EngineCreateModelGenerator < Rails::Generators::Base
|
3
|
+
source_root File.expand_path('../templates', __FILE__)
|
4
|
+
argument :module_name, :type => :string
|
5
|
+
argument :resource_name, :type => :string
|
6
|
+
argument :api_version, :type => :string, :default => "1"
|
7
|
+
argument :attributes, type: :array, default: [], banner: "field:type field:type"
|
8
|
+
|
9
|
+
def sprint
|
10
|
+
template "model.rb", "app/models/#{module_snake}/v#{api_version}/#{resource_singular}.rb"
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def resource_singular
|
16
|
+
resource_name.underscore.singularize
|
17
|
+
end
|
18
|
+
|
19
|
+
def resource_plural
|
20
|
+
resource_name.underscore.pluralize
|
21
|
+
end
|
22
|
+
|
23
|
+
def resource_camel
|
24
|
+
resource_name.camelize.singularize
|
25
|
+
end
|
26
|
+
|
27
|
+
def module_camel
|
28
|
+
module_name.camelize
|
29
|
+
end
|
30
|
+
|
31
|
+
def module_snake
|
32
|
+
module_name.underscore.downcase
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
data/lib/generators/json_voorhees/engine_create_serializer/engine_create_serializer_generator.rb
CHANGED
@@ -7,7 +7,7 @@ module JsonVoorhees
|
|
7
7
|
argument :attributes, type: :array, default: [], banner: "field:type field:type"
|
8
8
|
|
9
9
|
def sprint
|
10
|
-
template "serializer.rb.erb", "app/serializers/#{module_name.underscore}/#{resource_singular}_serializer.rb"
|
10
|
+
template "serializer.rb.erb", "app/serializers/#{module_name.underscore}/v#{api_version}/#{resource_singular}_serializer.rb"
|
11
11
|
end
|
12
12
|
|
13
13
|
private
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'authorization'
|
2
2
|
|
3
3
|
module <%= module_camel %>
|
4
|
-
class <%= resource_camel %>Serializer < ActiveModel::Serializer
|
4
|
+
class V<%= api_version %>::<%= resource_camel %>Serializer < ActiveModel::Serializer
|
5
5
|
embed :ids, include: true
|
6
6
|
|
7
7
|
attributes :id
|
@@ -11,25 +11,25 @@ module <%= module_camel %>
|
|
11
11
|
#has_many :posts
|
12
12
|
|
13
13
|
def include_id?
|
14
|
-
return ::Authorization
|
14
|
+
return ::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.include_id?(current_user,object,@options)
|
15
15
|
end
|
16
16
|
|
17
17
|
<% attributes.each do |pair| %>
|
18
18
|
def include_<%= pair.split(/:/)[0] %>?(current_user,<%= resource_singular %>_object,options)
|
19
|
-
return ::Authorization
|
19
|
+
return ::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.include_created_at?(current_user,object,@options)
|
20
20
|
end
|
21
21
|
<% end %>
|
22
22
|
def include_created_at?
|
23
|
-
return ::Authorization
|
23
|
+
return ::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.include_created_at?(current_user,object,@options)
|
24
24
|
end
|
25
25
|
|
26
26
|
def include_updated_at?
|
27
|
-
return ::Authorization
|
27
|
+
return ::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.include_updated_at?(current_user,object,@options)
|
28
28
|
end
|
29
29
|
|
30
30
|
def include_associations!
|
31
|
-
#include! :bulletin if ::Authorization
|
32
|
-
#include! :posts if ::Authorization
|
31
|
+
#include! :bulletin if ::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.include_bulletin?(current_user,object,@options)
|
32
|
+
#include! :posts if ::Authorization::<%= module_camel %>::V<%= api_version %>::<%= resource_camel %>.include_posts?(current_user,object,@options)
|
33
33
|
end
|
34
34
|
|
35
35
|
end
|
@@ -6,7 +6,8 @@ module JsonVoorhees
|
|
6
6
|
argument :api_version, :type => :string, :default => "1"
|
7
7
|
argument :attributes, type: :array, default: [], banner: "field:type field:type"
|
8
8
|
class_option :arcadex, :type => :boolean, :default => true, :description => "Include authorization in controller"
|
9
|
-
|
9
|
+
class_option :model, :type => :boolean, :default => true, :description => "Create namespaced model"
|
10
|
+
|
10
11
|
def sprint
|
11
12
|
if options.arcadex?
|
12
13
|
run "rails g json_voorhees:engine_create_controller #{module_name} #{resource_name} #{api_version} #{attributes.join(" ")}"
|
@@ -15,6 +16,9 @@ module JsonVoorhees
|
|
15
16
|
run "rails g json_voorhees:engine_create_controller --skip-arcadex #{module_name} #{resource_name} #{api_version} #{attributes.join(" ")}"
|
16
17
|
run "rails g json_voorhees:engine_create_serializer --skip-arcadex #{module_name} #{resource_name} #{api_version} #{attributes.join(" ")}"
|
17
18
|
end
|
19
|
+
if options.model?
|
20
|
+
run "rails g json_voorhees:engine_create_model #{module_name} #{resource_name} #{api_version} #{attributes.join(" ")}"
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
24
|
private
|
@@ -14,8 +14,13 @@ module JsonVoorhees
|
|
14
14
|
def sprint
|
15
15
|
inside "engines/#{module_name.underscore}" do
|
16
16
|
if options.both?
|
17
|
-
|
18
|
-
|
17
|
+
# We should skip making the migration if this is not version 1
|
18
|
+
if api_version != "1"
|
19
|
+
run "rails g scaffold #{resource_name} #{attributes.join(" ")} --no-migration "
|
20
|
+
else
|
21
|
+
run "rails g scaffold #{resource_name} #{attributes.join(" ")}"
|
22
|
+
end
|
23
|
+
end
|
19
24
|
if options.arcadex?
|
20
25
|
run "rails g json_voorhees:engine_scaffold #{module_name} #{resource_name} #{api_version} #{attributes.join(" ")}"
|
21
26
|
else
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module JsonVoorhees
|
2
2
|
class SetupAppGenerator < Rails::Generators::Base
|
3
3
|
source_root File.expand_path('../templates', __FILE__)
|
4
|
-
#argument :user_class, :type => :string
|
5
4
|
class_option :arcadex, :type => :boolean, :default => true, :description => "Include arcadex gem and authentication in api_controller"
|
6
5
|
class_option :user, :type => :boolean, :default => true, :description => "Create an engine for the user class"
|
7
6
|
class_option :test, :type => :boolean, :default => false, :description => "Set true if running tests to skip things like bundle update and git"
|
@@ -9,8 +8,7 @@ module JsonVoorhees
|
|
9
8
|
|
10
9
|
def sprint
|
11
10
|
create_file_structure
|
12
|
-
|
13
|
-
other_gems
|
11
|
+
all_gems
|
14
12
|
run_bundle
|
15
13
|
rspec
|
16
14
|
api_controller
|
@@ -19,41 +17,40 @@ module JsonVoorhees
|
|
19
17
|
make_admin
|
20
18
|
end
|
21
19
|
if options.user?
|
22
|
-
|
20
|
+
make_user
|
23
21
|
end
|
24
22
|
routes
|
25
23
|
make_controllers
|
26
|
-
#seed db?
|
27
|
-
#fancier admin?
|
28
24
|
run_git
|
29
25
|
end
|
30
26
|
|
31
27
|
private
|
32
28
|
|
33
29
|
def make_admin
|
30
|
+
if !options.arcadex? && !options.user?
|
31
|
+
run "rails g json_voorhees:app_make_admin --skip-arcadex --skip-user"
|
32
|
+
end
|
33
|
+
if !options.arcadex? && options.user?
|
34
|
+
run "rails g json_voorhees:app_make_admin --skip-arcadex"
|
35
|
+
end
|
36
|
+
if !options.user? && options.arcadex?
|
37
|
+
run "rails g json_voorhees:app_make_admin --skip-user"
|
38
|
+
end
|
34
39
|
if options.user? && options.arcadex?
|
35
|
-
|
36
|
-
copy_file "views/admin_home_with_user", "app/views/main/admin.html.erb"
|
37
|
-
else
|
38
|
-
#copy admin page without user engine
|
39
|
-
copy_file "views/admin_home_no_user", "app/views/main/admin.html.erb"
|
40
|
+
run "rails g json_voorhees:app_make_admin"
|
40
41
|
end
|
41
|
-
|
42
|
-
copy_file "views/application", "app/views/layouts/application.html.erb"
|
43
|
-
template "views/_header.html.erb", "app/views/layouts/_header.html.erb"
|
44
|
-
copy_file "views/_footer.html.erb", "app/views/layouts/_footer.html.erb"
|
45
|
-
inject_into_file 'app/controllers/application_controller.rb', after: "protect_from_forgery with: :exception\n" do <<-'RUBY'
|
46
|
-
|
47
|
-
#This needs to be put inside a config file. but this is good for now
|
48
|
-
#This only requires the password for the admin section of the website
|
49
|
-
http_basic_authenticate_with name: "admin", password: "password"
|
42
|
+
end
|
50
43
|
|
51
|
-
|
44
|
+
def make_user
|
45
|
+
if !options.arcadex?
|
46
|
+
run "rails g json_voorhees:app_make_user --skip-arcadex"
|
47
|
+
else
|
48
|
+
run "rails g json_voorhees:app_make_user"
|
52
49
|
end
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
50
|
+
run_bundle
|
51
|
+
run "rake railties:install:migrations"
|
52
|
+
run_db_migrations
|
53
|
+
end
|
57
54
|
|
58
55
|
def include_middleware
|
59
56
|
inject_into_file 'config/application.rb', after: "class Application < Rails::Application\n" do <<-'RUBY'
|
@@ -81,76 +78,6 @@ module JsonVoorhees
|
|
81
78
|
copy_file "views/app", "app/views/app_index/app.html.erb"
|
82
79
|
copy_file "views/app_index", "app/views/layouts/app_index.html.erb"
|
83
80
|
end
|
84
|
-
|
85
|
-
def run_db_migrations
|
86
|
-
run "rake db:migrate RAILS_ENV=development"
|
87
|
-
run "rake db:migrate RAILS_ENV=test"
|
88
|
-
run "rake db:migrate RAILS_ENV=production"
|
89
|
-
end
|
90
|
-
|
91
|
-
def run_git
|
92
|
-
if !options.test?
|
93
|
-
git :init
|
94
|
-
git add: "."
|
95
|
-
run "git commit -m \"Initial commit\""
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
def people
|
100
|
-
run "rails plugin new engines/people --mountable"
|
101
|
-
inside('engines/people') do
|
102
|
-
#This needs to run the generator for setting up engines
|
103
|
-
run "rails g json_voorhees:setup_engine people"
|
104
|
-
add_generator
|
105
|
-
#Now it needs to create the user class
|
106
|
-
run "rails g scaffold user username:string:uniq email:string:uniq password_digest:string"
|
107
|
-
#Add this to the routes and gemfile
|
108
|
-
end
|
109
|
-
#Need to add the engine to the main_apps gemfile
|
110
|
-
route "mount People::Engine, at: \'/\'"
|
111
|
-
if options.arcadex?
|
112
|
-
copy_user_files_over
|
113
|
-
route "mount Arcadex::Engine, at: \'/\'"
|
114
|
-
end
|
115
|
-
insert_people_engine
|
116
|
-
run_bundle
|
117
|
-
run "rake railties:install:migrations"
|
118
|
-
run_db_migrations
|
119
|
-
end
|
120
|
-
|
121
|
-
def add_generator
|
122
|
-
inject_into_file "people.gemspec", after: "s.test_files = Dir[\"test/**/*\"]\n" do <<-'RUBY'
|
123
|
-
|
124
|
-
s.add_development_dependency "json_voorhees"
|
125
|
-
|
126
|
-
RUBY
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
def insert_people_engine
|
131
|
-
inject_into_file 'Gemfile', after: "source \'https://rubygems.org\'\n" do <<-'RUBY'
|
132
|
-
|
133
|
-
gem 'people', :path => "engines/people"
|
134
|
-
|
135
|
-
RUBY
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
|
-
def copy_user_files_over
|
140
|
-
template "user/user_authorizations.rb", "gems/authorization/lib/authorization/v1/people/user.rb"
|
141
|
-
run "rm -f gems/authorization/lib/authorization.rb"
|
142
|
-
template "user/include_authorization.rb", "gems/authorization/lib/authorization.rb"
|
143
|
-
template "user/user_controller.rb", "engines/people/app/controllers/people/api/v1/users_controller.rb"
|
144
|
-
run "rm -f engines/people/app/models/people/user.rb"
|
145
|
-
template "user/user_model.rb", "engines/people/app/models/people/user.rb"
|
146
|
-
run "rm -f engines/people/config/routes.rb"
|
147
|
-
template "user/user_routes.rb", "engines/people/config/routes.rb"
|
148
|
-
template "user/user_serializer.rb", "engines/people/app/serializers/people/user_serializer.rb"
|
149
|
-
template "user/specs/factory_girl.rb", "spec/factories/people_user_factory.rb"
|
150
|
-
template "user/specs/model_specs.rb", "spec/engines/people/api/v1/models/user_spec.rb"
|
151
|
-
template "user/specs/request_specs.rb", "spec/engines/people/api/v1/requests/user_spec.rb"
|
152
|
-
template "user/specs/route_specs.rb", "spec/engines/people/api/v1/routing/user_spec.rb"
|
153
|
-
end
|
154
81
|
|
155
82
|
def api_controller
|
156
83
|
if options.arcadex?
|
@@ -175,44 +102,36 @@ module JsonVoorhees
|
|
175
102
|
copy_file "json_helpers.rb", "spec/support/request_helpers.rb"
|
176
103
|
end
|
177
104
|
|
178
|
-
def
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
105
|
+
def all_gems
|
106
|
+
# Dev gems
|
107
|
+
gem_group :development, :test do
|
108
|
+
#gem 'sqlite3', '~> 1.3.9' # dev & test database
|
109
|
+
gem 'figaro', '~> 0.7.0' # env variables
|
110
|
+
gem 'annotate', ">=2.6.0"
|
111
|
+
gem "better_errors", '~> 1.1.0'
|
112
|
+
gem "binding_of_caller", "~> 0.7.1" # needed by better_errors or variable inspection
|
113
|
+
gem 'rspec-rails', '~> 3.0.0'
|
114
|
+
gem 'byebug', '~> 3.2.0'
|
115
|
+
gem "factory_girl_rails", "~> 4.0"
|
116
|
+
gem "database_cleaner", '~> 1.3.0'
|
117
|
+
end
|
118
|
+
# Other gems
|
119
|
+
gem 'authorization', :path => "gems/authorization"
|
120
|
+
# This ties in nicely with Ember, 0.8.0 is the stable version
|
121
|
+
gem "active_model_serializers", "~> 0.8.0"
|
122
|
+
# This is the api of choice now
|
123
|
+
gem "rails-api"
|
124
|
+
gem 'kaminari'
|
125
|
+
gem 'bcrypt', '~> 3.1.7'
|
126
|
+
gem 'type_cartographer'
|
127
|
+
gem 'devise', "~> 3.2.4"
|
128
|
+
if options.arcadex?
|
129
|
+
gem 'arcadex'#, '~> 1.0.4'
|
130
|
+
end
|
198
131
|
if options.admin?
|
199
132
|
gem 'autoprefixer-rails'
|
200
133
|
gem 'bootstrap-sass', '~> 3.2.0'
|
201
134
|
end
|
202
|
-
end
|
203
|
-
|
204
|
-
def dev_test_gems
|
205
|
-
gem_group :development, :test do
|
206
|
-
#gem 'sqlite3', '~> 1.3.9' # dev & test database
|
207
|
-
gem 'figaro', '~> 0.7.0' # env variables
|
208
|
-
gem 'annotate', ">=2.6.0"
|
209
|
-
gem "better_errors", '~> 1.1.0'
|
210
|
-
gem "binding_of_caller", "~> 0.7.1" # needed by better_errors or variable inspection
|
211
|
-
gem 'rspec-rails', '~> 3.0.0'
|
212
|
-
gem 'byebug', '~> 3.2.0'
|
213
|
-
gem "factory_girl_rails", "~> 4.0"
|
214
|
-
gem "database_cleaner", '~> 1.3.0'
|
215
|
-
end
|
216
135
|
end
|
217
136
|
|
218
137
|
def create_file_structure
|
@@ -225,5 +144,26 @@ module JsonVoorhees
|
|
225
144
|
run "rails plugin new gems/authorization"
|
226
145
|
end
|
227
146
|
|
147
|
+
def run_bundle
|
148
|
+
if !options.test?
|
149
|
+
run "bundle update"
|
150
|
+
run "bundle install"
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
def run_db_migrations
|
155
|
+
run "rake db:migrate RAILS_ENV=development"
|
156
|
+
run "rake db:migrate RAILS_ENV=test"
|
157
|
+
run "rake db:migrate RAILS_ENV=production"
|
158
|
+
end
|
159
|
+
|
160
|
+
def run_git
|
161
|
+
if !options.test?
|
162
|
+
git :init
|
163
|
+
git add: "."
|
164
|
+
run "git commit -m \"Initial commit\""
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
228
168
|
end
|
229
169
|
end
|