to_google_spreadsheet 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
1
  module ToGoogleSpreadsheet
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -22,7 +22,7 @@ module GoogleSpreadsheet
22
22
  def set_header_columns(row)
23
23
  # #sort_by to sort by symbols
24
24
  get_hash_from_row(row).keys.sort_by { |k,v| k.to_s }.each_with_index do |key, col_nr|
25
- self[1, col_nr + 1] = key.to_s.capitalize
25
+ self[1, col_nr + 1] = humanize(key)
26
26
  end
27
27
  end
28
28
 
@@ -43,6 +43,10 @@ module GoogleSpreadsheet
43
43
  return row._hash if row.respond_to?(:_hash) # ostruct
44
44
  row # fallback to handle hashes
45
45
  end
46
+
47
+ def humanize(text)
48
+ text.to_s.gsub(/_/, " ").capitalize
49
+ end
46
50
  end
47
51
  end
48
52
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: to_google_spreadsheet
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 5
10
- version: 0.0.5
9
+ - 6
10
+ version: 0.0.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Simon H. Eskildsen