Sha256: d569393f3eec71ba5a2c5bdffc6f89a41e4acc0357b0be548ba355e182ad2e59

Contents?: true

Size: 614 Bytes

Versions: 38

Compression:

Stored size: 614 Bytes

Contents

module RBeautify
  class Language

    @@languages = {}

    attr_reader :matchers
    attr_accessor :indent_size

    class << self

      def language(name)
        languages[name]
      end

      def languages
        @@languages
      end

      def add_language(name)
        languages[name] = new()
      end
    end

    def initialize
      @matchers = []
    end

    def add_matcher(name, starts, ends, options = {})
      self.matchers << BlockMatcher.new(self, name, starts, ends, options)
    end

    def matcher(name)
      self.matchers.detect { |matcher| matcher.name == name}
    end

  end
end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
knife-chop-0.3.7 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.3.6 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.3.5 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.3.4 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.3.3 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.3.2 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.3.0 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.3.1 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.2.11 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.2.9 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.2.7 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.2.8 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.2.6 lib/ruby-beautify/lib/ruby-beautify/language.rb
ruby-beautify-0.92.2 lib/ruby-beautify/language.rb
ruby-beautify-0.92.1 lib/ruby-beautify/language.rb
ruby-beautify-0.92.0 lib/ruby-beautify/language.rb
ruby-beautify-0.91.0 lib/ruby-beautify/language.rb
ruby-beautify-0.9.0 lib/rbeautify/language.rb