fb_graph 0.0.7 → 0.0.8

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.
Files changed (56) hide show
  1. data/README.rdoc +2 -1
  2. data/VERSION +1 -1
  3. data/assets/fb_graph.ai +1726 -6
  4. data/assets/fb_graph.png +0 -0
  5. data/fb_graph.gemspec +22 -2
  6. data/lib/fb_graph/album.rb +8 -4
  7. data/lib/fb_graph/collection.rb +4 -1
  8. data/lib/fb_graph/comment.rb +6 -4
  9. data/lib/fb_graph/connections/comments.rb +8 -1
  10. data/lib/fb_graph/education.rb +25 -0
  11. data/lib/fb_graph/event.rb +10 -4
  12. data/lib/fb_graph/group.rb +4 -2
  13. data/lib/fb_graph/link.rb +5 -3
  14. data/lib/fb_graph/note.rb +8 -4
  15. data/lib/fb_graph/photo.rb +9 -5
  16. data/lib/fb_graph/post.rb +24 -17
  17. data/lib/fb_graph/status.rb +5 -3
  18. data/lib/fb_graph/tag.rb +3 -1
  19. data/lib/fb_graph/user.rb +16 -4
  20. data/lib/fb_graph/video.rb +11 -7
  21. data/lib/fb_graph/work.rb +25 -0
  22. data/lib/fb_graph.rb +2 -0
  23. data/spec/fake_json/posts/platform_private.json +97 -0
  24. data/spec/fake_json/posts/platform_public.json +52 -0
  25. data/spec/fake_json/users/books/matake_private.json +9 -0
  26. data/spec/fake_json/users/books/matake_public.json +6 -0
  27. data/spec/fb_graph/album_spec.rb +2 -2
  28. data/spec/fb_graph/collection_spec.rb +7 -8
  29. data/spec/fb_graph/comment_spec.rb +31 -0
  30. data/spec/fb_graph/connections/activities_spec.rb +18 -14
  31. data/spec/fb_graph/connections/albums_spec.rb +25 -21
  32. data/spec/fb_graph/connections/books_spec.rb +32 -0
  33. data/spec/fb_graph/connections/events_spec.rb +20 -17
  34. data/spec/fb_graph/connections/feed_spec.rb +23 -22
  35. data/spec/fb_graph/connections/friends_spec.rb +29 -22
  36. data/spec/fb_graph/connections/groups_spec.rb +17 -14
  37. data/spec/fb_graph/connections/home_spec.rb +37 -30
  38. data/spec/fb_graph/connections/likes_spec.rb +18 -14
  39. data/spec/fb_graph/connections/picture_spec.rb +2 -2
  40. data/spec/fb_graph/connections/posts_spec.rb +23 -22
  41. data/spec/fb_graph/connections/statuses_spec.rb +45 -37
  42. data/spec/fb_graph/connections/tagged_spec.rb +30 -29
  43. data/spec/fb_graph/education_spec.rb +61 -0
  44. data/spec/fb_graph/event_spec.rb +3 -3
  45. data/spec/fb_graph/group_spec.rb +1 -1
  46. data/spec/fb_graph/link_spec.rb +1 -1
  47. data/spec/fb_graph/note_spec.rb +2 -2
  48. data/spec/fb_graph/photo_spec.rb +2 -2
  49. data/spec/fb_graph/post_spec.rb +63 -2
  50. data/spec/fb_graph/status_spec.rb +1 -1
  51. data/spec/fb_graph/tag_spec.rb +21 -0
  52. data/spec/fb_graph/user_spec.rb +64 -22
  53. data/spec/fb_graph/venue_spec.rb +23 -0
  54. data/spec/fb_graph/video_spec.rb +2 -2
  55. data/spec/fb_graph/work_spec.rb +52 -0
  56. metadata +23 -3
@@ -0,0 +1,23 @@
1
+ require File.join(File.dirname(__FILE__), '../spec_helper')
2
+
3
+ describe FbGraph::Venue, '#new' do
4
+
5
+ it 'should setup all supported attributes' do
6
+ attributes = {
7
+ :street => "409 Colorado St.",
8
+ :city => "Austin",
9
+ :state => "Texas",
10
+ :country => "United States",
11
+ :latitude => 30.2669,
12
+ :longitude => -97.7428
13
+ }
14
+ venue = FbGraph::Venue.new(attributes)
15
+ venue.street.should == "409 Colorado St."
16
+ venue.city.should == "Austin"
17
+ venue.state.should == "Texas"
18
+ venue.country.should == "United States"
19
+ venue.latitude.should == 30.2669
20
+ venue.longitude.should == -97.7428
21
+ end
22
+
23
+ end
@@ -21,8 +21,8 @@ describe FbGraph::Video, '#new' do
21
21
  video.message.should == 'check this out!'
22
22
  video.description.should == 'Smart.fm learning engine details'
23
23
  video.length.should == 3600
24
- video.created_time.should == '2010-01-02T15:37:40+0000'
25
- video.updated_time.should == '2010-01-02T15:37:41+0000'
24
+ video.created_time.should == Time.parse('2010-01-02T15:37:40+0000')
25
+ video.updated_time.should == Time.parse('2010-01-02T15:37:41+0000')
26
26
  end
27
27
 
28
28
  it 'should support page as from' do
@@ -0,0 +1,52 @@
1
+ require File.join(File.dirname(__FILE__), '../spec_helper')
2
+
3
+ describe FbGraph::Work, '#new' do
4
+
5
+ it 'should setup all supported attributes' do
6
+ attributes = {
7
+ :employer => {
8
+ :id => 107722015925937,
9
+ :name => "Drecom Co., Ltd."
10
+ },
11
+ :location => {
12
+ :id => 111736052177472,
13
+ :name => "Tokyo, Tokyo"
14
+ },
15
+ :position => {
16
+ :id => 111091815582753,
17
+ :name => "Web Engineer"
18
+ },
19
+ :start_date => "2007-04",
20
+ :end_date => "2008-09"
21
+ }
22
+ work = FbGraph::Work.new(attributes)
23
+ work.employer.should == FbGraph::Page.new(
24
+ 107722015925937,
25
+ :name => "Drecom Co., Ltd."
26
+ )
27
+ work.location.should == FbGraph::Page.new(
28
+ 111736052177472,
29
+ :name => "Tokyo, Tokyo"
30
+ )
31
+ work.position.should == FbGraph::Page.new(
32
+ 111091815582753,
33
+ :name => "Web Engineer"
34
+ )
35
+ work.start_date.should == Date.new(2007, 4)
36
+ work.end_date.should == Date.new(2008, 9)
37
+ end
38
+
39
+ it 'should ignore 0000-00 end date' do
40
+ attributes = {
41
+ :employer => {
42
+ :id => 105612642807396,
43
+ :name => "Cerego Japan Inc."
44
+ },
45
+ :start_date => "2008-10",
46
+ :end_date => "0000-00"
47
+ }
48
+ work = FbGraph::Work.new(attributes)
49
+ work.end_date.should be_nil
50
+ end
51
+
52
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 7
9
- version: 0.0.7
8
+ - 8
9
+ version: 0.0.8
10
10
  platform: ruby
11
11
  authors:
12
12
  - nov matake
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-30 00:00:00 +09:00
17
+ date: 2010-05-10 00:00:00 +09:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -105,6 +105,8 @@ files:
105
105
  - README.rdoc
106
106
  - Rakefile
107
107
  - VERSION
108
+ - assets/fb_graph.ai
109
+ - assets/fb_graph.png
108
110
  - fb_graph.gemspec
109
111
  - lib/fb_graph.rb
110
112
  - lib/fb_graph/album.rb
@@ -140,6 +142,7 @@ files:
140
142
  - lib/fb_graph/connections/tagged.rb
141
143
  - lib/fb_graph/connections/television.rb
142
144
  - lib/fb_graph/connections/videos.rb
145
+ - lib/fb_graph/education.rb
143
146
  - lib/fb_graph/event.rb
144
147
  - lib/fb_graph/group.rb
145
148
  - lib/fb_graph/link.rb
@@ -153,16 +156,21 @@ files:
153
156
  - lib/fb_graph/user.rb
154
157
  - lib/fb_graph/venue.rb
155
158
  - lib/fb_graph/video.rb
159
+ - lib/fb_graph/work.rb
156
160
  - spec/fake_json/pages/platform_private.json
157
161
  - spec/fake_json/pages/platform_public.json
158
162
  - spec/fake_json/pages/statuses/platform_private.json
159
163
  - spec/fake_json/pages/statuses/platform_public.json
164
+ - spec/fake_json/posts/platform_private.json
165
+ - spec/fake_json/posts/platform_public.json
160
166
  - spec/fake_json/users/activities/arjun_private.json
161
167
  - spec/fake_json/users/activities/arjun_public.json
162
168
  - spec/fake_json/users/albums/matake_private.json
163
169
  - spec/fake_json/users/albums/matake_public.json
164
170
  - spec/fake_json/users/arjun_private.json
165
171
  - spec/fake_json/users/arjun_public.json
172
+ - spec/fake_json/users/books/matake_private.json
173
+ - spec/fake_json/users/books/matake_public.json
166
174
  - spec/fake_json/users/events/matake_private.json
167
175
  - spec/fake_json/users/events/matake_public.json
168
176
  - spec/fake_json/users/feed/arjun_private.json
@@ -191,8 +199,10 @@ files:
191
199
  - spec/fake_json/users/tagged/arjun_public.json
192
200
  - spec/fb_graph/album_spec.rb
193
201
  - spec/fb_graph/collection_spec.rb
202
+ - spec/fb_graph/comment_spec.rb
194
203
  - spec/fb_graph/connections/activities_spec.rb
195
204
  - spec/fb_graph/connections/albums_spec.rb
205
+ - spec/fb_graph/connections/books_spec.rb
196
206
  - spec/fb_graph/connections/events_spec.rb
197
207
  - spec/fb_graph/connections/feed_spec.rb
198
208
  - spec/fb_graph/connections/friends_spec.rb
@@ -203,6 +213,7 @@ files:
203
213
  - spec/fb_graph/connections/posts_spec.rb
204
214
  - spec/fb_graph/connections/statuses_spec.rb
205
215
  - spec/fb_graph/connections/tagged_spec.rb
216
+ - spec/fb_graph/education_spec.rb
206
217
  - spec/fb_graph/event_spec.rb
207
218
  - spec/fb_graph/group_spec.rb
208
219
  - spec/fb_graph/link_spec.rb
@@ -212,8 +223,11 @@ files:
212
223
  - spec/fb_graph/photo_spec.rb
213
224
  - spec/fb_graph/post_spec.rb
214
225
  - spec/fb_graph/status_spec.rb
226
+ - spec/fb_graph/tag_spec.rb
215
227
  - spec/fb_graph/user_spec.rb
228
+ - spec/fb_graph/venue_spec.rb
216
229
  - spec/fb_graph/video_spec.rb
230
+ - spec/fb_graph/work_spec.rb
217
231
  - spec/fb_graph_spec.rb
218
232
  - spec/helpers/fake_json_helper.rb
219
233
  - spec/spec.opts
@@ -251,8 +265,10 @@ summary: A Ruby wrapper for Facebook Graph API
251
265
  test_files:
252
266
  - spec/fb_graph/album_spec.rb
253
267
  - spec/fb_graph/collection_spec.rb
268
+ - spec/fb_graph/comment_spec.rb
254
269
  - spec/fb_graph/connections/activities_spec.rb
255
270
  - spec/fb_graph/connections/albums_spec.rb
271
+ - spec/fb_graph/connections/books_spec.rb
256
272
  - spec/fb_graph/connections/events_spec.rb
257
273
  - spec/fb_graph/connections/feed_spec.rb
258
274
  - spec/fb_graph/connections/friends_spec.rb
@@ -263,6 +279,7 @@ test_files:
263
279
  - spec/fb_graph/connections/posts_spec.rb
264
280
  - spec/fb_graph/connections/statuses_spec.rb
265
281
  - spec/fb_graph/connections/tagged_spec.rb
282
+ - spec/fb_graph/education_spec.rb
266
283
  - spec/fb_graph/event_spec.rb
267
284
  - spec/fb_graph/group_spec.rb
268
285
  - spec/fb_graph/link_spec.rb
@@ -272,8 +289,11 @@ test_files:
272
289
  - spec/fb_graph/photo_spec.rb
273
290
  - spec/fb_graph/post_spec.rb
274
291
  - spec/fb_graph/status_spec.rb
292
+ - spec/fb_graph/tag_spec.rb
275
293
  - spec/fb_graph/user_spec.rb
294
+ - spec/fb_graph/venue_spec.rb
276
295
  - spec/fb_graph/video_spec.rb
296
+ - spec/fb_graph/work_spec.rb
277
297
  - spec/fb_graph_spec.rb
278
298
  - spec/helpers/fake_json_helper.rb
279
299
  - spec/spec_helper.rb