Sha256: 1b8bf03d522c7465e0e818e17355fd6177f409e14eff1105252da180f3819dd3

Contents?: true

Size: 612 Bytes

Versions: 43

Compression:

Stored size: 612 Bytes

Contents

module Fontist
  module Indexes
    class IndexFormula
      def initialize(path)
        @path = path
      end

      def name
        normalized.sub(/\.yml$/, "")
      end

      def to_s
        normalized
      end

      def to_full
        Formula.new_from_file(full_path)
      end

      def ==(other)
        to_s == other.to_s
      end

      private

      def normalized
        escaped = Regexp.escape(Fontist.formulas_path.to_s + "/")
        @path.sub(Regexp.new("^" + escaped), "")
      end

      def full_path
        Fontist.formulas_path.join(normalized).to_s
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
fontist-1.21.2 lib/fontist/indexes/index_formula.rb
fontist-1.21.1 lib/fontist/indexes/index_formula.rb
fontist-1.20.0 lib/fontist/indexes/index_formula.rb
fontist-1.19.0 lib/fontist/indexes/index_formula.rb
fontist-1.18.2 lib/fontist/indexes/index_formula.rb
fontist-1.17.1 lib/fontist/indexes/index_formula.rb
fontist-1.17.0 lib/fontist/indexes/index_formula.rb
fontist-1.16.0 lib/fontist/indexes/index_formula.rb
fontist-1.15.2 lib/fontist/indexes/index_formula.rb
fontist-1.15.1 lib/fontist/indexes/index_formula.rb
fontist-1.15.0 lib/fontist/indexes/index_formula.rb
fontist-1.14.6 lib/fontist/indexes/index_formula.rb
fontist-1.14.5 lib/fontist/indexes/index_formula.rb
fontist-1.14.4 lib/fontist/indexes/index_formula.rb
fontist-1.14.3 lib/fontist/indexes/index_formula.rb
fontist-1.14.2 lib/fontist/indexes/index_formula.rb
fontist-1.14.1 lib/fontist/indexes/index_formula.rb
fontist-1.14.0 lib/fontist/indexes/index_formula.rb
fontist-1.13.2 lib/fontist/indexes/index_formula.rb
fontist-1.13.1 lib/fontist/indexes/index_formula.rb