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.
Files changed (4) hide show
  1. data/README.md +16 -18
  2. data/lib/lionel/cli.rb +17 -3
  3. data/lib/lionel/version.rb +1 -1
  4. metadata +1 -1
data/README.md CHANGED
@@ -20,36 +20,34 @@ Or install it yourself as:
20
20
 
21
21
  ## Setup
22
22
 
23
- First, you'll create a Google client app. Visit the [Google API console](https://code.google.com/apis/console). Create an app. Feel free to call it "Trello Export" or "Lionel Richie".
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
- 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".
25
+ You'll first need to authorize your CLI to use the Trello and Google APIs.
26
26
 
27
- From your newly created client settings, grab the client ID and client secret. Add them to your environment:
27
+ To authorize, sign in to Trello and run the following command:
28
28
 
29
- $ export GOOGLE_CLIENT_ID=your-google-client-id
30
- $ export GOOGLE_CLIENT_SECRET=your-google-client-secret
29
+ $ lionel authorize trello
31
30
 
32
- Next, you'll need to authorize the lionel_richie CLI. Run the following:
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
- $ authorize_lionel
33
+ To authorize Google, run the following command:
35
34
 
36
- Follow the instructions, which will include entering info on the command line from webpages on Trello and Google. If successful, you'll be able to export the following environment variables needed to run the export.
35
+ $ lionel authorize google
37
36
 
38
- $ export TRELLO_KEY=your-trello-key
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
- Finally, you need to set the trello board and the google doc you want to export. You can get these from the respective URLs for those resources.
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
 
@@ -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
- unless export.has_sources?
44
- export.trello_board_id = ask("Enter a trello board id to export from:")
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?"
@@ -1,3 +1,3 @@
1
1
  module Lionel
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lionel_richie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: