trello_cli 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.rvmrc +1 -1
- data/CHANGELOG.md +4 -0
- data/README.md +26 -3
- data/lib/trello_cli/cli/commands/shared.rb +5 -1
- data/lib/trello_cli/cli/run.rb +2 -2
- data/lib/trello_cli/version.rb +1 -1
- data/spec/cli/commands/shared_spec.rb +31 -0
- metadata +12 -10
data/.rvmrc
CHANGED
@@ -1 +1 @@
|
|
1
|
-
rvm use ruby-1.9.3-
|
1
|
+
rvm use ruby-1.9.3-p385@trello_cli --create
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -35,15 +35,38 @@ The CLI takes the following form:
|
|
35
35
|
|
36
36
|
trello TARGET COMMAND OPTIONS
|
37
37
|
|
38
|
-
|
38
|
+
To see a list of targets:
|
39
|
+
|
40
|
+
# trello -h
|
41
|
+
trello [board|card|list] [command] OPTIONS
|
42
|
+
Append -h for help on specific target.
|
43
|
+
|
44
|
+
To see a list of commands for a given target:
|
45
|
+
|
46
|
+
# trello card -h
|
47
|
+
Valid commands for card: create, list
|
48
|
+
For further help, append -h to sub command.
|
49
|
+
|
50
|
+
To see help for a specific command:
|
51
|
+
|
52
|
+
# trello card create -h
|
53
|
+
Usage: trello card [create] [options]
|
54
|
+
-b, --board [BOARD] Trello Board Id
|
55
|
+
-d, --description [DESCRIPTION] Description Of Card
|
56
|
+
-l, --list [LIST] List Of Card
|
57
|
+
-n, --name [NAME] Name Of Card
|
58
|
+
|
59
|
+
## Examples
|
60
|
+
|
61
|
+
List the boards available to the given credentials:
|
39
62
|
|
40
63
|
trello board list
|
41
64
|
|
42
|
-
|
65
|
+
List the lists for a given board id:
|
43
66
|
|
44
67
|
trello list list -b 123
|
45
68
|
|
46
|
-
|
69
|
+
Create a card:
|
47
70
|
|
48
71
|
trello card create -b 123 -l 321 -n 'card name' -d 'card description'
|
49
72
|
|
@@ -11,8 +11,12 @@ module TrelloCli
|
|
11
11
|
TrelloCli::CLI::Commands::Shared.instance_methods
|
12
12
|
end
|
13
13
|
|
14
|
+
def target_name
|
15
|
+
self.class.name.downcase.split('::').last
|
16
|
+
end
|
17
|
+
|
14
18
|
def help
|
15
|
-
puts "Valid
|
19
|
+
puts "Valid commands for #{target_name}: #{actions.join(', ')}"
|
16
20
|
puts "For further help, append -h to sub command."
|
17
21
|
end
|
18
22
|
|
data/lib/trello_cli/cli/run.rb
CHANGED
@@ -12,7 +12,7 @@ module TrelloCli
|
|
12
12
|
cmd = 'help' unless target_object.actions.include?(cmd.to_sym)
|
13
13
|
|
14
14
|
begin
|
15
|
-
target_object.send cmd
|
15
|
+
target_object.send cmd
|
16
16
|
rescue OptionParser::InvalidOption, Trello::Error => e
|
17
17
|
puts e.message
|
18
18
|
exit 1
|
@@ -29,7 +29,7 @@ module TrelloCli
|
|
29
29
|
private
|
30
30
|
|
31
31
|
def targets
|
32
|
-
klasses = TrelloCli::CLI.constants.reject do |c|
|
32
|
+
klasses = TrelloCli::CLI.constants.reject do |c|
|
33
33
|
( c == :Run ) || ( c == :Commands )
|
34
34
|
end
|
35
35
|
klasses.map { |k| k.to_s.downcase }
|
data/lib/trello_cli/version.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
TrelloCli::CLI::Commands::Test = Struct.new('Test')
|
4
|
+
|
5
|
+
describe TrelloCli::CLI::Commands::Shared do
|
6
|
+
|
7
|
+
before do
|
8
|
+
@object = TrelloCli::CLI::Commands::Test.new
|
9
|
+
@object.extend TrelloCli::CLI::Commands::Shared
|
10
|
+
@object.define_singleton_method(:test_action) { true }
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should return a list of actions (instance methods)" do
|
14
|
+
@object.actions.should == [:test_action]
|
15
|
+
end
|
16
|
+
|
17
|
+
it "should return the short name of the target class" do
|
18
|
+
@object.target_name.should == 'test'
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should return the shared methods" do
|
22
|
+
@object.shared_methods.should == TrelloCli::CLI::Commands::Shared.instance_methods
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should print help for a given target" do
|
26
|
+
@object.should_receive(:puts).with('Valid commands for test: test_action')
|
27
|
+
@object.should_receive(:puts).with('For further help, append -h to sub command.')
|
28
|
+
@object.help
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trello_cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70261266173780 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70261266173780
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rake
|
27
|
-
requirement: &
|
27
|
+
requirement: &70261266173340 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70261266173340
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: ruby-trello
|
38
|
-
requirement: &
|
38
|
+
requirement: &70261266172800 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - =
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 0.5.1
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70261266172800
|
47
47
|
description: Simple Trello Command Line Interface
|
48
48
|
email:
|
49
49
|
- brett@weav.net
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- lib/trello_cli/requests/list_lists.rb
|
84
84
|
- lib/trello_cli/requests/shared.rb
|
85
85
|
- lib/trello_cli/version.rb
|
86
|
+
- spec/cli/commands/shared_spec.rb
|
86
87
|
- spec/cli/run_spec.rb
|
87
88
|
- spec/requests/create_card_spec.rb
|
88
89
|
- spec/requests/list_boards_spec.rb
|
@@ -105,7 +106,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
105
106
|
version: '0'
|
106
107
|
segments:
|
107
108
|
- 0
|
108
|
-
hash:
|
109
|
+
hash: 3964216416038007398
|
109
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
111
|
none: false
|
111
112
|
requirements:
|
@@ -114,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
114
115
|
version: '0'
|
115
116
|
segments:
|
116
117
|
- 0
|
117
|
-
hash:
|
118
|
+
hash: 3964216416038007398
|
118
119
|
requirements: []
|
119
120
|
rubyforge_project:
|
120
121
|
rubygems_version: 1.8.16
|
@@ -122,6 +123,7 @@ signing_key:
|
|
122
123
|
specification_version: 3
|
123
124
|
summary: Simple Trello Command Line Interface
|
124
125
|
test_files:
|
126
|
+
- spec/cli/commands/shared_spec.rb
|
125
127
|
- spec/cli/run_spec.rb
|
126
128
|
- spec/requests/create_card_spec.rb
|
127
129
|
- spec/requests/list_boards_spec.rb
|