Sha256: 9dadb4e8b8d07c601e9405d440c62312164a6f763b0da68269c5e681d10d1b3c
Contents?: true
Size: 1.04 KB
Versions: 2
Compression:
Stored size: 1.04 KB
Contents
# frozen_string_literal: true require 'draper' require 'responders' require_relative 'mountable_helper' module Mountable module Enginizer def _prepare(module_name) module_ = module_name.constantize isolate_namespace module_ config.to_prepare do # so that I can use safe_join Draper::Decorator.send(:include, ActionView::Helpers::OutputSafetyHelper) [Mountable::MountableHelper, Rails.application.helpers].each { |h| module_.const_get('ApplicationController').helper h } Dir.glob(Rails.root + "app/#{module_name.underscore}/*_patch*.rb").each(&method(:require_dependency)) end end def enginize _prepare(name.split('::').first) config.generators do |g| g.test_framework :rspec, fixture: false g.fixture_replacement :factory_girl, dir: 'spec/factories' g.assets false g.helper false end config.generators do |g| g.template_engine :haml end end end end ::Rails::Engine.class_eval do extend Mountable::Enginizer end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
yaw-0.0.2 | lib/mountable/lib/mountable/enginize.rb |
yaw-0.0.1 | lib/mountable/lib/mountable/enginize.rb |