ruby-trello 2.1.0 → 2.2.0

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
  SHA256:
3
- metadata.gz: 2971d7fb189328ae318b068c480ccb94824c8c85dbefed703a1837d839790144
4
- data.tar.gz: ffdf9a6dac2e3adc9d69306d70c7a8b784cd1809e0ebab2a3bb4dd394d25a732
3
+ metadata.gz: 05525435b0e8308a1adc45db693f314a91a17bb9f565efd8a87048b0dee6a4c6
4
+ data.tar.gz: 96229c421c262dba867848a91b23149bce1f947bb4ef7b4df36d8cf5d1693f3a
5
5
  SHA512:
6
- metadata.gz: 4c7b7da985552a94069f359ea7e80200305e60ae1642f50541d28a412e8fe83b9dd8ca77594556435b0b7aac827eecf83d6ee5b8da378cbdfac635a42146694e
7
- data.tar.gz: 230297498d5a1847802cc5a1a0a273222e75b2204554f2caed1b41549bf2942cedda5633156f414d108c384dfaaac8fa865d8520a7f16545105c6ee9adcc8aa9
6
+ metadata.gz: fc91f9504c4666af90366c3b9cf18f49e50fd7afee11a9a1f9ff1bbbf70da7ab786ec1a56ffcaa3ff8f608012d439f7d9ee8fd5050a2f7ad609bc5a8941d8b09
7
+ data.tar.gz: c9034334cc3d962272dad40e9beb781108ee729d2f86137faab7695bd9da00bd94789ecf2c41fcb33e83ddc3151a9f33d449bc52cffd215360958ed33402b511
data/README.md CHANGED
@@ -1,7 +1,8 @@
1
1
  # Ruby Trello API
2
2
 
3
3
  [![Stories in Ready](http://badge.waffle.io/jeremytregunna/ruby-trello.png)](http://waffle.io/jeremytregunna/ruby-trello)
4
- [![Build Status](https://secure.travis-ci.org/jeremytregunna/ruby-trello.png)](http://travis-ci.org/jeremytregunna/ruby-trello) [![Dependency Status](https://gemnasium.com/jeremytregunna/ruby-trello.png)](https://gemnasium.com/jeremytregunna/ruby-trello)
4
+ [![Build Status](https://secure.travis-ci.org/jeremytregunna/ruby-trello.png)](http://travis-ci.org/jeremytregunna/ruby-trello)
5
+ [![security](https://hakiri.io/github/jeremytregunna/ruby-trello/master.svg)](https://hakiri.io/github/jeremytregunna/ruby-trello/master)
5
6
  [![Code Climate](https://codeclimate.com/github/jeremytregunna/ruby-trello/badges/gpa.svg)](https://codeclimate.com/github/jeremytregunna/ruby-trello)
6
7
 
7
8
  This library implements the [Trello](http://www.trello.com/) [API](https://developers.trello.com/).
@@ -29,7 +30,7 @@ Use version 1.4.x or earlier for Ruby 2.0.0 support.
29
30
 
30
31
  #### Basic authorization:
31
32
 
32
- 1. Get your API public key from Trello via the irb console:
33
+ 1. Get your API public key from Trello via [trello.com/app-key/](https://trello.com/app-key/) or the irb console as follows:
33
34
 
34
35
  ```
35
36
  $ gem install ruby-trello
@@ -49,16 +49,16 @@ module Trello
49
49
  # Defines the attribute getter and setters.
50
50
  class_eval do
51
51
  define_method :attributes do
52
- @attributes ||= names.reduce({}) { |hash, k| hash.merge(k.to_sym => nil) }
52
+ @__attributes ||= names.reduce({}) { |hash, k| hash.merge(k.to_sym => nil) }
53
53
  end
54
54
 
55
55
  names.each do |key|
56
- define_method(:"#{key}") { @attributes[key] }
56
+ define_method(:"#{key}") { @__attributes[key] }
57
57
 
58
58
  unless options[:readonly].include?(key.to_sym)
59
59
  define_method :"#{key}=" do |val|
60
- send(:"#{key}_will_change!") unless val == @attributes[key]
61
- @attributes[key] = val
60
+ send(:"#{key}_will_change!") unless val == @__attributes[key]
61
+ @__attributes[key] = val
62
62
  end
63
63
  end
64
64
  end
@@ -72,7 +72,8 @@ module Trello
72
72
  fail "Cannot save new instance." unless self.id
73
73
 
74
74
  @previously_changed = changes
75
- @changed_attributes.clear
75
+ @changed_attributes.try(:clear)
76
+ changes_applied if respond_to?(:changes_applied)
76
77
 
77
78
  fields = {
78
79
  name: attributes[:name],
@@ -225,9 +225,7 @@ module Trello
225
225
  #
226
226
  # @return [Array<Trello::Member>]
227
227
  def members
228
- members = member_ids.map do |member_id|
229
- Member.from_response client.get("/members/#{member_id}")
230
- end
228
+ members = Member.from_response client.get("/cards/#{self.id}/members")
231
229
  MultiAssociation.new(self, members).proxy
232
230
  end
233
231
 
@@ -279,7 +277,8 @@ module Trello
279
277
  @previously_changed = changes
280
278
  # extract only new values to build payload
281
279
  payload = Hash[changes.map { |key, values| [SYMBOL_TO_STRING[key.to_sym].to_sym, values[1]] }]
282
- @changed_attributes.clear
280
+ @changed_attributes.try(:clear)
281
+ changes_applied if respond_to?(:changes_applied)
283
282
 
284
283
  client.put("/cards/#{id}", payload)
285
284
  end
@@ -88,7 +88,8 @@ module Trello
88
88
  @previously_changed = changes
89
89
  # extract only new values to build payload
90
90
  payload = Hash[changes.map { |key, values| [SYMBOL_TO_STRING[key.to_sym].to_sym, values[1]] }]
91
- @changed_attributes.clear
91
+ @changed_attributes.try(:clear)
92
+ changes_applied if respond_to?(:changes_applied)
92
93
 
93
94
  client.put("/customFields/#{id}", payload)
94
95
  end
@@ -33,7 +33,8 @@ module Trello
33
33
  @previously_changed = changes
34
34
  # extract only new values to build payload
35
35
  payload = Hash[changes.map { |key, values| [key.to_sym, values[1]] }]
36
- @changed_attributes.clear
36
+ @changed_attributes.try(:clear)
37
+ changes_applied if respond_to?(:changes_applied)
37
38
 
38
39
  client.put("/card/#{model_id}/customField/#{custom_field_id}/item", payload)
39
40
  end
@@ -46,7 +46,7 @@ module Trello
46
46
  define_attribute_methods [:color]
47
47
 
48
48
  def color
49
- @attributes[:color]
49
+ @__attributes[:color]
50
50
  end
51
51
 
52
52
  def color= colour
@@ -55,8 +55,8 @@ module Trello
55
55
  return Trello.logger.warn "The label colour '#{colour}' does not exist."
56
56
  end
57
57
 
58
- self.send(:"color_will_change!") unless colour == @attributes[:color]
59
- @attributes[:color] = colour
58
+ self.send(:"color_will_change!") unless colour == @__attributes[:color]
59
+ @__attributes[:color] = colour
60
60
  end
61
61
 
62
62
  # Update the fields of a label.
@@ -95,7 +95,8 @@ module Trello
95
95
  @previously_changed = changes
96
96
  # extract only new values to build payload
97
97
  payload = Hash[changes.map { |key, values| [SYMBOL_TO_STRING[key.to_sym].to_sym, values[1]] }]
98
- @changed_attributes.clear
98
+ @changed_attributes.try(:clear)
99
+ changes_applied if respond_to?(:changes_applied)
99
100
 
100
101
  client.put("/labels/#{id}", payload)
101
102
  end
@@ -92,7 +92,8 @@ module Trello
92
92
 
93
93
  def save
94
94
  @previously_changed = changes
95
- @changed_attributes.clear
95
+ @changed_attributes.try(:clear)
96
+ changes_applied if respond_to?(:changes_applied)
96
97
 
97
98
  return update! if id
98
99
  end
@@ -489,7 +489,7 @@ module Trello
489
489
 
490
490
  allow(client)
491
491
  .to receive(:get)
492
- .with("/members/abcdef123456789123456789")
492
+ .with("/cards/abcdef123456789123456789/members")
493
493
  .and_return user_payload
494
494
  end
495
495
 
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: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Tregunna
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-08 00:00:00.000000000 Z
11
+ date: 2019-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -174,39 +174,38 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  - !ruby/object:Gem::Version
175
175
  version: '0'
176
176
  requirements: []
177
- rubyforge_project: ruby-trello
178
- rubygems_version: 2.7.7
177
+ rubygems_version: 3.0.6
179
178
  signing_key:
180
179
  specification_version: 4
181
180
  summary: A wrapper around the trello.com API.
182
181
  test_files:
183
- - spec/association_spec.rb
184
- - spec/notification_spec.rb
185
- - spec/spec_helper.rb
182
+ - spec/json_utils_spec.rb
183
+ - spec/item_spec.rb
186
184
  - spec/integration/how_to_use_boards_spec.rb
187
185
  - spec/integration/how_to_authorize_spec.rb
188
186
  - spec/integration/integration_test.rb
189
- - spec/custom_field_spec.rb
190
- - spec/card_spec.rb
191
- - spec/hash_spec.rb
192
- - spec/trello_spec.rb
187
+ - spec/string_spec.rb
193
188
  - spec/board_spec.rb
194
- - spec/member_spec.rb
189
+ - spec/action_spec.rb
190
+ - spec/association_spec.rb
191
+ - spec/notification_spec.rb
192
+ - spec/trello_spec.rb
193
+ - spec/hash_spec.rb
194
+ - spec/webhook_spec.rb
195
+ - spec/label_spec.rb
195
196
  - spec/custom_field_option_spec.rb
196
- - spec/oauth_policy_spec.rb
197
+ - spec/custom_field_item_spec.rb
198
+ - spec/card_spec.rb
199
+ - spec/token_spec.rb
200
+ - spec/custom_field_spec.rb
201
+ - spec/organization_spec.rb
197
202
  - spec/configuration_spec.rb
198
- - spec/json_utils_spec.rb
203
+ - spec/array_spec.rb
199
204
  - spec/checklist_spec.rb
200
- - spec/list_spec.rb
201
- - spec/webhook_spec.rb
202
- - spec/organization_spec.rb
203
- - spec/custom_field_item_spec.rb
204
205
  - spec/basic_auth_policy_spec.rb
205
- - spec/token_spec.rb
206
- - spec/string_spec.rb
207
- - spec/action_spec.rb
206
+ - spec/oauth_policy_spec.rb
207
+ - spec/spec_helper.rb
208
+ - spec/member_spec.rb
208
209
  - spec/basic_data_spec.rb
209
- - spec/array_spec.rb
210
+ - spec/list_spec.rb
210
211
  - spec/client_spec.rb
211
- - spec/item_spec.rb
212
- - spec/label_spec.rb