trello-client 0.0.5 → 0.0.6
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.
- data/.gitignore +5 -2
- data/HISTORY.rdoc +11 -1
- data/README.rdoc +0 -98
- data/Rakefile +1 -0
- data/lib/trello-client.rb +34 -9
- data/lib/trello-client/version.rb +1 -1
- data/test/data/card.json +1 -0
- data/test/test_card.rb +27 -0
- data/test/test_client.rb +112 -74
- data/trello-client.gemspec +7 -3
- metadata +74 -24
data/.gitignore
CHANGED
data/HISTORY.rdoc
CHANGED
@@ -1,25 +1,35 @@
|
|
1
1
|
= Trello::Client History
|
2
2
|
|
3
|
-
==
|
3
|
+
== 2013-07-01 v0.0.6
|
4
|
+
|
5
|
+
* Added Trello::Client#card()
|
6
|
+
* Fix example code (Hugo Rincon)
|
7
|
+
|
8
|
+
|
9
|
+
== 2012-04-03 v0.0.5
|
4
10
|
|
5
11
|
* Added +trello2todo.rb+
|
6
12
|
* Trello::Client bug fixes
|
7
13
|
* Add +to_s()+ method to +Board+, +Card+, +List+ and +Member+ to dump JSON objects
|
8
14
|
|
15
|
+
|
9
16
|
== 2012-04-02 v0.0.4
|
10
17
|
|
11
18
|
* Added Trello::Client#list()
|
12
19
|
* Added Trello::Client::Card
|
13
20
|
|
21
|
+
|
14
22
|
== 2012-03-30 v0.0.3
|
15
23
|
|
16
24
|
* Added Trello::Client#board()
|
17
25
|
* Added Trello::Client::List
|
18
26
|
|
27
|
+
|
19
28
|
== 2012-03-29 v0.0.2
|
20
29
|
|
21
30
|
* Added Trello::Client::Board
|
22
31
|
|
32
|
+
|
23
33
|
== 2012-03-28 v0.0.1
|
24
34
|
|
25
35
|
* First public release.
|
data/README.rdoc
CHANGED
@@ -1,98 +0,0 @@
|
|
1
|
-
= Trello::Client - Trello API client
|
2
|
-
|
3
|
-
== Configuration
|
4
|
-
|
5
|
-
Get developer API key:
|
6
|
-
https://trello.com/1/appKey/generate
|
7
|
-
|
8
|
-
Get user token:
|
9
|
-
https://trello.com/1/connect?key=$YOUR_API_KEY&name=trello-client.rb&response_type=token
|
10
|
-
|
11
|
-
== Usage
|
12
|
-
|
13
|
-
require 'trello-client'
|
14
|
-
|
15
|
-
Trello::Client.new do |client|
|
16
|
-
# Set API key
|
17
|
-
client.api_key = ...
|
18
|
-
|
19
|
-
# Set token
|
20
|
-
client.token = ...
|
21
|
-
|
22
|
-
# Get member
|
23
|
-
client.member('me') do |m|
|
24
|
-
# Returns Trello::Client::Member object
|
25
|
-
m['id'] # => member identifier
|
26
|
-
m['fullName'] # => member name
|
27
|
-
m['userName'] # => member user
|
28
|
-
m['url'] # => member url
|
29
|
-
end
|
30
|
-
|
31
|
-
# Get member with boards
|
32
|
-
client.member( 'me', :boards => 'all' ) do |m|
|
33
|
-
m.boards.each do |b|
|
34
|
-
# Returns Trello::Client::Board objects
|
35
|
-
b['id'] # => board identifier
|
36
|
-
b['name'] # => board name
|
37
|
-
end
|
38
|
-
|
39
|
-
# Get board
|
40
|
-
client.board( '<identifier>' ) do |b|
|
41
|
-
# Returns Trello::Client::Board object
|
42
|
-
b['id'] # => board identifier
|
43
|
-
b['name'] # => board name
|
44
|
-
b['url'] # => board url
|
45
|
-
end
|
46
|
-
|
47
|
-
# Get board with lists
|
48
|
-
client.board( '<identifier>', :lists => 'all' ) do |b|
|
49
|
-
b.lists.each do |l|
|
50
|
-
# Returns Trello::Client::List object
|
51
|
-
l['id'] # => list identifier
|
52
|
-
l['idBoard'] # => list board identifier
|
53
|
-
l['name'] # => list name
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
# Get list
|
58
|
-
client.list( '<identifier>' ) do |l|
|
59
|
-
# Returns Trello::Client::List object
|
60
|
-
l['id'] # => list identifier
|
61
|
-
l['idBoard'] # => list board identifier
|
62
|
-
l['name'] # => list name
|
63
|
-
end
|
64
|
-
|
65
|
-
# Get list with cards
|
66
|
-
client.list( '<identifier>' ) do |l|
|
67
|
-
l.cards.each do |c|
|
68
|
-
# Returns Trello::Client::Card object
|
69
|
-
c['id'] # => card identifier
|
70
|
-
c['idBoard'] # => card board identifier
|
71
|
-
c['idList'] # => card list identifier
|
72
|
-
c['name'] # => card name
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
end
|
77
|
-
|
78
|
-
== Author
|
79
|
-
|
80
|
-
blair christensen. <mailto:blair.christensen@gmail.com>
|
81
|
-
|
82
|
-
== Homepage
|
83
|
-
|
84
|
-
https://github.com/blairc/trello-client/
|
85
|
-
|
86
|
-
== See Also
|
87
|
-
|
88
|
-
* https://trello.com/docs/api/
|
89
|
-
|
90
|
-
== To Do
|
91
|
-
|
92
|
-
* DRY +Card+, +Board+, +List+ and +Member+
|
93
|
-
* DRY +board()+, +list()+ and +member()+
|
94
|
-
* Make +trello2todo+ configurable
|
95
|
-
* Actual API test that can be run on demand
|
96
|
-
* Memoize API calls
|
97
|
-
* Lazy fetching of data that wasn't requested?
|
98
|
-
|
data/Rakefile
CHANGED
@@ -36,6 +36,7 @@ task :update_test_data do
|
|
36
36
|
{
|
37
37
|
'board' => [ :board, '4f4f9d55cf2e679318098c5b' ],
|
38
38
|
'board_with_lists' => [ :board, '4f4f9d55cf2e679318098c5b', :lists => 'all' ],
|
39
|
+
'card' => [ :card, '4f4f9d56cf2e679318098ca3' ],
|
39
40
|
'list' => [ :list, '4f4f9d55cf2e679318098c53' ],
|
40
41
|
'list_with_cards' => [ :list, '4f4f9d55cf2e679318098c53', :cards => 'all' ],
|
41
42
|
'member' => [ :member, 'me' ],
|
data/lib/trello-client.rb
CHANGED
@@ -30,7 +30,7 @@ require 'trello-client/version'
|
|
30
30
|
# client.api_key = ...
|
31
31
|
#
|
32
32
|
# # Set token
|
33
|
-
# client.
|
33
|
+
# client.api_token = ...
|
34
34
|
#
|
35
35
|
# # Get member
|
36
36
|
# client.member('me') do |m|
|
@@ -76,7 +76,7 @@ require 'trello-client/version'
|
|
76
76
|
# end
|
77
77
|
#
|
78
78
|
# # Get list with cards
|
79
|
-
# client.list( '<identifier>' ) do |l|
|
79
|
+
# client.list( '<identifier>', :cards => 'all' ) do |l|
|
80
80
|
# l.cards.each do |c|
|
81
81
|
# # Returns Trello::Client::Card object
|
82
82
|
# c['id'] # => card identifier
|
@@ -86,6 +86,12 @@ require 'trello-client/version'
|
|
86
86
|
# end
|
87
87
|
# end
|
88
88
|
#
|
89
|
+
# # Get card
|
90
|
+
# client.card( '<identifier>' ) do |card|
|
91
|
+
# card['id'] # => card identifier
|
92
|
+
# card['name'] # => card name
|
93
|
+
# card['closed'] # => true | false
|
94
|
+
# end
|
89
95
|
# end
|
90
96
|
#
|
91
97
|
# == Author
|
@@ -102,7 +108,6 @@ require 'trello-client/version'
|
|
102
108
|
#
|
103
109
|
# == To Do
|
104
110
|
#
|
105
|
-
# * Add +card()+
|
106
111
|
# * DRY +Card+, +Board+, +List+ and +Member+
|
107
112
|
# * DRY +board()+, +list()+ and +member()+
|
108
113
|
# * Make +trello2todo+ configurable
|
@@ -154,9 +159,25 @@ module Trello # :nodoc:
|
|
154
159
|
#
|
155
160
|
def board(id, options = {} )
|
156
161
|
raise('invalid id') if id.nil? || id.empty?
|
157
|
-
|
158
|
-
yield
|
159
|
-
|
162
|
+
board = Trello::Client::Board.new( _get( "#{api}/board/#{id}", options ) )
|
163
|
+
yield board if block_given?
|
164
|
+
board
|
165
|
+
end
|
166
|
+
|
167
|
+
#
|
168
|
+
# Get Trello::Client::Card object
|
169
|
+
#
|
170
|
+
# See https://trello.com/docs/api/card/index.html
|
171
|
+
#
|
172
|
+
# Params:
|
173
|
+
# +id+:: Card identifier
|
174
|
+
# +options+:: (optional) Additional API parameters
|
175
|
+
#
|
176
|
+
def card(id, options = {} )
|
177
|
+
raise('invalid id') if id.nil? || id.empty?
|
178
|
+
card = Trello::Client::Card.new( _get( "#{api}/card/#{id}", options ) )
|
179
|
+
yield card if block_given?
|
180
|
+
card
|
160
181
|
end
|
161
182
|
|
162
183
|
#
|
@@ -196,9 +217,7 @@ module Trello # :nodoc:
|
|
196
217
|
private
|
197
218
|
|
198
219
|
def _get( uri, options = {} )
|
199
|
-
|
200
|
-
raise('invalid API key') if @api_key.nil? || @api_key.empty?
|
201
|
-
raise('invalid API token') if @api_token.nil? || @api_token.empty?
|
220
|
+
_validate_request!(uri)
|
202
221
|
|
203
222
|
defaults = { :key => @api_key, :token => @api_token }
|
204
223
|
options.merge!(defaults)
|
@@ -212,6 +231,12 @@ module Trello # :nodoc:
|
|
212
231
|
open(uri).read
|
213
232
|
end
|
214
233
|
|
234
|
+
def _validate_request!(uri)
|
235
|
+
raise('invalid URI') if uri.nil? || uri.empty?
|
236
|
+
raise('invalid API key') if @api_key.nil? || @api_key.empty?
|
237
|
+
raise('invalid API token') if @api_token.nil? || @api_token.empty?
|
238
|
+
end
|
239
|
+
|
215
240
|
end # class Client
|
216
241
|
|
217
242
|
end # module Trello
|
data/test/data/card.json
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"id":"4f4f9d56cf2e679318098ca3","name":"Welcome to Trello!","desc":"","closed":false,"idShort":1,"idList":"4f4f9d55cf2e679318098c53","idBoard":"4f4f9d55cf2e679318098c5b","idMembers":[],"url":"https://trello.com/card/welcome-to-trello/4f4f9d55cf2e679318098c5b/1","attachments":[],"labels":[],"badges":{"votes":0,"viewingMemberVoted":false,"due":null,"description":false,"attachments":0,"comments":0,"checkItemsChecked":0,"checkItems":0,"fogbugz":""},"pos":65536,"idChecklists":[],"checkItemStates":[]}
|
data/test/test_card.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'simplecov'
|
4
|
+
SimpleCov.start
|
5
|
+
|
6
|
+
require 'fakeweb'
|
7
|
+
require 'trello-client'
|
8
|
+
require 'test/unit'
|
9
|
+
|
10
|
+
|
11
|
+
class TestCard < Test::Unit::TestCase
|
12
|
+
|
13
|
+
def setup
|
14
|
+
@test_dir = File.dirname(__FILE__)
|
15
|
+
@test_data = File.join( @test_dir, 'data' )
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_to_s
|
19
|
+
Trello::Client.new do |client|
|
20
|
+
json = open( File.join( @test_data, 'card.json' ) ).read
|
21
|
+
board = Trello::Client::Card.new(json)
|
22
|
+
assert_equal MultiJson.decode(json).to_s, board.to_s
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
data/test/test_client.rb
CHANGED
@@ -4,7 +4,7 @@ require 'simplecov'
|
|
4
4
|
SimpleCov.start
|
5
5
|
|
6
6
|
require 'fakeweb'
|
7
|
-
require 'mocha'
|
7
|
+
require 'mocha/setup'
|
8
8
|
require 'trello-client'
|
9
9
|
require 'test/unit'
|
10
10
|
|
@@ -17,6 +17,8 @@ class TestClient < Test::Unit::TestCase
|
|
17
17
|
|
18
18
|
@test_dir = File.dirname(__FILE__)
|
19
19
|
@test_data = File.join( @test_dir, 'data' )
|
20
|
+
|
21
|
+
FakeWeb.allow_net_connect = false
|
20
22
|
end
|
21
23
|
|
22
24
|
|
@@ -43,45 +45,57 @@ class TestClient < Test::Unit::TestCase
|
|
43
45
|
Trello::Client.new do |client|
|
44
46
|
assert_raise(RuntimeError, 'invalid id') { client.board(nil) }
|
45
47
|
assert_raise(RuntimeError, 'invalid id') { client.board('') }
|
46
|
-
|
47
|
-
assert_nil client.api_key
|
48
|
-
assert_raise(RuntimeError, 'invalid API key') { client.board('id') }
|
49
|
-
client.api_key = ''
|
50
|
-
assert_equal '', client.api_key
|
51
|
-
assert_raise(RuntimeError, 'invalid API key') { client.board('id') }
|
52
|
-
client.api_key = @api_key
|
53
|
-
assert_equal @api_key, client.api_key
|
54
|
-
|
55
|
-
assert_nil client.api_token
|
56
|
-
assert_raise(RuntimeError, 'invalid API token') { client.board('id') }
|
57
|
-
client.api_token = ''
|
58
|
-
assert_equal '', client.api_token
|
59
|
-
assert_raise(RuntimeError, 'invalid API token') { client.board('id') }
|
60
48
|
end
|
61
49
|
end
|
62
50
|
|
63
51
|
def test_board
|
64
52
|
Trello::Client.new do |client|
|
65
|
-
|
66
|
-
|
67
|
-
client.stubs(:board).with('id').returns(b)
|
68
|
-
|
69
|
-
assert_not_nil b
|
70
|
-
assert_kind_of Trello::Client::Board, b
|
71
|
-
|
72
|
-
assert_equal '4f4f9d55cf2e679318098c5b', b['id']
|
73
|
-
assert_equal 'Welcome Board', b['name']
|
74
|
-
assert_equal '', b['desc']
|
75
|
-
assert_equal false, b['closed']
|
76
|
-
assert_equal true, b['pinned']
|
77
|
-
assert_equal 'https://trello.com/board/welcome-board/4f4f9d55cf2e679318098c5b', b['url']
|
78
|
-
assert_not_nil b['prefs']
|
79
|
-
assert_kind_of Hash, b['prefs']
|
80
|
-
assert_equal 5, b['prefs'].size
|
53
|
+
client.api_key = @api_key
|
54
|
+
client.api_token = @api_token
|
81
55
|
|
82
|
-
|
83
|
-
|
84
|
-
|
56
|
+
json = open( File.join( @test_data, 'board.json' ) ).read
|
57
|
+
uri = "#{ client.api }/board/id?key=#{ client.api_key }&token=#{ client.api_token }"
|
58
|
+
|
59
|
+
FakeWeb.register_uri( :get, uri, :body => json )
|
60
|
+
|
61
|
+
blockable = false
|
62
|
+
board = client.board('id') do |board|
|
63
|
+
assert_not_nil board
|
64
|
+
assert_kind_of Trello::Client::Board, board
|
65
|
+
assert_equal '4f4f9d55cf2e679318098c5b', board['id']
|
66
|
+
assert_equal 'Welcome Board', board['name']
|
67
|
+
assert_equal '', board['desc']
|
68
|
+
assert_equal false, board['closed']
|
69
|
+
assert_equal true, board['pinned']
|
70
|
+
assert_equal 'https://trello.com/board/welcome-board/4f4f9d55cf2e679318098c5b', board['url']
|
71
|
+
assert_not_nil board['prefs']
|
72
|
+
assert_kind_of Hash, board['prefs']
|
73
|
+
assert_equal 5, board['prefs'].size
|
74
|
+
|
75
|
+
assert_not_nil board.lists
|
76
|
+
assert_kind_of Array, board.lists
|
77
|
+
assert_equal 0, board.lists.size
|
78
|
+
|
79
|
+
blockable = true
|
80
|
+
end
|
81
|
+
|
82
|
+
assert blockable
|
83
|
+
|
84
|
+
assert_not_nil board
|
85
|
+
assert_kind_of Trello::Client::Board, board
|
86
|
+
assert_equal '4f4f9d55cf2e679318098c5b', board['id']
|
87
|
+
assert_equal 'Welcome Board', board['name']
|
88
|
+
assert_equal '', board['desc']
|
89
|
+
assert_equal false, board['closed']
|
90
|
+
assert_equal true, board['pinned']
|
91
|
+
assert_equal 'https://trello.com/board/welcome-board/4f4f9d55cf2e679318098c5b', board['url']
|
92
|
+
assert_not_nil board['prefs']
|
93
|
+
assert_kind_of Hash, board['prefs']
|
94
|
+
assert_equal 5, board['prefs'].size
|
95
|
+
|
96
|
+
assert_not_nil board.lists
|
97
|
+
assert_kind_of Array, board.lists
|
98
|
+
assert_equal 0, board.lists.size
|
85
99
|
end
|
86
100
|
end
|
87
101
|
|
@@ -110,24 +124,50 @@ class TestClient < Test::Unit::TestCase
|
|
110
124
|
end
|
111
125
|
end
|
112
126
|
|
127
|
+
def test_card_parameter_validation
|
128
|
+
Trello::Client.new do |client|
|
129
|
+
assert_raise(RuntimeError, 'invalid id') { client.card(nil) }
|
130
|
+
assert_raise(RuntimeError, 'invalid id') { client.card('') }
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
def test_card
|
135
|
+
Trello::Client.new do |client|
|
136
|
+
client.api_key = @api_key
|
137
|
+
client.api_token = @api_token
|
138
|
+
|
139
|
+
json = open( File.join( @test_data, 'card.json' ) ).read
|
140
|
+
uri = "#{ client.api }/card/id?key=#{ client.api_key }&token=#{ client.api_token }"
|
141
|
+
|
142
|
+
FakeWeb.register_uri( :get, uri, :body => json )
|
143
|
+
|
144
|
+
blockable = false
|
145
|
+
card = client.card('id') do |card|
|
146
|
+
assert_not_nil card
|
147
|
+
assert_kind_of Trello::Client::Card, card
|
148
|
+
assert_equal '4f4f9d56cf2e679318098ca3', card['id']
|
149
|
+
assert_equal false, card['closed']
|
150
|
+
assert_equal '', card['desc']
|
151
|
+
assert_equal 'Welcome to Trello!', card['name']
|
152
|
+
|
153
|
+
blockable = true
|
154
|
+
end
|
155
|
+
|
156
|
+
assert blockable
|
157
|
+
|
158
|
+
assert_not_nil card
|
159
|
+
assert_kind_of Trello::Client::Card, card
|
160
|
+
assert_equal '4f4f9d56cf2e679318098ca3', card['id']
|
161
|
+
assert_equal false, card['closed']
|
162
|
+
assert_equal '', card['desc']
|
163
|
+
assert_equal 'Welcome to Trello!', card['name']
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
113
167
|
def test_list_parameter_validation
|
114
168
|
Trello::Client.new do |client|
|
115
169
|
assert_raise(RuntimeError, 'invalid id') { client.list(nil) }
|
116
170
|
assert_raise(RuntimeError, 'invalid id') { client.list('') }
|
117
|
-
|
118
|
-
assert_nil client.api_key
|
119
|
-
assert_raise(RuntimeError, 'invalid API key') { client.list('me') }
|
120
|
-
client.api_key = ''
|
121
|
-
assert_equal '', client.api_key
|
122
|
-
assert_raise(RuntimeError, 'invalid API key') { client.list('me') }
|
123
|
-
client.api_key = @api_key
|
124
|
-
assert_equal @api_key, client.api_key
|
125
|
-
|
126
|
-
assert_nil client.api_token
|
127
|
-
assert_raise(RuntimeError, 'invalid API token') { client.list('me') }
|
128
|
-
client.api_token = ''
|
129
|
-
assert_equal '', client.api_token
|
130
|
-
assert_raise(RuntimeError, 'invalid API token') { client.list('me') }
|
131
171
|
end
|
132
172
|
end
|
133
173
|
|
@@ -177,20 +217,6 @@ class TestClient < Test::Unit::TestCase
|
|
177
217
|
Trello::Client.new do |client|
|
178
218
|
assert_raise(RuntimeError, 'invalid id') { client.member(nil) }
|
179
219
|
assert_raise(RuntimeError, 'invalid id') { client.member('') }
|
180
|
-
|
181
|
-
assert_nil client.api_key
|
182
|
-
assert_raise(RuntimeError, 'invalid API key') { client.member('me') }
|
183
|
-
client.api_key = ''
|
184
|
-
assert_equal '', client.api_key
|
185
|
-
assert_raise(RuntimeError, 'invalid API key') { client.member('me') }
|
186
|
-
client.api_key = @api_key
|
187
|
-
assert_equal @api_key, client.api_key
|
188
|
-
|
189
|
-
assert_nil client.api_token
|
190
|
-
assert_raise(RuntimeError, 'invalid API token') { client.member('me') }
|
191
|
-
client.api_token = ''
|
192
|
-
assert_equal '', client.api_token
|
193
|
-
assert_raise(RuntimeError, 'invalid API token') { client.member('me') }
|
194
220
|
end
|
195
221
|
end
|
196
222
|
|
@@ -244,18 +270,9 @@ class TestClient < Test::Unit::TestCase
|
|
244
270
|
|
245
271
|
def test_underscore_get_parameter_validation
|
246
272
|
Trello::Client.new do |client|
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
assert_raise(RuntimeError, 'invalid URI') { client.send( :_get, '' ) }
|
251
|
-
|
252
|
-
assert_raise(RuntimeError, 'invalid API key') { client.send( :_get, uri ) }
|
253
|
-
assert_raise(RuntimeError, 'invalid API key') { client.send( :_get, uri ) }
|
254
|
-
client.api_key = @api_key
|
255
|
-
|
256
|
-
assert_raise(RuntimeError, 'invalid API token') { client.send( :_get, uri ) }
|
257
|
-
assert_raise(RuntimeError, 'invalid API token') { client.send( :_get, uri ) }
|
258
|
-
client.api_token = @api_token
|
273
|
+
[ nil, '' ].each do |arg|
|
274
|
+
assert_raise(RuntimeError, 'invalid URI') { client.send( :_get, arg ) }
|
275
|
+
end
|
259
276
|
end
|
260
277
|
end
|
261
278
|
|
@@ -274,7 +291,28 @@ class TestClient < Test::Unit::TestCase
|
|
274
291
|
assert_not_nil r
|
275
292
|
assert_equal json, r
|
276
293
|
end
|
294
|
+
end
|
295
|
+
|
296
|
+
def test_underscore_validate_request_bang
|
297
|
+
Trello::Client.new do |client|
|
298
|
+
[ nil, '' ].each do |arg|
|
299
|
+
assert_raise(RuntimeError, 'invalid uri') { client.send( :_validate_request!, arg ) }
|
300
|
+
end
|
301
|
+
|
302
|
+
[ nil, '' ].each do |arg|
|
303
|
+
client.api_key = arg
|
304
|
+
assert_equal client.api_key, arg
|
305
|
+
assert_raise(RuntimeError, 'invalid API key') { client.send( :_validate_request!, 'url' ) }
|
306
|
+
end
|
307
|
+
client.api_key = @api_key
|
308
|
+
assert_equal @api_key, client.api_key
|
277
309
|
|
310
|
+
[ nil, '' ].each do |arg|
|
311
|
+
client.api_token = arg
|
312
|
+
assert_equal client.api_token, arg
|
313
|
+
assert_raise(RuntimeError, 'invalid API token') { client.send( :_validate_request!, 'url' ) }
|
314
|
+
end
|
315
|
+
end
|
278
316
|
end
|
279
317
|
|
280
318
|
end
|
data/trello-client.gemspec
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'trello-client/version'
|
3
5
|
|
4
6
|
Gem::Specification.new do |gem|
|
5
7
|
gem.authors = ['blair christensen']
|
@@ -7,8 +9,9 @@ Gem::Specification.new do |gem|
|
|
7
9
|
gem.description = %q{Trello API client}
|
8
10
|
gem.summary = %q{Trello API client}
|
9
11
|
gem.homepage = 'https://github.com/blairc/trello-client/'
|
12
|
+
gem.license = 'MIT'
|
10
13
|
|
11
|
-
gem.files = `git ls-files`.split(
|
14
|
+
gem.files = `git ls-files`.split($/)
|
12
15
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
16
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
17
|
gem.name = 'trello-client'
|
@@ -17,6 +20,7 @@ Gem::Specification.new do |gem|
|
|
17
20
|
|
18
21
|
gem.add_runtime_dependency 'multi_json'
|
19
22
|
|
23
|
+
gem.add_development_dependency 'bundler'
|
20
24
|
gem.add_development_dependency 'fakeweb'
|
21
25
|
gem.add_development_dependency 'mocha'
|
22
26
|
gem.add_development_dependency 'rake'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trello-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
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:
|
12
|
+
date: 2013-07-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: multi_json
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,31 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: bundler
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
25
46
|
- !ruby/object:Gem::Dependency
|
26
47
|
name: fakeweb
|
27
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
28
49
|
none: false
|
29
50
|
requirements:
|
30
51
|
- - ! '>='
|
@@ -32,10 +53,15 @@ dependencies:
|
|
32
53
|
version: '0'
|
33
54
|
type: :development
|
34
55
|
prerelease: false
|
35
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
36
62
|
- !ruby/object:Gem::Dependency
|
37
63
|
name: mocha
|
38
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
39
65
|
none: false
|
40
66
|
requirements:
|
41
67
|
- - ! '>='
|
@@ -43,10 +69,15 @@ dependencies:
|
|
43
69
|
version: '0'
|
44
70
|
type: :development
|
45
71
|
prerelease: false
|
46
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
47
78
|
- !ruby/object:Gem::Dependency
|
48
79
|
name: rake
|
49
|
-
requirement:
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
50
81
|
none: false
|
51
82
|
requirements:
|
52
83
|
- - ! '>='
|
@@ -54,10 +85,15 @@ dependencies:
|
|
54
85
|
version: '0'
|
55
86
|
type: :development
|
56
87
|
prerelease: false
|
57
|
-
version_requirements:
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
58
94
|
- !ruby/object:Gem::Dependency
|
59
95
|
name: rdoc
|
60
|
-
requirement:
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
61
97
|
none: false
|
62
98
|
requirements:
|
63
99
|
- - ! '>='
|
@@ -65,10 +101,15 @@ dependencies:
|
|
65
101
|
version: '0'
|
66
102
|
type: :development
|
67
103
|
prerelease: false
|
68
|
-
version_requirements:
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
69
110
|
- !ruby/object:Gem::Dependency
|
70
111
|
name: rdoc-readme
|
71
|
-
requirement:
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
72
113
|
none: false
|
73
114
|
requirements:
|
74
115
|
- - ~>
|
@@ -76,10 +117,15 @@ dependencies:
|
|
76
117
|
version: 0.1.2
|
77
118
|
type: :development
|
78
119
|
prerelease: false
|
79
|
-
version_requirements:
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.1.2
|
80
126
|
- !ruby/object:Gem::Dependency
|
81
127
|
name: simplecov
|
82
|
-
requirement:
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
83
129
|
none: false
|
84
130
|
requirements:
|
85
131
|
- - ! '>='
|
@@ -87,7 +133,12 @@ dependencies:
|
|
87
133
|
version: '0'
|
88
134
|
type: :development
|
89
135
|
prerelease: false
|
90
|
-
version_requirements:
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
91
142
|
description: Trello API client
|
92
143
|
email:
|
93
144
|
- blair.christensen@gmail.com
|
@@ -111,17 +162,20 @@ files:
|
|
111
162
|
- lib/trello-client/version.rb
|
112
163
|
- test/data/board.json
|
113
164
|
- test/data/board_with_lists.json
|
165
|
+
- test/data/card.json
|
114
166
|
- test/data/list.json
|
115
167
|
- test/data/list_with_cards.json
|
116
168
|
- test/data/member.json
|
117
169
|
- test/data/member_with_boards.json
|
118
170
|
- test/test_board.rb
|
171
|
+
- test/test_card.rb
|
119
172
|
- test/test_client.rb
|
120
173
|
- test/test_list.rb
|
121
174
|
- test/test_member.rb
|
122
175
|
- trello-client.gemspec
|
123
176
|
homepage: https://github.com/blairc/trello-client/
|
124
|
-
licenses:
|
177
|
+
licenses:
|
178
|
+
- MIT
|
125
179
|
post_install_message:
|
126
180
|
rdoc_options: []
|
127
181
|
require_paths:
|
@@ -132,32 +186,28 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
132
186
|
- - ! '>='
|
133
187
|
- !ruby/object:Gem::Version
|
134
188
|
version: '0'
|
135
|
-
segments:
|
136
|
-
- 0
|
137
|
-
hash: 4017662574721932785
|
138
189
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
139
190
|
none: false
|
140
191
|
requirements:
|
141
192
|
- - ! '>='
|
142
193
|
- !ruby/object:Gem::Version
|
143
194
|
version: '0'
|
144
|
-
segments:
|
145
|
-
- 0
|
146
|
-
hash: 4017662574721932785
|
147
195
|
requirements: []
|
148
196
|
rubyforge_project:
|
149
|
-
rubygems_version: 1.8.
|
197
|
+
rubygems_version: 1.8.23
|
150
198
|
signing_key:
|
151
199
|
specification_version: 3
|
152
200
|
summary: Trello API client
|
153
201
|
test_files:
|
154
202
|
- test/data/board.json
|
155
203
|
- test/data/board_with_lists.json
|
204
|
+
- test/data/card.json
|
156
205
|
- test/data/list.json
|
157
206
|
- test/data/list_with_cards.json
|
158
207
|
- test/data/member.json
|
159
208
|
- test/data/member_with_boards.json
|
160
209
|
- test/test_board.rb
|
210
|
+
- test/test_card.rb
|
161
211
|
- test/test_client.rb
|
162
212
|
- test/test_list.rb
|
163
213
|
- test/test_member.rb
|