ruby-trello 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f46b5d3c7a3289b56568b9be4ccff37cdb218806
4
- data.tar.gz: b67d2acd6cbd716a7bf013efc961c78c9bd117d0
3
+ metadata.gz: 09926829a9c5e626cd0ab3796ab1a57af77c294a
4
+ data.tar.gz: 9694ed068bacd16f153e35384a5f6641378cb6e6
5
5
  SHA512:
6
- metadata.gz: 33d759205434832b33b63ce91b052cbe0e8f621bd4783eb159f704bfe6be9ca7fd3271bdd34ea896bcf581c8d8b0ed51bdf40f43dcc649cc438252f8a7829c91
7
- data.tar.gz: 2ad17d8f86890622fbf9503abda767bec8a1afcce6ce5151eac9b0c1a7f6feff85b2c80b43bf26ec38d5208dcd752ff9f39b2ff0d1f3dcbd9c40499adc58278c
6
+ metadata.gz: 5802afb500a67024cc96f203a239c39ef1844102d3278e7398a7c6142edea202fbe74f6965932ac7efd9e3b12dd9906e5ef614218567ec060cf487888753f4b8
7
+ data.tar.gz: 7f6208ed5447fa1ae89e4a5d43dab717c8b986e2548c5577407e89b4d5ac5e63b2e8248cecf1606dde8eec2f3a102145dd5c5fa8548e596d19cbd8f6ae244aac
data/README.md CHANGED
@@ -18,7 +18,7 @@ Full Disclosure: This library is mostly complete, if you do find anything missin
18
18
  to, please [let us know](https://trello.com/card/spot-a-bug-report-it/4f092b2ee23cb6fe6d1aaabd/17).
19
19
 
20
20
  While this library still does function on ruby 1.8 as of version 1.0.2 with activemodel < 4.0, this notice services to
21
- illustrate that future versions may include ruby 1.9+ specific features.
21
+ illustrate that future versions may include ruby 1.9.3+ specific features.
22
22
 
23
23
  ## Configuration
24
24
 
data/lib/trello/action.rb CHANGED
@@ -7,8 +7,8 @@ module Trello
7
7
 
8
8
  class << self
9
9
  # Locate a specific action and return a new Action object.
10
- def find(id)
11
- client.find(:action, id)
10
+ def find(id, params = {})
11
+ client.find(:action, id, params)
12
12
  end
13
13
  end
14
14
 
@@ -11,8 +11,8 @@ module Trello
11
11
  name.split("::").last.underscore
12
12
  end
13
13
 
14
- def find(id)
15
- client.find(path_name, id)
14
+ def find(id, params = {})
15
+ client.find(path_name, id, params)
16
16
  end
17
17
 
18
18
  def create(options)
data/lib/trello/board.rb CHANGED
@@ -10,8 +10,8 @@ module Trello
10
10
 
11
11
  class << self
12
12
  # Finds a board.
13
- def find(id)
14
- client.find(:board, id)
13
+ def find(id, params = {})
14
+ client.find(:board, id, params)
15
15
  end
16
16
 
17
17
  def create(fields)
data/lib/trello/card.rb CHANGED
@@ -11,8 +11,8 @@ module Trello
11
11
 
12
12
  class << self
13
13
  # Find a specific card by its id.
14
- def find(id)
15
- client.find(:card, id)
14
+ def find(id, params = {})
15
+ client.find(:card, id, params)
16
16
  end
17
17
 
18
18
  # Create a new card and save it on Trello.
@@ -8,8 +8,8 @@ module Trello
8
8
 
9
9
  class << self
10
10
  # Locate a specific checklist by its id.
11
- def find(id)
12
- client.find(:checklist, id)
11
+ def find(id, params = {})
12
+ client.find(:checklist, id, params)
13
13
  end
14
14
 
15
15
  def create(options)
data/lib/trello/client.rb CHANGED
@@ -39,8 +39,8 @@ module Trello
39
39
  # client.find(:board, "board1234")
40
40
  # client.find(:member, "user1234")
41
41
  #
42
- def find(path, id)
43
- response = get("/#{path.to_s.pluralize}/#{id}")
42
+ def find(path, id, params = {})
43
+ response = get("/#{path.to_s.pluralize}/#{id}", params)
44
44
  trello_class = class_from_path(path)
45
45
  trello_class.parse response do |data|
46
46
  data.client = self
data/lib/trello/list.rb CHANGED
@@ -9,8 +9,8 @@ module Trello
9
9
 
10
10
  class << self
11
11
  # Finds a specific list, given an id.
12
- def find(id)
13
- client.find(:list, id)
12
+ def find(id, params = {})
13
+ client.find(:list, id, params)
14
14
  end
15
15
 
16
16
  def create(options)
data/lib/trello/member.rb CHANGED
@@ -12,8 +12,8 @@ module Trello
12
12
  # Finds a user
13
13
  #
14
14
  # The argument may be specified as either an _id_ or a _username_.
15
- def find(id_or_username)
16
- client.find(:member, id_or_username)
15
+ def find(id_or_username, params = {})
16
+ client.find(:member, id_or_username, params)
17
17
  end
18
18
  end
19
19
 
@@ -6,8 +6,8 @@ module Trello
6
6
 
7
7
  class << self
8
8
  # Locate a notification by its id
9
- def find(id)
10
- client.find(:notification, id)
9
+ def find(id, params = {})
10
+ client.find(:notification, id, params)
11
11
  end
12
12
  end
13
13
 
@@ -9,8 +9,8 @@ module Trello
9
9
 
10
10
  class << self
11
11
  # Find an organization by its id.
12
- def find(id)
13
- client.find(:organization, id)
12
+ def find(id, params = {})
13
+ client.find(:organization, id, params)
14
14
  end
15
15
  end
16
16
 
data/lib/trello/token.rb CHANGED
@@ -5,8 +5,8 @@ module Trello
5
5
 
6
6
  class << self
7
7
  # Finds a token
8
- def find(token)
9
- client.find(:token, token)
8
+ def find(token, params = {})
9
+ client.find(:token, token, params)
10
10
  end
11
11
  end
12
12
 
data/spec/action_spec.rb CHANGED
@@ -8,7 +8,7 @@ module Trello
8
8
  let(:client) { Client.new }
9
9
 
10
10
  before(:each) do
11
- client.stub(:get).with("/actions/4ee2482134a81a757a08af47").
11
+ client.stub(:get).with("/actions/4ee2482134a81a757a08af47", {}).
12
12
  and_return JSON.generate(actions_details.first)
13
13
  end
14
14
 
@@ -16,7 +16,7 @@ module Trello
16
16
  let(:client) { Trello.client }
17
17
 
18
18
  it "delegates to Trello.client#find" do
19
- client.should_receive(:find).with(:action, '4ee2482134a81a757a08af47')
19
+ client.should_receive(:find).with(:action, '4ee2482134a81a757a08af47', {})
20
20
  Action.find('4ee2482134a81a757a08af47')
21
21
  end
22
22
 
@@ -74,7 +74,7 @@ module Trello
74
74
 
75
75
  context "member creator" do
76
76
  it "knows its member creator" do
77
- client.stub(:get).with("/members/abcdef123456789123456789").and_return user_payload
77
+ client.stub(:get).with("/members/abcdef123456789123456789", {}).and_return user_payload
78
78
 
79
79
  action.member_creator.should_not be_nil
80
80
  end
data/spec/board_spec.rb CHANGED
@@ -8,7 +8,7 @@ module Trello
8
8
  let(:client) { Client.new }
9
9
 
10
10
  before(:each) do
11
- client.stub(:get).with("/boards/abcdef123456789123456789").
11
+ client.stub(:get).with("/boards/abcdef123456789123456789", {}).
12
12
  and_return JSON.generate(boards_details.first)
13
13
  end
14
14
 
@@ -16,7 +16,7 @@ module Trello
16
16
  let(:client) { Trello.client }
17
17
 
18
18
  it "delegates to client#find" do
19
- client.should_receive(:find).with(:board, 'abcdef123456789123456789')
19
+ client.should_receive(:find).with(:board, 'abcdef123456789123456789', {})
20
20
  Board.find('abcdef123456789123456789')
21
21
  end
22
22
 
@@ -114,7 +114,7 @@ module Trello
114
114
 
115
115
  context "organization" do
116
116
  it "belongs to an organization" do
117
- client.stub(:get).with("/organizations/abcdef123456789123456789").
117
+ client.stub(:get).with("/organizations/abcdef123456789123456789", {}).
118
118
  and_return JSON.generate(orgs_details.first)
119
119
 
120
120
  board.organization.should_not be_nil
data/spec/card_spec.rb CHANGED
@@ -8,7 +8,7 @@ module Trello
8
8
  let(:client) { Client.new }
9
9
 
10
10
  before(:each) do
11
- client.stub(:get).with("/cards/abcdef123456789123456789").
11
+ client.stub(:get).with("/cards/abcdef123456789123456789", {}).
12
12
  and_return JSON.generate(cards_details.first)
13
13
  end
14
14
 
@@ -16,7 +16,7 @@ module Trello
16
16
  let(:client) { Trello.client }
17
17
 
18
18
  it "delegates to Trello.client#find" do
19
- client.should_receive(:find).with(:card, 'abcdef123456789123456789')
19
+ client.should_receive(:find).with(:card, 'abcdef123456789123456789', {})
20
20
  Card.find('abcdef123456789123456789')
21
21
  end
22
22
 
@@ -127,7 +127,7 @@ module Trello
127
127
 
128
128
  context "boards" do
129
129
  it "has a board" do
130
- client.stub(:get).with("/boards/abcdef123456789123456789").and_return JSON.generate(boards_details.first)
130
+ client.stub(:get).with("/boards/abcdef123456789123456789", {}).and_return JSON.generate(boards_details.first)
131
131
  card.board.should_not be_nil
132
132
  end
133
133
  end
@@ -141,7 +141,7 @@ module Trello
141
141
 
142
142
  context "list" do
143
143
  it 'has a list' do
144
- client.stub(:get).with("/lists/abcdef123456789123456789").and_return JSON.generate(lists_details.first)
144
+ client.stub(:get).with("/lists/abcdef123456789123456789", {}).and_return JSON.generate(lists_details.first)
145
145
  card.list.should_not be_nil
146
146
  end
147
147
 
@@ -183,7 +183,7 @@ module Trello
183
183
 
184
184
  context "members" do
185
185
  it "has a list of members" do
186
- client.stub(:get).with("/boards/abcdef123456789123456789").and_return JSON.generate(boards_details.first)
186
+ client.stub(:get).with("/boards/abcdef123456789123456789", {}).and_return JSON.generate(boards_details.first)
187
187
  client.stub(:get).with("/members/abcdef123456789123456789").and_return user_payload
188
188
 
189
189
  card.board.should_not be_nil
@@ -273,7 +273,7 @@ module Trello
273
273
  end
274
274
 
275
275
  it "can list the existing attachments with correct fields" do
276
- client.stub(:get).with("/boards/abcdef123456789123456789").and_return JSON.generate(boards_details.first)
276
+ client.stub(:get).with("/boards/abcdef123456789123456789", {}).and_return JSON.generate(boards_details.first)
277
277
  client.stub(:get).with("/cards/abcdef123456789123456789/attachments").and_return attachments_payload
278
278
 
279
279
  card.board.should_not be_nil
@@ -8,7 +8,7 @@ module Trello
8
8
  let(:client) { Client.new }
9
9
 
10
10
  before(:each) do
11
- client.stub(:get).with("/checklists/abcdef123456789123456789").
11
+ client.stub(:get).with("/checklists/abcdef123456789123456789", {}).
12
12
  and_return JSON.generate(checklists_details.first)
13
13
  end
14
14
 
@@ -16,7 +16,7 @@ module Trello
16
16
  let(:client) { Trello.client }
17
17
 
18
18
  it "delegates to Trello.client#find" do
19
- client.should_receive(:find).with(:checklist, 'abcdef123456789123456789')
19
+ client.should_receive(:find).with(:checklist, 'abcdef123456789123456789', {})
20
20
  Checklist.find('abcdef123456789123456789')
21
21
  end
22
22
 
@@ -107,7 +107,7 @@ module Trello
107
107
 
108
108
  context "list" do
109
109
  it 'has a list' do
110
- client.stub(:get).with("/lists/abcdef123456789123456789").and_return JSON.generate(lists_details.first)
110
+ client.stub(:get).with("/lists/abcdef123456789123456789", {}).and_return JSON.generate(lists_details.first)
111
111
  checklist.list.should_not be_nil
112
112
  end
113
113
  end
data/spec/list_spec.rb CHANGED
@@ -8,15 +8,15 @@ module Trello
8
8
  let(:client) { Client.new }
9
9
 
10
10
  before(:each) do
11
- client.stub(:get).with("/lists/abcdef123456789123456789").and_return JSON.generate(lists_details.first)
12
- client.stub(:get).with("/boards/abcdef123456789123456789").and_return JSON.generate(boards_details.first)
11
+ client.stub(:get).with("/lists/abcdef123456789123456789", {}).and_return JSON.generate(lists_details.first)
12
+ client.stub(:get).with("/boards/abcdef123456789123456789", {}).and_return JSON.generate(boards_details.first)
13
13
  end
14
14
 
15
15
  context "finding" do
16
16
  let(:client) { Trello.client }
17
17
 
18
18
  it "delegates to client#find" do
19
- client.should_receive(:find).with(:list, 'abcdef123456789123456789')
19
+ client.should_receive(:find).with(:list, 'abcdef123456789123456789', {})
20
20
  List.find('abcdef123456789123456789')
21
21
  end
22
22
 
data/spec/member_spec.rb CHANGED
@@ -10,14 +10,14 @@ module Trello
10
10
  let(:client) { Client.new }
11
11
 
12
12
  before(:each) do
13
- client.stub(:get).with("/members/abcdef123456789012345678").and_return user_payload
13
+ client.stub(:get).with("/members/abcdef123456789012345678", {}).and_return user_payload
14
14
  end
15
15
 
16
16
  context "finding" do
17
17
  let(:client) { Trello.client }
18
18
 
19
19
  it "delegates to Trello.client#find" do
20
- client.should_receive(:find).with(:member, 'abcdef123456789012345678')
20
+ client.should_receive(:find).with(:member, 'abcdef123456789012345678', {})
21
21
  Member.find('abcdef123456789012345678')
22
22
  end
23
23
 
@@ -9,7 +9,7 @@ module Trello
9
9
  let(:client) { Client.new }
10
10
 
11
11
  before(:each) do
12
- client.stub(:get).with("/members/abcdef123456789012345678").and_return user_payload
12
+ client.stub(:get).with("/members/abcdef123456789012345678", {}).and_return user_payload
13
13
  client.stub(:get).with("/members/abcdef123456789012345678/notifications", {}).and_return "[" << notification_payload << "]"
14
14
  end
15
15
 
@@ -17,7 +17,7 @@ module Trello
17
17
  let(:client) { Trello.client }
18
18
 
19
19
  it "can find a specific notification" do
20
- client.stub(:get).with("/notifications/#{notification_details['id']}").and_return notification_payload
20
+ client.stub(:get).with("/notifications/#{notification_details['id']}", {}).and_return notification_payload
21
21
  Notification.find(notification_details['id']).should == notification
22
22
  end
23
23
  end
@@ -50,7 +50,7 @@ module Trello
50
50
  end
51
51
 
52
52
  it "can retrieve the member creator" do
53
- client.stub(:get).with("/members/#{user_details['id']}").and_return user_payload
53
+ client.stub(:get).with("/members/#{user_details['id']}", {}).and_return user_payload
54
54
  notification.member_creator.id.should == user_details['id']
55
55
  end
56
56
  end
@@ -9,7 +9,7 @@ module Trello
9
9
  let(:client) { Client.new }
10
10
 
11
11
  before(:each) do
12
- client.stub(:get).with("/organizations/4ee7e59ae582acdec8000291").
12
+ client.stub(:get).with("/organizations/4ee7e59ae582acdec8000291", {}).
13
13
  and_return organization_payload
14
14
  end
15
15
 
@@ -17,7 +17,7 @@ module Trello
17
17
  let(:client) { Trello.client }
18
18
 
19
19
  it "delegates to Trello.client#find" do
20
- client.should_receive(:find).with(:organization, '4ee7e59ae582acdec8000291')
20
+ client.should_receive(:find).with(:organization, '4ee7e59ae582acdec8000291', {})
21
21
  Organization.find('4ee7e59ae582acdec8000291')
22
22
  end
23
23
 
data/spec/token_spec.rb CHANGED
@@ -8,14 +8,14 @@ module Trello
8
8
  let(:client) { Client.new }
9
9
 
10
10
  before(:each) do
11
- client.stub(:get).with("/tokens/1234").and_return token_payload
11
+ client.stub(:get).with("/tokens/1234", {}).and_return token_payload
12
12
  end
13
13
 
14
14
  context "finding" do
15
15
  let(:client) { Trello.client }
16
16
 
17
17
  it "delegates to Trello.client#find" do
18
- client.should_receive(:find).with(:token, '1234')
18
+ client.should_receive(:find).with(:token, '1234', {})
19
19
  Token.find('1234')
20
20
  end
21
21
 
@@ -40,9 +40,9 @@ module Trello
40
40
 
41
41
  context "members" do
42
42
  it "retrieves the member who authorized the token" do
43
- client.stub(:get).with("/members/abcdef123456789123456789").and_return user_payload
44
- Trello.client.stub(:get).with("/members/abcdef123456789123456789").and_return user_payload
45
- client.stub(:get).with("/tokens/1234").and_return token_payload
43
+ client.stub(:get).with("/members/abcdef123456789123456789", {}).and_return user_payload
44
+ Trello.client.stub(:get).with("/members/abcdef123456789123456789", {}).and_return user_payload
45
+ client.stub(:get).with("/tokens/1234", {}).and_return token_payload
46
46
  token.member.should == Member.find("abcdef123456789123456789")
47
47
  end
48
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-trello
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Tregunna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-13 00:00:00.000000000 Z
11
+ date: 2013-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -135,7 +135,8 @@ files:
135
135
  - spec/token_spec.rb
136
136
  - spec/trello_spec.rb
137
137
  homepage: https://github.com/jeremytregunna/ruby-trello
138
- licenses: []
138
+ licenses:
139
+ - MIT
139
140
  metadata: {}
140
141
  post_install_message:
141
142
  rdoc_options: