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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 86d8fa2df8d08e7b6569b14d9f8a3f655208cffde08aa1ad43dc4f854ec4941a
4
- data.tar.gz: c8f2e5efdab5c93d316f166ee930055c2073be6b83ae2542f00cb87d1497da9d
3
+ metadata.gz: 743aa18dba357091cb8fb9ab4aff149d9cd5839e03aa31d581f77e47ea45a42d
4
+ data.tar.gz: 8fdbfbfe7db2e495ed6252ecbc10eddcbc89e824731bf28be5345c20a3659a4e
5
5
  SHA512:
6
- metadata.gz: b13a04d960dea0b45a2b1c559c0eb324bb21867b4d056eb8872fed0be58bba3817f6953efe7a695f6d247baa2fe2f9072e7b7912954ffbeac5bfd3e6163a341d
7
- data.tar.gz: 61837bf1c9ada04fb12be150955b56e0e1b6da8db3d4e0863a410c3165d22afb58b7d73c1097b71b96e906659ad8d911db530b429edeb92aae7c39dc88be7ef4
6
+ metadata.gz: 944080499c49894c63bf1b817e48e6b53ea4cc9700745cfa31fb3c295755d790db07acebfdba8d375a76b810a26933bf52a10285df420246a2cd6d997bea5165
7
+ data.tar.gz: a0489aabb7d33f1415c2166fd069cb50357a8e4d6aa5e800d81946cbc30ea114a76ded4b84b0df5467f6d29d4603445eacf7b99803daa452681677cf5592ab1f
data/README.md CHANGED
@@ -1,13 +1,12 @@
1
- [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/github/shmay/google_sheets/)
1
+ [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/github/kmurph73/google_sheets/)
2
2
 
3
- [google-drive-ruby](https://github.com/gimite/google-drive-ruby), a great gem, doesn't support Google's v4 Drive API. As a result, I seem to encounter rate limiting errors fairly quickly.
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/shmay/google_sheets)
10
- * [API docs](https://www.rubydoc.info/github/shmay/google_sheets/master)
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
@@ -1,4 +1,8 @@
1
1
  require 'google_sheets/session'
2
2
 
3
3
  module GoogleSheets
4
+ # #strip cells?
5
+ class << self
6
+ attr_accessor :strip_all_cells
7
+ end
4
8
  end
@@ -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 ||= @service.get_spreadsheet_values(@spreadsheet.key, @title).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.7
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
- rubyforge_project:
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.