google_scribe 1.0.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1e2953a8fa4d59f49165dd5f7004ab7facaf490d
4
+ data.tar.gz: caedc6357101cd040b166e63b520e181241e9eed
5
+ SHA512:
6
+ metadata.gz: aea28d6f01ae0f9417c426c247ef223475796a51243113c8b2b5e5d823bf898c7d17940de4bb1687480cc7ad3bc4b73426f4ad8dac6dcaa130ce92eaf66543f6
7
+ data.tar.gz: 139f0dcc5e81841e0532f22a9a9d906a437631d52a308d73f8d13a8c829244bf4b3518341079ee584c811ab03993332a62a7613cf0b3de989ad09793114524df
@@ -0,0 +1,19 @@
1
+ require "net/http"
2
+ require "net/https"
3
+ require "uri"
4
+
5
+ class GoogleSheetsClient
6
+
7
+ def self.post(data, url)
8
+ uri = URI.parse(url)
9
+ request = Net::HTTP::Post.new(uri.path, 'Content-Type' => 'application/json')
10
+
11
+ request.set_form_data(data)
12
+
13
+ https = Net::HTTP.new(uri.host, uri.port)
14
+ https.use_ssl = true
15
+
16
+ # This returns a 302 code but still logs the data
17
+ https.request(request)
18
+ end
19
+ end
@@ -0,0 +1,13 @@
1
+ require "google_scribe/google_sheets_client"
2
+
3
+ class GoogleScribe
4
+ attr_accessor :url
5
+
6
+ def initialize(url = nil)
7
+ self.url = url
8
+ end
9
+
10
+ def send_data(data)
11
+ GoogleSheetsClient.post(data, self.url)
12
+ end
13
+ end
metadata ADDED
@@ -0,0 +1,45 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: google_scribe
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Greg Serrid
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-09-17 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Allows writing and logging data to google sheets through a public url.
14
+ email: nick@quaran.to
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/google_scribe.rb
20
+ - lib/google_scribe/google_sheets_client.rb
21
+ homepage: https://github.com/gregsherrid/google_scribe
22
+ licenses:
23
+ - MIT
24
+ metadata: {}
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements: []
40
+ rubyforge_project:
41
+ rubygems_version: 2.0.3
42
+ signing_key:
43
+ specification_version: 4
44
+ summary: Google Scribe!
45
+ test_files: []