Sha256: 461c8b67b1837785933ff5e76dda8d94401f2818749e38ef51e38e4867646458

Contents?: true

Size: 722 Bytes

Versions: 36

Compression:

Stored size: 722 Bytes

Contents

require "ruby-beautify/version"
require 'ruby-beautify/block_start'
require 'ruby-beautify/block_end'
require 'ruby-beautify/block_matcher'
require 'ruby-beautify/language'
require 'ruby-beautify/line'
require 'ruby-beautify/config/ruby'

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

36 entries across 36 versions & 2 rubygems

Version Path
knife-chop-0.12.18 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.12.17 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.12.03 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.11.12 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.9.5 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.9.4 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.9.2 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.9.1 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.9.0 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.8.3 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.8.2 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.8.0 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.7.8 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.7.2 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.7.1 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.7.0 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.6.7 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.5.15 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.4.1 lib/ruby-beautify/lib/ruby-beautify.rb
knife-chop-0.4.0 lib/ruby-beautify/lib/ruby-beautify.rb