google_sheets 0.0.7 → 0.0.8
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.
- checksums.yaml +4 -4
- data/README.md +19 -6
- data/lib/google_sheets.rb +4 -0
- data/lib/google_sheets/sheet.rb +9 -1
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 743aa18dba357091cb8fb9ab4aff149d9cd5839e03aa31d581f77e47ea45a42d
|
4
|
+
data.tar.gz: 8fdbfbfe7db2e495ed6252ecbc10eddcbc89e824731bf28be5345c20a3659a4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 944080499c49894c63bf1b817e48e6b53ea4cc9700745cfa31fb3c295755d790db07acebfdba8d375a76b810a26933bf52a10285df420246a2cd6d997bea5165
|
7
|
+
data.tar.gz: a0489aabb7d33f1415c2166fd069cb50357a8e4d6aa5e800d81946cbc30ea114a76ded4b84b0df5467f6d29d4603445eacf7b99803daa452681677cf5592ab1f
|
data/README.md
CHANGED
@@ -1,13 +1,12 @@
|
|
1
|
-
[](http://www.rubydoc.info/github/
|
1
|
+
[](http://www.rubydoc.info/github/kmurph73/google_sheets/)
|
2
2
|
|
3
|
-
[google-drive-ruby](https://github.com/gimite/google-drive-ruby)
|
4
|
-
|
5
|
-
Since I only ever used that gem for creating/reading spreadsheets, I created this simple gem for just that, but using the v4 API.
|
3
|
+
A simple gem for interacting with GSheets using its v4 API. Originally created due to [google-drive-ruby](https://github.com/gimite/google-drive-ruby) lacking v4 support, which gimite has [since fixed](https://github.com/gimite/google-drive-ruby/issues/214).
|
6
4
|
|
5
|
+
**If you'd like changes or a new feature, please create an issue or PR** - features will be developed on an as-needed basis.
|
7
6
|
* [Installing](#installing)
|
8
7
|
* [Getting started](#getting-started)
|
9
|
-
* [GitHub](http://github.com/
|
10
|
-
* [API docs](https://www.rubydoc.info/github/
|
8
|
+
* [GitHub](http://github.com/kmurph73/google_sheets)
|
9
|
+
* [API docs](https://www.rubydoc.info/github/kmurph73/google_sheets/master)
|
11
10
|
|
12
11
|
<h3 id='installing'>Installing</h3>
|
13
12
|
|
@@ -117,3 +116,17 @@ sheet1.save!
|
|
117
116
|
```
|
118
117
|
|
119
118
|
Or just look at [the spec](spec/test_all_the_things_spec.rb) to see it in action.
|
119
|
+
|
120
|
+
**UPDATE 5-19-2019:**
|
121
|
+
|
122
|
+
``` ruby
|
123
|
+
GoogleSheets.strip_all_cells
|
124
|
+
```
|
125
|
+
|
126
|
+
is now a thing - it will `#strip` all of the cells returned from the sheet if set to true.
|
127
|
+
|
128
|
+
You can set it in an initializer, eg in `config/initializers/google_sheets.rb`:
|
129
|
+
|
130
|
+
``` ruby
|
131
|
+
GoogleSheets.strip_all_cells = true
|
132
|
+
```
|
data/lib/google_sheets.rb
CHANGED
data/lib/google_sheets/sheet.rb
CHANGED
@@ -27,7 +27,15 @@ module GoogleSheets
|
|
27
27
|
# Returns an Array of string values, EG: [['one', 'two'], ['three', 'four']]
|
28
28
|
# @return [Array(String)]
|
29
29
|
def values
|
30
|
-
@values ||=
|
30
|
+
@values ||= begin
|
31
|
+
vals = @service.get_spreadsheet_values(@spreadsheet.key, @title).values
|
32
|
+
|
33
|
+
if GoogleSheets.strip_all_cells
|
34
|
+
vals.flatten.each &:strip!
|
35
|
+
end
|
36
|
+
|
37
|
+
vals
|
38
|
+
end
|
31
39
|
end
|
32
40
|
|
33
41
|
# Deletes a sheet from a spreadsheet
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_sheets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kyle Murphy
|
@@ -74,8 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
|
-
|
78
|
-
rubygems_version: 2.7.6
|
77
|
+
rubygems_version: 3.0.3
|
79
78
|
signing_key:
|
80
79
|
specification_version: 4
|
81
80
|
summary: Basic Google Sheets interaction, using the v4 api.
|