lionel_richie 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +16 -18
- data/lib/lionel/cli.rb +17 -3
- data/lib/lionel/version.rb +1 -1
- metadata +1 -1
data/README.md
CHANGED
@@ -20,36 +20,34 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Setup
|
22
22
|
|
23
|
-
|
23
|
+
Assuming you have a Google account, a Trello account, and a board you want to export to google docs, you're ready to start using lionel_richie.
|
24
24
|
|
25
|
-
|
25
|
+
You'll first need to authorize your CLI to use the Trello and Google APIs.
|
26
26
|
|
27
|
-
|
27
|
+
To authorize, sign in to Trello and run the following command:
|
28
28
|
|
29
|
-
$
|
30
|
-
$ export GOOGLE_CLIENT_SECRET=your-google-client-secret
|
29
|
+
$ lionel authorize trello
|
31
30
|
|
32
|
-
|
31
|
+
This command will direct you to a URL which has your trello key. Enter this into the CLI. You'll then be directed to a URL where you'll authorize the application to get your trello token. If you entered the key and token correctly, you should now be authorized to use Trello.
|
33
32
|
|
34
|
-
|
33
|
+
To authorize Google, run the following command:
|
35
34
|
|
36
|
-
|
35
|
+
$ lionel authorize google
|
37
36
|
|
38
|
-
|
39
|
-
$ export TRELLO_TOKEN=your-trello-token
|
40
|
-
$ export GOOGLE_TOKEN=your-google-token
|
41
|
-
$ export GOOGLE_REFRESH_TOKEN=your-google-refresh-token
|
37
|
+
This command will direct you to the [Google API console](https://code.google.com/apis/console). You'll need to create a Google client app for LionelRichie. Feel free to call it whatever you want. Once you have registered a client app, click the tab "API Access", then "Create an OAuth 2.0 Client ID" to open up a modal. Set a client name, like "CLI" for command line interface and continue. Next the modal presents "Client ID Settings"; choose "Installed Application" for "Application type", and "Other" for "Installed application type". Now press "Create client ID". From your newly created client settings, grab the client id and client secret. Enter them in the CLI.
|
42
38
|
|
43
|
-
|
44
|
-
|
45
|
-
$ export TRELLO_BOARD_ID=your-trello-board-id
|
46
|
-
$ export GOOGLE_DOC_ID=your-google-doc-id
|
39
|
+
You'll then be directed to authorize the application and retrieve your google token.
|
47
40
|
|
48
41
|
You should now be ready to run the export:
|
49
42
|
|
50
|
-
$ lionel
|
43
|
+
$ lionel export # uploads to your google doc
|
44
|
+
$ lionel export --print # prints the output without uploading
|
45
|
+
|
46
|
+
When running this command for the first time, you'll be asked to enter your trello board id and google doc id, which you can grab from the respective URLs of those resources.
|
47
|
+
|
48
|
+
Run `lionel` to see a list of the available commands and options.
|
51
49
|
|
52
|
-
## Crafting the Export
|
50
|
+
## Crafting the Export (Doesn't exist yet)
|
53
51
|
|
54
52
|
```ruby
|
55
53
|
|
data/lib/lionel/cli.rb
CHANGED
@@ -37,15 +37,29 @@ module Lionel
|
|
37
37
|
|
38
38
|
desc "export", "Saves Trello export to Google Docs"
|
39
39
|
method_option "print", :aliases => "-p", :type => :boolean, :default => false, :desc => "Print results instead of saving them to Google Docs."
|
40
|
+
method_option "trello-board-id", :aliases => "-t", :type => :string, :default => nil, :desc => "Specify the Google Doc."
|
41
|
+
method_option "google-doc-id", :aliases => "-g", :type => :string, :default => nil, :desc => "Print results instead of saving them to Google Docs."
|
42
|
+
method_option "configure", :aliases => "-c", :type => :string, :default => false, :desc => "Save export configuration."
|
40
43
|
def export
|
41
44
|
export = Lionel::Export.new
|
42
45
|
|
43
|
-
|
44
|
-
export.
|
46
|
+
if options['google-doc-id']
|
47
|
+
export.google_doc_id = options['google-doc-id']
|
48
|
+
end
|
49
|
+
|
50
|
+
if options['trello-board-id']
|
51
|
+
export.trello_board_id = options['trello-board-id']
|
52
|
+
end
|
53
|
+
|
54
|
+
if !export.google_doc_id
|
45
55
|
export.google_doc_id = ask("Enter a google doc id to export to:")
|
46
|
-
export.save
|
47
56
|
end
|
48
57
|
|
58
|
+
if !export.trello_board_id
|
59
|
+
export.trello_board_id = ask("Enter a trello board id to export from:")
|
60
|
+
end
|
61
|
+
|
62
|
+
export.save if options['configure']
|
49
63
|
export.authenticate
|
50
64
|
|
51
65
|
welcome = "Trello? Is it me you're looking for?"
|
data/lib/lionel/version.rb
CHANGED