3llo 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +4 -0
- data/README.md +4 -3
- data/bin/3llo +20 -6
- data/lib/3llo/presenter/help.rb +16 -5
- data/lib/3llo/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d98e6963031445c64839dea30b0306cc264319fba049f12c0fe37bf3ef96d0a9
|
4
|
+
data.tar.gz: 3337c122e25299bb64cd0c12f12e83949c7d3ff17a96bed1c58757a53e631712
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cbbaf758f34553fa23b48e206651bd3240f3065830e2156c2e9c2ca6f88dad161ee5a6d6cf43d1e09105911653eac634dc61ba3af39b90485d42e5425711edf
|
7
|
+
data.tar.gz: a532fd7bed771cb61d1004721a583dade9e3962a4e8edef3fafdbe495d3ad74e5846b47f6361930687e4b104707d1bf78f6166774ac403a8a100f619ad6d3540
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -29,9 +29,10 @@ export TRELLO_TOKEN=your_token
|
|
29
29
|
|
30
30
|
### Obtain Trello API key and token
|
31
31
|
|
32
|
-
1.
|
33
|
-
|
34
|
-
|
32
|
+
1. Ensure you're logged into your Trello account at [trello.com](https://trello.com)
|
33
|
+
1. Visit [trello.com/app-key](https://trello.com/app-key), accept the Trello Developer Terms (if you're happy to do so) and press **Generate API Key**
|
34
|
+
1. Copy the `Key` that's displayed at the top of the page and set this as an environment variable (`TRELLO_KEY`).
|
35
|
+
1. Further down the page, follow the `Manually generate a token` link to generate a new API Token. Again, set this as an environment variable (`TRELLO_TOKEN`)
|
35
36
|
|
36
37
|
## Usage
|
37
38
|
|
data/bin/3llo
CHANGED
@@ -10,10 +10,26 @@ $container.register(:api_client, Tr3llo::HTTP::Client)
|
|
10
10
|
prompt = TTY::Prompt.new
|
11
11
|
$container.register(:interface, Tr3llo::Interface.new(prompt, $stdout))
|
12
12
|
|
13
|
+
def print_help(stripped = false)
|
14
|
+
Tr3llo::Presenter::HelpPresenter
|
15
|
+
.new($container.resolve(:interface), stripped)
|
16
|
+
.print!
|
17
|
+
end
|
18
|
+
|
19
|
+
if ARGV.size == 1 && (ARGV[0] == "-h" || ARGV[0] == "--help")
|
20
|
+
print_help(true)
|
21
|
+
exit
|
22
|
+
end
|
23
|
+
|
13
24
|
configuration = Tr3llo::Configuration.new
|
14
|
-
|
15
|
-
configuration.
|
16
|
-
configuration.
|
25
|
+
begin
|
26
|
+
configuration.user_id = ENV.fetch('TRELLO_USER') { raise "Have you set TRELLO_USER?" }
|
27
|
+
configuration.api_key = ENV.fetch('TRELLO_KEY') { raise "Have you set TRELLO_KEY?" }
|
28
|
+
configuration.api_token = ENV.fetch('TRELLO_TOKEN') { raise "Have you set TRELLO_TOKEN?" }
|
29
|
+
rescue => error
|
30
|
+
abort "Invalid configuration: \e[1m#{error.message}".colorize(31)
|
31
|
+
end
|
32
|
+
|
17
33
|
configuration.finalize!
|
18
34
|
|
19
35
|
$container.register(
|
@@ -24,8 +40,6 @@ $container.register(
|
|
24
40
|
user = Tr3llo::API::User.find($container.resolve(:configuration).user_id)
|
25
41
|
$container.register(:user, user)
|
26
42
|
|
27
|
-
|
28
|
-
.new($container.resolve(:interface))
|
29
|
-
.print!
|
43
|
+
print_help(false)
|
30
44
|
|
31
45
|
Tr3llo::Controller.new.start
|
data/lib/3llo/presenter/help.rb
CHANGED
@@ -1,13 +1,18 @@
|
|
1
1
|
module Tr3llo
|
2
2
|
module Presenter
|
3
3
|
class HelpPresenter
|
4
|
-
def initialize(interface)
|
4
|
+
def initialize(interface, stripped = false)
|
5
5
|
@interface = interface
|
6
|
+
@stripped = stripped
|
6
7
|
end
|
7
8
|
|
8
9
|
def print!
|
9
10
|
interface.print_frame do
|
10
|
-
|
11
|
+
text = menu_text(@stripped)
|
12
|
+
if @stripped
|
13
|
+
text = text.split("\n").map(&:lstrip).drop(1).join("\n")
|
14
|
+
end
|
15
|
+
interface.puts text
|
11
16
|
end
|
12
17
|
end
|
13
18
|
|
@@ -15,10 +20,16 @@ module Tr3llo
|
|
15
20
|
|
16
21
|
attr_reader :interface
|
17
22
|
|
18
|
-
def menu_text
|
19
|
-
%q{
|
23
|
+
def menu_text(cli_help = false)
|
24
|
+
cli_help_text = %q{
|
25
|
+
This is an interactive program for trello cards. To start, you
|
26
|
+
need to set `TRELLO_USER`, `TRELL_KEY` and `TRELLO_TOKEN` to access
|
27
|
+
your account. After that, the following commands are available in interactive
|
28
|
+
mode:
|
29
|
+
}
|
30
|
+
%Q{
|
20
31
|
3llo - CLI for Trello
|
21
|
-
|
32
|
+
#{if cli_help then cli_help_text end}
|
22
33
|
Usage:
|
23
34
|
board list - Show list of board
|
24
35
|
board select - Select board
|
data/lib/3llo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: 3llo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cẩm Huỳnh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-prompt
|
@@ -132,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
132
|
version: '0'
|
133
133
|
requirements: []
|
134
134
|
rubyforge_project:
|
135
|
-
rubygems_version: 2.
|
135
|
+
rubygems_version: 2.7.6
|
136
136
|
signing_key:
|
137
137
|
specification_version: 4
|
138
138
|
summary: Trello CLI
|