podio 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/.travis.yml +9 -0
  2. data/Gemfile +2 -0
  3. data/Rakefile +2 -0
  4. data/lib/podio.rb +19 -43
  5. data/lib/podio/active_podio/base.rb +83 -23
  6. data/lib/podio/client.rb +14 -3
  7. data/lib/podio/models/action.rb +15 -0
  8. data/lib/podio/models/activation_status.rb +9 -0
  9. data/lib/podio/models/activity.rb +10 -0
  10. data/lib/podio/models/app_store_share.rb +2 -0
  11. data/lib/podio/models/application.rb +30 -1
  12. data/lib/podio/models/application_field.rb +2 -1
  13. data/lib/podio/models/bulletin.rb +1 -0
  14. data/lib/podio/models/calendar.rb +45 -0
  15. data/lib/podio/models/calendar_mute.rb +27 -0
  16. data/lib/podio/models/comment.rb +1 -0
  17. data/lib/podio/models/connection.rb +7 -1
  18. data/lib/podio/models/contact.rb +9 -1
  19. data/lib/podio/models/contract.rb +113 -0
  20. data/lib/podio/models/contract_accounting.rb +33 -0
  21. data/lib/podio/models/contract_price.rb +46 -0
  22. data/lib/podio/models/email_subscription_setting.rb +2 -0
  23. data/lib/podio/models/file_attachment.rb +16 -7
  24. data/lib/podio/models/filter.rb +11 -0
  25. data/lib/podio/models/form.rb +26 -2
  26. data/lib/podio/models/item.rb +32 -13
  27. data/lib/podio/models/item_diff.rb +4 -0
  28. data/lib/podio/models/item_field.rb +1 -1
  29. data/lib/podio/models/meeting.rb +126 -0
  30. data/lib/podio/models/meeting_participiant.rb +5 -0
  31. data/lib/podio/models/news.rb +2 -1
  32. data/lib/podio/models/notification_group.rb +6 -1
  33. data/lib/podio/models/organization.rb +12 -2
  34. data/lib/podio/models/organization_member.rb +2 -3
  35. data/lib/podio/models/profile.rb +49 -1
  36. data/lib/podio/models/rating.rb +6 -0
  37. data/lib/podio/models/recurrence.rb +25 -0
  38. data/lib/podio/models/reminder.rb +33 -0
  39. data/lib/podio/models/search.rb +20 -0
  40. data/lib/podio/models/space.rb +22 -6
  41. data/lib/podio/models/{space_invite.rb → space_invitation.rb} +1 -3
  42. data/lib/podio/models/space_member.rb +7 -0
  43. data/lib/podio/models/status.rb +16 -0
  44. data/lib/podio/models/stream_mute.rb +27 -0
  45. data/lib/podio/models/stream_object.rb +66 -0
  46. data/lib/podio/models/tag.rb +2 -0
  47. data/lib/podio/models/tag_search.rb +14 -0
  48. data/lib/podio/models/task.rb +33 -0
  49. data/lib/podio/models/user.rb +60 -6
  50. data/lib/podio/models/user_mail.rb +7 -0
  51. data/lib/podio/models/user_status.rb +3 -0
  52. data/lib/podio/models/widget.rb +1 -0
  53. data/lib/podio/version.rb +1 -1
  54. data/podio.gemspec +3 -4
  55. data/test/active_podio_test.rb +36 -9
  56. data/test/models_sanity_test.rb +5 -3
  57. metadata +69 -68
@@ -0,0 +1,7 @@
1
+ class Podio::UserMail < ActivePodio::Base
2
+ property :mail, :string
3
+ property :verified, :boolean
4
+ property :primary, :boolean
5
+ property :disabled, :boolean
6
+
7
+ end
@@ -14,5 +14,8 @@ class Podio::UserStatus < ActivePodio::Base
14
14
  def current
15
15
  member Podio.connection.get("/user/status").body
16
16
  end
17
+ def find_for_space(space_id)
18
+ Podio.connection.get("/user/status/1ux/space/#{space_id}").body
19
+ end
17
20
  end
18
21
  end
@@ -5,6 +5,7 @@ class Podio::Widget < ActivePodio::Base
5
5
  property :type, :string
6
6
  property :title, :string
7
7
  property :config, :string
8
+ property :ref, :hash
8
9
 
9
10
  class << self
10
11
  def create(ref_type, ref_id, attributes)
@@ -1,3 +1,3 @@
1
1
  module Podio
2
- VERSION = '0.5.1'
2
+ VERSION = '0.6.0'
3
3
  end
@@ -16,10 +16,9 @@ Gem::Specification.new do |s|
16
16
  s.require_paths = ['lib']
17
17
 
18
18
  s.add_dependency('faraday', '~> 0.7.0')
19
- s.add_dependency('activesupport', '~> 3.0.0')
20
- s.add_dependency('activemodel', '~> 3.0.0')
21
- s.add_dependency('i18n', '~> 0.5.0')
22
- s.add_dependency('multi_json', '~> 0.0.5')
19
+ s.add_dependency('activesupport', '~> 3.0')
20
+ s.add_dependency('activemodel', '~> 3.0')
21
+ s.add_dependency('multi_json')
23
22
 
24
23
  s.description = <<desc
25
24
  The official Ruby wrapper for the Podio API used and maintained by the Podio team
@@ -10,7 +10,9 @@ class ActivePodioTest < Test::Unit::TestCase
10
10
  property :test_id, :integer
11
11
  property :string, :string
12
12
  property :hash_property, :hash
13
- property :other_hash_property, :hash
13
+ property :prefixed_hash_property, :hash
14
+ property :hash_property_with_setter, :hash
15
+ property :prefixed_hash_property_with_setter, :hash
14
16
  property :datetime, :datetime
15
17
  property :date, :date
16
18
  property :integer, :integer
@@ -25,7 +27,9 @@ class ActivePodioTest < Test::Unit::TestCase
25
27
  alias_method :id, :test_id
26
28
 
27
29
  delegate_to_hash :hash_property, :key1, :key2, :really?
28
- delegate_to_hash :other_hash_property, :key3, :prefix => true, :setter => true
30
+ delegate_to_hash :prefixed_hash_property, :key3, :prefix => true
31
+ delegate_to_hash :hash_property_with_setter, :key4, :setter => true
32
+ delegate_to_hash :prefixed_hash_property_with_setter, :key5, :setter => true, :prefix => true
29
33
 
30
34
 
31
35
  def save(exception_class = nil)
@@ -165,11 +169,34 @@ class ActivePodioTest < Test::Unit::TestCase
165
169
  assert @test.really?
166
170
  end
167
171
 
172
+ test 'should expose prefixed getter methods defined by delegate to hash' do
173
+ @test = TestModel.new(:prefixed_hash_property => {'key3' => 'value3'})
174
+ assert_equal 'value3', @test.prefixed_hash_property_key3
175
+ end
176
+
177
+ test 'should expose setter methods defined by delegate to hash' do
178
+ @test = TestModel.new(:hash_property_with_setter => {'key4' => 'value4'})
179
+ assert_equal 'value4', @test.key4
180
+ @test.key4 = 'new'
181
+ assert_equal 'new', @test.key4
182
+ end
183
+
168
184
  test 'should expose prefixed getter and setter methods defined by delegate to hash' do
169
- @test = TestModel.new(:other_hash_property => {'key3' => 'value3'})
170
- assert_equal 'value3', @test.other_hash_property_key3
171
- @test.other_hash_property_key3 = 'new'
172
- assert_equal 'new', @test.other_hash_property_key3
185
+ @test = TestModel.new(:prefixed_hash_property_with_setter => {'key5' => 'value5'})
186
+ assert_equal 'value5', @test.prefixed_hash_property_with_setter_key5
187
+ @test.prefixed_hash_property_with_setter_key5 = 'new'
188
+ assert_equal 'new', @test.prefixed_hash_property_with_setter_key5
189
+ end
190
+
191
+ test 'should work with delegate to hash getter when hash is nil' do
192
+ @test = TestModel.new
193
+ assert_nil @test.key4
194
+ end
195
+
196
+ test 'should work with delegate to hashsetter when hash is nil' do
197
+ @test = TestModel.new
198
+ @test.key4 = 'new'
199
+ assert_equal 'new', @test.key4
173
200
  end
174
201
 
175
202
  test 'should handle non failing api requests' do
@@ -239,12 +266,12 @@ class ActivePodioTest < Test::Unit::TestCase
239
266
 
240
267
  test 'should initialize nil attributes when constructed without given attributes' do
241
268
  @test = TestModel.new
242
- assert_equal({:string=>nil, :test_id=>nil, :hash_property=>nil, :other_hash_property=>nil, :datetime=>nil, :date=>nil, :integer=>nil, :boolean=>nil, :array=>nil}, @test.attributes)
269
+ assert_equal({:string=>nil, :test_id=>nil, :hash_property=>nil, :prefixed_hash_property=>nil, :hash_property_with_setter=>nil, :prefixed_hash_property_with_setter=>nil, :datetime=>nil, :date=>nil, :integer=>nil, :boolean=>nil, :array=>nil}, @test.attributes)
243
270
  end
244
271
 
245
272
  test 'should accept unknown properties when constructed' do
246
273
  @test = TestModel.new(:unknown => 'attribute')
247
- assert_equal({:string=>nil, :test_id=>nil, :hash_property=>nil, :other_hash_property=>nil, :datetime=>nil, :date=>nil, :integer=>nil, :boolean=>nil, :array=>nil, :unknown => 'attribute'}, @test.attributes)
274
+ assert_equal({:string=>nil, :test_id=>nil, :hash_property=>nil, :prefixed_hash_property=>nil, :hash_property_with_setter=>nil, :prefixed_hash_property_with_setter=>nil, :datetime=>nil, :date=>nil, :integer=>nil, :boolean=>nil, :array=>nil, :unknown => 'attribute'}, @test.attributes)
248
275
  end
249
276
 
250
277
  test 'should use id for ==' do
@@ -260,7 +287,7 @@ class ActivePodioTest < Test::Unit::TestCase
260
287
 
261
288
  test 'should return attributes for as_json' do
262
289
  @test = TestModel.new(:test_id => 42)
263
- assert_equal({:string=>nil, :test_id=>42, :hash_property=>nil, :other_hash_property=>nil, :datetime=>nil, :date=>nil, :integer=>nil, :boolean=>nil, :array=>nil}, @test.as_json)
290
+ assert_equal({:string=>nil, :test_id=>42, :hash_property=>nil, :prefixed_hash_property=>nil, :hash_property_with_setter=>nil, :prefixed_hash_property_with_setter=>nil, :datetime=>nil, :date=>nil, :integer=>nil, :boolean=>nil, :array=>nil}, @test.as_json)
264
291
  end
265
292
 
266
293
  end
@@ -10,10 +10,12 @@ class ModelsSanityTest < Test::Unit::TestCase
10
10
  model_files = Dir[File.join(models_directory, '**', '*')]
11
11
  model_files.each do |model_file|
12
12
  filename = File.basename(model_file, File.extname(model_file))
13
- model_class = ActiveSupport::Inflector.constantize("Podio::" + filename.classify)
13
+ model_class = ActiveSupport::Inflector.constantize("Podio::" + filename.classify) rescue nil
14
14
 
15
- test "should instansiate #{model_class.name}" do
16
- assert_nothing_raised { model_class.new }
15
+ if model_class
16
+ test "should instansiate #{model_class.name}" do
17
+ assert_nothing_raised { model_class.new }
18
+ end
17
19
  end
18
20
  end
19
21
  end
metadata CHANGED
@@ -1,85 +1,72 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: podio
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.6.0
4
5
  prerelease:
5
- version: 0.5.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Florian Munz
9
9
  - Casper Fabricius
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
-
14
- date: 2011-07-18 00:00:00 Z
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
13
+ date: 2011-12-06 00:00:00.000000000Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
17
16
  name: faraday
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &2162021080 !ruby/object:Gem::Requirement
20
18
  none: false
21
- requirements:
19
+ requirements:
22
20
  - - ~>
23
- - !ruby/object:Gem::Version
21
+ - !ruby/object:Gem::Version
24
22
  version: 0.7.0
25
23
  type: :runtime
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: activesupport
29
24
  prerelease: false
30
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *2162021080
26
+ - !ruby/object:Gem::Dependency
27
+ name: activesupport
28
+ requirement: &2162019020 !ruby/object:Gem::Requirement
31
29
  none: false
32
- requirements:
30
+ requirements:
33
31
  - - ~>
34
- - !ruby/object:Gem::Version
35
- version: 3.0.0
32
+ - !ruby/object:Gem::Version
33
+ version: '3.0'
36
34
  type: :runtime
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
39
- name: activemodel
40
35
  prerelease: false
41
- requirement: &id003 !ruby/object:Gem::Requirement
36
+ version_requirements: *2162019020
37
+ - !ruby/object:Gem::Dependency
38
+ name: activemodel
39
+ requirement: &2162017180 !ruby/object:Gem::Requirement
42
40
  none: false
43
- requirements:
41
+ requirements:
44
42
  - - ~>
45
- - !ruby/object:Gem::Version
46
- version: 3.0.0
43
+ - !ruby/object:Gem::Version
44
+ version: '3.0'
47
45
  type: :runtime
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
50
- name: i18n
51
46
  prerelease: false
52
- requirement: &id004 !ruby/object:Gem::Requirement
53
- none: false
54
- requirements:
55
- - - ~>
56
- - !ruby/object:Gem::Version
57
- version: 0.5.0
58
- type: :runtime
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
47
+ version_requirements: *2162017180
48
+ - !ruby/object:Gem::Dependency
61
49
  name: multi_json
62
- prerelease: false
63
- requirement: &id005 !ruby/object:Gem::Requirement
50
+ requirement: &2162015780 !ruby/object:Gem::Requirement
64
51
  none: false
65
- requirements:
66
- - - ~>
67
- - !ruby/object:Gem::Version
68
- version: 0.0.5
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
69
56
  type: :runtime
70
- version_requirements: *id005
71
- description: |
72
- The official Ruby wrapper for the Podio API used and maintained by the Podio team
57
+ prerelease: false
58
+ version_requirements: *2162015780
59
+ description: ! 'The official Ruby wrapper for the Podio API used and maintained by
60
+ the Podio team
73
61
 
62
+ '
74
63
  email: florian@podio.com
75
64
  executables: []
76
-
77
65
  extensions: []
78
-
79
66
  extra_rdoc_files: []
80
-
81
- files:
67
+ files:
82
68
  - .gitignore
69
+ - .travis.yml
83
70
  - Gemfile
84
71
  - LICENSE
85
72
  - README.md
@@ -97,22 +84,31 @@ files:
97
84
  - lib/podio/middleware/logger.rb
98
85
  - lib/podio/middleware/oauth2.rb
99
86
  - lib/podio/middleware/response_recorder.rb
87
+ - lib/podio/models/action.rb
88
+ - lib/podio/models/activation_status.rb
89
+ - lib/podio/models/activity.rb
100
90
  - lib/podio/models/app_store_share.rb
101
91
  - lib/podio/models/application.rb
102
92
  - lib/podio/models/application_email.rb
103
93
  - lib/podio/models/application_field.rb
104
94
  - lib/podio/models/bulletin.rb
105
95
  - lib/podio/models/by_line.rb
96
+ - lib/podio/models/calendar.rb
97
+ - lib/podio/models/calendar_mute.rb
106
98
  - lib/podio/models/category.rb
107
99
  - lib/podio/models/comment.rb
108
100
  - lib/podio/models/connection.rb
109
101
  - lib/podio/models/contact.rb
102
+ - lib/podio/models/contract.rb
103
+ - lib/podio/models/contract_accounting.rb
104
+ - lib/podio/models/contract_price.rb
110
105
  - lib/podio/models/conversation.rb
111
106
  - lib/podio/models/conversation_message.rb
112
107
  - lib/podio/models/conversation_participant.rb
113
108
  - lib/podio/models/email_subscription_setting.rb
114
109
  - lib/podio/models/embed.rb
115
110
  - lib/podio/models/file_attachment.rb
111
+ - lib/podio/models/filter.rb
116
112
  - lib/podio/models/form.rb
117
113
  - lib/podio/models/hook.rb
118
114
  - lib/podio/models/importer.rb
@@ -121,6 +117,8 @@ files:
121
117
  - lib/podio/models/item_diff.rb
122
118
  - lib/podio/models/item_field.rb
123
119
  - lib/podio/models/item_revision.rb
120
+ - lib/podio/models/meeting.rb
121
+ - lib/podio/models/meeting_participiant.rb
124
122
  - lib/podio/models/news.rb
125
123
  - lib/podio/models/notification.rb
126
124
  - lib/podio/models/notification_group.rb
@@ -135,17 +133,23 @@ files:
135
133
  - lib/podio/models/question_answer.rb
136
134
  - lib/podio/models/question_option.rb
137
135
  - lib/podio/models/rating.rb
136
+ - lib/podio/models/recurrence.rb
137
+ - lib/podio/models/reminder.rb
138
138
  - lib/podio/models/search.rb
139
139
  - lib/podio/models/space.rb
140
140
  - lib/podio/models/space_contact.rb
141
- - lib/podio/models/space_invite.rb
141
+ - lib/podio/models/space_invitation.rb
142
142
  - lib/podio/models/space_member.rb
143
143
  - lib/podio/models/status.rb
144
+ - lib/podio/models/stream_mute.rb
145
+ - lib/podio/models/stream_object.rb
144
146
  - lib/podio/models/subscription.rb
145
147
  - lib/podio/models/tag.rb
148
+ - lib/podio/models/tag_search.rb
146
149
  - lib/podio/models/task.rb
147
150
  - lib/podio/models/task_label.rb
148
151
  - lib/podio/models/user.rb
152
+ - lib/podio/models/user_mail.rb
149
153
  - lib/podio/models/user_status.rb
150
154
  - lib/podio/models/via.rb
151
155
  - lib/podio/models/widget.rb
@@ -164,32 +168,29 @@ files:
164
168
  - test/test_helper.rb
165
169
  homepage: https://github.com/podio/podio-rb
166
170
  licenses: []
167
-
168
171
  post_install_message:
169
172
  rdoc_options: []
170
-
171
- require_paths:
173
+ require_paths:
172
174
  - lib
173
- required_ruby_version: !ruby/object:Gem::Requirement
175
+ required_ruby_version: !ruby/object:Gem::Requirement
174
176
  none: false
175
- requirements:
176
- - - ">="
177
- - !ruby/object:Gem::Version
178
- version: "0"
179
- required_rubygems_version: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ! '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ required_rubygems_version: !ruby/object:Gem::Requirement
180
182
  none: false
181
- requirements:
182
- - - ">="
183
- - !ruby/object:Gem::Version
184
- version: "0"
183
+ requirements:
184
+ - - ! '>='
185
+ - !ruby/object:Gem::Version
186
+ version: '0'
185
187
  requirements: []
186
-
187
188
  rubyforge_project:
188
- rubygems_version: 1.8.5
189
+ rubygems_version: 1.8.6
189
190
  signing_key:
190
191
  specification_version: 3
191
192
  summary: Ruby wrapper for the Podio API
192
- test_files:
193
+ test_files:
193
194
  - test/active_podio_test.rb
194
195
  - test/client_test.rb
195
196
  - test/fixtures/client/18a224aaf83ac57a7b8159cecdbb1263.rack