lib/squib/import/data_frame.rb in squib-0.12.0 vs lib/squib/import/data_frame.rb in squib-0.13.0
- old
+ new
@@ -84,16 +84,16 @@
downcase.
to_sym
end
def wrap_n_pad(str, max_col)
- str.to_s.
- concat(' '). # handle nil & empty strings
- scan(/.{1,34}/).
- map { |s| (' ' * max_col) + " | " + s.ljust(34) }.
- join(" |\n").
- lstrip. # initially no whitespace next to key
- concat(" |\n")
+ new_str = str.to_s + ' ' # handle nil & empty strings
+ new_str = new_str.
+ scan(/.{1,34}/). # break down
+ map { |s| (' ' * max_col) + " | " + s.ljust(34) }.
+ join(" |\n").
+ lstrip # initially no whitespace next to key
+ return new_str + " |\n"
end
def def_column(col)
raise "Column #{col} - does not exist" unless @hash.key? col
method_name = snake_case(col)