Sha256: 3eed0f4f343119a202f8a948fcffee32ca8c07abe76e7ae99a240e3fb4bda4c0

Contents?: true

Size: 587 Bytes

Versions: 1

Compression:

Stored size: 587 Bytes

Contents

module Marty
  module ApplicationHelper
    DEFAULT_ASSETS_PATH = 'app/assets'

    def asset_exists?(file, file_extension, default_path)
      path = Rails.configuration.marty.send("assets_#{file_extension}_path") ||
             default_path

      asset_path = Rails.root.join("#{path}/#{file}.#{file_extension}")
      File.exist?(asset_path)
    end

    def javascript_exists?(file)
      asset_exists?(file, :js, DEFAULT_ASSETS_PATH + '/javascript')
    end

    def stylesheet_exists?(file)
      asset_exists?(file, :css, DEFAULT_ASSETS_PATH + '/stylesheets')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
marty-13.0.2 app/helpers/marty/application_helper.rb