middleman-google_drive 0.3.9 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google_drive.rb +3 -0
- data/lib/middleman-google_drive/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 210d0a32f405752ec435f03512409b3da3497c4e
|
4
|
+
data.tar.gz: 2b39ff3f1f5b3dca71a78cef6bb2cea5a9a30207
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06732016e778d11a4be353609b7bbcfa0e78e3be9c1308e428d86ad3e156d8ff7aac62f0bbaf78482ba9d89c5aa415855a0f5f707c7d17d7cdb77cbab1eb5540
|
7
|
+
data.tar.gz: 1487b0e756a0aa36bdbf91fe252061dd94e7945c3dbd30403501d508a47ad9f20450acf2a8e9a415f15a8ffcea9d82df4432b08e11bf7e6cfcdf2ac41d92c842
|
data/lib/google_drive.rb
CHANGED
@@ -181,6 +181,7 @@ class GoogleDrive
|
|
181
181
|
else
|
182
182
|
# otherwise parse the sheet into a hash
|
183
183
|
data[title] = load_table(sheet.extract_data)
|
184
|
+
puts "Rows in #{title}: #{data[title].length}"
|
184
185
|
end
|
185
186
|
end
|
186
187
|
return data
|
@@ -221,6 +222,8 @@ class GoogleDrive
|
|
221
222
|
def load_table(table)
|
222
223
|
return [] if table.length < 2
|
223
224
|
header = table.shift # Get the header row
|
225
|
+
# remove blank rows
|
226
|
+
table.reject! { |row| row.map { |r| r.to_s }.reduce(:+).strip.empty? }
|
224
227
|
table.map do |row|
|
225
228
|
# zip headers with current row, convert it to a hash
|
226
229
|
header.zip(row).to_h unless row.nil?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: middleman-google_drive
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Mark
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-04-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: middleman-core
|