jets_bb_fork 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/bin/commit_docs.sh +26 -0
- data/.circleci/config.yml +126 -0
- data/.codebuild/README.md +68 -0
- data/.codebuild/bin/jets +3 -0
- data/.codebuild/buildspec-base.yml +14 -0
- data/.codebuild/integration.sh +72 -0
- data/.codebuild/jets.postman_collection.json +323 -0
- data/.codebuild/scripts/install-docker.sh +12 -0
- data/.codebuild/scripts/install-dynamodb-local.sh +22 -0
- data/.codebuild/scripts/install-java.sh +22 -0
- data/.codebuild/scripts/install-node.sh +4 -0
- data/.github/ISSUE_TEMPLATE.md +7 -0
- data/.github/ISSUE_TEMPLATE/bug_report.md +84 -0
- data/.github/ISSUE_TEMPLATE/documentation.md +27 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +64 -0
- data/.github/ISSUE_TEMPLATE/question.md +16 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +42 -0
- data/.gitignore +24 -0
- data/.gitmodules +0 -0
- data/.python-version +1 -0
- data/.rspec +4 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +734 -0
- data/CONDUCT.md +1 -0
- data/CONTRIBUTING.md +1 -0
- data/Dockerfile +16 -0
- data/Dockerfile.base +53 -0
- data/Gemfile +14 -0
- data/Guardfile +22 -0
- data/LICENSE.txt +22 -0
- data/Procfile +2 -0
- data/README.md +203 -0
- data/Rakefile +24 -0
- data/backers.md +16 -0
- data/bin/release +9 -0
- data/buildspec.yml +18 -0
- data/exe/jets_bb_fork +14 -0
- data/jets.gemspec +68 -0
- data/lib/jets.rb +27 -0
- data/lib/jets/application.rb +216 -0
- data/lib/jets/application/defaults.rb +172 -0
- data/lib/jets/autoloaders.rb +97 -0
- data/lib/jets/aws_info.rb +113 -0
- data/lib/jets/aws_services.rb +65 -0
- data/lib/jets/aws_services/global_memoist.rb +57 -0
- data/lib/jets/aws_services/s3_bucket.rb +34 -0
- data/lib/jets/aws_services/stack_status.rb +59 -0
- data/lib/jets/booter.rb +119 -0
- data/lib/jets/builders/code_builder.rb +399 -0
- data/lib/jets/builders/code_size.rb +57 -0
- data/lib/jets/builders/gem_replacer.rb +76 -0
- data/lib/jets/builders/handler_generator.rb +186 -0
- data/lib/jets/builders/lambda_layer.rb +69 -0
- data/lib/jets/builders/md5.rb +60 -0
- data/lib/jets/builders/md5_zip.rb +61 -0
- data/lib/jets/builders/purger.rb +35 -0
- data/lib/jets/builders/rack_packager.rb +51 -0
- data/lib/jets/builders/rackup_wrappers/rackup +19 -0
- data/lib/jets/builders/rackup_wrappers/rackup.rb +7 -0
- data/lib/jets/builders/reconfigure_rails.rb +114 -0
- data/lib/jets/builders/reconfigure_rails/config/initializers/jets.rb +16 -0
- data/lib/jets/builders/ruby_packager.rb +207 -0
- data/lib/jets/builders/shim_vars/app.rb +78 -0
- data/lib/jets/builders/shim_vars/base.rb +25 -0
- data/lib/jets/builders/shim_vars/shared.rb +37 -0
- data/lib/jets/builders/templates/handler.rb +12 -0
- data/lib/jets/builders/tidy.rb +107 -0
- data/lib/jets/builders/util.rb +31 -0
- data/lib/jets/bundle.rb +82 -0
- data/lib/jets/camelizer.rb +71 -0
- data/lib/jets/cfn/builders/api_deployment_builder.rb +63 -0
- data/lib/jets/cfn/builders/api_gateway_builder.rb +157 -0
- data/lib/jets/cfn/builders/base_child_builder.rb +75 -0
- data/lib/jets/cfn/builders/controller_builder.rb +42 -0
- data/lib/jets/cfn/builders/function_builder.rb +14 -0
- data/lib/jets/cfn/builders/interface.rb +137 -0
- data/lib/jets/cfn/builders/job_builder.rb +14 -0
- data/lib/jets/cfn/builders/paged.rb +37 -0
- data/lib/jets/cfn/builders/parent_builder.rb +100 -0
- data/lib/jets/cfn/builders/rule_builder.rb +24 -0
- data/lib/jets/cfn/builders/shared_builder.rb +14 -0
- data/lib/jets/cfn/ship.rb +185 -0
- data/lib/jets/cfn/status.rb +212 -0
- data/lib/jets/cfn/upload.rb +139 -0
- data/lib/jets/cli.rb +194 -0
- data/lib/jets/commands/base.rb +146 -0
- data/lib/jets/commands/build.rb +234 -0
- data/lib/jets/commands/call.rb +169 -0
- data/lib/jets/commands/call/anonymous_guesser.rb +96 -0
- data/lib/jets/commands/call/autoload_guesser.rb +136 -0
- data/lib/jets/commands/call/base_guesser.rb +60 -0
- data/lib/jets/commands/call/guesser.rb +48 -0
- data/lib/jets/commands/clean.rb +19 -0
- data/lib/jets/commands/clean/base.rb +24 -0
- data/lib/jets/commands/clean/build.rb +13 -0
- data/lib/jets/commands/clean/log.rb +107 -0
- data/lib/jets/commands/console.rb +12 -0
- data/lib/jets/commands/db.rb +13 -0
- data/lib/jets/commands/db/environment-task.rake +3 -0
- data/lib/jets/commands/db/tasks.rb +44 -0
- data/lib/jets/commands/dbconsole.rb +131 -0
- data/lib/jets/commands/delete.rb +143 -0
- data/lib/jets/commands/deploy.rb +141 -0
- data/lib/jets/commands/dynamodb.rb +19 -0
- data/lib/jets/commands/dynamodb/migrate.rb +9 -0
- data/lib/jets/commands/dynamodb/migrator.rb +36 -0
- data/lib/jets/commands/gems.rb +21 -0
- data/lib/jets/commands/help.rb +9 -0
- data/lib/jets/commands/help/build.md +6 -0
- data/lib/jets/commands/help/call.md +61 -0
- data/lib/jets/commands/help/clean/build.md +5 -0
- data/lib/jets/commands/help/clean/log.md +5 -0
- data/lib/jets/commands/help/console.md +18 -0
- data/lib/jets/commands/help/db/generate.md +8 -0
- data/lib/jets/commands/help/dbconsole.md +9 -0
- data/lib/jets/commands/help/delete.md +22 -0
- data/lib/jets/commands/help/deploy.md +32 -0
- data/lib/jets/commands/help/destroy.md +16 -0
- data/lib/jets/commands/help/dynamodb/generate.md +52 -0
- data/lib/jets/commands/help/dynamodb/migrate.md +4 -0
- data/lib/jets/commands/help/gems/check.md +8 -0
- data/lib/jets/commands/help/generate.md +22 -0
- data/lib/jets/commands/help/import/rack.md +13 -0
- data/lib/jets/commands/help/import/rails.md +11 -0
- data/lib/jets/commands/help/new.md +42 -0
- data/lib/jets/commands/help/routes.md +16 -0
- data/lib/jets/commands/help/runner.md +17 -0
- data/lib/jets/commands/help/server.md +15 -0
- data/lib/jets/commands/help/status.md +14 -0
- data/lib/jets/commands/help/upgrade.md +5 -0
- data/lib/jets/commands/help/url.md +6 -0
- data/lib/jets/commands/import.rb +12 -0
- data/lib/jets/commands/import/base.rb +49 -0
- data/lib/jets/commands/import/cheatsheet.rb +35 -0
- data/lib/jets/commands/import/rack.rb +16 -0
- data/lib/jets/commands/import/rails.rb +74 -0
- data/lib/jets/commands/import/sequence.rb +90 -0
- data/lib/jets/commands/import/templates/config/database.yml +26 -0
- data/lib/jets/commands/import/templates/submodules-cheatsheet.md +89 -0
- data/lib/jets/commands/main.rb +157 -0
- data/lib/jets/commands/markdown/creator.rb +58 -0
- data/lib/jets/commands/markdown/index.rb +27 -0
- data/lib/jets/commands/markdown/page.rb +125 -0
- data/lib/jets/commands/markdown/shell.rb +11 -0
- data/lib/jets/commands/new.rb +157 -0
- data/lib/jets/commands/rake_command.rb +61 -0
- data/lib/jets/commands/rake_tasks.rb +46 -0
- data/lib/jets/commands/runner.rb +16 -0
- data/lib/jets/commands/sequence.rb +99 -0
- data/lib/jets/commands/stack_info.rb +30 -0
- data/lib/jets/commands/templates/skeleton/.gitignore +12 -0
- data/lib/jets/commands/templates/skeleton/.jetskeep +1 -0
- data/lib/jets/commands/templates/skeleton/.rspec +3 -0
- data/lib/jets/commands/templates/skeleton/Gemfile.tt +38 -0
- data/lib/jets/commands/templates/skeleton/Procfile +7 -0
- data/lib/jets/commands/templates/skeleton/README.md +11 -0
- data/lib/jets/commands/templates/skeleton/Rakefile +2 -0
- data/lib/jets/commands/templates/skeleton/app/controllers/application_controller.rb +2 -0
- data/lib/jets/commands/templates/skeleton/app/helpers/application_helper.rb +2 -0
- data/lib/jets/commands/templates/skeleton/app/jobs/application_job.rb +4 -0
- data/lib/jets/commands/templates/skeleton/app/models/application_item.rb +2 -0
- data/lib/jets/commands/templates/skeleton/app/models/application_record.rb +3 -0
- data/lib/jets/commands/templates/skeleton/app/views/layouts/application.html.erb.tt +25 -0
- data/lib/jets/commands/templates/skeleton/config.ru +5 -0
- data/lib/jets/commands/templates/skeleton/config/application.rb.tt +67 -0
- data/lib/jets/commands/templates/skeleton/config/database.yml.tt +26 -0
- data/lib/jets/commands/templates/skeleton/config/dynamodb.yml +22 -0
- data/lib/jets/commands/templates/skeleton/config/environments/development.rb +7 -0
- data/lib/jets/commands/templates/skeleton/config/environments/production.rb +9 -0
- data/lib/jets/commands/templates/skeleton/config/environments/test.rb +7 -0
- data/lib/jets/commands/templates/skeleton/config/routes.rb +9 -0
- data/lib/jets/commands/templates/skeleton/db/.gitkeep +0 -0
- data/lib/jets/commands/templates/skeleton/public/404.html +67 -0
- data/lib/jets/commands/templates/skeleton/public/422.html +67 -0
- data/lib/jets/commands/templates/skeleton/public/500.html +66 -0
- data/lib/jets/commands/templates/skeleton/public/favicon.ico +0 -0
- data/lib/jets/commands/templates/skeleton/public/index.html.tt +91 -0
- data/lib/jets/commands/templates/skeleton/spec/controllers/posts_controller_spec.rb +15 -0
- data/lib/jets/commands/templates/skeleton/spec/fixtures/payloads/posts-index.json +51 -0
- data/lib/jets/commands/templates/skeleton/spec/fixtures/payloads/posts-show.json +53 -0
- data/lib/jets/commands/templates/skeleton/spec/spec_helper.rb.tt +30 -0
- data/lib/jets/commands/templates/webpacker/app/javascript/packs/application.js.tt +14 -0
- data/lib/jets/commands/templates/webpacker/app/javascript/packs/theme.scss.tt +24 -0
- data/lib/jets/commands/templates/webpacker/app/javascript/src/jets/crud.js +87 -0
- data/lib/jets/commands/upgrade.rb +145 -0
- data/lib/jets/commands/upgrade/templates/bin/webpack +19 -0
- data/lib/jets/commands/upgrade/templates/bin/webpack-dev-server +19 -0
- data/lib/jets/commands/url.rb +68 -0
- data/lib/jets/commands/webpacker_template.rb +18 -0
- data/lib/jets/controller.rb +3 -0
- data/lib/jets/controller/base.rb +108 -0
- data/lib/jets/controller/callbacks.rb +68 -0
- data/lib/jets/controller/cookies.rb +38 -0
- data/lib/jets/controller/cookies/jar.rb +269 -0
- data/lib/jets/controller/layout.rb +17 -0
- data/lib/jets/controller/middleware/cors.rb +60 -0
- data/lib/jets/controller/middleware/local.rb +116 -0
- data/lib/jets/controller/middleware/local/api_gateway.rb +93 -0
- data/lib/jets/controller/middleware/local/mimic_aws_call.rb +38 -0
- data/lib/jets/controller/middleware/local/route_matcher.rb +106 -0
- data/lib/jets/controller/middleware/main.rb +46 -0
- data/lib/jets/controller/middleware/reloader.rb +15 -0
- data/lib/jets/controller/middleware/webpacker_setup.rb +6 -0
- data/lib/jets/controller/params.rb +87 -0
- data/lib/jets/controller/rack/adapter.rb +88 -0
- data/lib/jets/controller/rack/env.rb +105 -0
- data/lib/jets/controller/redirection.rb +55 -0
- data/lib/jets/controller/rendering.rb +79 -0
- data/lib/jets/controller/rendering/rack_renderer.rb +250 -0
- data/lib/jets/controller/request.rb +29 -0
- data/lib/jets/controller/response.rb +61 -0
- data/lib/jets/controller/stage.rb +33 -0
- data/lib/jets/core.rb +149 -0
- data/lib/jets/core_ext/kernel.rb +13 -0
- data/lib/jets/db.rb +15 -0
- data/lib/jets/dotenv.rb +48 -0
- data/lib/jets/dotenv/ssm.rb +48 -0
- data/lib/jets/erb.rb +51 -0
- data/lib/jets/generator.rb +48 -0
- data/lib/jets/generator/templates/erb/controller/view.html.erb +2 -0
- data/lib/jets/generator/templates/erb/scaffold/_form.html.erb +39 -0
- data/lib/jets/generator/templates/erb/scaffold/edit.html.erb +6 -0
- data/lib/jets/generator/templates/erb/scaffold/index.html.erb +29 -0
- data/lib/jets/generator/templates/erb/scaffold/new.html.erb +5 -0
- data/lib/jets/generator/templates/erb/scaffold/show.html.erb +9 -0
- data/lib/jets/generator/templates/rails/assets/javascript.js +2 -0
- data/lib/jets/generator/templates/rails/assets/stylesheet.css +4 -0
- data/lib/jets/generator/templates/rails/controller/controller.rb +13 -0
- data/lib/jets/generator/templates/rails/helper/helper.rb +4 -0
- data/lib/jets/generator/templates/rails/scaffold/scaffold.css +80 -0
- data/lib/jets/generator/templates/rails/scaffold_controller/api_controller.rb +62 -0
- data/lib/jets/generator/templates/rails/scaffold_controller/controller.rb +79 -0
- data/lib/jets/inflections.rb +32 -0
- data/lib/jets/internal/app/controllers/jets/mailers_controller.rb +97 -0
- data/lib/jets/internal/app/controllers/jets/public_controller.rb +31 -0
- data/lib/jets/internal/app/controllers/jets/rack_controller.rb +25 -0
- data/lib/jets/internal/app/functions/jets/base_path.rb +157 -0
- data/lib/jets/internal/app/helpers/jets/mailers_helper.rb +9 -0
- data/lib/jets/internal/app/jobs/jets/preheat_job.rb +70 -0
- data/lib/jets/internal/app/shared/functions/jets/s3_bucket_config.rb +43 -0
- data/lib/jets/internal/app/views/jets/mailers/email.html.erb +145 -0
- data/lib/jets/internal/app/views/jets/mailers/index.html.erb +8 -0
- data/lib/jets/internal/app/views/jets/mailers/mailer.html.erb +6 -0
- data/lib/jets/internal/turbines/jets/mailer.rb +51 -0
- data/lib/jets/job/base.rb +39 -0
- data/lib/jets/job/dsl.rb +40 -0
- data/lib/jets/job/dsl/dynamodb_event.rb +65 -0
- data/lib/jets/job/dsl/event_source_mapping.rb +11 -0
- data/lib/jets/job/dsl/iot_event.rb +24 -0
- data/lib/jets/job/dsl/kinesis_event.rb +46 -0
- data/lib/jets/job/dsl/log_event.rb +15 -0
- data/lib/jets/job/dsl/rule_event.rb +75 -0
- data/lib/jets/job/dsl/s3_event.rb +36 -0
- data/lib/jets/job/dsl/sns_event.rb +54 -0
- data/lib/jets/job/dsl/sqs_event.rb +96 -0
- data/lib/jets/job/helpers/kinesis_event_helper.rb +13 -0
- data/lib/jets/job/helpers/log_event_helper.rb +17 -0
- data/lib/jets/job/helpers/s3_event_helper.rb +13 -0
- data/lib/jets/klass.rb +109 -0
- data/lib/jets/lambda/dsl.rb +419 -0
- data/lib/jets/lambda/function.rb +29 -0
- data/lib/jets/lambda/function_constructor.rb +55 -0
- data/lib/jets/lambda/functions.rb +34 -0
- data/lib/jets/lambda/task.rb +111 -0
- data/lib/jets/logger.rb +21 -0
- data/lib/jets/mega/hash_converter.rb +25 -0
- data/lib/jets/mega/request.rb +139 -0
- data/lib/jets/mega/request/source.rb +21 -0
- data/lib/jets/middleware.rb +33 -0
- data/lib/jets/middleware/configurator.rb +84 -0
- data/lib/jets/middleware/default_stack.rb +51 -0
- data/lib/jets/middleware/layer.rb +34 -0
- data/lib/jets/middleware/stack.rb +77 -0
- data/lib/jets/naming.rb +49 -0
- data/lib/jets/overrides/lambda.rb +1 -0
- data/lib/jets/overrides/lambda/marshaller.rb +31 -0
- data/lib/jets/overrides/rails.rb +4 -0
- data/lib/jets/overrides/rails/asset_tag_helper.rb +114 -0
- data/lib/jets/overrides/rails/common_methods.rb +13 -0
- data/lib/jets/overrides/rails/rendering_helper.rb +26 -0
- data/lib/jets/overrides/rails/url_helper.rb +25 -0
- data/lib/jets/poly_fun.rb +73 -0
- data/lib/jets/poly_fun/base_executor.rb +125 -0
- data/lib/jets/poly_fun/lambda_executor.rb +16 -0
- data/lib/jets/poly_fun/node_error.rb +8 -0
- data/lib/jets/poly_fun/node_executor.rb +54 -0
- data/lib/jets/poly_fun/python_error.rb +8 -0
- data/lib/jets/poly_fun/python_executor.rb +23 -0
- data/lib/jets/preheat.rb +117 -0
- data/lib/jets/processors/deducer.rb +65 -0
- data/lib/jets/processors/main_processor.rb +61 -0
- data/lib/jets/rack_server.rb +86 -0
- data/lib/jets/rdoc.rb +30 -0
- data/lib/jets/resource.rb +71 -0
- data/lib/jets/resource/api_gateway/base_path/function.rb +42 -0
- data/lib/jets/resource/api_gateway/base_path/mapping.rb +44 -0
- data/lib/jets/resource/api_gateway/base_path/role.rb +76 -0
- data/lib/jets/resource/api_gateway/cors.rb +61 -0
- data/lib/jets/resource/api_gateway/deployment.rb +78 -0
- data/lib/jets/resource/api_gateway/domain_name.rb +59 -0
- data/lib/jets/resource/api_gateway/method.rb +98 -0
- data/lib/jets/resource/api_gateway/resource.rb +101 -0
- data/lib/jets/resource/api_gateway/rest_api.rb +56 -0
- data/lib/jets/resource/api_gateway/rest_api/change_detection.rb +42 -0
- data/lib/jets/resource/api_gateway/rest_api/logical_id.rb +63 -0
- data/lib/jets/resource/api_gateway/rest_api/routes.rb +7 -0
- data/lib/jets/resource/api_gateway/rest_api/routes/change.rb +8 -0
- data/lib/jets/resource/api_gateway/rest_api/routes/change/base.rb +130 -0
- data/lib/jets/resource/api_gateway/rest_api/routes/change/to.rb +29 -0
- data/lib/jets/resource/api_gateway/rest_api/routes/change/variable.rb +39 -0
- data/lib/jets/resource/api_gateway/rest_api/routes/collision.rb +121 -0
- data/lib/jets/resource/api_gateway/rest_api/routes/collision/variable_exception.rb +7 -0
- data/lib/jets/resource/associated.rb +37 -0
- data/lib/jets/resource/base.rb +28 -0
- data/lib/jets/resource/child_stack/api_deployment.rb +56 -0
- data/lib/jets/resource/child_stack/api_gateway.rb +53 -0
- data/lib/jets/resource/child_stack/app_class.rb +107 -0
- data/lib/jets/resource/child_stack/base.rb +24 -0
- data/lib/jets/resource/child_stack/shared.rb +92 -0
- data/lib/jets/resource/config/config_rule.rb +74 -0
- data/lib/jets/resource/config/managed_rule.rb +15 -0
- data/lib/jets/resource/events/rule.rb +31 -0
- data/lib/jets/resource/iam/application_role.rb +27 -0
- data/lib/jets/resource/iam/base_role_definition.rb +47 -0
- data/lib/jets/resource/iam/class_role.rb +74 -0
- data/lib/jets/resource/iam/function_role.rb +54 -0
- data/lib/jets/resource/iam/managed_policy.rb +22 -0
- data/lib/jets/resource/iam/policy_document.rb +41 -0
- data/lib/jets/resource/iot/topic_rule.rb +34 -0
- data/lib/jets/resource/lambda/event_source_mapping.rb +31 -0
- data/lib/jets/resource/lambda/function.rb +214 -0
- data/lib/jets/resource/lambda/function/environment.rb +62 -0
- data/lib/jets/resource/lambda/gem_layer.rb +17 -0
- data/lib/jets/resource/lambda/layer_version.rb +44 -0
- data/lib/jets/resource/logs/subscription_filter.rb +31 -0
- data/lib/jets/resource/permission.rb +45 -0
- data/lib/jets/resource/replacer.rb +85 -0
- data/lib/jets/resource/route53/record_set.rb +70 -0
- data/lib/jets/resource/s3/bucket.rb +24 -0
- data/lib/jets/resource/sns/subscription.rb +29 -0
- data/lib/jets/resource/sns/topic.rb +35 -0
- data/lib/jets/resource/sns/topic_policy.rb +40 -0
- data/lib/jets/resource/sqs/queue.rb +21 -0
- data/lib/jets/resource/standardizer.rb +42 -0
- data/lib/jets/route.rb +166 -0
- data/lib/jets/router.rb +177 -0
- data/lib/jets/router/scope.rb +30 -0
- data/lib/jets/rule/base.rb +19 -0
- data/lib/jets/rule/dsl.rb +110 -0
- data/lib/jets/spec_helpers.rb +54 -0
- data/lib/jets/spec_helpers/params.rb +10 -0
- data/lib/jets/spec_helpers/request.rb +78 -0
- data/lib/jets/spec_helpers/response.rb +5 -0
- data/lib/jets/stack.rb +88 -0
- data/lib/jets/stack/builder.rb +43 -0
- data/lib/jets/stack/definition.rb +50 -0
- data/lib/jets/stack/depends.rb +34 -0
- data/lib/jets/stack/depends/item.rb +9 -0
- data/lib/jets/stack/function.rb +69 -0
- data/lib/jets/stack/main.rb +4 -0
- data/lib/jets/stack/main/dsl.rb +28 -0
- data/lib/jets/stack/main/dsl/base.rb +49 -0
- data/lib/jets/stack/main/dsl/cloudwatch.rb +19 -0
- data/lib/jets/stack/main/dsl/iam.rb +8 -0
- data/lib/jets/stack/main/dsl/lambda.rb +83 -0
- data/lib/jets/stack/main/dsl/s3.rb +12 -0
- data/lib/jets/stack/main/dsl/sns.rb +16 -0
- data/lib/jets/stack/main/dsl/sqs.rb +10 -0
- data/lib/jets/stack/output.rb +35 -0
- data/lib/jets/stack/output/dsl.rb +19 -0
- data/lib/jets/stack/output/lookup.rb +36 -0
- data/lib/jets/stack/parameter.rb +37 -0
- data/lib/jets/stack/parameter/dsl.rb +42 -0
- data/lib/jets/stack/resource.rb +31 -0
- data/lib/jets/stack/resource/dsl.rb +19 -0
- data/lib/jets/stack/s3_event.rb +87 -0
- data/lib/jets/tmp_loader.rb +52 -0
- data/lib/jets/turbine.rb +41 -0
- data/lib/jets/turbo.rb +55 -0
- data/lib/jets/turbo/database_yaml.rb +41 -0
- data/lib/jets/turbo/project/.gitignore +12 -0
- data/lib/jets/turbo/project/.jetskeep +1 -0
- data/lib/jets/turbo/project/Gemfile +16 -0
- data/lib/jets/turbo/project/Rakefile +2 -0
- data/lib/jets/turbo/project/app/controllers/application_controller.rb +2 -0
- data/lib/jets/turbo/project/app/helpers/application_helper.rb +2 -0
- data/lib/jets/turbo/project/app/jobs/application_job.rb +4 -0
- data/lib/jets/turbo/project/config.ru +5 -0
- data/lib/jets/turbo/project/config/application.rb +4 -0
- data/lib/jets/turbo/project/config/routes.rb +4 -0
- data/lib/jets/turbo/rails.rb +127 -0
- data/lib/jets/turbo/templates/config/database.yml +26 -0
- data/lib/jets/util.rb +38 -0
- data/lib/jets/version.rb +3 -0
- data/readme/prerelease.md +6 -0
- data/readme/testing.md +60 -0
- metadata +1004 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 01eb94f2cef338f918e49f2e834e82ecf47494afd2badfe6b0110e462c79e826
|
4
|
+
data.tar.gz: 9bca7d8c444e3650a136842a466d914c67b2e12c79744d79b294bd07b9abf301
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9a92b59b79d65fe03a0f9c79f3b1556c5ce2d915151ad704c96b50cca54eded4380de3be4c2531064fd9a9950a34e87ef7dd677631c9453c9b0c20e97dfcedde
|
7
|
+
data.tar.gz: 64789280e15eb551b69998a14448acde5bf927814e31ef9976dfb4cab7ca3f3b19b529b306a0a43e126a45e83d3efd935af1dff4c3a6a2ced0b85fea00a66e30
|
@@ -0,0 +1,26 @@
|
|
1
|
+
#!/bin/bash -eux
|
2
|
+
|
3
|
+
# Even though specs also generate docs, lets run again to ensure clean slate
|
4
|
+
rake docs
|
5
|
+
|
6
|
+
out=$(git status docs)
|
7
|
+
if [[ "$out" = *"nothing to commit"* ]]; then
|
8
|
+
exit
|
9
|
+
fi
|
10
|
+
|
11
|
+
COMMIT_MESSAGE="docs updated by circleci"
|
12
|
+
|
13
|
+
# If the last commit already updated the docs, then exit.
|
14
|
+
# Preventable measure to avoid infinite loop.
|
15
|
+
if git log -1 --pretty=oneline | grep "$COMMIT_MESSAGE" ; then
|
16
|
+
exit
|
17
|
+
fi
|
18
|
+
|
19
|
+
# If reach here, we have some changes on docs that we should commit.
|
20
|
+
# Even though s
|
21
|
+
git add docs
|
22
|
+
git commit -m "$COMMIT_MESSAGE"
|
23
|
+
|
24
|
+
# https://makandracards.com/makandra/12107-git-show-current-branch-name-only
|
25
|
+
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
26
|
+
git push origin "$current_branch"
|
@@ -0,0 +1,126 @@
|
|
1
|
+
# Ruby CircleCI 2.0 configuration file
|
2
|
+
#
|
3
|
+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
+
#
|
5
|
+
version: 2
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
docker:
|
9
|
+
# specify the version you desire here
|
10
|
+
- image: circleci/ruby:2.5.0-node-browsers
|
11
|
+
|
12
|
+
# Specify service dependencies here if necessary
|
13
|
+
# CircleCI maintains a library of pre-built images
|
14
|
+
# documented at https://circleci.com/docs/2.0/circleci-images/
|
15
|
+
# - image: circleci/postgres:9.4
|
16
|
+
|
17
|
+
working_directory: ~/repo
|
18
|
+
|
19
|
+
steps:
|
20
|
+
- checkout
|
21
|
+
|
22
|
+
- run:
|
23
|
+
name: submodule sync
|
24
|
+
command: |
|
25
|
+
git submodule sync
|
26
|
+
git submodule update --init
|
27
|
+
|
28
|
+
# Download and cache dependencies
|
29
|
+
- restore_cache:
|
30
|
+
keys:
|
31
|
+
- v2-dependencies-{{ checksum "jets.gemspec" }}
|
32
|
+
# fallback to using the latest cache if no exact match is found
|
33
|
+
- v2-dependencies-
|
34
|
+
|
35
|
+
- run:
|
36
|
+
name: install dependencies
|
37
|
+
command: |
|
38
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
39
|
+
|
40
|
+
- save_cache:
|
41
|
+
paths:
|
42
|
+
- ./vendor/bundle
|
43
|
+
key: v2-dependencies-{{ checksum "jets.gemspec" }}
|
44
|
+
|
45
|
+
# Database setup
|
46
|
+
# - run: bundle exec rake db:create
|
47
|
+
# - run: bundle exec rake db:schema:load
|
48
|
+
|
49
|
+
- run:
|
50
|
+
name: install dynamodb-local
|
51
|
+
command: |
|
52
|
+
whoami > /tmp/whoami.txt
|
53
|
+
|
54
|
+
mkdir ~/dynamodb_local_latest
|
55
|
+
cd ~/dynamodb_local_latest
|
56
|
+
wget https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz
|
57
|
+
tar zxf dynamodb_local_latest.tar.gz
|
58
|
+
cat >~/dynamodb-local <<EOL
|
59
|
+
#!/bin/sh
|
60
|
+
exec java -Djava.library.path=~/dynamodb_local_latest/DynamoDBLocal_lib -jar ~/dynamodb_local_latest/DynamoDBLocal.jar -sharedDb
|
61
|
+
EOL
|
62
|
+
|
63
|
+
chmod a+x ~/dynamodb-local
|
64
|
+
sudo mv ~/dynamodb-local /usr/local/bin/dynamodb-local
|
65
|
+
|
66
|
+
- run:
|
67
|
+
name: start dynamodb-local
|
68
|
+
command: dynamodb-local
|
69
|
+
background: true
|
70
|
+
|
71
|
+
# run tests!
|
72
|
+
- run:
|
73
|
+
name: run tests
|
74
|
+
command: |
|
75
|
+
mkdir /tmp/test-results
|
76
|
+
|
77
|
+
cat >.rspec <<EOL
|
78
|
+
--format documentation
|
79
|
+
--exclude-pattern spec/fixtures/apps/**/*
|
80
|
+
--format RspecJunitFormatter \
|
81
|
+
--out /tmp/test-results/rspec.xml \
|
82
|
+
--require spec_helper
|
83
|
+
EOL
|
84
|
+
|
85
|
+
bundle exec rspec
|
86
|
+
|
87
|
+
# commit_docs.sh requires this
|
88
|
+
- run:
|
89
|
+
name: configure git
|
90
|
+
command: |
|
91
|
+
git config --global user.email "tongueroo@gmail.com"
|
92
|
+
git config --global user.name "Tung Nguyen"
|
93
|
+
|
94
|
+
- run:
|
95
|
+
name: commit cli reference docs
|
96
|
+
command: |
|
97
|
+
chmod a+x -R .circleci/bin
|
98
|
+
.circleci/bin/commit_docs.sh
|
99
|
+
|
100
|
+
- run:
|
101
|
+
name: install awscli
|
102
|
+
command: sudo apt-get update && sudo apt-get install -y awscli groff
|
103
|
+
|
104
|
+
- run:
|
105
|
+
name: configure awscli
|
106
|
+
command: |
|
107
|
+
mkdir ~/.aws
|
108
|
+
|
109
|
+
cat >~/.aws/config <<EOL
|
110
|
+
[default]
|
111
|
+
region = ${AWS_REGION}
|
112
|
+
output = json
|
113
|
+
EOL
|
114
|
+
|
115
|
+
cat >~/.aws/credentials <<EOL
|
116
|
+
[default]
|
117
|
+
aws_secret_access_key = ${AWS_SECRET_ACCESS_KEY}
|
118
|
+
aws_access_key_id = ${AWS_ACCESS_KEY_ID}
|
119
|
+
EOL
|
120
|
+
|
121
|
+
# collect reports
|
122
|
+
- store_test_results:
|
123
|
+
path: /tmp/test-results
|
124
|
+
- store_artifacts:
|
125
|
+
path: /tmp/test-results
|
126
|
+
destination: test-results
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# Code Build Commands
|
2
|
+
|
3
|
+
## The code definitions are stored in the codebuild s3 bucket.
|
4
|
+
|
5
|
+
aws s3 cp .codebuild/definitions/jets_base.json s3://$S3_BUCKET/codebuild/definitions/jets_base.json
|
6
|
+
aws s3 cp .codebuild/definitions/jets_main.json s3://$S3_BUCKET/codebuild/definitions/jets_main.json
|
7
|
+
|
8
|
+
## JetsBase
|
9
|
+
|
10
|
+
The JetsBase codebuild project projects builds the Docker base image and pushes it to Docker hub. Here are the commands to manage the codebuild project.
|
11
|
+
|
12
|
+
aws codebuild create-project --cli-input-json file://.codebuild/definitions/jets_base.json
|
13
|
+
aws codebuild update-project --cli-input-json file://.codebuild/definitions/jets_base.json
|
14
|
+
|
15
|
+
aws codebuild start-build --project-name JetsBase --source-version codebuild
|
16
|
+
|
17
|
+
aws codebuild batch-get-projects --names JetsBase
|
18
|
+
aws codebuild list-builds-for-project --project-name JetsBase
|
19
|
+
|
20
|
+
BUILD_ID=$(aws codebuild list-builds-for-project --project-name JetsBase | jq -r '.ids[0]')
|
21
|
+
aws codebuild batch-get-builds --ids $BUILD_ID
|
22
|
+
|
23
|
+
STREAM=$(aws codebuild batch-get-builds --ids $BUILD_ID | jq -r '.builds[0].logs.streamName')
|
24
|
+
cw tail -f /aws/codebuild/JetsBase $STREAM
|
25
|
+
|
26
|
+
If you want to manually build the Docker base image. Run:
|
27
|
+
|
28
|
+
docker build -t tongueroo/jets:base -f Dockerfile.base .
|
29
|
+
docker push tongueroo/jets:base
|
30
|
+
|
31
|
+
## JetsMain
|
32
|
+
|
33
|
+
aws codebuild create-project --cli-input-json file://.codebuild/definitions/jets_main.json
|
34
|
+
aws codebuild update-project --cli-input-json file://.codebuild/definitions/jets_main.json
|
35
|
+
|
36
|
+
aws codebuild start-build --project-name JetsMain --source-version codebuild
|
37
|
+
|
38
|
+
aws codebuild batch-get-projects --names JetsMain
|
39
|
+
aws codebuild list-builds-for-project --project-name JetsMain
|
40
|
+
|
41
|
+
BUILD_ID=$(aws codebuild list-builds-for-project --project-name JetsMain | jq -r '.ids[0]')
|
42
|
+
aws codebuild batch-get-builds --ids $BUILD_ID
|
43
|
+
|
44
|
+
STREAM=$(aws codebuild batch-get-builds --ids $BUILD_ID | jq -r '.builds[0].logs.streamName')
|
45
|
+
cw tail -f /aws/codebuild/JetsMain $STREAM
|
46
|
+
|
47
|
+
## Run CodeBuild Locally
|
48
|
+
|
49
|
+
time docker run -it -v /var/run/docker.sock:/var/run/docker.sock \
|
50
|
+
-e "IMAGE_NAME=tongueroo/jets:base" \
|
51
|
+
-e "ARTIFACTS=/tmp/artifacts" \
|
52
|
+
-e "SOURCE=/home/ec2-user/environment/jets" \
|
53
|
+
-e "DB_USER=$DB_USER" \
|
54
|
+
-e "DB_PASS=$DB_PASS" \
|
55
|
+
-e "DB_HOST=$DB_HOST" \
|
56
|
+
amazon/aws-codebuild-local
|
57
|
+
|
58
|
+
## Run ingreration.sh
|
59
|
+
|
60
|
+
Can run the integration.sh test locally by running:
|
61
|
+
|
62
|
+
export DB_NAME=demo
|
63
|
+
export DB_USER=dbuser
|
64
|
+
export DB_PASS=dbpass
|
65
|
+
export DB_HOST=rdshost
|
66
|
+
.codebuild/integration.sh
|
67
|
+
|
68
|
+
Note, you'll need to use a real RDS db instance. Make sure DATABASE_URL is not set, this is working with the DB_* vars.
|
data/.codebuild/bin/jets
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
version: 0.2
|
2
|
+
|
3
|
+
phases:
|
4
|
+
build:
|
5
|
+
commands:
|
6
|
+
- echo Build started on `date`
|
7
|
+
- mkdir ~/.docker
|
8
|
+
- aws s3 cp s3://$S3_BUCKET_DOCKER_CONFIG/codebuild/jets/docker-config.json ~/.docker/config.json
|
9
|
+
- docker build -t tongueroo/jets:base -f Dockerfile.base .
|
10
|
+
- docker push tongueroo/jets
|
11
|
+
|
12
|
+
artifacts:
|
13
|
+
files:
|
14
|
+
- README.md
|
@@ -0,0 +1,72 @@
|
|
1
|
+
#!/bin/bash -exu
|
2
|
+
|
3
|
+
# on codebuild make sure we use the bin/jets that was checked out
|
4
|
+
set +u
|
5
|
+
if [ -n "$CODEBUILD_SRC_DIR" ]; then
|
6
|
+
cp .codebuild/bin/jets /usr/local/bin/jets
|
7
|
+
chmod a+x /usr/local/bin/jets
|
8
|
+
export PATH=/usr/local/bin:$PATH
|
9
|
+
which jets
|
10
|
+
fi
|
11
|
+
|
12
|
+
# Locally set the CODEBUILD_SRC_DIR to make script simpler
|
13
|
+
# Do this before the cd-ing into the newly created directory.
|
14
|
+
if [ -z $CODEBUILD_SRC_DIR ]; then
|
15
|
+
CODEBUILD_SRC_DIR=$(pwd)
|
16
|
+
fi
|
17
|
+
set -u
|
18
|
+
|
19
|
+
APP_NAME=demo$(date +%s)
|
20
|
+
jets new $APP_NAME # jets new runs bundle and webpacker:install
|
21
|
+
cd $APP_NAME
|
22
|
+
|
23
|
+
cat >.env.development <<EOL
|
24
|
+
DB_NAME=$DB_NAME
|
25
|
+
DB_USER=$DB_USER
|
26
|
+
DB_PASS=$DB_PASS
|
27
|
+
DB_HOST=$DB_HOST
|
28
|
+
EOL
|
29
|
+
# IE: replace demo with demo1535227161 in case locally using demo and forget to set
|
30
|
+
perl -i -pe "s/DB_NAME=demo/DB_NAME=${APP_NAME}_dev/" .env.development
|
31
|
+
# Make sure database env vars matches whats in the file
|
32
|
+
eval $(cat .env.development | sed 's/^/export /')
|
33
|
+
# Make sure that nothing is .env.development.remote, dont want to use it for this case
|
34
|
+
cp /dev/null .env.development.remote
|
35
|
+
|
36
|
+
jets generate scaffold Post title:string
|
37
|
+
# The DB_ environment variables are set up in the circleci environment variables
|
38
|
+
# website GUI under project settings
|
39
|
+
jets db:create db:migrate
|
40
|
+
|
41
|
+
jets deploy
|
42
|
+
|
43
|
+
APP_URL=$(jets url)
|
44
|
+
cat > jets.postman_environment.json <<EOL
|
45
|
+
{
|
46
|
+
"id": "f50e05e5-c6dd-4707-9270-82c706b2bcef",
|
47
|
+
"name": "Jets Test1",
|
48
|
+
"values": [
|
49
|
+
{
|
50
|
+
"key": "BASE_URL",
|
51
|
+
"value": "${APP_URL}/",
|
52
|
+
"description": "",
|
53
|
+
"type": "text",
|
54
|
+
"enabled": true
|
55
|
+
}
|
56
|
+
],
|
57
|
+
"_postman_variable_scope": "environment",
|
58
|
+
"_postman_exported_at": "2018-08-06T01:39:56.523Z",
|
59
|
+
"_postman_exported_using": "Postman/6.2.3"
|
60
|
+
}
|
61
|
+
EOL
|
62
|
+
|
63
|
+
cp $CODEBUILD_SRC_DIR/.codebuild/jets.postman_collection.json .
|
64
|
+
|
65
|
+
npm install -g newman
|
66
|
+
newman run jets.postman_collection.json -e jets.postman_environment.json
|
67
|
+
|
68
|
+
# cleanup the database
|
69
|
+
jets db:drop
|
70
|
+
|
71
|
+
# delete jets project
|
72
|
+
jets delete --sure --no-wait
|
@@ -0,0 +1,323 @@
|
|
1
|
+
{
|
2
|
+
"info": {
|
3
|
+
"_postman_id": "c8ca4bd7-c5f4-4e75-95a3-e50290a06661",
|
4
|
+
"name": "Jets Integration Tests",
|
5
|
+
"description": "Tests basic CRUD",
|
6
|
+
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
7
|
+
},
|
8
|
+
"item": [
|
9
|
+
{
|
10
|
+
"_postman_id": "154ebb9d-4235-4d4b-9984-d5e3ab3c20d5",
|
11
|
+
"name": "PostsController#index",
|
12
|
+
"event": [
|
13
|
+
{
|
14
|
+
"listen": "test",
|
15
|
+
"script": {
|
16
|
+
"id": "f91acb11-eee6-4c83-956e-ef21f4adf246",
|
17
|
+
"type": "text/javascript",
|
18
|
+
"exec": [
|
19
|
+
"pm.test(\"response is ok\", function () {",
|
20
|
+
" pm.response.to.have.status(200);",
|
21
|
+
"});",
|
22
|
+
"",
|
23
|
+
"pm.test(\"Content-Type is present\", function () {",
|
24
|
+
" pm.response.to.have.header(\"Content-Type\");",
|
25
|
+
"});"
|
26
|
+
]
|
27
|
+
}
|
28
|
+
}
|
29
|
+
],
|
30
|
+
"request": {
|
31
|
+
"method": "GET",
|
32
|
+
"header": [],
|
33
|
+
"body": {},
|
34
|
+
"url": {
|
35
|
+
"raw": "{{BASE_URL}}posts",
|
36
|
+
"host": [
|
37
|
+
"{{BASE_URL}}posts"
|
38
|
+
]
|
39
|
+
}
|
40
|
+
},
|
41
|
+
"response": []
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"_postman_id": "7c6d9207-3303-4d9c-8628-3ec9fdbdd56f",
|
45
|
+
"name": "PostsController#create",
|
46
|
+
"event": [
|
47
|
+
{
|
48
|
+
"listen": "test",
|
49
|
+
"script": {
|
50
|
+
"id": "4f349f21-09e6-436d-bd70-89324ad334e8",
|
51
|
+
"type": "text/javascript",
|
52
|
+
"exec": [
|
53
|
+
"pm.test(\"response is ok\", function () {",
|
54
|
+
" pm.response.to.have.status(200);",
|
55
|
+
"});",
|
56
|
+
"",
|
57
|
+
"pm.test(\"Content-Type is present\", function () {",
|
58
|
+
" pm.response.to.have.header(\"Content-Type\");",
|
59
|
+
"});",
|
60
|
+
"",
|
61
|
+
"pm.test(\"Body matches string\", function () {",
|
62
|
+
" pm.expect(pm.response.text()).to.include(\"test1\");",
|
63
|
+
"});"
|
64
|
+
]
|
65
|
+
}
|
66
|
+
}
|
67
|
+
],
|
68
|
+
"request": {
|
69
|
+
"method": "POST",
|
70
|
+
"header": [
|
71
|
+
{
|
72
|
+
"key": "Content-Type",
|
73
|
+
"value": "application/x-www-form-urlencoded"
|
74
|
+
}
|
75
|
+
],
|
76
|
+
"body": {
|
77
|
+
"mode": "raw",
|
78
|
+
"raw": "utf8=%E2%9C%93&post%5Btitle%5D=test1&post%5Bbody%5D=test1&commit=Submit"
|
79
|
+
},
|
80
|
+
"url": {
|
81
|
+
"raw": "{{BASE_URL}}posts",
|
82
|
+
"host": [
|
83
|
+
"{{BASE_URL}}posts"
|
84
|
+
]
|
85
|
+
}
|
86
|
+
},
|
87
|
+
"response": []
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"_postman_id": "4be8797b-1da7-4386-96b9-f2a2d3bfff16",
|
91
|
+
"name": "PostsController#new",
|
92
|
+
"event": [
|
93
|
+
{
|
94
|
+
"listen": "test",
|
95
|
+
"script": {
|
96
|
+
"id": "7ece5182-aacd-45b9-ba1e-52552f5843cb",
|
97
|
+
"type": "text/javascript",
|
98
|
+
"exec": [
|
99
|
+
"pm.test(\"response is ok\", function () {",
|
100
|
+
" pm.response.to.have.status(200);",
|
101
|
+
"});",
|
102
|
+
"",
|
103
|
+
"pm.test(\"Content-Type is present\", function () {",
|
104
|
+
" pm.response.to.have.header(\"Content-Type\");",
|
105
|
+
"});",
|
106
|
+
""
|
107
|
+
]
|
108
|
+
}
|
109
|
+
}
|
110
|
+
],
|
111
|
+
"request": {
|
112
|
+
"method": "GET",
|
113
|
+
"header": [],
|
114
|
+
"body": {},
|
115
|
+
"url": {
|
116
|
+
"raw": "{{BASE_URL}}posts/new",
|
117
|
+
"host": [
|
118
|
+
"{{BASE_URL}}posts"
|
119
|
+
],
|
120
|
+
"path": [
|
121
|
+
"new"
|
122
|
+
]
|
123
|
+
}
|
124
|
+
},
|
125
|
+
"response": []
|
126
|
+
},
|
127
|
+
{
|
128
|
+
"_postman_id": "8389acfe-5b9a-489e-b9ff-97cc32e9a899",
|
129
|
+
"name": "PostsController#edit",
|
130
|
+
"event": [
|
131
|
+
{
|
132
|
+
"listen": "test",
|
133
|
+
"script": {
|
134
|
+
"id": "f3ac4857-58f8-40b0-8161-d2e2d6d921f3",
|
135
|
+
"type": "text/javascript",
|
136
|
+
"exec": [
|
137
|
+
"pm.test(\"response is ok\", function () {",
|
138
|
+
" pm.response.to.have.status(200);",
|
139
|
+
"});",
|
140
|
+
"",
|
141
|
+
"pm.test(\"Content-Type is present\", function () {",
|
142
|
+
" pm.response.to.have.header(\"Content-Type\");",
|
143
|
+
"});",
|
144
|
+
""
|
145
|
+
]
|
146
|
+
}
|
147
|
+
}
|
148
|
+
],
|
149
|
+
"request": {
|
150
|
+
"method": "GET",
|
151
|
+
"header": [],
|
152
|
+
"body": {},
|
153
|
+
"url": {
|
154
|
+
"raw": "{{BASE_URL}}posts/1/edit",
|
155
|
+
"host": [
|
156
|
+
"{{BASE_URL}}posts"
|
157
|
+
],
|
158
|
+
"path": [
|
159
|
+
"1",
|
160
|
+
"edit"
|
161
|
+
]
|
162
|
+
}
|
163
|
+
},
|
164
|
+
"response": []
|
165
|
+
},
|
166
|
+
{
|
167
|
+
"_postman_id": "22161f8e-1387-44b0-a890-edda95e8ebaf",
|
168
|
+
"name": "PostsController#update",
|
169
|
+
"event": [
|
170
|
+
{
|
171
|
+
"listen": "test",
|
172
|
+
"script": {
|
173
|
+
"id": "f597eb8f-34ea-461b-8793-3c257480f315",
|
174
|
+
"type": "text/javascript",
|
175
|
+
"exec": [
|
176
|
+
"pm.test(\"response is ok\", function () {",
|
177
|
+
" pm.response.to.have.status(200);",
|
178
|
+
"});",
|
179
|
+
"",
|
180
|
+
"pm.test(\"Content-Type is present\", function () {",
|
181
|
+
" pm.response.to.have.header(\"Content-Type\");",
|
182
|
+
"});",
|
183
|
+
"",
|
184
|
+
"pm.test(\"Success json response\", function () {",
|
185
|
+
" var jsonData = pm.response.json();",
|
186
|
+
" pm.expect(jsonData.success).to.eql(true);",
|
187
|
+
"});"
|
188
|
+
]
|
189
|
+
}
|
190
|
+
}
|
191
|
+
],
|
192
|
+
"request": {
|
193
|
+
"method": "PUT",
|
194
|
+
"header": [
|
195
|
+
{
|
196
|
+
"key": "Content-Type",
|
197
|
+
"value": "application/x-www-form-urlencoded; charset=UTF-8"
|
198
|
+
}
|
199
|
+
],
|
200
|
+
"body": {
|
201
|
+
"mode": "raw",
|
202
|
+
"raw": "utf8=%E2%9C%93&_method=put&post%5Btitle%5D=test1edit&post%5Bbody%5D=test1"
|
203
|
+
},
|
204
|
+
"url": {
|
205
|
+
"raw": "{{BASE_URL}}posts/1",
|
206
|
+
"host": [
|
207
|
+
"{{BASE_URL}}posts"
|
208
|
+
],
|
209
|
+
"path": [
|
210
|
+
"1"
|
211
|
+
]
|
212
|
+
}
|
213
|
+
},
|
214
|
+
"response": []
|
215
|
+
},
|
216
|
+
{
|
217
|
+
"_postman_id": "17a8cbb5-ead2-4949-9103-4dba5fb65309",
|
218
|
+
"name": "PostsController#create2",
|
219
|
+
"event": [
|
220
|
+
{
|
221
|
+
"listen": "test",
|
222
|
+
"script": {
|
223
|
+
"id": "100b5476-2194-4d25-8170-3b3416b2c9e2",
|
224
|
+
"type": "text/javascript",
|
225
|
+
"exec": [
|
226
|
+
"pm.test(\"response is ok\", function () {",
|
227
|
+
" pm.response.to.have.status(200);",
|
228
|
+
"});",
|
229
|
+
"",
|
230
|
+
"pm.test(\"Content-Type is present\", function () {",
|
231
|
+
" pm.response.to.have.header(\"Content-Type\");",
|
232
|
+
"});",
|
233
|
+
"",
|
234
|
+
"pm.test(\"Body matches string\", function () {",
|
235
|
+
" pm.expect(pm.response.text()).to.include(\"test2\");",
|
236
|
+
"});"
|
237
|
+
]
|
238
|
+
}
|
239
|
+
}
|
240
|
+
],
|
241
|
+
"request": {
|
242
|
+
"method": "POST",
|
243
|
+
"header": [
|
244
|
+
{
|
245
|
+
"key": "Content-Type",
|
246
|
+
"value": "application/x-www-form-urlencoded"
|
247
|
+
}
|
248
|
+
],
|
249
|
+
"body": {
|
250
|
+
"mode": "raw",
|
251
|
+
"raw": "utf8=%E2%9C%93&post%5Btitle%5D=test2&post%5Bbody%5D=test2&commit=Submit"
|
252
|
+
},
|
253
|
+
"url": {
|
254
|
+
"raw": "{{BASE_URL}}posts",
|
255
|
+
"host": [
|
256
|
+
"{{BASE_URL}}posts"
|
257
|
+
]
|
258
|
+
}
|
259
|
+
},
|
260
|
+
"response": []
|
261
|
+
},
|
262
|
+
{
|
263
|
+
"_postman_id": "c18f1c89-b15d-429a-bc1f-e58630802cba",
|
264
|
+
"name": "PostsController#delete",
|
265
|
+
"event": [
|
266
|
+
{
|
267
|
+
"listen": "test",
|
268
|
+
"script": {
|
269
|
+
"id": "530e0c60-e3c3-4812-82d9-f3072ddb3995",
|
270
|
+
"type": "text/javascript",
|
271
|
+
"exec": [
|
272
|
+
"pm.test(\"response is ok\", function () {",
|
273
|
+
" pm.response.to.have.status(200);",
|
274
|
+
"});",
|
275
|
+
"",
|
276
|
+
"pm.test(\"Content-Type is present\", function () {",
|
277
|
+
" pm.response.to.have.header(\"Content-Type\");",
|
278
|
+
"});",
|
279
|
+
""
|
280
|
+
]
|
281
|
+
}
|
282
|
+
}
|
283
|
+
],
|
284
|
+
"request": {
|
285
|
+
"method": "DELETE",
|
286
|
+
"header": [],
|
287
|
+
"body": {},
|
288
|
+
"url": {
|
289
|
+
"raw": "{{BASE_URL}}posts/2",
|
290
|
+
"host": [
|
291
|
+
"{{BASE_URL}}posts"
|
292
|
+
],
|
293
|
+
"path": [
|
294
|
+
"2"
|
295
|
+
]
|
296
|
+
}
|
297
|
+
},
|
298
|
+
"response": []
|
299
|
+
}
|
300
|
+
],
|
301
|
+
"event": [
|
302
|
+
{
|
303
|
+
"listen": "prerequest",
|
304
|
+
"script": {
|
305
|
+
"id": "a85e6949-f311-4c79-923c-46b55b7fb3e6",
|
306
|
+
"type": "text/javascript",
|
307
|
+
"exec": [
|
308
|
+
""
|
309
|
+
]
|
310
|
+
}
|
311
|
+
},
|
312
|
+
{
|
313
|
+
"listen": "test",
|
314
|
+
"script": {
|
315
|
+
"id": "7b5709b5-7a77-43b6-acfb-abee4a9362ff",
|
316
|
+
"type": "text/javascript",
|
317
|
+
"exec": [
|
318
|
+
""
|
319
|
+
]
|
320
|
+
}
|
321
|
+
}
|
322
|
+
]
|
323
|
+
}
|