Sha256: 76efbedac1cd457c9bc87346fb983f9c398a9a9110edd8ae83ac02ac41f862c3

Contents?: true

Size: 450 Bytes

Versions: 6

Compression:

Stored size: 450 Bytes

Contents

require 'pathname'

module Spontaneous::Asset
  class File
    def initialize(source, relative_path)
      @source, @relative_path = source, relative_path
    end

    def load_path
      [name, extensions.first].join(".")
    end

    def basename
      @basename ||= ::File.basename(@relative_path)
    end

    def name
      basename.split(".").first
    end

    def extensions
      @extensions ||= basename.split(".")[1..-1]
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta1 lib/spontaneous/asset/file.rb
spontaneous-0.2.0.alpha7 lib/spontaneous/asset/file.rb
spontaneous-0.2.0.alpha6 lib/spontaneous/asset/file.rb
spontaneous-0.2.0.alpha5 lib/spontaneous/asset/file.rb
spontaneous-0.2.0.alpha4 lib/spontaneous/asset/file.rb
spontaneous-0.2.0.alpha3 lib/spontaneous/asset/file.rb