Module: Barebones::TextFormatHelpers

Included in:
AppBuilder
Defined in:
lib/barebones/text_format_helpers.rb

Instance Method Summary collapse

Instance Method Details

#replace_regex_in_file(file, regex, replacement) ⇒ Object



8
9
10
11
12
# File 'lib/barebones/text_format_helpers.rb', line 8

def replace_regex_in_file(file, regex, replacement)
  gsub_file file, regex do |match|
    replacement
  end
end

#spaces(num_spaces) ⇒ Object



4
5
6
# File 'lib/barebones/text_format_helpers.rb', line 4

def spaces(num_spaces)
  "\s" * num_spaces
end