Sha256: e6d9269167e6ea0f5ca736788a7b9fa0b00886bea3729d9c32e51cddc0e64c9f

Contents?: true

Size: 591 Bytes

Versions: 1

Compression:

Stored size: 591 Bytes

Contents

require 'cells'
require 'cell/assets/version'
    
module Cell
  module Assets

    def inherited(cls)
      super
      cls.extend(Cell::Assets)
    end
    
    def assets(glob)
      [].tap do |matches|
        self.view_paths.each do |path|
          base = "#{path}/#{cell_name}"
          Dir.glob("#{base}/#{glob}").sort.each do |entry|
            match = "#{base}/#{File.basename(entry)}"
            matches << match
            yield match, File.read(File.expand_path(match)) if block_given?
          end
        end
      end
    end
    
    Cell::Rails.extend(self)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cells-assets-0.0.1 lib/cell/assets.rb