disco_app 0.14.3 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/disco_app/concerns/webhooks_controller.rb +48 -0
  3. data/app/controllers/disco_app/webhooks_controller.rb +2 -46
  4. data/app/models/disco_app/concerns/renders_assets.rb +1 -1
  5. data/app/models/disco_app/concerns/taggable.rb +1 -1
  6. data/config/routes.rb +1 -1
  7. data/db/migrate/20150525000000_create_shops_if_not_existent.rb +80 -80
  8. data/db/migrate/20170315062548_create_disco_app_sources.rb +2 -0
  9. data/db/migrate/20170315062629_add_sources_to_shop_subscriptions.rb +2 -0
  10. data/db/migrate/20170327214540_create_disco_app_users.rb +2 -1
  11. data/db/migrate/20170606160751_fix_disco_app_users_index.rb +2 -0
  12. data/lib/disco_app/version.rb +1 -1
  13. data/lib/generators/disco_app/disco_app_generator.rb +24 -7
  14. data/lib/generators/disco_app/templates/config/cable.yml.tt +11 -0
  15. data/lib/generators/disco_app/templates/config/database.yml.tt +6 -3
  16. data/lib/generators/disco_app/templates/config/environments/staging.rb +108 -0
  17. data/lib/generators/disco_app/templates/config/newrelic.yml +3 -0
  18. data/lib/generators/disco_app/templates/controllers/home_controller.rb +1 -0
  19. data/lib/generators/disco_app/templates/initializers/rollbar.rb +2 -4
  20. data/lib/generators/disco_app/templates/initializers/session_store.rb +1 -1
  21. data/lib/generators/disco_app/templates/root/.github/PULL_REQUEST_TEMPLATE.md +18 -0
  22. data/lib/generators/disco_app/templates/root/.gitignore +4 -0
  23. data/lib/generators/disco_app/templates/root/.rubocop.yml +223 -158
  24. data/test/dummy/config/database.yml +3 -0
  25. data/test/dummy/config/environments/staging.rb +85 -0
  26. data/test/dummy/config/secrets.yml +3 -0
  27. metadata +129 -123
@@ -18,5 +18,8 @@ test:
18
18
 
19
19
  # Do not keep production secrets in the repository,
20
20
  # instead read values from the environment.
21
+ staging:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
23
+
21
24
  production:
22
25
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: disco_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.3
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Ballard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-22 00:00:00.000000000 Z
11
+ date: 2018-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 5.1.0
19
+ version: 5.2.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 5.1.0
26
+ version: 5.2.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sass-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -584,6 +584,7 @@ files:
584
584
  - app/controllers/disco_app/concerns/authenticated_controller.rb
585
585
  - app/controllers/disco_app/concerns/carrier_request_controller.rb
586
586
  - app/controllers/disco_app/concerns/user_authenticated_controller.rb
587
+ - app/controllers/disco_app/concerns/webhooks_controller.rb
587
588
  - app/controllers/disco_app/frame_controller.rb
588
589
  - app/controllers/disco_app/install_controller.rb
589
590
  - app/controllers/disco_app/subscriptions_controller.rb
@@ -693,7 +694,9 @@ files:
693
694
  - lib/generators/disco_app/templates/assets/javascripts/application.js
694
695
  - lib/generators/disco_app/templates/assets/javascripts/components.js
695
696
  - lib/generators/disco_app/templates/assets/stylesheets/application.scss
697
+ - lib/generators/disco_app/templates/config/cable.yml.tt
696
698
  - lib/generators/disco_app/templates/config/database.yml.tt
699
+ - lib/generators/disco_app/templates/config/environments/staging.rb
697
700
  - lib/generators/disco_app/templates/config/newrelic.yml
698
701
  - lib/generators/disco_app/templates/config/puma.rb
699
702
  - lib/generators/disco_app/templates/controllers/home_controller.rb
@@ -706,6 +709,7 @@ files:
706
709
  - lib/generators/disco_app/templates/root/.editorconfig
707
710
  - lib/generators/disco_app/templates/root/.env
708
711
  - lib/generators/disco_app/templates/root/.env.local
712
+ - lib/generators/disco_app/templates/root/.github/PULL_REQUEST_TEMPLATE.md
709
713
  - lib/generators/disco_app/templates/root/.gitignore
710
714
  - lib/generators/disco_app/templates/root/.rubocop.yml
711
715
  - lib/generators/disco_app/templates/root/.ruby-version
@@ -772,6 +776,7 @@ files:
772
776
  - test/dummy/config/environment.rb
773
777
  - test/dummy/config/environments/development.rb
774
778
  - test/dummy/config/environments/production.rb
779
+ - test/dummy/config/environments/staging.rb
775
780
  - test/dummy/config/environments/test.rb
776
781
  - test/dummy/config/initializers/assets.rb
777
782
  - test/dummy/config/initializers/backtrace_silencers.rb
@@ -899,164 +904,165 @@ required_rubygems_version: !ruby/object:Gem::Requirement
899
904
  version: '0'
900
905
  requirements: []
901
906
  rubyforge_project:
902
- rubygems_version: 2.7.3
907
+ rubygems_version: 2.7.7
903
908
  signing_key:
904
909
  specification_version: 4
905
910
  summary: Rails engine for Shopify applications.
906
911
  test_files:
907
- - test/clients/disco_app/api_client_test.rb
908
- - test/dummy/app/models/disco_app/shop.rb
909
- - test/dummy/app/models/product.rb
910
- - test/dummy/app/models/js_configuration.rb
911
- - test/dummy/app/models/widget_configuration.rb
912
- - test/dummy/app/models/application_record.rb
913
- - test/dummy/app/models/cart.rb
912
+ - test/dummy/public/500.html
913
+ - test/dummy/public/favicon.ico
914
+ - test/dummy/public/422.html
915
+ - test/dummy/public/404.html
916
+ - test/dummy/bin/rake
917
+ - test/dummy/bin/rails
918
+ - test/dummy/bin/setup
919
+ - test/dummy/bin/bundle
920
+ - test/dummy/Rakefile
921
+ - test/dummy/config.ru
922
+ - test/dummy/app/assets/stylesheets/application.scss
923
+ - test/dummy/app/assets/javascripts/application.js
924
+ - test/dummy/app/jobs/products_create_job.rb
925
+ - test/dummy/app/jobs/products_update_job.rb
914
926
  - test/dummy/app/jobs/disco_app/app_installed_job.rb
915
927
  - test/dummy/app/jobs/disco_app/app_uninstalled_job.rb
928
+ - test/dummy/app/jobs/application_job.rb
916
929
  - test/dummy/app/jobs/products_delete_job.rb
917
- - test/dummy/app/jobs/products_update_job.rb
918
- - test/dummy/app/jobs/products_create_job.rb
919
930
  - test/dummy/app/jobs/carts_update_job.rb
920
- - test/dummy/app/jobs/application_job.rb
921
- - test/dummy/app/controllers/application_controller.rb
922
- - test/dummy/app/controllers/carrier_request_controller.rb
931
+ - test/dummy/app/controllers/home_controller.rb
923
932
  - test/dummy/app/controllers/disco_app/admin/shops_controller.rb
933
+ - test/dummy/app/controllers/carrier_request_controller.rb
924
934
  - test/dummy/app/controllers/proxy_controller.rb
925
- - test/dummy/app/controllers/home_controller.rb
926
- - test/dummy/app/views/snippets/widget.liquid.erb
927
- - test/dummy/app/views/home/index.html.erb
935
+ - test/dummy/app/controllers/application_controller.rb
936
+ - test/dummy/app/helpers/application_helper.rb
937
+ - test/dummy/app/models/disco_app/shop.rb
938
+ - test/dummy/app/models/product.rb
939
+ - test/dummy/app/models/widget_configuration.rb
940
+ - test/dummy/app/models/js_configuration.rb
941
+ - test/dummy/app/models/application_record.rb
942
+ - test/dummy/app/models/cart.rb
943
+ - test/dummy/app/views/assets/script_tag.js.erb
928
944
  - test/dummy/app/views/assets/widget.scss.erb
929
- - test/dummy/app/views/assets/widget.js.erb
930
945
  - test/dummy/app/views/assets/test.js.erb
931
- - test/dummy/app/views/assets/script_tag.js.erb
932
- - test/dummy/app/assets/javascripts/application.js
933
- - test/dummy/app/assets/stylesheets/application.scss
934
- - test/dummy/app/helpers/application_helper.rb
935
- - test/dummy/bin/rake
936
- - test/dummy/bin/setup
937
- - test/dummy/bin/bundle
938
- - test/dummy/bin/rails
939
- - test/dummy/config/secrets.yml
940
- - test/dummy/config/routes.rb
946
+ - test/dummy/app/views/assets/widget.js.erb
947
+ - test/dummy/app/views/snippets/widget.liquid.erb
948
+ - test/dummy/app/views/home/index.html.erb
949
+ - test/dummy/db/migrate/20161105054746_create_carts.rb
950
+ - test/dummy/db/migrate/20160530160739_create_asset_models.rb
951
+ - test/dummy/db/migrate/20160307182229_create_products.rb
952
+ - test/dummy/db/schema.rb
941
953
  - test/dummy/config/locales/en.yml
942
- - test/dummy/config/environments/production.rb
943
- - test/dummy/config/environments/development.rb
944
- - test/dummy/config/environments/test.rb
945
- - test/dummy/config/environment.rb
946
- - test/dummy/config/application.rb
947
- - test/dummy/config/database.yml
948
- - test/dummy/config/database.codeship.yml
949
- - test/dummy/config/boot.rb
950
- - test/dummy/config/initializers/shopify_app.rb
951
- - test/dummy/config/initializers/backtrace_silencers.rb
952
- - test/dummy/config/initializers/mime_types.rb
953
954
  - test/dummy/config/initializers/filter_parameter_logging.rb
954
- - test/dummy/config/initializers/shopify_session_repository.rb
955
+ - test/dummy/config/initializers/assets.rb
955
956
  - test/dummy/config/initializers/session_store.rb
957
+ - test/dummy/config/initializers/inflections.rb
958
+ - test/dummy/config/initializers/mime_types.rb
956
959
  - test/dummy/config/initializers/wrap_parameters.rb
957
- - test/dummy/config/initializers/assets.rb
958
- - test/dummy/config/initializers/cookies_serializer.rb
959
960
  - test/dummy/config/initializers/disco_app.rb
961
+ - test/dummy/config/initializers/shopify_app.rb
962
+ - test/dummy/config/initializers/shopify_session_repository.rb
963
+ - test/dummy/config/initializers/backtrace_silencers.rb
960
964
  - test/dummy/config/initializers/omniauth.rb
961
- - test/dummy/config/initializers/inflections.rb
962
- - test/dummy/config.ru
963
- - test/dummy/Rakefile
964
- - test/dummy/public/favicon.ico
965
- - test/dummy/public/422.html
966
- - test/dummy/public/500.html
967
- - test/dummy/public/404.html
968
- - test/dummy/db/schema.rb
969
- - test/dummy/db/migrate/20161105054746_create_carts.rb
970
- - test/dummy/db/migrate/20160530160739_create_asset_models.rb
971
- - test/dummy/db/migrate/20160307182229_create_products.rb
972
- - test/integration/synchronises_test.rb
973
- - test/models/disco_app/session_test.rb
974
- - test/models/disco_app/renders_assets_test.rb
975
- - test/models/disco_app/has_metafields_test.rb
976
- - test/models/disco_app/plan_test.rb
977
- - test/models/disco_app/shop_test.rb
978
- - test/models/disco_app/can_be_liquified_test.rb
979
- - test/models/disco_app/subscription_test.rb
980
- - test/disco_app_test.rb
981
- - test/vcr/webhook_failure.yml
982
- - test/support/test_shopify_api.rb
983
- - test/support/test_file_fixtures.rb
984
- - test/fixtures/products.yml
985
- - test/fixtures/disco_app/application_charges.yml
986
- - test/fixtures/disco_app/shops.yml
987
- - test/fixtures/disco_app/plan_codes.yml
988
- - test/fixtures/disco_app/subscriptions.yml
989
- - test/fixtures/disco_app/sources.yml
990
- - test/fixtures/disco_app/recurring_application_charges.yml
991
- - test/fixtures/disco_app/plans.yml
992
- - test/fixtures/widget_configurations.yml
965
+ - test/dummy/config/initializers/cookies_serializer.rb
966
+ - test/dummy/config/secrets.yml
967
+ - test/dummy/config/routes.rb
968
+ - test/dummy/config/database.codeship.yml
969
+ - test/dummy/config/environments/production.rb
970
+ - test/dummy/config/environments/test.rb
971
+ - test/dummy/config/environments/development.rb
972
+ - test/dummy/config/environments/staging.rb
973
+ - test/dummy/config/environment.rb
974
+ - test/dummy/config/boot.rb
975
+ - test/dummy/config/database.yml
976
+ - test/dummy/config/application.rb
993
977
  - test/fixtures/liquid/model.liquid
978
+ - test/fixtures/api/subscriptions/valid_request.json
979
+ - test/fixtures/api/widget_store/users.json
994
980
  - test/fixtures/api/widget_store/carrier_services.json
995
- - test/fixtures/api/widget_store/webhooks.json
981
+ - test/fixtures/api/widget_store/assets/create_test_js_response.json
982
+ - test/fixtures/api/widget_store/assets/create_widget_js_response.json
983
+ - test/fixtures/api/widget_store/assets/create_test_js_request.json
984
+ - test/fixtures/api/widget_store/assets/update_script_tag_request.json
985
+ - test/fixtures/api/widget_store/assets/create_script_tag_response.json
986
+ - test/fixtures/api/widget_store/assets/create_script_tag_js_response.json
987
+ - test/fixtures/api/widget_store/assets/create_widget_scss_request.json
988
+ - test/fixtures/api/widget_store/assets/update_script_tag_response.json
989
+ - test/fixtures/api/widget_store/assets/create_widget_liquid_request.json
990
+ - test/fixtures/api/widget_store/assets/create_script_tag_js_request.json
991
+ - test/fixtures/api/widget_store/assets/create_script_tag_request.json
992
+ - test/fixtures/api/widget_store/assets/get_script_tags_preexisting_response.json
993
+ - test/fixtures/api/widget_store/assets/create_widget_scss_response.json
994
+ - test/fixtures/api/widget_store/assets/create_widget_liquid_response.json
995
+ - test/fixtures/api/widget_store/assets/get_script_tags_preexisting_request.json
996
+ - test/fixtures/api/widget_store/assets/get_script_tags_empty_response.json
997
+ - test/fixtures/api/widget_store/assets/get_script_tags_empty_request.json
998
+ - test/fixtures/api/widget_store/assets/create_widget_js_request.json
996
999
  - test/fixtures/api/widget_store/products/write_metafields_single_namespace_response.json
1000
+ - test/fixtures/api/widget_store/products/write_metafields_multiple_namespaces_request.json
997
1001
  - test/fixtures/api/widget_store/products/write_metafields_multiple_namespaces_response.json
998
1002
  - test/fixtures/api/widget_store/products/write_metafields_single_namespace_request.json
999
- - test/fixtures/api/widget_store/products/write_metafields_multiple_namespaces_request.json
1000
- - test/fixtures/api/widget_store/charges/activate_recurring_application_charge_request.json
1001
- - test/fixtures/api/widget_store/charges/activate_application_charge_request.json
1002
- - test/fixtures/api/widget_store/charges/get_pending_application_charge_response.json
1003
- - test/fixtures/api/widget_store/charges/activate_recurring_application_charge_response.json
1004
- - test/fixtures/api/widget_store/charges/create_application_charge_request.json
1003
+ - test/fixtures/api/widget_store/webhooks.json
1005
1004
  - test/fixtures/api/widget_store/charges/create_application_charge_response.json
1005
+ - test/fixtures/api/widget_store/charges/create_second_recurring_application_charge_response.json
1006
1006
  - test/fixtures/api/widget_store/charges/activate_application_charge_response.json
1007
- - test/fixtures/api/widget_store/charges/create_recurring_application_charge_request.json
1008
- - test/fixtures/api/widget_store/charges/get_declined_application_charge_response.json
1009
- - test/fixtures/api/widget_store/charges/get_declined_recurring_application_charge_response.json
1007
+ - test/fixtures/api/widget_store/charges/create_application_charge_request.json
1008
+ - test/fixtures/api/widget_store/charges/create_recurring_application_charge_response.json
1010
1009
  - test/fixtures/api/widget_store/charges/get_pending_recurring_application_charge_response.json
1010
+ - test/fixtures/api/widget_store/charges/get_declined_recurring_application_charge_response.json
1011
+ - test/fixtures/api/widget_store/charges/get_pending_application_charge_response.json
1012
+ - test/fixtures/api/widget_store/charges/activate_recurring_application_charge_response.json
1011
1013
  - test/fixtures/api/widget_store/charges/get_accepted_recurring_application_charge_response.json
1012
- - test/fixtures/api/widget_store/charges/create_second_recurring_application_charge_request.json
1013
- - test/fixtures/api/widget_store/charges/create_second_recurring_application_charge_response.json
1014
+ - test/fixtures/api/widget_store/charges/activate_recurring_application_charge_request.json
1014
1015
  - test/fixtures/api/widget_store/charges/get_accepted_application_charge_response.json
1015
- - test/fixtures/api/widget_store/charges/create_recurring_application_charge_response.json
1016
- - test/fixtures/api/widget_store/users.json
1017
- - test/fixtures/api/widget_store/shop.json
1016
+ - test/fixtures/api/widget_store/charges/create_recurring_application_charge_request.json
1017
+ - test/fixtures/api/widget_store/charges/get_declined_application_charge_response.json
1018
+ - test/fixtures/api/widget_store/charges/create_second_recurring_application_charge_request.json
1019
+ - test/fixtures/api/widget_store/charges/activate_application_charge_request.json
1018
1020
  - test/fixtures/api/widget_store/carrier_services_create.json
1019
- - test/fixtures/api/widget_store/assets/create_widget_liquid_request.json
1020
- - test/fixtures/api/widget_store/assets/create_test_js_response.json
1021
- - test/fixtures/api/widget_store/assets/create_widget_js_request.json
1022
- - test/fixtures/api/widget_store/assets/update_script_tag_response.json
1023
- - test/fixtures/api/widget_store/assets/create_script_tag_js_response.json
1024
- - test/fixtures/api/widget_store/assets/create_script_tag_response.json
1025
- - test/fixtures/api/widget_store/assets/create_widget_scss_request.json
1026
- - test/fixtures/api/widget_store/assets/get_script_tags_preexisting_response.json
1027
- - test/fixtures/api/widget_store/assets/create_widget_liquid_response.json
1028
- - test/fixtures/api/widget_store/assets/get_script_tags_preexisting_request.json
1029
- - test/fixtures/api/widget_store/assets/create_widget_scss_response.json
1030
- - test/fixtures/api/widget_store/assets/create_script_tag_request.json
1031
- - test/fixtures/api/widget_store/assets/create_widget_js_response.json
1032
- - test/fixtures/api/widget_store/assets/get_script_tags_empty_request.json
1033
- - test/fixtures/api/widget_store/assets/update_script_tag_request.json
1034
- - test/fixtures/api/widget_store/assets/create_script_tag_js_request.json
1035
- - test/fixtures/api/widget_store/assets/create_test_js_request.json
1036
- - test/fixtures/api/widget_store/assets/get_script_tags_empty_response.json
1037
- - test/fixtures/api/subscriptions/valid_request.json
1038
- - test/fixtures/webhooks/product_deleted.json
1039
- - test/fixtures/webhooks/cart_updated.json
1040
- - test/fixtures/webhooks/product_updated.json
1041
- - test/fixtures/webhooks/product_created.json
1042
- - test/fixtures/webhooks/app_uninstalled.json
1021
+ - test/fixtures/api/widget_store/shop.json
1043
1022
  - test/fixtures/assets/test.js
1044
1023
  - test/fixtures/assets/test.min.js
1045
- - test/fixtures/carts.yml
1024
+ - test/fixtures/widget_configurations.yml
1046
1025
  - test/fixtures/js_configurations.yml
1026
+ - test/fixtures/disco_app/sources.yml
1027
+ - test/fixtures/disco_app/plan_codes.yml
1028
+ - test/fixtures/disco_app/shops.yml
1029
+ - test/fixtures/disco_app/application_charges.yml
1030
+ - test/fixtures/disco_app/subscriptions.yml
1031
+ - test/fixtures/disco_app/plans.yml
1032
+ - test/fixtures/disco_app/recurring_application_charges.yml
1033
+ - test/fixtures/carts.yml
1034
+ - test/fixtures/webhooks/cart_updated.json
1035
+ - test/fixtures/webhooks/app_uninstalled.json
1036
+ - test/fixtures/webhooks/product_updated.json
1037
+ - test/fixtures/webhooks/product_created.json
1038
+ - test/fixtures/webhooks/product_deleted.json
1039
+ - test/fixtures/products.yml
1040
+ - test/support/test_file_fixtures.rb
1041
+ - test/support/test_shopify_api.rb
1047
1042
  - test/test_helper.rb
1048
- - test/jobs/disco_app/synchronise_users_job_test.rb
1049
- - test/jobs/disco_app/synchronise_webhooks_job_test.rb
1043
+ - test/disco_app_test.rb
1050
1044
  - test/jobs/disco_app/app_uninstalled_job_test.rb
1051
1045
  - test/jobs/disco_app/synchronise_carrier_service_job_test.rb
1046
+ - test/jobs/disco_app/synchronise_users_job_test.rb
1052
1047
  - test/jobs/disco_app/send_subscription_job_test.rb
1048
+ - test/jobs/disco_app/synchronise_webhooks_job_test.rb
1053
1049
  - test/jobs/disco_app/app_installed_job_test.rb
1054
- - test/controllers/proxy_controller_test.rb
1050
+ - test/vcr/webhook_failure.yml
1055
1051
  - test/controllers/disco_app/install_controller_test.rb
1056
- - test/controllers/disco_app/charges_controller_test.rb
1052
+ - test/controllers/disco_app/webhooks_controller_test.rb
1057
1053
  - test/controllers/disco_app/admin/shops_controller_test.rb
1058
1054
  - test/controllers/disco_app/subscriptions_controller_test.rb
1059
- - test/controllers/disco_app/webhooks_controller_test.rb
1055
+ - test/controllers/disco_app/charges_controller_test.rb
1056
+ - test/controllers/proxy_controller_test.rb
1060
1057
  - test/controllers/home_controller_test.rb
1061
- - test/services/disco_app/subscription_service_test.rb
1058
+ - test/integration/synchronises_test.rb
1059
+ - test/clients/disco_app/api_client_test.rb
1060
+ - test/models/disco_app/plan_test.rb
1061
+ - test/models/disco_app/has_metafields_test.rb
1062
+ - test/models/disco_app/shop_test.rb
1063
+ - test/models/disco_app/session_test.rb
1064
+ - test/models/disco_app/subscription_test.rb
1065
+ - test/models/disco_app/can_be_liquified_test.rb
1066
+ - test/models/disco_app/renders_assets_test.rb
1062
1067
  - test/services/disco_app/charges_service_test.rb
1068
+ - test/services/disco_app/subscription_service_test.rb