disco_app 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +7 -0
  2. data/Rakefile +37 -0
  3. data/app/assets/images/disco_app/icon.svg +1 -0
  4. data/app/assets/javascripts/disco_app/disco_app.js +7 -0
  5. data/app/assets/stylesheets/disco_app/bootstrap/_custom.scss +54 -0
  6. data/app/assets/stylesheets/disco_app/bootstrap/_variables.scss +872 -0
  7. data/app/assets/stylesheets/disco_app/disco/_buttons.scss +31 -0
  8. data/app/assets/stylesheets/disco_app/disco/_cards.scss +43 -0
  9. data/app/assets/stylesheets/disco_app/disco/_forms.scss +23 -0
  10. data/app/assets/stylesheets/disco_app/disco/_sections.scss +61 -0
  11. data/app/assets/stylesheets/disco_app/disco/_type.scss +21 -0
  12. data/app/assets/stylesheets/disco_app/disco/mixins/_flexbox.scss +394 -0
  13. data/app/assets/stylesheets/disco_app/disco_app.scss +13 -0
  14. data/app/controllers/disco_app/app_proxy_controller.rb +41 -0
  15. data/app/controllers/disco_app/authenticated_controller.rb +44 -0
  16. data/app/controllers/disco_app/carrier_request_controller.rb +28 -0
  17. data/app/controllers/disco_app/charges_controller.rb +30 -0
  18. data/app/controllers/disco_app/install_controller.rb +26 -0
  19. data/app/controllers/disco_app/webhooks_controller.rb +42 -0
  20. data/app/helpers/disco_app/application_helper.rb +4 -0
  21. data/app/jobs/disco_app/app_installed_job.rb +41 -0
  22. data/app/jobs/disco_app/app_uninstalled_job.rb +3 -0
  23. data/app/jobs/disco_app/concerns/app_uninstalled_job.rb +19 -0
  24. data/app/jobs/disco_app/shop_job.rb +29 -0
  25. data/app/jobs/disco_app/shop_update_job.rb +16 -0
  26. data/app/models/disco_app/concerns/plan.rb +14 -0
  27. data/app/models/disco_app/concerns/shop.rb +62 -0
  28. data/app/models/disco_app/concerns/subscription.rb +14 -0
  29. data/app/models/disco_app/plan.rb +3 -0
  30. data/app/models/disco_app/session_storage.rb +18 -0
  31. data/app/models/disco_app/shop.rb +3 -0
  32. data/app/models/disco_app/subscription.rb +3 -0
  33. data/app/services/disco_app/charges_service.rb +73 -0
  34. data/app/services/disco_app/subscription_service.rb +25 -0
  35. data/app/services/disco_app/webhook_service.rb +30 -0
  36. data/app/views/disco_app/charges/activate.html.erb +1 -0
  37. data/app/views/disco_app/charges/create.html.erb +1 -0
  38. data/app/views/disco_app/charges/new.html.erb +45 -0
  39. data/app/views/disco_app/install/installing.html.erb +7 -0
  40. data/app/views/disco_app/install/uninstalling.html.erb +1 -0
  41. data/app/views/disco_app/proxy_errors/404.html.erb +1 -0
  42. data/app/views/disco_app/shared/_card.html.erb +16 -0
  43. data/app/views/disco_app/shared/_section.html.erb +17 -0
  44. data/app/views/layouts/application.html.erb +18 -0
  45. data/app/views/layouts/embedded_app.html.erb +41 -0
  46. data/app/views/sessions/new.html.erb +26 -0
  47. data/config/routes.rb +19 -0
  48. data/db/migrate/20150525000000_create_shops_if_not_existent.rb +15 -0
  49. data/db/migrate/20150525162112_add_status_to_shops.rb +5 -0
  50. data/db/migrate/20150525171422_add_meta_to_shops.rb +11 -0
  51. data/db/migrate/20150629210346_add_charge_status_to_shop.rb +5 -0
  52. data/db/migrate/20150814214025_add_more_meta_to_shops.rb +15 -0
  53. data/db/migrate/20151017231302_create_disco_app_plans.rb +13 -0
  54. data/db/migrate/20151017232027_create_disco_app_subscriptions.rb +15 -0
  55. data/db/migrate/20151017234409_move_shop_to_disco_app_engine.rb +5 -0
  56. data/lib/disco_app/engine.rb +11 -0
  57. data/lib/disco_app/version.rb +3 -0
  58. data/lib/disco_app.rb +4 -0
  59. data/lib/generators/disco_app/USAGE +5 -0
  60. data/lib/generators/disco_app/disco_app_generator.rb +159 -0
  61. data/lib/generators/disco_app/mailify/mailify_generator.rb +55 -0
  62. data/lib/generators/disco_app/reactify/reactify_generator.rb +31 -0
  63. data/lib/generators/disco_app/templates/assets/javascripts/application.js +17 -0
  64. data/lib/generators/disco_app/templates/assets/stylesheets/application.scss +5 -0
  65. data/lib/generators/disco_app/templates/config/puma.rb +15 -0
  66. data/lib/generators/disco_app/templates/controllers/home_controller.rb +7 -0
  67. data/lib/generators/disco_app/templates/initializers/disco_app.rb +1 -0
  68. data/lib/generators/disco_app/templates/initializers/shopify_app.rb +7 -0
  69. data/lib/generators/disco_app/templates/initializers/shopify_session_repository.rb +7 -0
  70. data/lib/generators/disco_app/templates/root/Procfile +2 -0
  71. data/lib/generators/disco_app/templates/views/home/index.html.erb +2 -0
  72. data/test/controllers/disco_app/install_controller_test.rb +50 -0
  73. data/test/controllers/disco_app/webhooks_controller_test.rb +58 -0
  74. data/test/controllers/home_controller_test.rb +61 -0
  75. data/test/disco_app_test.rb +7 -0
  76. data/test/dummy/Rakefile +6 -0
  77. data/test/dummy/app/assets/javascripts/application.js +17 -0
  78. data/test/dummy/app/assets/stylesheets/application.scss +5 -0
  79. data/test/dummy/app/controllers/application_controller.rb +6 -0
  80. data/test/dummy/app/controllers/home_controller.rb +7 -0
  81. data/test/dummy/app/helpers/application_helper.rb +2 -0
  82. data/test/dummy/app/jobs/disco_app/app_uninstalled_job.rb +11 -0
  83. data/test/dummy/app/models/disco_app/shop.rb +15 -0
  84. data/test/dummy/app/views/home/index.html.erb +2 -0
  85. data/test/dummy/bin/bundle +3 -0
  86. data/test/dummy/bin/rails +4 -0
  87. data/test/dummy/bin/rake +4 -0
  88. data/test/dummy/bin/setup +29 -0
  89. data/test/dummy/config/application.rb +37 -0
  90. data/test/dummy/config/boot.rb +5 -0
  91. data/test/dummy/config/database.yml +25 -0
  92. data/test/dummy/config/environment.rb +5 -0
  93. data/test/dummy/config/environments/development.rb +41 -0
  94. data/test/dummy/config/environments/production.rb +85 -0
  95. data/test/dummy/config/environments/test.rb +42 -0
  96. data/test/dummy/config/initializers/assets.rb +11 -0
  97. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  98. data/test/dummy/config/initializers/cookies_serializer.rb +3 -0
  99. data/test/dummy/config/initializers/disco_app.rb +1 -0
  100. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  101. data/test/dummy/config/initializers/inflections.rb +16 -0
  102. data/test/dummy/config/initializers/mime_types.rb +4 -0
  103. data/test/dummy/config/initializers/omniauth.rb +9 -0
  104. data/test/dummy/config/initializers/session_store.rb +3 -0
  105. data/test/dummy/config/initializers/shopify_app.rb +7 -0
  106. data/test/dummy/config/initializers/shopify_session_repository.rb +7 -0
  107. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  108. data/test/dummy/config/locales/en.yml +23 -0
  109. data/test/dummy/config/routes.rb +8 -0
  110. data/test/dummy/config/secrets.yml +22 -0
  111. data/test/dummy/config.ru +4 -0
  112. data/test/dummy/db/schema.rb +70 -0
  113. data/test/dummy/public/404.html +67 -0
  114. data/test/dummy/public/422.html +67 -0
  115. data/test/dummy/public/500.html +66 -0
  116. data/test/dummy/public/favicon.ico +0 -0
  117. data/test/fixtures/api/widget_store/shop.json +46 -0
  118. data/test/fixtures/disco_app/plans.yml +32 -0
  119. data/test/fixtures/disco_app/shops.yml +10 -0
  120. data/test/fixtures/disco_app/subscriptions.yml +26 -0
  121. data/test/fixtures/webhooks/app_uninstalled.json +46 -0
  122. data/test/integration/navigation_test.rb +10 -0
  123. data/test/jobs/disco_app/app_installed_job_test.rb +29 -0
  124. data/test/jobs/disco_app/app_uninstalled_job_test.rb +32 -0
  125. data/test/models/disco_app/plan_test.rb +5 -0
  126. data/test/models/disco_app/shop_test.rb +26 -0
  127. data/test/models/disco_app/subscription_test.rb +6 -0
  128. data/test/services/disco_app/subscription_service_test.rb +28 -0
  129. data/test/support/test_file_fixtures.rb +29 -0
  130. data/test/test_helper.rb +51 -0
  131. metadata +456 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1755c833438d9a42cdbc39e3016a20bb83f3110e472282daf58cc9c5fe56f86d
4
+ data.tar.gz: b2f041535874d1e8ecd4996d8ead0ebab4d6b6e5ac86e3087263fede8fec71c3
5
+ SHA512:
6
+ metadata.gz: 348c5d1933877e55d664eb17afcf73ff3121c705447afe78ce1460ac0a35709a506538c9020dc6d6c644ddb2a7a4a3d1af77178905c869f06acf7e6cd0d6cda4
7
+ data.tar.gz: 62b3d647d57a6f5ab9860e23940f052251c953de3ea86a9f1f43e4776aad5834fda7cc90f1a90f917f1e37634b5b1c79d3310e49f45cbc99146eef777ec7eb65
data/Rakefile ADDED
@@ -0,0 +1,37 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'DiscoApp'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+ load 'rails/tasks/statistics.rake'
22
+
23
+
24
+
25
+ Bundler::GemHelper.install_tasks
26
+
27
+ require 'rake/testtask'
28
+
29
+ Rake::TestTask.new(:test) do |t|
30
+ t.libs << 'lib'
31
+ t.libs << 'test'
32
+ t.pattern = 'test/**/*_test.rb'
33
+ t.verbose = false
34
+ end
35
+
36
+
37
+ task default: :test
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><style>.st0{fill:#231F20;} .st1{fill:#FBAF41;} .st2{fill:#8676D5;} .st3{fill:#9CCC6B;} .st4{fill:#FBCC6B;} .st5{fill:#9CCCD5;} .st6{fill:#FFFFFF;}</style><path id="XMLID_7_" class="st0" d="M12 24l-5.2-3-5.2-3V6l5.2-3L12 0l5.2 3 5.2 3v12l-5.2 3-5.2 3z"/><path id="XMLID_6_" class="st1" d="M2.9 6.8v10.4h18.2z"/><path id="XMLID_5_" class="st2" d="M2.9 17.2h18.2V6.8z"/><path id="XMLID_4_" class="st3" d="M21.1 17.2L12 1.5 2.9 17.2z"/><path id="XMLID_3_" class="st4" d="M7.5 9.4l-4.6 7.8h18.2z"/><path id="XMLID_2_" class="st5" d="M2.9 17.2h18.2l-4.6-7.8z"/><path id="XMLID_1_" class="st6" d="M12 12l-9.1 5.2 9.1 5.3 9.1-5.3z"/></svg>
@@ -0,0 +1,7 @@
1
+ /**
2
+ * disco_app/disco_app.js
3
+ * Base Javascript for Disco applications.
4
+ * Assumes that jQuery will be loaded in the parent application.js.
5
+ */
6
+ //= require bootstrap-sprockets
7
+ //= require_tree .
@@ -0,0 +1,54 @@
1
+ //
2
+ // Select the Bootstrap components to pull in.
3
+ // --------------------------------------------------
4
+
5
+ // Core variables and mixins
6
+ @import "bootstrap/variables";
7
+ @import "bootstrap/mixins";
8
+
9
+ // Reset and dependencies
10
+ @import "bootstrap/normalize";
11
+ //@import "bootstrap/print";
12
+ //@import "bootstrap/glyphicons";
13
+
14
+ // Core CSS
15
+ @import "bootstrap/scaffolding";
16
+ @import "bootstrap/type";
17
+ //@import "bootstrap/code";
18
+ @import "bootstrap/grid";
19
+ @import "bootstrap/tables";
20
+ @import "bootstrap/forms";
21
+ @import "bootstrap/buttons";
22
+
23
+ // Components
24
+ @import "bootstrap/component-animations";
25
+ @import "bootstrap/dropdowns";
26
+ @import "bootstrap/button-groups";
27
+ @import "bootstrap/input-groups";
28
+ @import "bootstrap/navs";
29
+ @import "bootstrap/navbar";
30
+ //@import "bootstrap/breadcrumbs";
31
+ //@import "bootstrap/pagination";
32
+ //@import "bootstrap/pager";
33
+ @import "bootstrap/labels";
34
+ @import "bootstrap/badges";
35
+ //@import "bootstrap/jumbotron";
36
+ @import "bootstrap/thumbnails";
37
+ @import "bootstrap/alerts";
38
+ @import "bootstrap/progress-bars";
39
+ @import "bootstrap/media";
40
+ @import "bootstrap/list-group";
41
+ @import "bootstrap/panels";
42
+ //@import "bootstrap/responsive-embed";
43
+ //@import "bootstrap/wells";
44
+ @import "bootstrap/close";
45
+
46
+ // Components w/ JavaScript
47
+ //@import "bootstrap/modals";
48
+ //@import "bootstrap/tooltip";
49
+ //@import "bootstrap/popovers";
50
+ //@import "bootstrap/carousel";
51
+
52
+ // Utility classes
53
+ @import "bootstrap/utilities";
54
+ @import "bootstrap/responsive-utilities";