Sha256: 7fb627160cb3d1616d6acaa29457c64c032d35683adf3b5e2dfdaa4b6510c0df

Contents?: true

Size: 876 Bytes

Versions: 49

Compression:

Stored size: 876 Bytes

Contents

module Cmor
  module Core
    module Frontend
      module Generators
        class Bootstrap4Generator < Rails::Generators::Base
          desc 'Generates a frontend engine with bootstrap 4 layout'

          source_root File.expand_path('../templates', __FILE__)

          def install_eu_gdpr
            generate "eu_gdpr:install"
          end

          def generate_engine
            empty_directory 'engines/frontend'
            templates_dir = "#{__dir__}/templates/"
            Dir.glob("#{templates_dir}**/*").each do |f|
              next unless File.file?(f)
              f.gsub!(templates_dir, '')
              copy_file f, "engines/frontend/#{f}"
            end
          end

          def add_engine_to_gemfile
            append_to_file 'Gemfile', "\r\ngem 'frontend', path: './engines/frontend'"
          end
        end
      end
    end
  end
end

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
cmor_core_frontend-0.0.60.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.59.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.58.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.57.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.56.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.55.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.54.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.53.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.52.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.51.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.50.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.49.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.48.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.45.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.44.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.43.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.42.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.41.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.40.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb
cmor_core_frontend-0.0.39.pre lib/generators/cmor/core/frontend/bootstrap4/bootstrap4_generator.rb