Sha256: 3219b94471a5407cabf681a58be6e1bc8cbf1f7a7868c89c0f49dc7ddc605bb7

Contents?: true

Size: 913 Bytes

Versions: 64

Compression:

Stored size: 913 Bytes

Contents

module Lookbook
  module Lang
    class << self
      LANGUAGES = [
        {
          name: "ruby",
          ext: ".rb",
          label: "Ruby",
          comment: "# %s"
        },
        {
          name: "html",
          ext: ".html",
          label: "HTML",
          comment: "<!-- %s -->"
        },
        {
          name: "erb",
          ext: ".erb",
          label: "ERB",
          comment: "<%%# %s %%>"
        },
        {
          name: "haml",
          ext: ".haml",
          label: "Haml",
          comment: "<!-- %s -->"
        },
        {
          name: "slim",
          ext: ".slim",
          label: "Slim",
          comment: "<!-- %s -->"
        }
      ]

      def find(name)
        LANGUAGES.find { |l| l[:name] == name.to_s }
      end

      def guess(path)
        ext = File.extname(path)
        LANGUAGES.find { |l| l[:ext] == ext }
      end
    end
  end
end

Version data entries

64 entries across 64 versions & 1 rubygems

Version Path
lookbook-1.0.0.rc.2 lib/lookbook/lang.rb
lookbook-1.0.0.rc.1 lib/lookbook/lang.rb
lookbook-1.0.0.beta.8 lib/lookbook/lang.rb
lookbook-0.9.6 lib/lookbook/lang.rb
lookbook-1.0.0.beta.7 lib/lookbook/lang.rb
lookbook-0.9.5 lib/lookbook/lang.rb
lookbook-1.0.0.beta.6 lib/lookbook/lang.rb
lookbook-0.9.4 lib/lookbook/lang.rb
lookbook-1.0.0.beta.5 lib/lookbook/lang.rb
lookbook-0.9.3 lib/lookbook/lang.rb
lookbook-0.9.2 lib/lookbook/lang.rb
lookbook-0.9.1 lib/lookbook/lang.rb
lookbook-1.0.0.beta.4 lib/lookbook/lang.rb
lookbook-1.0.0.beta.3 lib/lookbook/lang.rb
lookbook-1.0.0.beta.2 lib/lookbook/lang.rb
lookbook-1.0.0.beta.1 lib/lookbook/lang.rb
lookbook-0.9.0 lib/lookbook/lang.rb
lookbook-0.8.3 lib/lookbook/lang.rb
lookbook-1.0.0.beta.0 lib/lookbook/lang.rb
lookbook-0.8.2 lib/lookbook/lang.rb