Sha256: 7a5d0a48b65866ceff873d2a1a092a3b6b3996d3e5804663bdf402f5705a3f60

Contents?: true

Size: 581 Bytes

Versions: 1

Compression:

Stored size: 581 Bytes

Contents

# Manage the assets and their URI/path
module Slippery
  module Assets
    ASSETS_PATH = ROOT.join('assets')

    # Copies the assets locally
    def self.embed_locally
      raise 'damn'
      FileUtils.cp_r(ASSETS_PATH, './')
    end

    # returns a composer returning a URI for a given relative file path
    # considering if the asset is local or not
    def self.path_composer(local)
      if local
        ->(path) { File.join('assets', path) }
      else
        ->(path) { "file://#{File.expand_path(File.join(ASSETS_PATH, path), __FILE__)}" }
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slippery-0.1.0 lib/slippery/assets.rb