bstat2google 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bstat2google.rb +12 -3
- data/lib/bstat2google/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e7bf52f8621a613c88726389fdb0bddc26b6633
|
4
|
+
data.tar.gz: cbf0657a29c9d3cf4419991f0bd8ad669c2115ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcb8ef8f3bee2366103e3a36064e86dbec652e8f7a60619e5f066091fdf63f51d61bef8a58dc93c9743a5b1990f70e4f30f9ece10ad4d067748a07f0c4bf80b9
|
7
|
+
data.tar.gz: b5c3dff6ca2a69f85c94e392bbc8a059a6f67c41fb938b5190bbfd53e2ef702d2359f754ef4fbc10a86c9435e1c350732d2258852ea2c0b12f978b69cf9d687c
|
data/lib/bstat2google.rb
CHANGED
@@ -70,13 +70,22 @@ module Bstat2google
|
|
70
70
|
attrs.each {|k,v| self.send("#{k}=", v)}
|
71
71
|
end
|
72
72
|
def write(bucket_stats)
|
73
|
+
puts "-------------------------"
|
74
|
+
puts "BucketId: #{bucket_stats.id}"
|
75
|
+
puts "Error: #{bucket_stats.id}" if bucket_stats.error
|
73
76
|
ap bucket_stats.kpis
|
77
|
+
|
74
78
|
session = GoogleDrive.login(gmail, password)
|
75
79
|
ws = session.spreadsheet_by_key(sheet_id).worksheets[worksheet_no.to_i]
|
76
80
|
|
77
|
-
|
78
|
-
|
79
|
-
|
81
|
+
if mapped_cols.first == "USE_CATEGORIES"
|
82
|
+
bucket_stats.kpis.keys.each_with_index do |kpi_value, i|
|
83
|
+
ws[row.to_i, col.to_i+i] = kpi_value
|
84
|
+
end
|
85
|
+
else
|
86
|
+
mapped_cols.each_with_index do |kpi_term, i|
|
87
|
+
ws[row.to_i, col.to_i+i] = bucket_stats.kpis[kpi_term]
|
88
|
+
end
|
80
89
|
end
|
81
90
|
ws[timestamp_cell] = Time.now.strftime("%d/%m/%y %H:%M")
|
82
91
|
ws.save
|
data/lib/bstat2google/version.rb
CHANGED