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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be59fd1d31bacb83659c6fbcb5d6fec55e58981c
4
- data.tar.gz: 5bcb20375abef5c4ce25e76b26d409baf7bb449a
3
+ metadata.gz: 3e7bf52f8621a613c88726389fdb0bddc26b6633
4
+ data.tar.gz: cbf0657a29c9d3cf4419991f0bd8ad669c2115ae
5
5
  SHA512:
6
- metadata.gz: 90e3250595d79b47d2a62ec1f3fe305df329ffeec6d57a5058b0eddd12143608c4583d5b1e8c7d5d7d85ffe96ee3a2ec7918a8b0e57458c5a80be3d34dacb84f
7
- data.tar.gz: b853b49fdc17d71b37c8c23c1dd2f19ec0ffd2e1c2e84f69a58cfdfae5e84a9dde4b35464339fa434e65feadd8842f14418a3405e12d3c3c19ebff56d7eab8cc
6
+ metadata.gz: dcb8ef8f3bee2366103e3a36064e86dbec652e8f7a60619e5f066091fdf63f51d61bef8a58dc93c9743a5b1990f70e4f30f9ece10ad4d067748a07f0c4bf80b9
7
+ data.tar.gz: b5c3dff6ca2a69f85c94e392bbc8a059a6f67c41fb938b5190bbfd53e2ef702d2359f754ef4fbc10a86c9435e1c350732d2258852ea2c0b12f978b69cf9d687c
@@ -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
- puts "-------------------------"
78
- mapped_cols.each_with_index do |kpi_term, i|
79
- ws[row.to_i, col.to_i+i] = bucket_stats.kpis[kpi_term]
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
@@ -1,3 +1,3 @@
1
1
  module Bstat2google
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bstat2google
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ijonas Kisselbach