Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Require additional gems when running the dummy generator
Browse files Browse the repository at this point in the history
This fixed frontend/backend generators in extensions
  • Loading branch information
damianlegawiec committed Aug 9, 2021
1 parent 89d77e6 commit 4f1ce37
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions core/lib/generators/spree/dummy/dummy_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

module Spree
class DummyGenerator < Rails::Generators::Base
SPREE_GEMS = %w(spree_backend spree_frontend spree_api spree_emails).freeze

desc 'Creates blank Rails application, installs Spree and all sample data'

class_option :lib_name, default: ''
Expand Down Expand Up @@ -60,10 +62,14 @@ def test_dummy_config

def test_dummy_inject_extension_requirements
if DummyGeneratorHelper.inject_extension_requirements
inside dummy_path do
inject_require_for('spree_frontend')
inject_require_for('spree_backend')
inject_require_for('spree_api')
SPREE_GEMS.each do |gem|
begin
require "#{gem}"
inside dummy_path do
inject_require_for(gem)
end
rescue
end
end
end
end
Expand Down

0 comments on commit 4f1ce37

Please sign in to comment.