Sha256: 7ff4c1430856de4cb39bd94bc1de346340ea00b002a81bc1278f75f426e9abce

Contents?: true

Size: 743 Bytes

Versions: 4

Compression:

Stored size: 743 Bytes

Contents

# frozen_string_literal: true

module HTML
  class Pipeline
    # utilized to integrate into rails asset pipeline
    class TaskList
      class << self
        def root_path
          @root_path ||= Pathname.new(File.expand_path('../..', __dir__))
        end

        def asset_paths
          @asset_paths ||= Dir[root_path.join('app/assets/*')]
        end
      end

      if defined? ::Rails::Railtie
        # If the Rails asset pipeline exists, incorporate into
        # asset pipeline
        class Railtie < ::Rails::Railtie
          initializer 'task_list' do |app|
            TaskList.asset_paths.each do |path|
              app.config.assets.paths << path
            end
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
html-pipeline-task_list-0.1.0 lib/html/pipeline/task_list/railtie.rb
html-pipeline-task_list-0.0.3 lib/html/pipeline/task_list/railtie.rb
html-pipeline-task_list-0.0.2 lib/html/pipeline/task_list/railtie.rb
html-pipeline-task_list-0.0.1 lib/html/pipeline/task_list/railtie.rb