google_drive_dotenv 0.2.1 → 0.3.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 +4 -4
- data/README.md +8 -0
- data/lib/google_drive_dotenv/cli.rb +2 -1
- data/lib/google_drive_dotenv/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f1f1301b0ccab8d3d313e1191bd6981b57df72b4ceda55de8def0bc2838c375
|
4
|
+
data.tar.gz: 0acfbde9b338fd5ec46a50994e8774c7120ba8fec169255bc06c64ea88980b0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32c420b15ad226514c3897e2bd19f3f4232f558c85ee811d7724198b43ba503ebca862d2546c5f894ce58333400c7e54ec91bfef119fda193822e2046ce9eb70
|
7
|
+
data.tar.gz: 93115793354066506019e246fd38e768b3ef5dee6370c2b0b59a02b9beb9f6bbd5c49b3b7e9a80d9d53e208bfc14f261215dac7db03b6ee9128f5601de86af43
|
data/README.md
CHANGED
@@ -4,9 +4,17 @@ Welcome to your new gem! In this directory, you'll find the files you need to be
|
|
4
4
|
|
5
5
|
## Usage
|
6
6
|
```
|
7
|
+
Commands:
|
8
|
+
google_drive_dotenv export [key] # Export Spreadsheet to env file
|
9
|
+
google_drive_dotenv help [COMMAND] # Describe available commands or one specific command
|
10
|
+
|
7
11
|
Usage:
|
8
12
|
google_drive_dotenv export [key]
|
9
13
|
|
14
|
+
Options:
|
15
|
+
o, [--output=OUTPUT]
|
16
|
+
# Default: .env
|
17
|
+
|
10
18
|
Export Spreadsheet to env file
|
11
19
|
```
|
12
20
|
|
@@ -4,6 +4,7 @@ require 'google_drive'
|
|
4
4
|
module GoogleDriveDotenv
|
5
5
|
class CLI < Thor
|
6
6
|
desc "export [key]", "Export Spreadsheet to env file"
|
7
|
+
option "output", aliases: "o", type: :string, default: ".env"
|
7
8
|
def export(key)
|
8
9
|
config_path = File.expand_path("~/google_config.json")
|
9
10
|
|
@@ -14,7 +15,7 @@ module GoogleDriveDotenv
|
|
14
15
|
session = GoogleDrive::Session.from_config(config_path)
|
15
16
|
|
16
17
|
sheet = session.spreadsheet_by_key(key).worksheets[0]
|
17
|
-
File.open('
|
18
|
+
File.open(options['output'], 'wb') do |file|
|
18
19
|
(1..sheet.num_rows).each do |row|
|
19
20
|
key = sheet[row, 1]
|
20
21
|
value = sheet[row, 2]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google_drive_dotenv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- adorechic
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|