to_google_spreadsheet 0.0.4 → 0.0.5

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.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -20,7 +20,8 @@ module GoogleSpreadsheet
20
20
 
21
21
  class Worksheet
22
22
  def set_header_columns(row)
23
- get_hash_from_row(row).keys.each_with_index do |key, col_nr|
23
+ # #sort_by to sort by symbols
24
+ get_hash_from_row(row).keys.sort_by { |k,v| k.to_s }.each_with_index do |key, col_nr|
24
25
  self[1, col_nr + 1] = key.to_s.capitalize
25
26
  end
26
27
  end
@@ -30,7 +31,7 @@ module GoogleSpreadsheet
30
31
  # provided by the Gem
31
32
  # https://github.com/gimite/google-spreadsheet-ruby/blob/master/lib/google_spreadsheet.rb#L693-700
32
33
  rows.each_with_index do |row, row_nr|
33
- get_hash_from_row(row).each_with_index do |val, col_nr|
34
+ get_hash_from_row(row).sort_by { |k,v| k.to_s }.each_with_index do |val, col_nr|
34
35
  self[row_nr + 2, col_nr + 1] = val.last
35
36
  end
36
37
  end
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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Simon H. Eskildsen