middleman-google_drive 0.0.1 → 0.0.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
  SHA1:
3
- metadata.gz: f3a285921b3f9a1cd1315a39ca4adeb5789ff591
4
- data.tar.gz: 95ea9261a02cfcd9c2e719fb92194a2abb880a04
3
+ metadata.gz: 1afb11c7d973d269a92ed9ca7d3083d26d10be94
4
+ data.tar.gz: 2a716ee1cf4e9ac1cac6abcdcc0e7f9ebc312805
5
5
  SHA512:
6
- metadata.gz: 4c674d9893c9f45c9f2ede571ffbe9905989690e50cc7d362ba8387c7953373a36e929c6e64adc2618668f37f2beb3c3c8fe1f981fa45622cbfca546168be94c
7
- data.tar.gz: 8e88247849e0f5004e08990ece3bcfd0b5c9e5afdbec9bc355e59cf30e7cfef230725f33631aa59580f7df947c393c3b9aecdccaf0e3bc31d82ed5e24e902d45
6
+ metadata.gz: ea341f8b96380de5e5e67923ae3014f0a95dd401b4038a614dd5a4264efd3381501ee03250f6fdacd372a12c61f827ac698aace488c55e5358fccab72f2b8e1f
7
+ data.tar.gz: ee513b57b122fad012b277cef94343e10af928827171e47d6ed78fa2bdff19b5b9ecff2752d9597850991de3df6af9061c4798ee5681874c5bbb91ffbc3c5a34
data/LICENSE.txt CHANGED
@@ -1,22 +1,27 @@
1
1
  Copyright (c) 2014 Vox Media Inc., Ryan Mark, Pablo Mercado
2
+ All rights reserved.
2
3
 
3
- MIT License
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
4
6
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
12
9
 
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
10
+ * Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
15
13
 
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+ * Neither the name of the {organization} nor the names of its
15
+ contributors may be used to endorse or promote products derived from
16
+ this software without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/README.md CHANGED
@@ -43,16 +43,25 @@ explanation](http://tarbell.readthedocs.org/en/latest/install.html#configure-goo
43
43
  run middleman, you will be sent to a Google login prompt in order to
44
44
  associate Middleman with your Google account. You should make sure that the
45
45
  account that you choose has access to the spreadsheets you want to use in
46
- Middleman. Once you authenticate with Google, a new file
47
- `~/.google_drive_oauth2.json` will be created containing an key for
48
- communicating with Google Drive.
46
+ Middleman.
47
+
48
+ You need to make sure that the `redirect_urls` setting for the client secrets
49
+ is `urn:ietf:wg:oauth:2.0:oob` and not another URL.
50
+
51
+ Protip: If somebody in your org has used this extension or something like it,
52
+ chances are that person has already created a client secrets file that can be
53
+ shared with you.
54
+
55
+ Once you authenticate with Google, a new file `~/.google_drive_oauth2.json`
56
+ will be created containing an key for communicating with Google Drive.
49
57
 
50
58
  You can override the location of the client secrets and oauth2 JSON files with
51
59
  the environment variables `GOOGLE_CLIENT_SECRETS` and `GOOGLE_DRIVE_OAUTH`.
52
60
 
53
61
  If you plan to run Middleman on a server, you can use Google's server to server
54
62
  authentication. This will kick in if you define the environment variables
55
- `GOOGLE_OAUTH_PERSON`, `GOOGLE_OAUTH_ISSUER` and either `GOOGLE_OAUTH_KEYFILE` or `GOOGLE_OAUTH_PRIVATE_KEY`.
63
+ `GOOGLE_OAUTH_PERSON`, `GOOGLE_OAUTH_ISSUER` and either `GOOGLE_OAUTH_KEYFILE`
64
+ or `GOOGLE_OAUTH_PRIVATE_KEY`.
56
65
 
57
66
  ## Contributing
58
67
 
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module GoogleDrive
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
5
5
  end
@@ -30,8 +30,8 @@ module Middleman
30
30
  if key
31
31
  puts 'authenticating with key'
32
32
  client = Google::APIClient.new(
33
- application_name: 'VoxDocs',
34
- application_version: '0.0.1',
33
+ application_name: 'Middleman',
34
+ application_version: Middleman::GoogleDrive::VERSION,
35
35
  authorization: Signet::OAuth2::Client.new(
36
36
  token_credential_uri: 'https://accounts.google.com/o/oauth2/token',
37
37
  audience: 'https://accounts.google.com/o/oauth2/token',
@@ -50,9 +50,14 @@ module Middleman
50
50
  else
51
51
  client = Google::APIClient.new(
52
52
  application_name: 'Middleman',
53
- application_version: '1.0.0'
53
+ application_version: Middleman::GoogleDrive::VERSION
54
54
  )
55
- file_storage = Google::APIClient::FileStorage.new(credentials)
55
+ begin
56
+ file_storage = Google::APIClient::FileStorage.new(credentials)
57
+ rescue URI::InvalidURIError
58
+ File.delete credentials
59
+ file_storage = Google::APIClient::FileStorage.new(credentials)
60
+ end
56
61
  if file_storage.authorization.nil?
57
62
  unless File.exist? client_secrets
58
63
  puts 'You need to create a client_secrets.json file and save it to `~/.google_client_secrets.json`. Find instructions here: http://tarbell.readthedocs.org/en/latest/install.html#configure-google-spreadsheet-access-optional'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-google_drive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Mark
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-26 00:00:00.000000000 Z
12
+ date: 2014-06-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: middleman-core