Sha256: 905a3d67b038d0249d69c419aede3680ad061c8d0c72306127d98c7a905f33f6

Contents?: true

Size: 176 Bytes

Versions: 16

Compression:

Stored size: 176 Bytes

Contents

class String
  
  def realign_indentation
    basis = self.index(/\S/) # find the first non-whitespace character
    return self.to_a.map { |s| s[basis..-1] }.join
  end
  
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
templater-0.3.1 lib/templater/core_ext/string.rb
templater-0.2.2 lib/templater/core_ext/string.rb
templater-0.3.0 lib/templater/core_ext/string.rb
templater-0.3.3 lib/templater/core_ext/string.rb
templater-0.2.1 lib/templater/core_ext/string.rb
templater-0.3.2 lib/templater/core_ext/string.rb
templater-0.3.4 lib/templater/core_ext/string.rb
templater-0.2 lib/templater/core_ext/string.rb
templater-0.4.1 lib/templater/core_ext/string.rb
templater-0.5.0 lib/templater/core_ext/string.rb
templater-0.4.0 lib/templater/core_ext/string.rb
templater-0.4.4 lib/templater/core_ext/string.rb
templater-0.3.5 lib/templater/core_ext/string.rb
templater-0.4.5 lib/templater/core_ext/string.rb
templater-0.4.3 lib/templater/core_ext/string.rb
templater-0.4.2 lib/templater/core_ext/string.rb