Sha256: a93aa70759a432355152927d483275113d08ccef8d02ac635d25ec7102942038

Contents?: true

Size: 516 Bytes

Versions: 6

Compression:

Stored size: 516 Bytes

Contents

require "ruby-beautify/version"

module RBeautify
  def self.beautify_string(language, source, use_tabs=false)
    dest = ""
    block = nil

    unless language.is_a? RBeautify::Language
      language = RBeautify::Language.language(language)
    end

    source.lines.each_with_index do |line_content, line_number|
      line = RBeautify::Line.new(language, line_content, line_number, block, use_tabs)
      dest += line.format + "\n"
      block = line.block
    end

    return dest
  end
end # module RBeautify

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ruby-beautify-0.95.0 lib/ruby-beautify.rb
ruby-beautify-0.94.2 lib/ruby-beautify.rb
ruby-beautify-0.94.1 lib/ruby-beautify.rb
ruby-beautify-0.94.0 lib/ruby-beautify.rb
ruby-beautify-0.93.2 lib/ruby-beautify.rb
ruby-beautify-0.93.0 lib/ruby-beautify.rb