troo 0.0.9 → 0.0.10
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/.gitignore +2 -2
- data/Gemfile.lock +40 -32
- data/Guardfile +9 -1
- data/README.md +15 -10
- data/bin/troo +22 -2
- data/config/en.yml +11 -1
- data/config/help +16 -0
- data/{.trooconf.example → config/trooconf.yml} +4 -2
- data/features/add/card.feature +1 -1
- data/features/add/comment.feature +1 -1
- data/features/add/list.feature +1 -1
- data/features/default/board.feature +1 -1
- data/features/default/card.feature +1 -1
- data/features/default/list.feature +1 -1
- data/features/move/card.feature +5 -5
- data/features/refresh/board.feature +1 -1
- data/features/refresh/card.feature +1 -1
- data/features/refresh/list.feature +1 -1
- data/features/show/board.feature +11 -3
- data/features/show/boards.feature +1 -0
- data/features/show/card.feature +7 -7
- data/features/show/comment.feature +15 -6
- data/features/show/list.feature +3 -1
- data/features/status.feature +2 -2
- data/features/step_definitions/fabrication_steps.rb +11 -11
- data/features/step_definitions/troo_steps.rb +1 -1
- data/features/support/cassettes/200_board_by_id.yml +56 -0
- data/features/support/cassettes/200_card_by_id.yml +77 -0
- data/features/support/cassettes/200_create_board.yml +186 -0
- data/features/support/cassettes/200_create_card.yml +86 -0
- data/features/support/cassettes/200_create_comment.yml +73 -0
- data/features/support/cassettes/200_create_list.yml +53 -0
- data/{test/cassettes/list_by_id.yml → features/support/cassettes/200_list_by_id.yml} +6 -6
- data/features/support/cassettes/200_move_card_200_board.yml +86 -0
- data/features/support/cassettes/200_move_card_200_list.yml +86 -0
- data/features/support/cassettes/200_move_card_400_list.yml +46 -0
- data/{test/cassettes/lists_by_board_id.yml → features/support/cassettes/400_board_by_id.yml} +10 -10
- data/features/support/cassettes/400_card_by_id.yml +46 -0
- data/features/support/cassettes/400_create_card.yml +46 -0
- data/features/support/cassettes/400_create_comment.yml +46 -0
- data/features/support/cassettes/400_create_list.yml +46 -0
- data/features/support/cassettes/400_list_by_id.yml +46 -0
- data/features/support/cassettes/400_move_card_200_list.yml +46 -0
- data/features/support/cassettes/400_move_card_400_board.yml +46 -0
- data/features/support/cassettes/boards_all.yml +286 -0
- data/features/support/env.rb +1 -2
- data/lib/troo/cli/commands/refresh/all.rb +2 -0
- data/lib/troo/cli/main.rb +2 -23
- data/lib/troo/configuration.rb +5 -0
- data/lib/troo/database.rb +29 -0
- data/lib/troo/decorators/resource.rb +24 -10
- data/lib/troo/helpers/model_helpers.rb +3 -2
- data/lib/troo/models/board.rb +1 -1
- data/lib/troo/models/card.rb +1 -1
- data/lib/troo/models/comment.rb +0 -4
- data/lib/troo/models/list.rb +1 -1
- data/lib/troo/presentation/formatter.rb +99 -4
- data/lib/troo/presentation/template.rb +8 -9
- data/lib/troo/presenters/board.rb +24 -26
- data/lib/troo/presenters/card.rb +3 -1
- data/lib/troo/presenters/list.rb +30 -17
- data/lib/troo/presenters/resource.rb +90 -0
- data/lib/troo/retrieval/local.rb +5 -1
- data/lib/troo/troo.rb +2 -0
- data/lib/troo/version.rb +1 -1
- data/lib/troo.rb +7 -4
- data/test/cassettes/create_board.yml +15 -9
- data/test/cassettes/create_card.yml +10 -10
- data/test/cassettes/create_comment.yml +9 -9
- data/test/cassettes/create_list.yml +5 -5
- data/test/cassettes/move_card_board.yml +11 -11
- data/test/cassettes/move_card_list.yml +11 -11
- data/test/lib/troo/api/endpoints_test.rb +2 -2
- data/test/lib/troo/cli/commands/add_test.rb +2 -2
- data/test/lib/troo/cli/commands/refresh/all_test.rb +4 -9
- data/test/lib/troo/cli/main_test.rb +0 -25
- data/test/lib/troo/configuration_test.rb +18 -13
- data/test/lib/troo/decorators/member_test.rb +0 -27
- data/test/lib/troo/decorators/resource_test.rb +0 -32
- data/test/lib/troo/helpers/model_helpers_test.rb +15 -3
- data/test/lib/troo/models/board_test.rb +45 -1
- data/test/lib/troo/models/card_test.rb +60 -6
- data/test/lib/troo/models/comment_test.rb +44 -4
- data/test/lib/troo/models/database_test.rb +19 -0
- data/test/lib/troo/models/list_test.rb +46 -2
- data/test/lib/troo/models/member_test.rb +51 -1
- data/test/lib/troo/presentation/formatter_test.rb +54 -2
- data/test/lib/troo/presentation/template_test.rb +4 -4
- data/test/lib/troo/presenters/board_test.rb +4 -3
- data/test/lib/troo/presenters/list_test.rb +3 -3
- data/test/lib/troo/presenters/member_test.rb +1 -1
- data/test/lib/troo/presenters/resource_test.rb +79 -0
- data/test/lib/troo/remote/board_test.rb +5 -8
- data/test/lib/troo/remote/card_test.rb +7 -11
- data/test/lib/troo/remote/comment_test.rb +10 -14
- data/test/lib/troo/remote/list_test.rb +5 -9
- data/test/lib/troo/remote/member_test.rb +5 -9
- data/test/lib/troo/remote/persistence/card_test.rb +1 -1
- data/test/lib/troo/remote/persistence/comment_test.rb +1 -1
- data/test/lib/troo/remote/persistence/list_test.rb +1 -1
- data/test/lib/troo/remote/persistence/move_card_test.rb +3 -3
- data/test/lib/troo/retrieval/local_test.rb +13 -1
- data/test/lib/troo/retrieval/remote_test.rb +1 -1
- data/test/support/fabrication.rb +12 -12
- data/test/support/fake_trello/fake_response.rb +18 -1
- data/test/support/fake_trello/server.rb +2 -0
- data/test/support/remotes/all_boards.json +103 -4
- data/test/support/remotes/{board.json → all_boards_200.json} +13 -13
- data/test/support/remotes/board_200.json +140 -0
- data/test/support/remotes/board_by_id.json +9 -9
- data/test/support/remotes/board_by_id_200.json +75 -0
- data/test/support/remotes/card.json +4 -4
- data/test/support/remotes/card_200.json +40 -0
- data/test/support/remotes/card_by_card_id.json +64 -64
- data/test/support/remotes/card_by_card_id_200.json +302 -0
- data/test/support/remotes/comment.json +6 -6
- data/test/support/remotes/comment_200.json +27 -0
- data/test/support/remotes/create_board.json +1 -1
- data/test/support/remotes/create_board_200.json +38 -0
- data/test/support/remotes/list.json +2 -2
- data/test/support/remotes/list_200.json +7 -0
- data/test/support/remotes/member.json +4 -4
- data/test/support/remotes/member_200.json +50 -0
- data/test/test_helper.rb +9 -2
- data/troo.gemspec +4 -3
- metadata +92 -41
- data/test/cassettes/board_by_id.yml +0 -50
- data/test/cassettes/boards_all.yml +0 -50
- data/test/cassettes/card_by_id.yml +0 -49
- data/test/cassettes/cards_by_board_id.yml +0 -49
- data/test/cassettes/cards_by_list_id.yml +0 -49
- data/test/cassettes/comments_by_board_id.yml +0 -49
- data/test/cassettes/comments_by_card_id.yml +0 -49
- data/test/cassettes/member_by_id.yml +0 -48
- data/test/cassettes/members_by_board_id.yml +0 -48
- data/test/lib/troo/decorators/card_test.rb +0 -113
@@ -5,7 +5,7 @@ module Troo
|
|
5
5
|
|
6
6
|
class << self
|
7
7
|
def all(boards, options = {})
|
8
|
-
boards.map { |board| new(board
|
8
|
+
boards.map { |board| new(board, options).show }
|
9
9
|
nil
|
10
10
|
end
|
11
11
|
end
|
@@ -15,47 +15,45 @@ module Troo
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def show
|
18
|
-
output.render board
|
18
|
+
output.render Presenters::Resource.list_view(board)
|
19
19
|
|
20
20
|
output.indent do
|
21
|
-
if lists.empty?
|
22
|
-
output.
|
21
|
+
if board.lists.empty?
|
22
|
+
output.spacer do
|
23
|
+
output.render error('No lists were found.')
|
24
|
+
end
|
23
25
|
else
|
24
|
-
|
26
|
+
render_lists
|
25
27
|
end
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
31
|
+
def render_lists
|
32
|
+
output.spacer
|
33
|
+
|
34
|
+
board.lists.map do |list|
|
35
|
+
Presenters::List.new(list, output: output).render_list
|
36
|
+
end
|
37
|
+
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
|
29
41
|
private
|
30
42
|
|
31
43
|
attr_reader :board
|
32
44
|
|
33
45
|
def output
|
34
|
-
@output ||=
|
46
|
+
@output ||= options.fetch(:output)
|
35
47
|
end
|
36
48
|
|
37
|
-
def
|
38
|
-
|
39
|
-
lists.each do |list|
|
40
|
-
output.render list.title
|
41
|
-
|
42
|
-
output.indent do
|
43
|
-
if list.cards.empty?
|
44
|
-
output.render error('No cards were found.') + "\n"
|
45
|
-
else
|
46
|
-
output.render "\n"
|
47
|
-
list.cards.each do |card|
|
48
|
-
output.render card.title
|
49
|
-
end
|
50
|
-
output.render "\n"
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
nil
|
49
|
+
def options
|
50
|
+
defaults.merge!(@options)
|
55
51
|
end
|
56
52
|
|
57
|
-
def
|
58
|
-
|
53
|
+
def defaults
|
54
|
+
{
|
55
|
+
output: Troo::Output.new
|
56
|
+
}
|
59
57
|
end
|
60
58
|
end
|
61
59
|
end
|
data/lib/troo/presenters/card.rb
CHANGED
data/lib/troo/presenters/list.rb
CHANGED
@@ -8,18 +8,33 @@ module Troo
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def show
|
11
|
-
output.render list.board
|
12
|
-
|
11
|
+
output.render Presenters::Resource.list_view(list.board)
|
12
|
+
|
13
|
+
output.spacer
|
13
14
|
|
14
15
|
output.indent do
|
15
|
-
|
16
|
+
render_list
|
17
|
+
end
|
18
|
+
end
|
16
19
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
def render_list
|
21
|
+
output.render Presenters::Resource.list_view(list)
|
22
|
+
|
23
|
+
output.indent do
|
24
|
+
if list.cards.empty?
|
25
|
+
output.spacer do
|
26
|
+
output.render error('No cards were found.')
|
22
27
|
end
|
28
|
+
else
|
29
|
+
render_cards
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def render_cards
|
35
|
+
output.spacer do
|
36
|
+
list.cards.map do |card|
|
37
|
+
output.render Presenters::Resource.list_view(card)
|
23
38
|
end
|
24
39
|
end
|
25
40
|
end
|
@@ -29,19 +44,17 @@ module Troo
|
|
29
44
|
attr_reader :list
|
30
45
|
|
31
46
|
def output
|
32
|
-
@output ||=
|
47
|
+
@output ||= options.fetch(:output)
|
33
48
|
end
|
34
49
|
|
35
|
-
def
|
36
|
-
|
37
|
-
cards.each do |card|
|
38
|
-
output.render card.title
|
39
|
-
end
|
40
|
-
nil
|
50
|
+
def options
|
51
|
+
defaults.merge!(@options)
|
41
52
|
end
|
42
53
|
|
43
|
-
def
|
44
|
-
|
54
|
+
def defaults
|
55
|
+
{
|
56
|
+
output: Troo::Output.new
|
57
|
+
}
|
45
58
|
end
|
46
59
|
end
|
47
60
|
end
|
@@ -0,0 +1,90 @@
|
|
1
|
+
module Troo
|
2
|
+
module Presenters
|
3
|
+
class Resource
|
4
|
+
include DecoratorHelpers
|
5
|
+
|
6
|
+
class << self
|
7
|
+
def list_view(klass, options = {})
|
8
|
+
new(klass, options).list_view
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def initialize(klass, options = {})
|
13
|
+
@klass, @options = klass, options
|
14
|
+
end
|
15
|
+
|
16
|
+
def list_view
|
17
|
+
[id, name, default].compact.join(' ') + "\n"
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
attr_reader :klass
|
23
|
+
|
24
|
+
def id
|
25
|
+
brackets(formatted_id)
|
26
|
+
end
|
27
|
+
|
28
|
+
def formatted_id
|
29
|
+
return highlight(resource_id) if card?
|
30
|
+
resource_id
|
31
|
+
end
|
32
|
+
|
33
|
+
def name
|
34
|
+
return formatted_name if card?
|
35
|
+
highlight(formatted_name)
|
36
|
+
end
|
37
|
+
|
38
|
+
def formatted_name
|
39
|
+
Troo::Wordwrap.this(resource_name, prune: true)
|
40
|
+
end
|
41
|
+
|
42
|
+
def default
|
43
|
+
return '*' if resource_default?
|
44
|
+
end
|
45
|
+
|
46
|
+
def resource_id
|
47
|
+
return klass.short_id if card?
|
48
|
+
klass.id
|
49
|
+
end
|
50
|
+
|
51
|
+
def resource_name
|
52
|
+
(klass.name && klass.name.chomp) || 'N/A'
|
53
|
+
end
|
54
|
+
|
55
|
+
def resource_default?
|
56
|
+
klass.default?
|
57
|
+
end
|
58
|
+
|
59
|
+
def card?
|
60
|
+
klass.type == :card
|
61
|
+
end
|
62
|
+
|
63
|
+
def highlight(value)
|
64
|
+
Troo::Formatter.highlight(value, options)
|
65
|
+
end
|
66
|
+
|
67
|
+
def options
|
68
|
+
defaults.merge!(@options)
|
69
|
+
end
|
70
|
+
|
71
|
+
def defaults
|
72
|
+
{
|
73
|
+
ansicolor: true,
|
74
|
+
colour: colour.fetch(klass.type, nil),
|
75
|
+
underline: true
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
def colour
|
80
|
+
{
|
81
|
+
board: Esc.blue,
|
82
|
+
card: Esc.magenta,
|
83
|
+
list: Esc.green,
|
84
|
+
comments: Esc.cyan,
|
85
|
+
member: Esc.white
|
86
|
+
}
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
data/lib/troo/retrieval/local.rb
CHANGED
data/lib/troo/troo.rb
CHANGED
@@ -21,6 +21,7 @@ require 'yajl'
|
|
21
21
|
require 'yaml'
|
22
22
|
|
23
23
|
require_relative 'configuration'
|
24
|
+
require_relative 'database'
|
24
25
|
require_relative 'debug'
|
25
26
|
|
26
27
|
require_relative 'api/endpoints'
|
@@ -52,6 +53,7 @@ require_relative 'presenters/card'
|
|
52
53
|
require_relative 'presenters/comment'
|
53
54
|
require_relative 'presenters/list'
|
54
55
|
require_relative 'presenters/member'
|
56
|
+
require_relative 'presenters/resource'
|
55
57
|
|
56
58
|
require_relative 'persistence/local'
|
57
59
|
|
data/lib/troo/version.rb
CHANGED
data/lib/troo.rb
CHANGED
@@ -4,13 +4,13 @@ require_relative 'troo/troo'
|
|
4
4
|
require_relative 'troo/version'
|
5
5
|
|
6
6
|
module Troo
|
7
|
-
|
8
|
-
|
7
|
+
ConfigurationNotFound = Class.new(StandardError)
|
8
|
+
InvalidAccessToken = Class.new(StandardError)
|
9
|
+
EndpointNotFound = Class.new(StandardError)
|
9
10
|
|
10
11
|
def self.configuration(file = Dir.home + '/.trooconf', env = :default)
|
11
12
|
@configuration ||= Troo::Configuration.load(file, env)
|
12
13
|
end
|
13
|
-
configuration
|
14
14
|
|
15
15
|
def self.endpoints(version = :version_1)
|
16
16
|
@endpoints ||= Troo::API::Endpoints
|
@@ -29,7 +29,7 @@ module Troo
|
|
29
29
|
|
30
30
|
# RestClient.log = File.dirname(__FILE__) + '/../logs/restclient.log'
|
31
31
|
|
32
|
-
|
32
|
+
Database.connect(configuration)
|
33
33
|
|
34
34
|
class Launcher
|
35
35
|
def initialize(argv, stdin = STDIN,
|
@@ -47,6 +47,9 @@ module Troo
|
|
47
47
|
$stdin, $stdout, $stderr = @stdin, @stdout, @stderr
|
48
48
|
pad { Troo::CLI::Main.start(@argv) }
|
49
49
|
@kernel.exit(0)
|
50
|
+
rescue Redis::CannotConnectError
|
51
|
+
pad { puts 'Cannot connect to Redis database.' }
|
52
|
+
@kernel.exit(1)
|
50
53
|
ensure
|
51
54
|
$stdin, $stdout, $stderr = STDIN, STDOUT, STDERR
|
52
55
|
end
|
@@ -25,7 +25,7 @@ http_interactions:
|
|
25
25
|
Content-Type:
|
26
26
|
- text/html;charset=utf-8
|
27
27
|
Content-Length:
|
28
|
-
- '
|
28
|
+
- '3258'
|
29
29
|
X-Xss-Protection:
|
30
30
|
- 1; mode=block
|
31
31
|
X-Content-Type-Options:
|
@@ -33,18 +33,24 @@ http_interactions:
|
|
33
33
|
X-Frame-Options:
|
34
34
|
- SAMEORIGIN
|
35
35
|
Server:
|
36
|
-
- WEBrick/1.3.1 (Ruby/2.1.
|
36
|
+
- WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24) OpenSSL/1.0.1f
|
37
37
|
Date:
|
38
|
-
-
|
38
|
+
- Tue, 11 Mar 2014 21:34:41 GMT
|
39
39
|
Connection:
|
40
40
|
- Keep-Alive
|
41
41
|
body:
|
42
42
|
encoding: UTF-8
|
43
|
-
string:
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
string: '{"id":"20010","name":"My Test Board","desc":"A very brief description...","descData":null,"closed":false,"idOrganization":null,"pinned":true,"url":"<Trello
|
44
|
+
URL>","shortUrl":"<Trello URL>","prefs":{"permissionLevel":"private","voting":"disabled","comments":"members","invitations":"members","selfJoin":false,"cardCovers":true,"cardAging":"regular","background":"blue","backgroundColor":"#23719F","backgroundImage":null,"backgroundImageScaled":null,"backgroundTile":false,"backgroundBrightness":"unknown","canBePublic":true,"canBeOrg":true,"canBePrivate":true,"canInvite":true},"labelNames":{"yellow":"Analysis
|
45
|
+
Complete","red":"","purple":"","orange":"","green":"Ready to Pull","blue":""},"cards":[{"id":"20020","checkItemStates":[],"closed":true,"dateLastActivity":"2013-10-27T22:10:19.584Z","desc":"","descData":null,"idBoard":"20010","idList":"20040","idMembersVoted":[],"idShort":1,"idAttachmentCover":null,"manualCoverAttachment":false,"name":"Command:
|
46
|
+
config","pos":327679,"shortLink":"1G0cGaRV","badges":{"votes":0,"viewingMemberVoted":false,"subscribed":false,"fogbugz":"","checkItems":0,"checkItemsChecked":0,"comments":0,"attachments":0,"description":false,"due":null},"due":null,"idChecklists":[],"idMembers":[],"labels":[],"shortUrl":"<Trello
|
47
|
+
URL>","subscribed":false,"url":"<Trello URL>"},{"id":"20021","checkItemStates":[],"closed":false,"dateLastActivity":"2014-02-07T19:39:15.075Z","desc":"A
|
48
|
+
description to get us started.","descData":null,"idBoard":"20010","idList":"20040","idMembersVoted":[],"idShort":27,"idAttachmentCover":null,"manualCoverAttachment":false,"name":"My
|
49
|
+
New Card","pos":606207,"shortLink":"OMnSslgP","badges":{"votes":0,"viewingMemberVoted":false,"subscribed":false,"fogbugz":"","checkItems":0,"checkItemsChecked":0,"comments":1,"attachments":0,"description":true,"due":null},"due":null,"idChecklists":[],"idMembers":[],"labels":[],"shortUrl":"<Trello
|
50
|
+
URL>","subscribed":false,"url":"<Trello URL>"}],"members":[{"id":"20050","avatarHash":"20001","initials":"GL","fullName":"Gavin
|
51
|
+
Laking","username":"gavinlaking1","confirmed":true}],"lists":[{"id":"20040","name":"My
|
52
|
+
New List","closed":true,"idBoard":"20010","pos":256,"subscribed":false},{"id":"20041","name":"My
|
53
|
+
New List","closed":true,"idBoard":"20010","pos":512,"subscribed":false}]}'
|
48
54
|
http_version:
|
49
|
-
recorded_at:
|
55
|
+
recorded_at: Tue, 11 Mar 2014 21:34:41 GMT
|
50
56
|
recorded_with: VCR 2.8.0
|
@@ -5,7 +5,7 @@ http_interactions:
|
|
5
5
|
uri: https://api.trello.com/1/cards
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: desc=A%20description%20to%20get%20us%20started.&list_id=
|
8
|
+
string: desc=A%20description%20to%20get%20us%20started.&list_id=20040&name=My%20New%20Card
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
@@ -14,7 +14,7 @@ http_interactions:
|
|
14
14
|
Authorization:
|
15
15
|
- "<OAuth Credentials>"
|
16
16
|
Content-Length:
|
17
|
-
- '
|
17
|
+
- '82'
|
18
18
|
User-Agent:
|
19
19
|
- Ruby
|
20
20
|
response:
|
@@ -25,7 +25,7 @@ http_interactions:
|
|
25
25
|
Content-Type:
|
26
26
|
- text/html;charset=utf-8
|
27
27
|
Content-Length:
|
28
|
-
- '
|
28
|
+
- '786'
|
29
29
|
X-Xss-Protection:
|
30
30
|
- 1; mode=block
|
31
31
|
X-Content-Type-Options:
|
@@ -33,17 +33,17 @@ http_interactions:
|
|
33
33
|
X-Frame-Options:
|
34
34
|
- SAMEORIGIN
|
35
35
|
Server:
|
36
|
-
- WEBrick/1.3.1 (Ruby/2.1.
|
36
|
+
- WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24) OpenSSL/1.0.1f
|
37
37
|
Date:
|
38
|
-
-
|
38
|
+
- Tue, 11 Mar 2014 21:34:41 GMT
|
39
39
|
Connection:
|
40
40
|
- Keep-Alive
|
41
41
|
body:
|
42
42
|
encoding: UTF-8
|
43
|
-
string:
|
44
|
-
description
|
45
|
-
to Pull
|
46
|
-
URL
|
43
|
+
string: '{"id":"20020","badges":{"votes":0,"viewingMemberVoted":false,"subscribed":false,"fogbugz":"","checkItems":0,"checkItemsChecked":0,"comments":10,"attachments":0,"description":false,"due":null},"checkItemStates":[],"closed":false,"dateLastActivity":"2014-02-13T20:12:46.612Z","desc":"some
|
44
|
+
description","descData":null,"due":null,"idBoard":"20010","idChecklists":[],"idList":"20040","idMembers":["20050"],"idShort":67,"idAttachmentCover":null,"manualCoverAttachment":false,"labels":[{"color":"green","name":"Ready
|
45
|
+
to Pull"}],"name":"My Test Card","pos":589823,"shortUrl":"<Trello URL>","url":"<Trello
|
46
|
+
URL>"}'
|
47
47
|
http_version:
|
48
|
-
recorded_at:
|
48
|
+
recorded_at: Tue, 11 Mar 2014 21:34:41 GMT
|
49
49
|
recorded_with: VCR 2.8.0
|
@@ -2,7 +2,7 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: post
|
5
|
-
uri: https://api.trello.com/1/cards/
|
5
|
+
uri: https://api.trello.com/1/cards/20020/actions/comments
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
8
|
string: text=Some%20much%20needed%20feedback...
|
@@ -25,7 +25,7 @@ http_interactions:
|
|
25
25
|
Content-Type:
|
26
26
|
- text/html;charset=utf-8
|
27
27
|
Content-Length:
|
28
|
-
- '
|
28
|
+
- '543'
|
29
29
|
X-Xss-Protection:
|
30
30
|
- 1; mode=block
|
31
31
|
X-Content-Type-Options:
|
@@ -33,17 +33,17 @@ http_interactions:
|
|
33
33
|
X-Frame-Options:
|
34
34
|
- SAMEORIGIN
|
35
35
|
Server:
|
36
|
-
- WEBrick/1.3.1 (Ruby/2.1.
|
36
|
+
- WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24) OpenSSL/1.0.1f
|
37
37
|
Date:
|
38
|
-
-
|
38
|
+
- Tue, 11 Mar 2014 21:34:41 GMT
|
39
39
|
Connection:
|
40
40
|
- Keep-Alive
|
41
41
|
body:
|
42
42
|
encoding: UTF-8
|
43
|
-
string:
|
44
|
-
Test Board
|
45
|
-
Test Card
|
46
|
-
Laking
|
43
|
+
string: '{"id":"20030","idMemberCreator":"20050","data":{"board":{"shortLink":"a3RnYKnD","name":"My
|
44
|
+
Test Board","id":"20010"},"card":{"shortLink":"UJBK7pil","idShort":8,"name":"My
|
45
|
+
Test Card","id":"20020"},"text":"My Test Comment"},"type":"commentCard","date":"2014-02-07T18:02:24.297Z","memberCreator":{"id":"20050","avatarHash":"20001","fullName":"Gavin
|
46
|
+
Laking","initials":"GL","username":"gavinlaking1"}}'
|
47
47
|
http_version:
|
48
|
-
recorded_at:
|
48
|
+
recorded_at: Tue, 11 Mar 2014 21:34:41 GMT
|
49
49
|
recorded_with: VCR 2.8.0
|
@@ -25,7 +25,7 @@ http_interactions:
|
|
25
25
|
Content-Type:
|
26
26
|
- text/html;charset=utf-8
|
27
27
|
Content-Length:
|
28
|
-
- '
|
28
|
+
- '103'
|
29
29
|
X-Xss-Protection:
|
30
30
|
- 1; mode=block
|
31
31
|
X-Content-Type-Options:
|
@@ -33,14 +33,14 @@ http_interactions:
|
|
33
33
|
X-Frame-Options:
|
34
34
|
- SAMEORIGIN
|
35
35
|
Server:
|
36
|
-
- WEBrick/1.3.1 (Ruby/2.1.
|
36
|
+
- WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24) OpenSSL/1.0.1f
|
37
37
|
Date:
|
38
|
-
-
|
38
|
+
- Tue, 11 Mar 2014 21:34:41 GMT
|
39
39
|
Connection:
|
40
40
|
- Keep-Alive
|
41
41
|
body:
|
42
42
|
encoding: UTF-8
|
43
|
-
string:
|
43
|
+
string: '{"id":"20040","name":"My Test List","closed":false,"idBoard":"20010","pos":32768}'
|
44
44
|
http_version:
|
45
|
-
recorded_at:
|
45
|
+
recorded_at: Tue, 11 Mar 2014 21:34:41 GMT
|
46
46
|
recorded_with: VCR 2.8.0
|
@@ -2,10 +2,10 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: put
|
5
|
-
uri: https://api.trello.com/1/cards/
|
5
|
+
uri: https://api.trello.com/1/cards/20020/idBoard
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: idList=
|
8
|
+
string: idList=20040&value=20010
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
@@ -14,7 +14,7 @@ http_interactions:
|
|
14
14
|
Authorization:
|
15
15
|
- "<OAuth Credentials>"
|
16
16
|
Content-Length:
|
17
|
-
- '
|
17
|
+
- '24'
|
18
18
|
User-Agent:
|
19
19
|
- Ruby
|
20
20
|
response:
|
@@ -25,7 +25,7 @@ http_interactions:
|
|
25
25
|
Content-Type:
|
26
26
|
- text/html;charset=utf-8
|
27
27
|
Content-Length:
|
28
|
-
- '
|
28
|
+
- '786'
|
29
29
|
X-Xss-Protection:
|
30
30
|
- 1; mode=block
|
31
31
|
X-Content-Type-Options:
|
@@ -33,17 +33,17 @@ http_interactions:
|
|
33
33
|
X-Frame-Options:
|
34
34
|
- SAMEORIGIN
|
35
35
|
Server:
|
36
|
-
- WEBrick/1.3.1 (Ruby/2.1.
|
36
|
+
- WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24) OpenSSL/1.0.1f
|
37
37
|
Date:
|
38
|
-
-
|
38
|
+
- Tue, 11 Mar 2014 21:34:41 GMT
|
39
39
|
Connection:
|
40
40
|
- Keep-Alive
|
41
41
|
body:
|
42
42
|
encoding: UTF-8
|
43
|
-
string:
|
44
|
-
description
|
45
|
-
to Pull
|
46
|
-
URL
|
43
|
+
string: '{"id":"20020","badges":{"votes":0,"viewingMemberVoted":false,"subscribed":false,"fogbugz":"","checkItems":0,"checkItemsChecked":0,"comments":10,"attachments":0,"description":false,"due":null},"checkItemStates":[],"closed":false,"dateLastActivity":"2014-02-13T20:12:46.612Z","desc":"some
|
44
|
+
description","descData":null,"due":null,"idBoard":"20010","idChecklists":[],"idList":"20040","idMembers":["20050"],"idShort":67,"idAttachmentCover":null,"manualCoverAttachment":false,"labels":[{"color":"green","name":"Ready
|
45
|
+
to Pull"}],"name":"My Test Card","pos":589823,"shortUrl":"<Trello URL>","url":"<Trello
|
46
|
+
URL>"}'
|
47
47
|
http_version:
|
48
|
-
recorded_at:
|
48
|
+
recorded_at: Tue, 11 Mar 2014 21:34:41 GMT
|
49
49
|
recorded_with: VCR 2.8.0
|
@@ -2,10 +2,10 @@
|
|
2
2
|
http_interactions:
|
3
3
|
- request:
|
4
4
|
method: put
|
5
|
-
uri: https://api.trello.com/1/cards/
|
5
|
+
uri: https://api.trello.com/1/cards/20020/idList
|
6
6
|
body:
|
7
7
|
encoding: UTF-8
|
8
|
-
string: value=
|
8
|
+
string: value=20040
|
9
9
|
headers:
|
10
10
|
Accept:
|
11
11
|
- "*/*; q=0.5, application/xml"
|
@@ -14,7 +14,7 @@ http_interactions:
|
|
14
14
|
Authorization:
|
15
15
|
- "<OAuth Credentials>"
|
16
16
|
Content-Length:
|
17
|
-
- '
|
17
|
+
- '11'
|
18
18
|
User-Agent:
|
19
19
|
- Ruby
|
20
20
|
response:
|
@@ -25,7 +25,7 @@ http_interactions:
|
|
25
25
|
Content-Type:
|
26
26
|
- text/html;charset=utf-8
|
27
27
|
Content-Length:
|
28
|
-
- '
|
28
|
+
- '786'
|
29
29
|
X-Xss-Protection:
|
30
30
|
- 1; mode=block
|
31
31
|
X-Content-Type-Options:
|
@@ -33,17 +33,17 @@ http_interactions:
|
|
33
33
|
X-Frame-Options:
|
34
34
|
- SAMEORIGIN
|
35
35
|
Server:
|
36
|
-
- WEBrick/1.3.1 (Ruby/2.1.
|
36
|
+
- WEBrick/1.3.1 (Ruby/2.1.1/2014-02-24) OpenSSL/1.0.1f
|
37
37
|
Date:
|
38
|
-
-
|
38
|
+
- Tue, 11 Mar 2014 21:34:41 GMT
|
39
39
|
Connection:
|
40
40
|
- Keep-Alive
|
41
41
|
body:
|
42
42
|
encoding: UTF-8
|
43
|
-
string:
|
44
|
-
description
|
45
|
-
to Pull
|
46
|
-
URL
|
43
|
+
string: '{"id":"20020","badges":{"votes":0,"viewingMemberVoted":false,"subscribed":false,"fogbugz":"","checkItems":0,"checkItemsChecked":0,"comments":10,"attachments":0,"description":false,"due":null},"checkItemStates":[],"closed":false,"dateLastActivity":"2014-02-13T20:12:46.612Z","desc":"some
|
44
|
+
description","descData":null,"due":null,"idBoard":"20010","idChecklists":[],"idList":"20040","idMembers":["20050"],"idShort":67,"idAttachmentCover":null,"manualCoverAttachment":false,"labels":[{"color":"green","name":"Ready
|
45
|
+
to Pull"}],"name":"My Test Card","pos":589823,"shortUrl":"<Trello URL>","url":"<Trello
|
46
|
+
URL>"}'
|
47
47
|
http_version:
|
48
|
-
recorded_at:
|
48
|
+
recorded_at: Tue, 11 Mar 2014 21:34:41 GMT
|
49
49
|
recorded_with: VCR 2.8.0
|
@@ -22,7 +22,7 @@ module Troo
|
|
22
22
|
|
23
23
|
describe '#interpolate!' do
|
24
24
|
let(:endpoint) { :board_by_id }
|
25
|
-
let(:value) { { id: '
|
25
|
+
let(:value) { { id: '20001' } }
|
26
26
|
|
27
27
|
subject do
|
28
28
|
described_class.new(endpoints)
|
@@ -31,7 +31,7 @@ module Troo
|
|
31
31
|
|
32
32
|
context 'when the endpoint exists' do
|
33
33
|
it 'returns the interpolated endpoint' do
|
34
|
-
subject.must_equal('/boards/
|
34
|
+
subject.must_equal('/boards/20001')
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|