googlesheets 0.2.1 → 0.2.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
  SHA256:
3
- metadata.gz: 33fa210a08bf7ee1cd07cc38cb58cc7b9442dc0cc3c9582f84da28bf617c809e
4
- data.tar.gz: 49ff097a0f7864fb8f1f9a8d79c959ecb9ff2077e5679ff6ab5edb173c0985ed
3
+ metadata.gz: 9d0fb6e33bdfbb0e0e82efa3be32d26166be4bf4199d894e0dd555b0c568a4f5
4
+ data.tar.gz: fb113fecb311579662e9b2aa0d5cea4443c20218b0cb129741a757de242d1241
5
5
  SHA512:
6
- metadata.gz: dabdab76f1f0faaefbcf5b5df795545127c28b5c33862ec32cf4d1d26c6869642facbc258e96de41966147e85ab4bd56b35de288c8e1d923d7710b5b8fb9dc27
7
- data.tar.gz: d563746217a5d36321e56c807c21d29c804f43f10c22a03a327bbc20bfe1fbd2e31bc9dece174363f20d60aecbc9fc58242962a7d80adf4523c3c372002c7c27
6
+ metadata.gz: d30a91e91a3eaa552c0a84eb5f77e885d1da7fcdf6ee750f030e1b3b494a8f43a01cbc1838b8f9c4154558375b57ae985f531b37bfd4c0c1744598d7b3362c28
7
+ data.tar.gz: c7143744964858819f57fc6105fb0dccd9b680b3f1c485264c3162931fd8a4455b5a0e3fc098eaa036a9ff5aff690bc3df023c40c8503cdb3d1300054046aab6
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6
1
+ 2.6.5
data/googlesheets.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "googlesheets"
5
- s.version = "0.2.1"
5
+ s.version = "0.2.2"
6
6
  s.author = "Steve Shreeve"
7
7
  s.email = "steve.shreeve@gmail.com"
8
8
  s.summary = "Ruby gem for Google Sheets"
data/lib/googlesheets.rb CHANGED
@@ -8,6 +8,8 @@ module Enumerable
8
8
  end
9
9
  end
10
10
 
11
+ # https://googleapis.dev/ruby/google-api-client/latest/Google/Apis/SheetsV4/Request.html
12
+
11
13
  class GoogleSheets
12
14
  attr_accessor :api
13
15
 
@@ -132,6 +134,22 @@ class GoogleSheets
132
134
  end
133
135
  end
134
136
 
137
+ def sheet_rename(pick, name=nil)
138
+ shid = sheet_id(pick)
139
+ name ||= yield(sheet_name(shid)) if block_given?
140
+
141
+ reqs = []
142
+ reqs.push(update_sheet_properties: {
143
+ properties: {
144
+ sheet_id: shid,
145
+ title: name,
146
+ },
147
+ fields: 'title',
148
+ })
149
+ resp = api.batch_update_spreadsheet(@ssid, { requests: reqs }, {})
150
+ true
151
+ end
152
+
135
153
  def sheet_color(pick, color=nil) # NOTE: ignores alpha
136
154
  reqs = []
137
155
  reqs.push(update_sheet_properties: {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: googlesheets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Shreeve
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-18 00:00:00.000000000 Z
11
+ date: 2021-06-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem allows easy access to Google Sheets API V4.
14
14
  email: steve.shreeve@gmail.com
@@ -41,7 +41,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
41
41
  - !ruby/object:Gem::Version
42
42
  version: '0'
43
43
  requirements: []
44
- rubygems_version: 3.1.4
44
+ rubygems_version: 3.2.16
45
45
  signing_key:
46
46
  specification_version: 4
47
47
  summary: Ruby gem for Google Sheets