googlesheets 0.6.1 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/shat +32 -0
- data/lib/googlesheets.rb +8 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 337343bcb13d2a791f5aee8a239ce9f6fb176d9844da5d2d672efd98d21974d5
|
4
|
+
data.tar.gz: 68006ba26a382e5599a95822731e55261b7bb10b871c3536ecf4a2f0671d4755
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 250b28e880607001b70f71a1f417325cd73c301fe4cad19af54e390f17e08630dd9e7a44a2aaa537646d64c2bc8e0571aeadda02e3929561b88232f581700e04
|
7
|
+
data.tar.gz: 3e302a8611cd632225afac79f038ef000d3ea286e872de931640d43786b3de2acd7c325e9540a932be9b02dc6fc456f03b7dfb2e29092c0fa65703499990e9ff
|
data/bin/shat
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
version="0.0.1"
|
4
|
+
|
5
|
+
STDOUT.sync = true
|
6
|
+
|
7
|
+
begin
|
8
|
+
require "censive"
|
9
|
+
rescue LoadError
|
10
|
+
abort "#{File.basename($0)} needs another gem, run 'gem install censive'"
|
11
|
+
end
|
12
|
+
|
13
|
+
require "googlesheets"
|
14
|
+
require "optparse"
|
15
|
+
|
16
|
+
trap("INT" ) { abort "\n" }
|
17
|
+
|
18
|
+
OptionParser.new.instance_eval do
|
19
|
+
@banner = "usage: #{program_name} [options] <url>"
|
20
|
+
|
21
|
+
on "-h", "--help" , "Show help and command usage" do Kernel.abort to_s; end
|
22
|
+
on "-v", "--version" , "Show version number" do Kernel.abort "#{program_name} #{version}"; end
|
23
|
+
|
24
|
+
self
|
25
|
+
end.parse!(into: opts={}) rescue abort($!.message)
|
26
|
+
|
27
|
+
link = ARGV.shift or abort("no url provided")
|
28
|
+
|
29
|
+
goog = GoogleSheets.new(link)
|
30
|
+
rows = goog.sheet_read
|
31
|
+
|
32
|
+
Censive.writer {|csv| rows.each {|row| csv << row }}
|
data/lib/googlesheets.rb
CHANGED
@@ -11,8 +11,15 @@ require "google/apis/sheets_v4"
|
|
11
11
|
require "googleauth"
|
12
12
|
require "googleauth/stores/file_token_store"
|
13
13
|
|
14
|
+
class Object
|
15
|
+
def blank?
|
16
|
+
respond_to?(:empty?) or return !self
|
17
|
+
empty? or respond_to?(:strip) && strip.empty?
|
18
|
+
end unless defined? blank?
|
19
|
+
end
|
20
|
+
|
14
21
|
class GoogleSheets
|
15
|
-
VERSION = "0.6.
|
22
|
+
VERSION = "0.6.3"
|
16
23
|
|
17
24
|
attr_accessor :api
|
18
25
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: googlesheets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Shreeve
|
@@ -26,13 +26,15 @@ dependencies:
|
|
26
26
|
version: 0.53.0
|
27
27
|
description: This gem allows easy access to Google Sheets API V4.
|
28
28
|
email: steve.shreeve@gmail.com
|
29
|
-
executables:
|
29
|
+
executables:
|
30
|
+
- shat
|
30
31
|
extensions: []
|
31
32
|
extra_rdoc_files: []
|
32
33
|
files:
|
33
34
|
- Gemfile
|
34
35
|
- LICENSE
|
35
36
|
- README.md
|
37
|
+
- bin/shat
|
36
38
|
- googlesheets.gemspec
|
37
39
|
- lib/googlesheets.rb
|
38
40
|
homepage: https://github.com/shreeve/googlesheets
|