workarea-product_videos 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +16 -0
  3. data/.eslintrc +27 -0
  4. data/.gitignore +19 -0
  5. data/.rails-rubocop.yml +119 -0
  6. data/.rubocop.yml +7 -0
  7. data/.scss-lint.yml +192 -0
  8. data/CHANGELOG.md +92 -0
  9. data/Gemfile +16 -0
  10. data/README.md +87 -0
  11. data/Rakefile +60 -0
  12. data/app/assets/images/workarea/admin/icons/video.svg +1 -0
  13. data/app/assets/images/workarea/storefront/icons/video_play.svg +1 -0
  14. data/app/assets/javascripts/workarea/storefront/product_videos/modules/vimeo_api.js +81 -0
  15. data/app/assets/javascripts/workarea/storefront/product_videos/modules/youtube_api.js +124 -0
  16. data/app/assets/stylesheets/workarea/storefront/product_videos/components/_product_video.scss +37 -0
  17. data/app/controllers/workarea/admin/catalog_product_videos_controller.rb +52 -0
  18. data/app/controllers/workarea/storefront/products_controller.decorator +19 -0
  19. data/app/models/workarea/catalog/product.decorator +7 -0
  20. data/app/models/workarea/catalog/product_video.rb +32 -0
  21. data/app/services/workarea/video_embed_parser.rb +54 -0
  22. data/app/view_models/workarea/storefront/product_video_view_model.rb +84 -0
  23. data/app/view_models/workarea/storefront/product_view_model.decorator +9 -0
  24. data/app/views/workarea/admin/catalog_product_videos/edit.html.haml +76 -0
  25. data/app/views/workarea/admin/catalog_product_videos/index.html.haml +46 -0
  26. data/app/views/workarea/admin/catalog_product_videos/new.html.haml +57 -0
  27. data/app/views/workarea/admin/catalog_products/_product_videos_card.html.haml +21 -0
  28. data/app/views/workarea/storefront/products/_video_link.html.haml +8 -0
  29. data/app/views/workarea/storefront/products/_video_thumbnail.html.haml +12 -0
  30. data/app/views/workarea/storefront/products/video.html.haml +3 -0
  31. data/bin/rails +20 -0
  32. data/config/initializers/appends.rb +37 -0
  33. data/config/initializers/product_videos.rb +5 -0
  34. data/config/initializers/workarea.rb +3 -0
  35. data/config/locales/en.yml +41 -0
  36. data/config/routes.rb +15 -0
  37. data/lib/workarea/product_videos/engine.rb +8 -0
  38. data/lib/workarea/product_videos/version.rb +5 -0
  39. data/lib/workarea/product_videos.rb +11 -0
  40. data/script/admin_ci +9 -0
  41. data/script/ci +11 -0
  42. data/script/core_ci +9 -0
  43. data/script/plugins_ci +9 -0
  44. data/script/storefront_ci +9 -0
  45. data/test/dummy/Rakefile +6 -0
  46. data/test/dummy/app/assets/config/manifest.js +4 -0
  47. data/test/dummy/app/assets/images/.keep +0 -0
  48. data/test/dummy/app/assets/javascripts/application.js +13 -0
  49. data/test/dummy/app/assets/stylesheets/application.css +15 -0
  50. data/test/dummy/app/controllers/application_controller.rb +3 -0
  51. data/test/dummy/app/controllers/concerns/.keep +0 -0
  52. data/test/dummy/app/helpers/application_helper.rb +2 -0
  53. data/test/dummy/app/jobs/application_job.rb +2 -0
  54. data/test/dummy/app/mailers/application_mailer.rb +4 -0
  55. data/test/dummy/app/models/concerns/.keep +0 -0
  56. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  57. data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
  58. data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
  59. data/test/dummy/bin/bundle +3 -0
  60. data/test/dummy/bin/rails +4 -0
  61. data/test/dummy/bin/rake +4 -0
  62. data/test/dummy/bin/setup +38 -0
  63. data/test/dummy/bin/update +29 -0
  64. data/test/dummy/bin/yarn +11 -0
  65. data/test/dummy/config/application.rb +29 -0
  66. data/test/dummy/config/boot.rb +5 -0
  67. data/test/dummy/config/cable.yml +10 -0
  68. data/test/dummy/config/environment.rb +5 -0
  69. data/test/dummy/config/environments/development.rb +54 -0
  70. data/test/dummy/config/environments/production.rb +91 -0
  71. data/test/dummy/config/environments/test.rb +44 -0
  72. data/test/dummy/config/initializers/application_controller_renderer.rb +8 -0
  73. data/test/dummy/config/initializers/assets.rb +14 -0
  74. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  75. data/test/dummy/config/initializers/cookies_serializer.rb +5 -0
  76. data/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  77. data/test/dummy/config/initializers/inflections.rb +16 -0
  78. data/test/dummy/config/initializers/mime_types.rb +4 -0
  79. data/test/dummy/config/initializers/new_framework_defaults.rb +23 -0
  80. data/test/dummy/config/initializers/session_store.rb +3 -0
  81. data/test/dummy/config/initializers/workarea.rb +5 -0
  82. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  83. data/test/dummy/config/locales/en.yml +33 -0
  84. data/test/dummy/config/puma.rb +56 -0
  85. data/test/dummy/config/routes.rb +5 -0
  86. data/test/dummy/config/secrets.yml +32 -0
  87. data/test/dummy/config/spring.rb +6 -0
  88. data/test/dummy/config.ru +5 -0
  89. data/test/dummy/db/seeds.rb +2 -0
  90. data/test/dummy/lib/assets/.keep +0 -0
  91. data/test/dummy/log/.keep +0 -0
  92. data/test/dummy/package.json +5 -0
  93. data/test/factories/embed_codes.rb +15 -0
  94. data/test/integration/workarea/admin/product_videos_integration_test.rb +59 -0
  95. data/test/integration/workarea/storefront/product_videos_integration_test.rb +30 -0
  96. data/test/services/workarea/video_embedder_test.rb +27 -0
  97. data/test/system/workarea/admin/product_videos_system_test.rb +58 -0
  98. data/test/system/workarea/storefront/product_videos_system_test.rb +60 -0
  99. data/test/teaspoon_env.rb +6 -0
  100. data/test/test_helper.rb +10 -0
  101. data/test/view_models/workarea/storefront/product_video_view_model_test.rb +46 -0
  102. data/workarea-product_videos.gemspec +19 -0
  103. metadata +157 -0
@@ -0,0 +1,21 @@
1
+ .grid__cell
2
+ .card{ class: card_classes(:videos, local_assigns[:active]) }
3
+ = link_to catalog_product_videos_path(model), class: 'card__header' do
4
+ %span.card__header-text= t('workarea.admin.catalog_products.cards.videos.title')
5
+ = inline_svg 'workarea/admin/icons/video.svg', class: 'card__icon'
6
+ - if local_assigns[:active].blank?
7
+ .card__body
8
+ - if @product.videos.count < 1
9
+ %p.card__empty-note= t('workarea.admin.catalog_products.cards.videos.no_videos')
10
+
11
+ = link_to new_catalog_product_video_path(model), class: 'card__button' do
12
+ %span.button.button--small= t('workarea.admin.catalog_products.cards.videos.add_button')
13
+ - else
14
+ %ul.list-reset
15
+ - @product.videos.each do |video|
16
+ %li
17
+ %strong Embed ID
18
+ = video[:embed_id]
19
+
20
+ = link_to catalog_product_videos_path(model), class: 'card__button' do
21
+ %span.button.button--small= t('workarea.admin.catalog_products.cards.videos.manage_button')
@@ -0,0 +1,8 @@
1
+ - if @product.videos.present?
2
+ - @product.videos.each do |video|
3
+ .product-video
4
+ - if video.display_option == 'dialog'
5
+ = link_to t('workarea.storefront.products.watch_this_video'), product_video_path(@product.id, video.id), data: { dialog_button: { dialogOptions: { uiDialogOptions: { dialogClass: 'ui-dialog-video' } } } }, class: "product-video__dialog-link"
6
+ - elsif video.display_option == 'embedded'
7
+ .product-video__container
8
+ %iframe.product-video__iframe{ video.iframe_attrs }
@@ -0,0 +1,12 @@
1
+ - if product.videos.present?
2
+ - product.videos.each do |video|
3
+ - if video.display_option == 'thumbnail'
4
+ .grid__cell
5
+ .product-details__alt-image
6
+ = link_to(product_video_path(product.id, video.id), class: 'product-details__alt-image-link', target: '_blank', rel: 'noopener', data: { dialog_button: { dialog_options: { ui_dialog_options: { dialog_class: 'ui-dialog-video' } } }.to_json }) do
7
+ .product-video.product-video--thumbnail
8
+ = inline_svg('workarea/storefront/icons/video_play.svg', class: 'svg-icon product-video__play-icon', title: t('workarea.storefront.products.watch_this_video'))
9
+ - if video.thumbnail.present?
10
+ = image_tag(video.thumbnail.process(:small_thumb).url, alt: t('workarea.storefront.products.watch_this_video'), class: 'product-video__thumbnail')
11
+ - else
12
+ = image_tag(product_image_url(product.images.first, :small_thumb), alt: t('workarea.storefront.products.watch_this_video'), class: 'product-video__thumbnail')
@@ -0,0 +1,3 @@
1
+ .product-video
2
+ .product-video__container
3
+ %iframe.product-video__iframe{ @video.iframe_attrs }
data/bin/rails ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails gems
3
+ # installed from the root of your application.
4
+
5
+ ENGINE_ROOT = File.expand_path("../..", __FILE__)
6
+ ENGINE_PATH = File.expand_path("../../lib/product_videos/engine", __FILE__)
7
+ APP_PATH = File.expand_path("../../test/dummy/config/application", __FILE__)
8
+
9
+ # Set up gems listed in the Gemfile.
10
+ ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
11
+ require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
12
+
13
+ require "action_controller/railtie"
14
+ require "action_view/railtie"
15
+ require "action_mailer/railtie"
16
+ require "rails/test_unit/railtie"
17
+ require "sprockets/railtie"
18
+ require "teaspoon-mocha"
19
+
20
+ require "rails/engine/commands"
@@ -0,0 +1,37 @@
1
+ module Workarea
2
+ should_append_video_api_modules = proc do
3
+ if Plugin.javascripts_appends["storefront.modules"].nil?
4
+ true
5
+ else
6
+ Plugin.javascripts_appends["storefront.modules"].none? { |append| %r{/modules/youtube_api} =~ append }
7
+ end
8
+ end
9
+
10
+ Plugin.append_partials(
11
+ "admin.catalog_product_cards",
12
+ "workarea/admin/catalog_products/product_videos_card"
13
+ )
14
+
15
+ Plugin.append_partials(
16
+ "storefront.product_description",
17
+ "workarea/storefront/products/video_link"
18
+ )
19
+
20
+ Plugin.append_partials(
21
+ "storefront.product_details_alt_images",
22
+ "workarea/storefront/products/video_thumbnail"
23
+ )
24
+
25
+ if should_append_video_api_modules.call
26
+ Plugin.append_javascripts(
27
+ "storefront.modules",
28
+ "workarea/storefront/product_videos/modules/youtube_api",
29
+ "workarea/storefront/product_videos/modules/vimeo_api"
30
+ )
31
+ end
32
+
33
+ Plugin.append_stylesheets(
34
+ "storefront.components",
35
+ "workarea/storefront/product_videos/components/product_video",
36
+ )
37
+ end
@@ -0,0 +1,5 @@
1
+ Workarea.configure do |config|
2
+ config.product_videos = {
3
+ display_options: %w[embedded dialog thumbnail]
4
+ }
5
+ end
@@ -0,0 +1,3 @@
1
+ Workarea.configure do |config|
2
+ # Add custom configuration here
3
+ end
@@ -0,0 +1,41 @@
1
+ en:
2
+ workarea:
3
+ admin:
4
+ catalog_product_videos:
5
+ edit:
6
+ extracted_data: Extracted Data
7
+ heading: Edit Video
8
+ title: Edit Video for %{product}
9
+ update_button: Save changes
10
+ fields:
11
+ aspect_ratio: Aspect Ratio
12
+ display_type: Display Type
13
+ display_type_info_html: "<p><strong>Embedded:</strong> Embeds the video directly on the detail page.</p> <p><strong>Dialog:</strong> Opens the video in a dialog</p> <p><strong>Thumbnail:</strong> Adds thumbnail to alternate images, video plays in dialog when thumbnail is clicked. If no thumbnail is provided the primary product image will be used.</p>"
14
+ embed_code: Embed Code
15
+ host: Host
16
+ thumbnail: Thumbnail
17
+ url: URL
18
+ video_id: Embed ID
19
+ flash_messages:
20
+ created: Your video has been added.
21
+ deleted: Your video has been removed.
22
+ error: Your video was not saved.
23
+ updated: Your video has been updated.
24
+ index:
25
+ add_new: Add New
26
+ heading: Manage Videos
27
+ title: Manage Videos for %{product}
28
+ new:
29
+ button: Add video
30
+ heading: New Video
31
+ title: New Video for %{product}
32
+ catalog_products:
33
+ cards:
34
+ videos:
35
+ add_button: Add a Video
36
+ manage_button: Manage Videos
37
+ no_videos: This product has no videos.
38
+ title: Videos
39
+ storefront:
40
+ products:
41
+ watch_this_video: Watch this video
data/config/routes.rb ADDED
@@ -0,0 +1,15 @@
1
+ Workarea::Storefront::Engine.routes.draw do
2
+ scope "(:locale)", constraints: Workarea::I18n.routes_constraint do
3
+ resources :products, only: [:show] do
4
+ get "video/:video_id", to: "products#video", as: :video
5
+ end
6
+ end
7
+ end
8
+
9
+ Workarea::Admin::Engine.routes.draw do
10
+ scope "(:locale)", constraints: Workarea::I18n.routes_constraint do
11
+ resources :catalog_products, only: [:index] do
12
+ resources :videos, controller: "catalog_product_videos"
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,8 @@
1
+ module Workarea
2
+ module ProductVideos
3
+ class Engine < ::Rails::Engine
4
+ include Workarea::Plugin
5
+ isolate_namespace Workarea::ProductVideos
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Workarea
2
+ module ProductVideos
3
+ VERSION = "1.2.2"
4
+ end
5
+ end
@@ -0,0 +1,11 @@
1
+ require "workarea"
2
+ require "workarea/storefront"
3
+ require "workarea/admin"
4
+
5
+ require "workarea/product_videos/engine"
6
+ require "workarea/product_videos/version"
7
+
8
+ module Workarea
9
+ module ProductVideos
10
+ end
11
+ end
data/script/admin_ci ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ gem install bundler
4
+ bundle update
5
+
6
+ CI_GEM_PATH="$(bundle show workarea-ci)"
7
+ . ${CI_GEM_PATH}/exe/workarea-set-ci-env
8
+
9
+ bin/rails app:workarea:test:admin
data/script/ci ADDED
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env bash
2
+
3
+ gem install bundler
4
+ bundle update
5
+
6
+ CI_GEM_PATH="$(bundle show workarea-ci)"
7
+ . ${CI_GEM_PATH}/exe/workarea-set-ci-env
8
+
9
+ bundle exec workarea-lint
10
+ bundle exec workarea-audit
11
+ bin/rails test test/**/*_test.rb
data/script/core_ci ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ gem install bundler
4
+ bundle update
5
+
6
+ CI_GEM_PATH="$(bundle show workarea-ci)"
7
+ . ${CI_GEM_PATH}/exe/workarea-set-ci-env
8
+
9
+ bin/rails app:workarea:test:core
data/script/plugins_ci ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ gem install bundler
4
+ bundle update
5
+
6
+ CI_GEM_PATH="$(bundle show workarea-ci)"
7
+ . ${CI_GEM_PATH}/exe/workarea-set-ci-env
8
+
9
+ bin/rails app:workarea:test:plugins
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env bash
2
+
3
+ gem install bundler
4
+ bundle update
5
+
6
+ CI_GEM_PATH="$(bundle show workarea-ci)"
7
+ . ${CI_GEM_PATH}/exe/workarea-set-ci-env
8
+
9
+ bin/rails app:workarea:test:storefront
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,4 @@
1
+
2
+ //= link_tree ../images
3
+ //= link_directory ../javascripts .js
4
+ //= link_directory ../stylesheets .css
File without changes
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
3
+ end
File without changes
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
File without changes
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= csrf_meta_tags %>
6
+
7
+ <%= stylesheet_link_tag 'application', media: 'all' %>
8
+ <%= javascript_include_tag 'application' %>
9
+ </head>
10
+
11
+ <body>
12
+ <%= yield %>
13
+ </body>
14
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../config/application', __dir__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a starting point to setup your application.
15
+ # Add necessary setup steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ # Install JavaScript dependencies if using Yarn
22
+ # system('bin/yarn')
23
+
24
+
25
+ # puts "\n== Copying sample files =="
26
+ # unless File.exist?('config/database.yml')
27
+ # cp 'config/database.yml.sample', 'config/database.yml'
28
+ # end
29
+
30
+ puts "\n== Preparing database =="
31
+ system! 'bin/rails db:setup'
32
+
33
+ puts "\n== Removing old logs and tempfiles =="
34
+ system! 'bin/rails log:clear tmp:clear'
35
+
36
+ puts "\n== Restarting application server =="
37
+ system! 'bin/rails restart'
38
+ end
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a way to update your development environment automatically.
15
+ # Add necessary update steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ puts "\n== Updating database =="
22
+ system! 'bin/rails db:migrate'
23
+
24
+ puts "\n== Removing old logs and tempfiles =="
25
+ system! 'bin/rails log:clear tmp:clear'
26
+
27
+ puts "\n== Restarting application server =="
28
+ system! 'bin/rails restart'
29
+ end
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ VENDOR_PATH = File.expand_path('..', __dir__)
3
+ Dir.chdir(VENDOR_PATH) do
4
+ begin
5
+ exec "yarnpkg #{ARGV.join(" ")}"
6
+ rescue Errno::ENOENT
7
+ $stderr.puts "Yarn executable was not detected in the system."
8
+ $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
9
+ exit 1
10
+ end
11
+ end
@@ -0,0 +1,29 @@
1
+ require_relative 'boot'
2
+
3
+ require "action_controller/railtie"
4
+ require "action_view/railtie"
5
+ require "action_mailer/railtie"
6
+ require "rails/test_unit/railtie"
7
+ require "sprockets/railtie"
8
+ require 'teaspoon-mocha'
9
+
10
+
11
+ # Workarea must be required before other gems to ensure control over Rails.env
12
+ # for running tests
13
+ require 'workarea/core'
14
+ require 'workarea/admin'
15
+ require 'workarea/storefront'
16
+ Bundler.require(*Rails.groups)
17
+ require "workarea/product_videos"
18
+
19
+ module Dummy
20
+ class Application < Rails::Application
21
+ # Initialize configuration defaults for originally generated Rails version.
22
+ config.load_defaults 5.1
23
+
24
+ # Settings in config/environments/* take precedence over those specified here.
25
+ # Application configuration should go into files in config/initializers
26
+ # -- all .rb files in that directory are automatically loaded.
27
+ end
28
+ end
29
+
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
@@ -0,0 +1,10 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: async
6
+
7
+ production:
8
+ adapter: redis
9
+ url: redis://localhost:6379/1
10
+ channel_prefix: dummy_production
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require_relative 'application'
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,54 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports.
13
+ config.consider_all_requests_local = true
14
+
15
+ # Enable/disable caching. By default caching is disabled.
16
+ if Rails.root.join('tmp/caching-dev.txt').exist?
17
+ config.action_controller.perform_caching = true
18
+
19
+ config.cache_store = :memory_store
20
+ config.public_file_server.headers = {
21
+ 'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
22
+ }
23
+ else
24
+ config.action_controller.perform_caching = false
25
+
26
+ config.cache_store = :null_store
27
+ end
28
+
29
+ # Don't care if the mailer can't send.
30
+ config.action_mailer.raise_delivery_errors = false
31
+
32
+ config.action_mailer.perform_caching = false
33
+
34
+ # Print deprecation notices to the Rails logger.
35
+ config.active_support.deprecation = :log
36
+
37
+ # Raise an error on page load if there are pending migrations.
38
+ # config.active_record.migration_error = :page_load
39
+
40
+ # Debug mode disables concatenation and preprocessing of assets.
41
+ # This option may cause significant delays in view rendering with a large
42
+ # number of complex assets.
43
+ config.assets.debug = true
44
+
45
+ # Suppress logger output for asset requests.
46
+ config.assets.quiet = true
47
+
48
+ # Raises error for missing translations
49
+ # config.action_view.raise_on_missing_translations = true
50
+
51
+ # Use an evented file watcher to asynchronously detect changes in source code,
52
+ # routes, locales, etc. This feature depends on the listen gem.
53
+ # config.file_watcher = ActiveSupport::EventedFileUpdateChecker
54
+ end