class S3AssetDeploy::LocalAsset

Attributes

path[R]

Public Class Methods

new(path, remove_fingerprint: nil) click to toggle source
# File lib/s3_asset_deploy/local_asset.rb, line 8
def initialize(path, remove_fingerprint: nil)
  @path = path
  @remove_fingerprint = remove_fingerprint
end

Public Instance Methods

==(other_asset) click to toggle source
# File lib/s3_asset_deploy/local_asset.rb, line 30
def ==(other_asset)
  path == other_asset.path
end
full_path() click to toggle source
# File lib/s3_asset_deploy/local_asset.rb, line 22
def full_path
  File.join(ENV["PWD"], "public", path)
end
mime_type() click to toggle source
# File lib/s3_asset_deploy/local_asset.rb, line 26
def mime_type
  S3AssetDeploy::AssetHelper.mime_type_for_path(path).to_s
end
original_path() click to toggle source
# File lib/s3_asset_deploy/local_asset.rb, line 13
def original_path
  @original_path ||=
    if @remove_fingerprint
      @remove_fingerprint.call(path)
    else
      S3AssetDeploy::AssetHelper.remove_fingerprint(path)
    end
end
to_s() click to toggle source
# File lib/s3_asset_deploy/local_asset.rb, line 34
def to_s
  path
end