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.12.18 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.12.17 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.12.03 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.11.12 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.9.5 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.9.4 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.9.2 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.9.1 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.9.0 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.8.3 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.8.2 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.8.0 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.7.8 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.7.2 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.7.1 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.7.0 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.6.7 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.5.15 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.4.1 lib/ruby-beautify/lib/ruby-beautify/language.rb
knife-chop-0.4.0 lib/ruby-beautify/lib/ruby-beautify/language.rb