From 977a4196c2af7c710b5a02e5f9586fab58e9135d Mon Sep 17 00:00:00 2001 From: Bryan Brunetti Date: Tue, 30 May 2017 12:59:03 -0400 Subject: [PATCH] fixed a bug with parsing message_tags --- fb_graph2.original/.gitignore | 24 - fb_graph2.original/.rspec | 2 - fb_graph2.original/.travis.yml | 3 - fb_graph2.original/Gemfile | 4 - fb_graph2.original/LICENSE.txt | 22 - fb_graph2.original/README.md | 29 - fb_graph2.original/Rakefile | 18 - fb_graph2.original/VERSION | 1 - fb_graph2.original/fb_graph2.gemspec | 26 - fb_graph2.original/lib/fb_graph2.rb | 56 -- .../lib/fb_graph2/achievement.rb | 21 - .../lib/fb_graph2/achievement_type.rb | 11 - fb_graph2.original/lib/fb_graph2/album.rb | 16 - fb_graph2.original/lib/fb_graph2/app.rb | 45 -- .../lib/fb_graph2/app_link_host.rb | 33 -- .../lib/fb_graph2/attribute_assigner.rb | 103 ---- fb_graph2.original/lib/fb_graph2/auth.rb | 59 -- .../lib/fb_graph2/collection.rb | 54 -- fb_graph2.original/lib/fb_graph2/comment.rb | 20 - fb_graph2.original/lib/fb_graph2/domain.rb | 9 - fb_graph2.original/lib/fb_graph2/edge.rb | 39 -- .../lib/fb_graph2/edge/accounts.rb | 12 - .../lib/fb_graph2/edge/achievements.rb | 12 - .../lib/fb_graph2/edge/activities.rb | 12 - .../lib/fb_graph2/edge/admins.rb | 17 - .../lib/fb_graph2/edge/albums.rb | 17 - .../lib/fb_graph2/edge/app_event_types.rb | 12 - .../lib/fb_graph2/edge/app_link_hosts.rb | 12 - .../lib/fb_graph2/edge/app_requests.rb | 22 - .../lib/fb_graph2/edge/applications.rb | 12 - .../lib/fb_graph2/edge/attending.rb | 12 - .../lib/fb_graph2/edge/banned.rb | 29 - .../lib/fb_graph2/edge/blocked.rb | 29 - .../lib/fb_graph2/edge/books.rb | 12 - .../lib/fb_graph2/edge/comments.rb | 28 - .../lib/fb_graph2/edge/declined.rb | 12 - .../lib/fb_graph2/edge/dispute.rb | 9 - fb_graph2.original/lib/fb_graph2/edge/docs.rb | 12 - .../lib/fb_graph2/edge/events.rb | 13 - .../lib/fb_graph2/edge/family.rb | 12 - fb_graph2.original/lib/fb_graph2/edge/feed.rb | 17 - .../lib/fb_graph2/edge/files.rb | 12 - .../lib/fb_graph2/edge/friend_lists.rb | 13 - .../lib/fb_graph2/edge/friends.rb | 17 - .../lib/fb_graph2/edge/games.rb | 12 - .../fb_graph2/edge/global_brand_children.rb | 12 - .../lib/fb_graph2/edge/groups.rb | 12 - fb_graph2.original/lib/fb_graph2/edge/home.rb | 12 - .../lib/fb_graph2/edge/inbox.rb | 12 - .../lib/fb_graph2/edge/insights.rb | 12 - .../lib/fb_graph2/edge/interests.rb | 12 - .../lib/fb_graph2/edge/invitable_friends.rb | 12 - .../lib/fb_graph2/edge/invited.rb | 12 - .../lib/fb_graph2/edge/likes.rb | 47 -- .../lib/fb_graph2/edge/links.rb | 12 - .../lib/fb_graph2/edge/locations.rb | 14 - .../lib/fb_graph2/edge/maybe.rb | 12 - .../lib/fb_graph2/edge/members.rb | 12 - .../lib/fb_graph2/edge/milestones.rb | 12 - .../lib/fb_graph2/edge/movies.rb | 12 - .../lib/fb_graph2/edge/music.rb | 12 - .../lib/fb_graph2/edge/noreply.rb | 12 - .../lib/fb_graph2/edge/notifications.rb | 17 - .../lib/fb_graph2/edge/offers.rb | 17 - .../lib/fb_graph2/edge/outbox.rb | 12 - .../fb_graph2/edge/payment_transactions.rb | 12 - .../lib/fb_graph2/edge/permissions.rb | 12 - .../lib/fb_graph2/edge/photos.rb | 18 - .../lib/fb_graph2/edge/picture.rb | 12 - .../lib/fb_graph2/edge/pokes.rb | 12 - .../lib/fb_graph2/edge/posts.rb | 12 - .../lib/fb_graph2/edge/promotable_posts.rb | 12 - .../lib/fb_graph2/edge/refunds.rb | 9 - .../lib/fb_graph2/edge/roles.rb | 41 -- .../lib/fb_graph2/edge/scores.rb | 12 - .../lib/fb_graph2/edge/settings.rb | 12 - .../lib/fb_graph2/edge/shared_posts.rb | 13 - .../lib/fb_graph2/edge/static_resources.rb | 13 - .../lib/fb_graph2/edge/statuses.rb | 12 - .../lib/fb_graph2/edge/subscriptions.rb | 12 - .../lib/fb_graph2/edge/taggable_friends.rb | 12 - .../lib/fb_graph2/edge/tagged.rb | 12 - .../lib/fb_graph2/edge/tagged_places.rb | 12 - fb_graph2.original/lib/fb_graph2/edge/tags.rb | 17 - .../lib/fb_graph2/edge/television.rb | 12 - .../lib/fb_graph2/edge/test_users.rb | 12 - .../lib/fb_graph2/edge/translations.rb | 17 - .../lib/fb_graph2/edge/videos.rb | 18 - fb_graph2.original/lib/fb_graph2/event.rb | 23 - fb_graph2.original/lib/fb_graph2/exception.rb | 81 --- .../lib/fb_graph2/friend_list.rb | 7 - fb_graph2.original/lib/fb_graph2/group.rb | 21 - fb_graph2.original/lib/fb_graph2/group_doc.rb | 9 - fb_graph2.original/lib/fb_graph2/insight.rb | 13 - fb_graph2.original/lib/fb_graph2/message.rb | 9 - fb_graph2.original/lib/fb_graph2/milestone.rb | 13 - fb_graph2.original/lib/fb_graph2/node.rb | 125 ---- .../lib/fb_graph2/notification.rb | 17 - fb_graph2.original/lib/fb_graph2/offer.rb | 9 - fb_graph2.original/lib/fb_graph2/order.rb | 9 - fb_graph2.original/lib/fb_graph2/page.rb | 81 --- .../lib/fb_graph2/page_category.rb | 7 - fb_graph2.original/lib/fb_graph2/payment.rb | 19 - fb_graph2.original/lib/fb_graph2/photo.rb | 21 - fb_graph2.original/lib/fb_graph2/place.rb | 6 - fb_graph2.original/lib/fb_graph2/place_tag.rb | 8 - fb_graph2.original/lib/fb_graph2/post.rb | 44 -- fb_graph2.original/lib/fb_graph2/request.rb | 10 - .../fb_graph2/request_filter/authenticator.rb | 17 - .../lib/fb_graph2/request_filter/debugger.rb | 23 - fb_graph2.original/lib/fb_graph2/review.rb | 10 - .../lib/fb_graph2/searchable.rb | 27 - .../lib/fb_graph2/searchable/result.rb | 32 -- fb_graph2.original/lib/fb_graph2/struct.rb | 15 - .../lib/fb_graph2/struct/action.rb | 9 - .../lib/fb_graph2/struct/age_range.rb | 9 - .../lib/fb_graph2/struct/app_event_type.rb | 25 - .../lib/fb_graph2/struct/app_link.rb | 39 -- .../lib/fb_graph2/struct/context.rb | 18 - .../lib/fb_graph2/struct/currency.rb | 9 - .../lib/fb_graph2/struct/device.rb | 9 - .../lib/fb_graph2/struct/education.rb | 11 - .../lib/fb_graph2/struct/friend.rb | 10 - .../lib/fb_graph2/struct/group_file.rb | 12 - .../lib/fb_graph2/struct/image_source.rb | 9 - .../lib/fb_graph2/struct/location.rb | 9 - .../lib/fb_graph2/struct/parking.rb | 9 - .../lib/fb_graph2/struct/payment_options.rb | 9 - .../lib/fb_graph2/struct/permission.rb | 9 - .../lib/fb_graph2/struct/picture.rb | 9 - .../lib/fb_graph2/struct/poke.rb | 10 - .../lib/fb_graph2/struct/privacy.rb | 9 - .../lib/fb_graph2/struct/property.rb | 9 - .../fb_graph2/struct/restaurant_services.rb | 9 - .../struct/restaurant_specialties.rb | 9 - .../lib/fb_graph2/struct/role.rb | 9 - .../lib/fb_graph2/struct/score.rb | 11 - .../lib/fb_graph2/struct/setting.rb | 9 - .../lib/fb_graph2/struct/static_resource.rb | 17 - .../lib/fb_graph2/struct/subscription.rb | 9 - .../lib/fb_graph2/struct/work.rb | 11 - .../lib/fb_graph2/tagged_profile.rb | 26 - fb_graph2.original/lib/fb_graph2/thread.rb | 10 - .../lib/fb_graph2/token_metadata.rb | 45 -- .../lib/fb_graph2/translation.rb | 7 - fb_graph2.original/lib/fb_graph2/user.rb | 106 ---- fb_graph2.original/lib/fb_graph2/util.rb | 13 - fb_graph2.original/lib/fb_graph2/video.rb | 14 - fb_graph2.original/spec/fb_graph2/app_spec.rb | 23 - .../spec/fb_graph2/auth_spec.rb | 164 ------ .../spec/fb_graph2/collection_spec.rb | 11 - .../spec/fb_graph2/edge/accounts_spec.rb | 21 - .../spec/fb_graph2/edge/achievements_spec.rb | 19 - .../spec/fb_graph2/edge/activities_spec.rb | 19 - .../spec/fb_graph2/edge/admins_spec.rb | 41 -- .../spec/fb_graph2/edge/albums_spec.rb | 31 - .../spec/fb_graph2/edge/applications_spec.rb | 20 - .../spec/fb_graph2/edge/attending_spec.rb | 20 - .../spec/fb_graph2/edge/banned_spec.rb | 60 -- .../spec/fb_graph2/edge/blocked_spec.rb | 61 -- .../spec/fb_graph2/edge/books_spec.rb | 19 - .../spec/fb_graph2/edge/comments_spec.rb | 69 --- .../spec/fb_graph2/edge/declined_spec.rb | 20 - .../spec/fb_graph2/edge/events_spec.rb | 19 - .../spec/fb_graph2/edge/feed_spec.rb | 31 - .../spec/fb_graph2/edge/friend_lists_spec.rb | 19 - .../spec/fb_graph2/edge/friends_spec.rb | 38 -- .../spec/fb_graph2/edge/groups_spec.rb | 19 - .../spec/fb_graph2/edge/home_spec.rb | 19 - .../spec/fb_graph2/edge/inbox_spec.rb | 20 - .../spec/fb_graph2/edge/interests_spec.rb | 19 - .../fb_graph2/edge/invitable_friends_spec.rb | 19 - .../spec/fb_graph2/edge/invited_spec.rb | 20 - .../spec/fb_graph2/edge/likes_spec.rb | 97 ---- .../spec/fb_graph2/edge/links_spec.rb | 19 - .../spec/fb_graph2/edge/maybe_spec.rb | 20 - .../spec/fb_graph2/edge/members_spec.rb | 21 - .../spec/fb_graph2/edge/milestones_spec.rb | 19 - .../spec/fb_graph2/edge/movies_spec.rb | 19 - .../spec/fb_graph2/edge/music_spec.rb | 19 - .../spec/fb_graph2/edge/noreply_spec.rb | 20 - .../spec/fb_graph2/edge/notifications_spec.rb | 30 - .../spec/fb_graph2/edge/offers_spec.rb | 35 -- .../spec/fb_graph2/edge/outbox_spec.rb | 19 - .../spec/fb_graph2/edge/permissions_spec.rb | 19 - .../spec/fb_graph2/edge/photos_spec.rb | 30 - .../spec/fb_graph2/edge/picture_spec.rb | 16 - .../spec/fb_graph2/edge/pokes_spec.rb | 19 - .../spec/fb_graph2/edge/posts_spec.rb | 19 - .../fb_graph2/edge/promotable_posts_spec.rb | 19 - .../spec/fb_graph2/edge/roles_spec.rb | 67 --- .../spec/fb_graph2/edge/scores_spec.rb | 19 - .../spec/fb_graph2/edge/settings_spec.rb | 19 - .../spec/fb_graph2/edge/shared_posts_spec.rb | 19 - .../spec/fb_graph2/edge/statuses_spec.rb | 19 - .../spec/fb_graph2/edge/subscriptions_spec.rb | 19 - .../fb_graph2/edge/taggable_friends_spec.rb | 19 - .../spec/fb_graph2/edge/television_spec.rb | 19 - .../spec/fb_graph2/edge/test_users_spec.rb | 20 - .../spec/fb_graph2/edge/videos_spec.rb | 29 - .../spec/fb_graph2/edge_spec.rb | 148 ----- .../spec/fb_graph2/node_spec.rb | 171 ------ .../spec/fb_graph2/node_subclass_spec.rb | 23 - .../spec/fb_graph2/page_spec.rb | 61 -- .../request_filter/authenticator_spec.rb | 33 -- .../fb_graph2/request_filter/debugger_spec.rb | 33 -- .../spec/fb_graph2/searchable_spec.rb | 50 -- .../spec/fb_graph2/token_metadata_spec.rb | 51 -- .../spec/fb_graph2/user_spec.rb | 36 -- .../spec/fb_graph2/util_spec.rb | 19 - fb_graph2.original/spec/fb_graph2_spec.rb | 41 -- .../spec/mock_json/app/app.json | 15 - .../spec/mock_json/app/banned.json | 12 - .../spec/mock_json/app/roles.json | 10 - .../spec/mock_json/app/subscriptions.json | 8 - .../spec/mock_json/app/test_users.json | 17 - .../spec/mock_json/blank_collection.json | 1 - .../spec/mock_json/error/400/191.json | 7 - .../spec/mock_json/error/400/2500.json | 7 - .../spec/mock_json/error/invalid_format.json | 1 - .../spec/mock_json/event/attending.json | 17 - .../spec/mock_json/event/declined.json | 17 - .../spec/mock_json/event/invited.json | 17 - .../spec/mock_json/event/maybe.json | 17 - .../spec/mock_json/event/noreply.json | 17 - .../spec/mock_json/group/members.json | 22 - .../spec/mock_json/page/admins.json | 11 - .../spec/mock_json/page/block_succeeded.json | 3 - .../spec/mock_json/page/blocked.json | 9 - .../spec/mock_json/page/milestones.json | 19 - .../spec/mock_json/page/offers.json | 19 - .../spec/mock_json/page/promotable_posts.json | 67 --- .../spec/mock_json/page/roles.json | 19 - .../spec/mock_json/page/roles_single.json | 14 - .../spec/mock_json/page/settings.json | 36 -- .../mock_json/page/with_optional_fields.json | 42 -- .../spec/mock_json/post/comments.json | 20 - .../mock_json/post/comments_with_summary.json | 57 -- .../mock_json/post/liked_and_commented.json | 59 -- .../spec/mock_json/post/likes.json | 15 - .../spec/mock_json/post/shared_posts.json | 50 -- .../spec/mock_json/search/user.json | 9 - .../spec/mock_json/success_true.json | 3 - .../spec/mock_json/success_with_id.json | 3 - .../mock_json/token_metadata/app_token.json | 6 - .../token_metadata/invalid_token.json | 15 - .../mock_json/token_metadata/page_token.json | 11 - .../mock_json/token_metadata/user_token.json | 10 - .../spec/mock_json/token_response.json | 1 - fb_graph2.original/spec/mock_json/true.json | 1 - .../spec/mock_json/user/accounts.json | 24 - .../spec/mock_json/user/achievements.json | 40 -- .../spec/mock_json/user/activities.json | 36 -- .../spec/mock_json/user/albums.json | 23 - .../spec/mock_json/user/applications.json | 16 - .../spec/mock_json/user/books.json | 11 - .../spec/mock_json/user/events.json | 16 - .../spec/mock_json/user/feed.json | 274 --------- .../spec/mock_json/user/friend_lists.json | 98 ---- .../spec/mock_json/user/friends.json | 18 - .../spec/mock_json/user/groups.json | 16 - .../spec/mock_json/user/home.json | 61 -- .../spec/mock_json/user/inbox.json | 41 -- .../spec/mock_json/user/interests.json | 41 -- .../mock_json/user/invitable_friends.json | 27 - .../spec/mock_json/user/likes.json | 33 -- .../spec/mock_json/user/links.json | 45 -- .../spec/mock_json/user/me.json | 421 -------------- .../mock_json/user/me_with_ext_attrs.json | 65 --- .../spec/mock_json/user/movies.json | 11 - .../spec/mock_json/user/music.json | 45 -- .../spec/mock_json/user/notifications.json | 45 -- .../spec/mock_json/user/outbox.json | 36 -- .../spec/mock_json/user/permissions.json | 114 ---- .../spec/mock_json/user/photos.json | 542 ------------------ .../spec/mock_json/user/picture.json | 6 - .../spec/mock_json/user/pokes.json | 17 - .../spec/mock_json/user/posts.json | 48 -- .../spec/mock_json/user/scores.json | 14 - .../spec/mock_json/user/statuses.json | 15 - .../spec/mock_json/user/taggable_friends.json | 27 - .../spec/mock_json/user/television.json | 11 - .../spec/mock_json/user/videos.json | 41 -- fb_graph2.original/spec/spec_helper.rb | 19 - .../spec/spec_helper/mock_graph.rb | 96 ---- .../fb_graph2/auth/signed_request.rb | 0 lib/fb_graph2/post.rb | 8 +- lib/fb_graph2/tagged_profile.rb | 2 +- spec/fb_graph2/edge/posts_spec.rb | 1 + spec/mock_json/user/posts.json | 27 +- 290 files changed, 27 insertions(+), 8033 deletions(-) delete mode 100644 fb_graph2.original/.gitignore delete mode 100644 fb_graph2.original/.rspec delete mode 100644 fb_graph2.original/.travis.yml delete mode 100644 fb_graph2.original/Gemfile delete mode 100644 fb_graph2.original/LICENSE.txt delete mode 100644 fb_graph2.original/README.md delete mode 100644 fb_graph2.original/Rakefile delete mode 100644 fb_graph2.original/VERSION delete mode 100644 fb_graph2.original/fb_graph2.gemspec delete mode 100644 fb_graph2.original/lib/fb_graph2.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/achievement.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/achievement_type.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/album.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/app.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/app_link_host.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/attribute_assigner.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/auth.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/collection.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/comment.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/domain.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/accounts.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/achievements.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/activities.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/admins.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/albums.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/app_event_types.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/app_link_hosts.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/app_requests.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/applications.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/attending.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/banned.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/blocked.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/books.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/comments.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/declined.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/dispute.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/docs.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/events.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/family.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/feed.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/files.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/friend_lists.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/friends.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/games.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/global_brand_children.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/groups.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/home.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/inbox.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/insights.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/interests.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/invitable_friends.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/invited.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/likes.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/links.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/locations.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/maybe.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/members.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/milestones.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/movies.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/music.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/noreply.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/notifications.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/offers.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/outbox.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/payment_transactions.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/permissions.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/photos.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/picture.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/pokes.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/posts.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/promotable_posts.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/refunds.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/roles.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/scores.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/settings.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/shared_posts.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/static_resources.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/statuses.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/subscriptions.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/taggable_friends.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/tagged.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/tagged_places.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/tags.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/television.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/test_users.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/translations.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/edge/videos.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/event.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/exception.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/friend_list.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/group.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/group_doc.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/insight.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/message.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/milestone.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/node.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/notification.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/offer.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/order.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/page.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/page_category.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/payment.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/photo.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/place.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/place_tag.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/post.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/request.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/request_filter/authenticator.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/request_filter/debugger.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/review.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/searchable.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/searchable/result.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/action.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/age_range.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/app_event_type.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/app_link.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/context.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/currency.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/device.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/education.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/friend.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/group_file.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/image_source.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/location.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/parking.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/payment_options.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/permission.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/picture.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/poke.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/privacy.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/property.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/restaurant_services.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/restaurant_specialties.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/role.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/score.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/setting.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/static_resource.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/subscription.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/struct/work.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/tagged_profile.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/thread.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/token_metadata.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/translation.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/user.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/util.rb delete mode 100644 fb_graph2.original/lib/fb_graph2/video.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/app_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/auth_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/collection_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/accounts_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/achievements_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/activities_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/admins_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/albums_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/applications_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/attending_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/banned_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/blocked_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/books_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/comments_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/declined_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/events_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/feed_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/friend_lists_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/friends_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/groups_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/home_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/inbox_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/interests_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/invitable_friends_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/invited_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/likes_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/links_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/maybe_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/members_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/milestones_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/movies_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/music_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/noreply_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/notifications_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/offers_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/outbox_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/permissions_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/photos_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/picture_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/pokes_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/posts_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/promotable_posts_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/roles_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/scores_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/settings_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/shared_posts_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/statuses_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/subscriptions_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/taggable_friends_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/television_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/test_users_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge/videos_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/edge_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/node_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/node_subclass_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/page_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/request_filter/authenticator_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/request_filter/debugger_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/searchable_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/token_metadata_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/user_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2/util_spec.rb delete mode 100644 fb_graph2.original/spec/fb_graph2_spec.rb delete mode 100644 fb_graph2.original/spec/mock_json/app/app.json delete mode 100644 fb_graph2.original/spec/mock_json/app/banned.json delete mode 100644 fb_graph2.original/spec/mock_json/app/roles.json delete mode 100644 fb_graph2.original/spec/mock_json/app/subscriptions.json delete mode 100644 fb_graph2.original/spec/mock_json/app/test_users.json delete mode 100644 fb_graph2.original/spec/mock_json/blank_collection.json delete mode 100644 fb_graph2.original/spec/mock_json/error/400/191.json delete mode 100644 fb_graph2.original/spec/mock_json/error/400/2500.json delete mode 100644 fb_graph2.original/spec/mock_json/error/invalid_format.json delete mode 100644 fb_graph2.original/spec/mock_json/event/attending.json delete mode 100644 fb_graph2.original/spec/mock_json/event/declined.json delete mode 100644 fb_graph2.original/spec/mock_json/event/invited.json delete mode 100644 fb_graph2.original/spec/mock_json/event/maybe.json delete mode 100644 fb_graph2.original/spec/mock_json/event/noreply.json delete mode 100644 fb_graph2.original/spec/mock_json/group/members.json delete mode 100644 fb_graph2.original/spec/mock_json/page/admins.json delete mode 100644 fb_graph2.original/spec/mock_json/page/block_succeeded.json delete mode 100644 fb_graph2.original/spec/mock_json/page/blocked.json delete mode 100644 fb_graph2.original/spec/mock_json/page/milestones.json delete mode 100644 fb_graph2.original/spec/mock_json/page/offers.json delete mode 100644 fb_graph2.original/spec/mock_json/page/promotable_posts.json delete mode 100644 fb_graph2.original/spec/mock_json/page/roles.json delete mode 100644 fb_graph2.original/spec/mock_json/page/roles_single.json delete mode 100644 fb_graph2.original/spec/mock_json/page/settings.json delete mode 100644 fb_graph2.original/spec/mock_json/page/with_optional_fields.json delete mode 100644 fb_graph2.original/spec/mock_json/post/comments.json delete mode 100644 fb_graph2.original/spec/mock_json/post/comments_with_summary.json delete mode 100644 fb_graph2.original/spec/mock_json/post/liked_and_commented.json delete mode 100644 fb_graph2.original/spec/mock_json/post/likes.json delete mode 100644 fb_graph2.original/spec/mock_json/post/shared_posts.json delete mode 100644 fb_graph2.original/spec/mock_json/search/user.json delete mode 100644 fb_graph2.original/spec/mock_json/success_true.json delete mode 100644 fb_graph2.original/spec/mock_json/success_with_id.json delete mode 100644 fb_graph2.original/spec/mock_json/token_metadata/app_token.json delete mode 100644 fb_graph2.original/spec/mock_json/token_metadata/invalid_token.json delete mode 100644 fb_graph2.original/spec/mock_json/token_metadata/page_token.json delete mode 100644 fb_graph2.original/spec/mock_json/token_metadata/user_token.json delete mode 100644 fb_graph2.original/spec/mock_json/token_response.json delete mode 100644 fb_graph2.original/spec/mock_json/true.json delete mode 100644 fb_graph2.original/spec/mock_json/user/accounts.json delete mode 100644 fb_graph2.original/spec/mock_json/user/achievements.json delete mode 100644 fb_graph2.original/spec/mock_json/user/activities.json delete mode 100644 fb_graph2.original/spec/mock_json/user/albums.json delete mode 100644 fb_graph2.original/spec/mock_json/user/applications.json delete mode 100644 fb_graph2.original/spec/mock_json/user/books.json delete mode 100644 fb_graph2.original/spec/mock_json/user/events.json delete mode 100644 fb_graph2.original/spec/mock_json/user/feed.json delete mode 100644 fb_graph2.original/spec/mock_json/user/friend_lists.json delete mode 100644 fb_graph2.original/spec/mock_json/user/friends.json delete mode 100644 fb_graph2.original/spec/mock_json/user/groups.json delete mode 100644 fb_graph2.original/spec/mock_json/user/home.json delete mode 100644 fb_graph2.original/spec/mock_json/user/inbox.json delete mode 100644 fb_graph2.original/spec/mock_json/user/interests.json delete mode 100644 fb_graph2.original/spec/mock_json/user/invitable_friends.json delete mode 100644 fb_graph2.original/spec/mock_json/user/likes.json delete mode 100644 fb_graph2.original/spec/mock_json/user/links.json delete mode 100644 fb_graph2.original/spec/mock_json/user/me.json delete mode 100644 fb_graph2.original/spec/mock_json/user/me_with_ext_attrs.json delete mode 100644 fb_graph2.original/spec/mock_json/user/movies.json delete mode 100644 fb_graph2.original/spec/mock_json/user/music.json delete mode 100644 fb_graph2.original/spec/mock_json/user/notifications.json delete mode 100644 fb_graph2.original/spec/mock_json/user/outbox.json delete mode 100644 fb_graph2.original/spec/mock_json/user/permissions.json delete mode 100644 fb_graph2.original/spec/mock_json/user/photos.json delete mode 100644 fb_graph2.original/spec/mock_json/user/picture.json delete mode 100644 fb_graph2.original/spec/mock_json/user/pokes.json delete mode 100644 fb_graph2.original/spec/mock_json/user/posts.json delete mode 100644 fb_graph2.original/spec/mock_json/user/scores.json delete mode 100644 fb_graph2.original/spec/mock_json/user/statuses.json delete mode 100644 fb_graph2.original/spec/mock_json/user/taggable_friends.json delete mode 100644 fb_graph2.original/spec/mock_json/user/television.json delete mode 100644 fb_graph2.original/spec/mock_json/user/videos.json delete mode 100644 fb_graph2.original/spec/spec_helper.rb delete mode 100644 fb_graph2.original/spec/spec_helper/mock_graph.rb rename {fb_graph2.original/lib => lib}/fb_graph2/auth/signed_request.rb (100%) diff --git a/fb_graph2.original/.gitignore b/fb_graph2.original/.gitignore deleted file mode 100644 index 1d3b2f4..0000000 --- a/fb_graph2.original/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -*.gem -*.rbc -.bundle -.config -.yardoc -Gemfile.lock -InstalledFiles -_yardoc -coverage -doc/ -lib/bundler/man -pkg -rdoc -spec/reports -test/tmp -test/version_tmp -tmp -*.bundle -*.so -*.o -*.a -mkmf.log -wiki -samples diff --git a/fb_graph2.original/.rspec b/fb_graph2.original/.rspec deleted file mode 100644 index d3ad5a9..0000000 --- a/fb_graph2.original/.rspec +++ /dev/null @@ -1,2 +0,0 @@ ---color ---format=documentation diff --git a/fb_graph2.original/.travis.yml b/fb_graph2.original/.travis.yml deleted file mode 100644 index 2abcd8c..0000000 --- a/fb_graph2.original/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -rvm: - - 2.0.0 - - 2.1.2 \ No newline at end of file diff --git a/fb_graph2.original/Gemfile b/fb_graph2.original/Gemfile deleted file mode 100644 index 0218224..0000000 --- a/fb_graph2.original/Gemfile +++ /dev/null @@ -1,4 +0,0 @@ -source 'https://rubygems.org' - -# Specify your gem's dependencies in fb_graph2.gemspec -gemspec diff --git a/fb_graph2.original/LICENSE.txt b/fb_graph2.original/LICENSE.txt deleted file mode 100644 index edd687d..0000000 --- a/fb_graph2.original/LICENSE.txt +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2014 nov matake - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/fb_graph2.original/README.md b/fb_graph2.original/README.md deleted file mode 100644 index 43cd7de..0000000 --- a/fb_graph2.original/README.md +++ /dev/null @@ -1,29 +0,0 @@ -# FbGraph2 - -Similar to [fb_graph gem](https://github.com/nov/fb_graph), but supports Graph API v2.0+. - -## Installation - -Add this line to your application's Gemfile: - - gem 'fb_graph2' - -And then execute: - - $ bundle - -Or install it yourself as: - - $ gem install fb_graph2 - -## Usage - -See [fb_graph2 Wiki](https://github.com/nov/fb_graph2/wiki). - -## Contributing - -1. Fork it ( https://github.com/[my-github-username]/fb_graph2/fork ) -2. Create your feature branch (`git checkout -b my-new-feature`) -3. Commit your changes (`git commit -am 'Add some feature'`) -4. Push to the branch (`git push origin my-new-feature`) -5. Create a new Pull Request diff --git a/fb_graph2.original/Rakefile b/fb_graph2.original/Rakefile deleted file mode 100644 index 0eb4268..0000000 --- a/fb_graph2.original/Rakefile +++ /dev/null @@ -1,18 +0,0 @@ -require 'bundler/gem_tasks' - -require 'rspec/core/rake_task' -RSpec::Core::RakeTask.new(:spec) - -namespace :coverage do - desc 'Open coverage report' - task :report do - require 'simplecov' - `open '#{File.join SimpleCov.coverage_path, 'index.html'}'` - end -end - -task :spec do - Rake::Task[:'coverage:report'].invoke unless ENV['TRAVIS_RUBY_VERSION'] -end - -task default: :spec \ No newline at end of file diff --git a/fb_graph2.original/VERSION b/fb_graph2.original/VERSION deleted file mode 100644 index 79a2734..0000000 --- a/fb_graph2.original/VERSION +++ /dev/null @@ -1 +0,0 @@ -0.5.0 \ No newline at end of file diff --git a/fb_graph2.original/fb_graph2.gemspec b/fb_graph2.original/fb_graph2.gemspec deleted file mode 100644 index 77fe2f7..0000000 --- a/fb_graph2.original/fb_graph2.gemspec +++ /dev/null @@ -1,26 +0,0 @@ -Gem::Specification.new do |gem| - gem.name = 'fb_graph2' - gem.version = File.read('VERSION').delete("\n\r") - gem.authors = ['nov matake'] - gem.email = ['nov@matake.jp'] - gem.summary = %q{Facebook Graph API v2.0 Wrapper in Ruby} - gem.description = %q{Facebook Graph API v2.0 Wrapper in Ruby} - gem.homepage = 'https://github.com/nov/fb_graph2' - gem.license = 'MIT' - - gem.files = `git ls-files -z`.split("\x0") - gem.executables = gem.files.grep(%r{^bin/}) { |f| File.basename(f) } - gem.test_files = gem.files.grep(%r{^(test|gem|features)/}) - gem.require_paths = ['lib'] - - gem.add_runtime_dependency 'httpclient', '>= 2.4' - gem.add_runtime_dependency 'rack-oauth2', '>= 1.0' - gem.add_runtime_dependency 'url_safe_base64' - gem.add_runtime_dependency 'multi_json' - gem.add_runtime_dependency 'activesupport', '>= 3.2' - gem.add_development_dependency 'rake' - gem.add_development_dependency 'simplecov' - gem.add_development_dependency 'webmock' - gem.add_development_dependency 'rspec' - gem.add_development_dependency 'rspec-its' -end diff --git a/fb_graph2.original/lib/fb_graph2.rb b/fb_graph2.original/lib/fb_graph2.rb deleted file mode 100644 index f73ecd7..0000000 --- a/fb_graph2.original/lib/fb_graph2.rb +++ /dev/null @@ -1,56 +0,0 @@ -require 'active_support' -require 'active_support/core_ext' -require 'rack/oauth2' - -module FbGraph2 - mattr_accessor :root_url, :api_version, :gem_version, :logger, :debugging, :_http_config_, :object_classes - - self.root_url = 'https://graph.facebook.com' - self.api_version = 'v2.0' - self.gem_version = File.read(File.join(__dir__, '../VERSION')).delete("\n\r") - self.logger = Logger.new(STDOUT) - self.logger.progname = 'FbGraph2' - self.object_classes = Array.new - - class << self - def debugging? - !!self.debugging - end - def debug! - Rack::OAuth2.debug! - self.debugging = true - end - - def http_client(access_token = nil) - _http_client_ = HTTPClient.new( - agent_name: "FbGraph2 (#{gem_version})" - ) - _http_client_.request_filter.delete_if do |filter| - filter.is_a? HTTPClient::WWWAuth - end - _http_client_.request_filter << RequestFilter::Authenticator.new(access_token) if access_token.present? - _http_client_.request_filter << RequestFilter::Debugger.new if self.debugging? - _http_config_.try(:call, _http_client_) - _http_client_ - end - def http_config(&block) - Rack::OAuth2.http_config &block unless Rack::OAuth2.http_config - self._http_config_ ||= block - end - end -end - -require 'fb_graph2/exception' -require 'fb_graph2/attribute_assigner' -require 'fb_graph2/node' -require 'fb_graph2/collection' -require 'fb_graph2/searchable' -require 'fb_graph2/edge' -[ - '.', - 'request_filter' -].each do |dir| - Dir[File.join(__dir__, 'fb_graph2', dir, '*.rb')].each do |file| - require file - end -end diff --git a/fb_graph2.original/lib/fb_graph2/achievement.rb b/fb_graph2.original/lib/fb_graph2/achievement.rb deleted file mode 100644 index 92005bb..0000000 --- a/fb_graph2.original/lib/fb_graph2/achievement.rb +++ /dev/null @@ -1,21 +0,0 @@ -module FbGraph2 - class Achievement < Node - include Edge::Comments - include Edge::Likes::LikeeContext - - register_attributes( - raw: [:type, :no_feed_story], - time: [:publish_time], - app: [:application], - user: [:from], - custom: [:data] - ) - - def initialize(id, attributes = {}) - super - if attributes.include? :data - self.data = attributes[:data] - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/achievement_type.rb b/fb_graph2.original/lib/fb_graph2/achievement_type.rb deleted file mode 100644 index fcd798d..0000000 --- a/fb_graph2.original/lib/fb_graph2/achievement_type.rb +++ /dev/null @@ -1,11 +0,0 @@ -module FbGraph2 - class AchievementType < Node - register_attributes( - raw: [:type, :title, :url, :description, :is_scraped], - time: [:updated_time, :created_time], - picture: [:image], - app: [:application], - custom: [:data, :context] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/album.rb b/fb_graph2.original/lib/fb_graph2/album.rb deleted file mode 100644 index 1d400d9..0000000 --- a/fb_graph2.original/lib/fb_graph2/album.rb +++ /dev/null @@ -1,16 +0,0 @@ -module FbGraph2 - class Album < Node - include Edge::Comments - include Edge::Likes::LikeeContext - include Edge::Picture - include Edge::Photos - include Edge::SharedPosts - - register_attributes( - raw: [:can_upload, :count, :cover_photo, :description, :link, :location, :name, :privacy, :type], - time: [:created_time, :updated_time], - user: [:from], - page: [:place] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/app.rb b/fb_graph2.original/lib/fb_graph2/app.rb deleted file mode 100644 index e09ceb1..0000000 --- a/fb_graph2.original/lib/fb_graph2/app.rb +++ /dev/null @@ -1,45 +0,0 @@ -module FbGraph2 - class App < Node - include Edge::Achievements - include Edge::AppLinkHosts - include Edge::AppEventTypes - include Edge::Banned - include Edge::Groups - include Edge::Permissions - include Edge::Picture - include Edge::Roles::AppContext - include Edge::Scores - include Edge::StaticResources - include Edge::Subscriptions - include Edge::TestUsers - include Edge::Translations - - register_attributes( - raw: [ - :android_key_hash, :app_domains, :auth_dialog_data_help_url, :auth_dialog_headline, - :auth_dialog_perms_explanation, :auth_referral_enabled, :auth_referral_extended_perms, - :auth_referral_friend_perms, :auth_referral_user_perms, :canvas_fluid_height, :canvas_fluid_width, - :canvas_url, :category, :company, :contact_email, :creator_uid, :daily_active_users, :daily_active_users_rank, - :deauth_callback_url, :description, :hosting_url, :icon_url, :ios_bundle_id, :iphone_app_store_id, - :link, :logo_url, :mobile_web_url, :monthly_active_users, :monthly_active_users_rank, :name, - :namespace, :page_tab_default_name, :page_tab_url, :privacy_policy_url, :secure_canvas_url, - :secure_page_tab_url, :server_ip_whitelist, :social_discovery, :subcategory, :terms_of_service_url, - :user_support_email, :user_support_url, :website_url, :weekly_active_users - ], - timestamp: [:created_time], - custom: [ - :auth_referral_default_activity_privacy, :auth_referral_response_type, :context, :migrations, - :object_store_urls, :restrictions - ] - ) - - def initialize(id, attributes = {}) - super - # TODO: handle custom attributes. - end - - def self.app(access_token) - new(:app).authenticate access_token - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/app_link_host.rb b/fb_graph2.original/lib/fb_graph2/app_link_host.rb deleted file mode 100644 index ec00496..0000000 --- a/fb_graph2.original/lib/fb_graph2/app_link_host.rb +++ /dev/null @@ -1,33 +0,0 @@ -module FbGraph2 - class AppLinkHost < Node - register_attributes( - raw: [:name, :canonical_url], - custom: [:ios, :iphone, :ipad, :android, :windows_phone, :web] - ) - - def initialize(id, attributes = {}) - super - [:ios, :iphone, :ipad, :android, :windows_phone].each do |link_attr| - if attributes.include? link_attr - self.send :"#{link_attr}=", collect_links(attributes, link_attr) - end - end - end - - private - - def collect_links(attributes, link_attr) - Collection.new(attributes[link_attr]).collect! do |link| - klass = case link_attr - when :ios, :iphone, :ipad - Struct::AppLink::Native::IOS - when :android - Struct::AppLink::Native::Android - when :windows_phone - Struct::AppLink::Native::WindowsPhone - end - klass.new link - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/attribute_assigner.rb b/fb_graph2.original/lib/fb_graph2/attribute_assigner.rb deleted file mode 100644 index ce1dcfb..0000000 --- a/fb_graph2.original/lib/fb_graph2/attribute_assigner.rb +++ /dev/null @@ -1,103 +0,0 @@ -module FbGraph2 - module AttributeAssigner - extend ActiveSupport::Concern - - included do - extend ClassMethods - attr_accessor :raw_attributes - cattr_accessor :registered_attributes - end - - module ClassMethods - def register_attributes(attributes) - self.registered_attributes = attributes - send :attr_accessor, *attributes.values.flatten - end - end - - def assign(attributes) - Array(self.class.registered_attributes).each do |type, keys| - keys.each do |key| - if attributes.include? key - raw = attributes[key] - value = case type - when :raw - raw - when :int_flag - raw == 1 - when :date - Date.strptime raw, '%m/%d/%Y' rescue raw - when :time - Time.parse raw rescue raw - when :timestamp - Time.at raw - when :actions - Collection.new(raw).collect! do |_raw_| - Struct::Action.new _raw_ - end - when :album - Album.new raw[:id], raw - when :app - App.new raw[:id], raw - when :comment - Comment.new raw[:id], raw - when :group - Group.new raw[:id], raw - when :image_sources - Collection.new(raw).collect! do |_raw_| - Struct::ImageSource.new _raw_ - end - when :messages - Collection.new(raw).collect! do |_raw_| - Message.new _raw_[:id], _raw_ - end - when :page - Page.new raw[:id], raw - when :pages - Collection.new(raw).collect! do |_raw_| - Page.new _raw_[:id], _raw_ - end - when :photo - Photo.new raw[:id], raw - when :picture - Struct::Picture.new raw[:data] - when :profile - as_profile raw - when :profiles - Collection.new(raw).collect! do |_raw_| - as_profile _raw_ - end - when :user - User.new raw[:id], raw - when :users - Collection.new(raw).collect! do |_raw_| - User.new _raw_[:id], _raw_ - end - else - # NOTE: handle these attributes in each class - next - end - self.send :"#{key}=", value - end - end - end - end - - private - - def as_profile(raw) - klass = if raw.include? :namespace - App - elsif raw.include? :category - Page - elsif raw.include? :start_time - Event - elsif raw.include? :owner - Group - else - User - end - klass.new raw[:id], raw - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/auth.rb b/fb_graph2.original/lib/fb_graph2/auth.rb deleted file mode 100644 index dab1810..0000000 --- a/fb_graph2.original/lib/fb_graph2/auth.rb +++ /dev/null @@ -1,59 +0,0 @@ -module FbGraph2 - class Auth < Rack::OAuth2::Client - class Grant - class FbExchangeToken < Rack::OAuth2::Client::Grant - attr_required :fb_exchange_token - end - end - - def initialize(client_id, client_secret, options = {}) - super options.merge( - identifier: client_id, - secret: client_secret, - host: URI.parse(FbGraph2.root_url).host, - authorization_endpoint: '/oauth/authorize', - token_endpoint: '/oauth/access_token' - ) - end - - def fb_exchange_token=(access_token) - @grant = Grant::FbExchangeToken.new( - fb_exchange_token: access_token - ) - end - - def access_token!(options = {}) - super options.merge( - client_auth_method: :body - ) - rescue Rack::OAuth2::Client::Error => e - raise Exception.detect(e.status, e.response) - end - - def debug_token!(input_token) - token_metadata = TokenMetadata.new - token_metadata.authenticate access_token! - token_metadata.fetch( - input_token: input_token.to_s - ) - end - - def from_cookie(cookie) - token = case cookie - when String - cookie - else - cookie["fbsr_#{identifier}"] - end - from_signed_request token - end - - def from_signed_request(token) - SignedRequest.new(token).verify! self - end - end -end - -Dir[File.join(__dir__, 'auth/*.rb')].each do |file| - require file -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/collection.rb b/fb_graph2.original/lib/fb_graph2/collection.rb deleted file mode 100644 index 81ac1f0..0000000 --- a/fb_graph2.original/lib/fb_graph2/collection.rb +++ /dev/null @@ -1,54 +0,0 @@ -module FbGraph2 - class Collection < Array - attr_accessor :before, :after, :next, :previous, :total_count, :summary - - def initialize(collection = []) - collection = normalize collection - paginate collection[:paging] - summarize collection[:summary] - replace Array(collection[:data]) - end - - private - - def normalize(collection) - case collection - when Hash - collection - when Array - { - data: collection, - count: collection.size - } - else - raise ArgumentError.new("Invalid collection") - end - end - - def paginate(paging) - cursors = paging.try(:[], :cursors) - self.before = cursors.try(:[], :before) - self.after = cursors.try(:[], :after) - self.next = params_in paging.try(:[], :next) - self.previous = params_in paging.try(:[], :previous) - end - - def summarize(summary) - self.summary = summary - self.total_count = summary.try(:[], :total_count) - if summary.try(:[], :updated_time) - self.summary[:updated_time] = Time.parse summary[:updated_time] - end - end - - def params_in(url) - if url - Rack::Utils.parse_nested_query( - URI.parse(url).query - ).inject({}) do |params, (key, value)| - params.merge! key => value - end.with_indifferent_access - end - end - end -end diff --git a/fb_graph2.original/lib/fb_graph2/comment.rb b/fb_graph2.original/lib/fb_graph2/comment.rb deleted file mode 100644 index f0bf963..0000000 --- a/fb_graph2.original/lib/fb_graph2/comment.rb +++ /dev/null @@ -1,20 +0,0 @@ -module FbGraph2 - class Comment < Node - include Edge::Comments - include Edge::Likes::LikeeContext - - register_attributes( - raw: [:can_comment, :can_remove, :comment_count, :like_count, :message, :user_likes, :is_hidden, :can_hide], - time: [:created_time], - user: [:from], - comment: [:parent], - profiles: [:message_tags], - custom: [:attachment] - ) - - def initialize(id, attributes = {}) - super - # TODO: handle custom attributes. - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/domain.rb b/fb_graph2.original/lib/fb_graph2/domain.rb deleted file mode 100644 index 50f632c..0000000 --- a/fb_graph2.original/lib/fb_graph2/domain.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Domain < Node - include Edge::Insights - - register_attributes( - raw: [:name] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge.rb b/fb_graph2.original/lib/fb_graph2/edge.rb deleted file mode 100644 index 349df8d..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge.rb +++ /dev/null @@ -1,39 +0,0 @@ -module FbGraph2 - class Edge < Collection - attr_accessor :owner, :edge, :params, :options, :collection - delegate :summary, :total_count, to: :collection - - def initialize(owner, edge, params = {}, options = {}) - self.owner = owner - self.edge = edge - self.params = params - self.options = options - self.collection = options.delete(:collection) || Collection.new - replace collection - end - - def next(_options_ = {}) - if collection.next.present? - owner.send edge, options.merge(collection.next).merge(_options_) - elsif collection.after.present? - owner.send edge, options.merge(after: collection.after).merge(_options_) - else - self.class.new owner, edge - end - end - - def previous(_options_ = {}) - if self.collection.previous.present? - owner.send edge, options.merge(collection.previous).merge(_options_) - elsif collection.before.present? - owner.send edge, options.merge(before: collection.before).merge(_options_) - else - self.class.new owner, edge - end - end - end -end - -Dir[File.join(__dir__, 'edge/*.rb')].each do |file| - require file -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/accounts.rb b/fb_graph2.original/lib/fb_graph2/edge/accounts.rb deleted file mode 100644 index b0bca8b..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/accounts.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Accounts - def accounts(params = {}) - pages = self.edge :accounts, params - pages.collect! do |page| - Page.new(page[:id], page).authenticate page[:access_token] - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/achievements.rb b/fb_graph2.original/lib/fb_graph2/edge/achievements.rb deleted file mode 100644 index 8d687ef..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/achievements.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Achievements - def achievements(params = {}) - achievements = self.edge :achievements, params - achievements.collect! do |achievement| - Achievement.new(achievement[:id], achievement).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/activities.rb b/fb_graph2.original/lib/fb_graph2/edge/activities.rb deleted file mode 100644 index 3c9c52b..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/activities.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Activities - def activities(params = {}) - pages = self.edge :activities, params - pages.collect! do |page| - Page.new(page[:id], page).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/admins.rb b/fb_graph2.original/lib/fb_graph2/edge/admins.rb deleted file mode 100644 index b96587f..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/admins.rb +++ /dev/null @@ -1,17 +0,0 @@ -module FbGraph2 - class Edge - module Admins - def admins(params = {}) - users = self.edge :admins, params - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - end - - def admin?(user, params = {}) - users = self.edge :admins, params, edge_scope: user - users.present? - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/albums.rb b/fb_graph2.original/lib/fb_graph2/edge/albums.rb deleted file mode 100644 index 4adfd6e..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/albums.rb +++ /dev/null @@ -1,17 +0,0 @@ -module FbGraph2 - class Edge - module Albums - def albums(params = {}) - albums = self.edge :albums, params - albums.collect! do |album| - Album.new(album[:id], album).authenticate self.access_token - end - end - - def album!(params = {}) - album = self.post params, edge: :albums - Album.new(album[:id], params.merge(album)).authenticate self.access_token - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/app_event_types.rb b/fb_graph2.original/lib/fb_graph2/edge/app_event_types.rb deleted file mode 100644 index 37c6feb..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/app_event_types.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module AppEventTypes - def app_event_types(params = {}) - types = self.edge :app_event_types, params - types.collect! do |type| - Struct::AppEventType.new type - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/app_link_hosts.rb b/fb_graph2.original/lib/fb_graph2/edge/app_link_hosts.rb deleted file mode 100644 index dad64ba..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/app_link_hosts.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module AppLinkHosts - def app_link_hosts(params = {}) - hosts = self.edge :app_link_hosts, params - hosts.collect! do |host| - AppLinkHost.new(hosts[:id], hosts).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/app_requests.rb b/fb_graph2.original/lib/fb_graph2/edge/app_requests.rb deleted file mode 100644 index fec5f08..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/app_requests.rb +++ /dev/null @@ -1,22 +0,0 @@ -module FbGraph2 - class Edge - module AppRequests - def app_requests(params = {}) - requests = self.edge :apprequests, params - requests.collect! do |request| - Request.new(request[:id], request).authenticate self.access_token - end - end - alias_method :apprequests, :app_requests - - def app_request!(params = {}) - response = self.post params, edge: :apprequests - if request = response[:request] - response[:request] = Request.new(request[:id], request).authenticate self.access_token - end - response - end - alias_method :apprequest!, :app_request! - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/applications.rb b/fb_graph2.original/lib/fb_graph2/edge/applications.rb deleted file mode 100644 index dc6ac23..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/applications.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Applications - def applications(params = {}) - apps = self.edge :applications, params, edge_scope: :developer - apps.collect! do |app| - App.new(app[:id], app).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/attending.rb b/fb_graph2.original/lib/fb_graph2/edge/attending.rb deleted file mode 100644 index dfaf6a0..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/attending.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Attending - def attending(params = {}) - users = self.edge :attending, params - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/banned.rb b/fb_graph2.original/lib/fb_graph2/edge/banned.rb deleted file mode 100644 index d0df340..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/banned.rb +++ /dev/null @@ -1,29 +0,0 @@ -module FbGraph2 - class Edge - module Banned - def banned(params = {}) - users = self.edge :banned, params - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - end - - def banned?(user, params = {}) - users = self.edge :banned, params, edge_scope: user - users.present? - end - - def ban!(user, params = {}) - self.post params.merge( - uid: Util.as_identifier(user) - ), edge: :banned - end - - def unban!(user, params = {}) - self.delete params.merge( - uid: Util.as_identifier(user) - ), edge: :banned - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/blocked.rb b/fb_graph2.original/lib/fb_graph2/edge/blocked.rb deleted file mode 100644 index 77c7e74..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/blocked.rb +++ /dev/null @@ -1,29 +0,0 @@ -module FbGraph2 - class Edge - module Blocked - def blocked(params = {}) - users = self.edge :blocked, params - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - end - - def blocked?(user, params = {}) - users = self.edge :blocked, params, edge_scope: user - users.present? - end - - def block!(user, params = {}) - self.post params.merge( - user: Util.as_identifier(user) - ), edge: :blocked - end - - def unblock!(user, params = {}) - self.delete params.merge( - user: Util.as_identifier(user) - ), edge: :blocked - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/books.rb b/fb_graph2.original/lib/fb_graph2/edge/books.rb deleted file mode 100644 index 231b55d..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/books.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Books - def books(params = {}) - pages = self.edge :books, params - pages.collect! do |page| - Page.new(page[:id], page).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/comments.rb b/fb_graph2.original/lib/fb_graph2/edge/comments.rb deleted file mode 100644 index 3570824..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/comments.rb +++ /dev/null @@ -1,28 +0,0 @@ -module FbGraph2 - class Edge - module Comments - def assign(attributes) - super - if attributes.include? :comments - @_cached_comments = Collection.new attributes[:comments] - end - end - - def comments(params = {}) - comments = if @_cached_comments.present? && params.blank? - @_cached_comments - else - self.edge :comments, params - end - comments.collect! do |comment| - Comment.new(comment[:id], comment).authenticate self.access_token - end - end - - def comment!(params = {}) - comment = self.post params, edge: :comments - Comment.new(comment[:id], params.merge(comment)).authenticate self.access_token - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/declined.rb b/fb_graph2.original/lib/fb_graph2/edge/declined.rb deleted file mode 100644 index 41e7895..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/declined.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Declined - def declined(params = {}) - users = self.edge :declined, params - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/dispute.rb b/fb_graph2.original/lib/fb_graph2/edge/dispute.rb deleted file mode 100644 index f38eaf7..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/dispute.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Edge - module Dispute - def dispute!(params = {}) - self.post params, edge: :dispute - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/docs.rb b/fb_graph2.original/lib/fb_graph2/edge/docs.rb deleted file mode 100644 index 5ebf8d2..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/docs.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Docs - def docs(params = {}) - docs = self.edge :docs, params - docs.collect! do |doc| - GroupDoc.new(doc[:id], doc).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/events.rb b/fb_graph2.original/lib/fb_graph2/edge/events.rb deleted file mode 100644 index 989ab70..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/events.rb +++ /dev/null @@ -1,13 +0,0 @@ -module FbGraph2 - class Edge - module Events - def events(*args) - params = args.extract_options! - events = self.edge :events, params, edge_scope: args.first - events.collect! do |event| - Event.new(event[:id], event).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/family.rb b/fb_graph2.original/lib/fb_graph2/edge/family.rb deleted file mode 100644 index e16e736..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/family.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Family - def family(params = {}) - users = self.edge :family, params - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/feed.rb b/fb_graph2.original/lib/fb_graph2/edge/feed.rb deleted file mode 100644 index ae8d797..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/feed.rb +++ /dev/null @@ -1,17 +0,0 @@ -module FbGraph2 - class Edge - module Feed - def feed(params = {}) - posts = self.edge :feed, params - posts.collect! do |post| - Post.new(post[:id], post).authenticate self.access_token - end - end - - def feed!(params = {}) - post = self.post params, edge: :feed - Post.new(post[:id], params.merge(post)).authenticate self.access_token - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/files.rb b/fb_graph2.original/lib/fb_graph2/edge/files.rb deleted file mode 100644 index bcc2b18..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/files.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Files - def files(params = {}) - files = self.edge :files, params - files.collect! do |file| - Struct::GroupFile.new file - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/friend_lists.rb b/fb_graph2.original/lib/fb_graph2/edge/friend_lists.rb deleted file mode 100644 index 4709064..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/friend_lists.rb +++ /dev/null @@ -1,13 +0,0 @@ -module FbGraph2 - class Edge - module FriendLists - def friend_lists(params = {}) - friend_lists = self.edge :friendlists, params - friend_lists.collect! do |friend_list| - FriendList.new(friend_list[:id], friend_list).authenticate self.access_token - end - end - alias_method :friendlists, :friend_lists - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/friends.rb b/fb_graph2.original/lib/fb_graph2/edge/friends.rb deleted file mode 100644 index 1a16631..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/friends.rb +++ /dev/null @@ -1,17 +0,0 @@ -module FbGraph2 - class Edge - module Friends - def friends(params = {}) - users = self.edge :friends, params - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - end - - def friend?(user, params = {}) - users = self.edge :friends, params, edge_scope: user - users.present? - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/games.rb b/fb_graph2.original/lib/fb_graph2/edge/games.rb deleted file mode 100644 index b5f9bc0..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/games.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Games - def games(params = {}) - pages = self.edge :games, params - pages.collect! do |page| - Page.new(page[:id], page).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/global_brand_children.rb b/fb_graph2.original/lib/fb_graph2/edge/global_brand_children.rb deleted file mode 100644 index 76bfd98..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/global_brand_children.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module GlobalBrandChildren - def global_brand_children(params = {}) - pages = self.edge :global_brand_children, params - pages.collect! do |page| - Page.new(page[:id], page).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/groups.rb b/fb_graph2.original/lib/fb_graph2/edge/groups.rb deleted file mode 100644 index c979205..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/groups.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Groups - def groups(params = {}) - groups = self.edge :groups, params - groups.collect! do |group| - Group.new(group[:id], group).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/home.rb b/fb_graph2.original/lib/fb_graph2/edge/home.rb deleted file mode 100644 index 14037a0..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/home.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Home - def home(params = {}) - posts = self.edge :home, params - posts.collect! do |post| - Post.new(post[:id], post).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/inbox.rb b/fb_graph2.original/lib/fb_graph2/edge/inbox.rb deleted file mode 100644 index b739c5a..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/inbox.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Inbox - def inbox(params = {}) - threads = self.edge :inbox, params - threads.collect! do |thread| - Thread.new(thread[:id], thread).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/insights.rb b/fb_graph2.original/lib/fb_graph2/edge/insights.rb deleted file mode 100644 index 660f646..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/insights.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Insights - def insights(params = {}) - insights = self.edge :insights, params - insights.collect! do |insight| - Insight.new(insight[:id], insight).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/interests.rb b/fb_graph2.original/lib/fb_graph2/edge/interests.rb deleted file mode 100644 index b2e5d51..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/interests.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Interests - def interests(params = {}) - pages = self.edge :interests, params - pages.collect! do |page| - Page.new(page[:id], page).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/invitable_friends.rb b/fb_graph2.original/lib/fb_graph2/edge/invitable_friends.rb deleted file mode 100644 index 0c21076..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/invitable_friends.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module InvitableFriends - def invitable_friends(params = {}) - invitable_friends = self.edge :invitable_friends, params - invitable_friends.collect! do |friend| - Struct::Friend.new friend - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/invited.rb b/fb_graph2.original/lib/fb_graph2/edge/invited.rb deleted file mode 100644 index 2b3f0ee..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/invited.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Invited - def invited(params = {}) - users = self.edge :invited, params - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/likes.rb b/fb_graph2.original/lib/fb_graph2/edge/likes.rb deleted file mode 100644 index 23011a6..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/likes.rb +++ /dev/null @@ -1,47 +0,0 @@ -module FbGraph2 - class Edge - module Likes - module LikerContext - def likes(params = {}) - pages = self.edge :likes, params - pages.collect! do |page| - Page.new(page[:id], page).authenticate self.access_token - end - end - - def liked?(page, params = {}) - pages = self.edge :likes, params, edge_scope: page - pages.present? - end - end - - module LikeeContext - def assign(attributes) - super - if attributes.include? :likes - @_cached_likes = Collection.new attributes[:likes] - end - end - - def likes(params = {}) - users = if @_cached_likes.present? && params.blank? - @_cached_likes - else - self.edge :likes, params - end - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - end - - def like!(params = {}) - self.post params, edge: :likes - end - - def unlike!(params = {}) - self.delete params, edge: :likes - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/links.rb b/fb_graph2.original/lib/fb_graph2/edge/links.rb deleted file mode 100644 index f18bcca..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/links.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Links - def links(params = {}) - posts = self.edge :links, params - posts.collect! do |post| - Post.new(post[:id], post).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/locations.rb b/fb_graph2.original/lib/fb_graph2/edge/locations.rb deleted file mode 100644 index 8c4d6de..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/locations.rb +++ /dev/null @@ -1,14 +0,0 @@ -module FbGraph2 - class Edge - module Locations - def locations(params = {}) - pages = self.edge :locations, params - pages.collect! do |page| - Page.new(page[:id], page).authenticate self.access_token - end - end - - # TODO: add, delete and update locations - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/maybe.rb b/fb_graph2.original/lib/fb_graph2/edge/maybe.rb deleted file mode 100644 index 8356d60..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/maybe.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Maybe - def maybe(params = {}) - users = self.edge :maybe, params - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/members.rb b/fb_graph2.original/lib/fb_graph2/edge/members.rb deleted file mode 100644 index 61bc53e..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/members.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Members - def members(params = {}) - users = self.edge :members, params - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/milestones.rb b/fb_graph2.original/lib/fb_graph2/edge/milestones.rb deleted file mode 100644 index 723f32c..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/milestones.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Milestones - def milestones(params = {}) - milestones = self.edge :milestones, params - milestones.collect! do |milestone| - Milestone.new(milestone[:id], milestone).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/movies.rb b/fb_graph2.original/lib/fb_graph2/edge/movies.rb deleted file mode 100644 index 2d680dc..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/movies.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Movies - def movies(params = {}) - pages = self.edge :movies, params - pages.collect! do |page| - Page.new(page[:id], page).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/music.rb b/fb_graph2.original/lib/fb_graph2/edge/music.rb deleted file mode 100644 index f5ca76f..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/music.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Music - def music(params = {}) - pages = self.edge :music, params - pages.collect! do |page| - Page.new(page[:id], page).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/noreply.rb b/fb_graph2.original/lib/fb_graph2/edge/noreply.rb deleted file mode 100644 index 145a08b..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/noreply.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Noreply - def noreply(params = {}) - users = self.edge :noreply, params - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/notifications.rb b/fb_graph2.original/lib/fb_graph2/edge/notifications.rb deleted file mode 100644 index 0537781..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/notifications.rb +++ /dev/null @@ -1,17 +0,0 @@ -module FbGraph2 - class Edge - module Notifications - def notifications(params = {}) - notifications = self.edge :notifications, params - notifications.collect! do |notification| - Notification.new notification[:id], notification - end - end - - def notification!(params = {}) - self.post params, edge: :notifications - end - alias_method :notify!, :notification! - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/offers.rb b/fb_graph2.original/lib/fb_graph2/edge/offers.rb deleted file mode 100644 index ae3641b..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/offers.rb +++ /dev/null @@ -1,17 +0,0 @@ -module FbGraph2 - class Edge - module Offers - def offers(params = {}) - offers = self.edge :offers, params - offers.collect! do |offer| - Offer.new(offer[:id], offer).authenticate self.access_token - end - end - - def offer!(params = {}) - offer = self.post params, edge: :offers - Offer.new(offer[:id], params.merge(offer)).authenticate self.access_token - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/outbox.rb b/fb_graph2.original/lib/fb_graph2/edge/outbox.rb deleted file mode 100644 index c6b2e87..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/outbox.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Outbox - def outbox(params = {}) - threads = self.edge :outbox, params - threads.collect! do |thread| - Thread.new(thread[:id], thread).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/payment_transactions.rb b/fb_graph2.original/lib/fb_graph2/edge/payment_transactions.rb deleted file mode 100644 index b0ca976..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/payment_transactions.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module PaymentTransactions - def payment_transactions(params = {}) - payments = self.edge :payment_transactions, params - payments.collect! do |payment| - Payment.new(payment[:id], payment).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/permissions.rb b/fb_graph2.original/lib/fb_graph2/edge/permissions.rb deleted file mode 100644 index 5656fe6..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/permissions.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Permissions - def permissions(params = {}) - permissions = self.edge :permissions, params - permissions.collect! do |permission| - Struct::Permission.new permission - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/photos.rb b/fb_graph2.original/lib/fb_graph2/edge/photos.rb deleted file mode 100644 index 7ad7c1d..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/photos.rb +++ /dev/null @@ -1,18 +0,0 @@ -module FbGraph2 - class Edge - module Photos - def photos(*args) - params = args.extract_options! - photos = self.edge :photos, params, edge_scope: args.first - photos.collect! do |photo| - Photo.new(photo[:id], photo).authenticate self.access_token - end - end - - def photo!(params = {}) - photo = self.post params, edge: :photos - Photo.new(photo[:id], params.merge(photo)).authenticate self.access_token - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/picture.rb b/fb_graph2.original/lib/fb_graph2/edge/picture.rb deleted file mode 100644 index fba6950..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/picture.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Picture - def picture(*args) - params = args.extract_options! - params[:type] = args.first if args.first - picture = self.get params.merge(redirect: false), edge: :picture - Struct::Picture.new picture[:data] - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/pokes.rb b/fb_graph2.original/lib/fb_graph2/edge/pokes.rb deleted file mode 100644 index 549f9ea..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/pokes.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Pokes - def pokes(params = {}) - pokes = self.edge :pokes, params - pokes.collect! do |poke| - Struct::Poke.new poke - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/posts.rb b/fb_graph2.original/lib/fb_graph2/edge/posts.rb deleted file mode 100644 index f08f6e1..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/posts.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Posts - def posts(params = {}) - posts = self.edge :posts, params - posts.collect! do |post| - Post.new(post[:id], post).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/promotable_posts.rb b/fb_graph2.original/lib/fb_graph2/edge/promotable_posts.rb deleted file mode 100644 index d9d5c71..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/promotable_posts.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module PromotablePosts - def promotable_posts(params = {}) - posts = self.edge :promotable_posts, params - posts.collect! do |post| - Post.new(post[:id], post).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/refunds.rb b/fb_graph2.original/lib/fb_graph2/edge/refunds.rb deleted file mode 100644 index 0bb9922..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/refunds.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Edge - module Refunds - def refund!(params = {}) - self.post params, edge: :refund - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/roles.rb b/fb_graph2.original/lib/fb_graph2/edge/roles.rb deleted file mode 100644 index 3dbc3c2..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/roles.rb +++ /dev/null @@ -1,41 +0,0 @@ -module FbGraph2 - class Edge - module Roles - module AppContext - def roles(params = {}) - roles = self.edge :roles, params - roles.collect! do |role| - Struct::Role.new role - end - end - - def role!(user, params = {}) - self.post params.merge( - user: Util.as_identifier(user) - ), edge: :roles - end - - def unrole!(user, params = {}) - self.post params.merge( - user: Util.as_identifier(user) - ), edge: :roles - end - end - - module PageContext - def roles(*args) - params = args.extract_options! - users = self.edge :roles, params, edge_scope: args.first - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - if args.first.present? - users.first - else - users - end - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/scores.rb b/fb_graph2.original/lib/fb_graph2/edge/scores.rb deleted file mode 100644 index 948344c..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/scores.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Scores - def scores(params = {}) - scores = self.edge :scores, params - scores.collect! do |score| - Struct::Score.new score - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/settings.rb b/fb_graph2.original/lib/fb_graph2/edge/settings.rb deleted file mode 100644 index 2022b61..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/settings.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Settings - def settings(params = {}) - settings = self.edge :settings, params - settings.collect! do |setting| - Struct::Setting.new setting - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/shared_posts.rb b/fb_graph2.original/lib/fb_graph2/edge/shared_posts.rb deleted file mode 100644 index f3888e5..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/shared_posts.rb +++ /dev/null @@ -1,13 +0,0 @@ -module FbGraph2 - class Edge - module SharedPosts - def shared_posts(params = {}) - posts = self.edge :sharedposts, params - posts.collect! do |post| - Post.new(post[:id], post).authenticate self.access_token - end - end - alias_method :sharedposts, :shared_posts - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/static_resources.rb b/fb_graph2.original/lib/fb_graph2/edge/static_resources.rb deleted file mode 100644 index 31351e2..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/static_resources.rb +++ /dev/null @@ -1,13 +0,0 @@ -module FbGraph2 - class Edge - module StaticResources - def static_resources(params = {}) - resources = self.edge :staticresources, params - resources.collect! do |resource| - Struct::StaticResource.new resource - end - end - alias_method :staticresources, :static_resources - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/statuses.rb b/fb_graph2.original/lib/fb_graph2/edge/statuses.rb deleted file mode 100644 index 4ec379f..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/statuses.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Statuses - def statuses(params = {}) - posts = self.edge :statuses, params - posts.collect! do |post| - Post.new(post[:id], post).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/subscriptions.rb b/fb_graph2.original/lib/fb_graph2/edge/subscriptions.rb deleted file mode 100644 index f1f9db0..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/subscriptions.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Subscriptions - def subscriptions(params = {}) - subscriptions = self.edge :subscriptions, params - subscriptions.collect! do |subscription| - Struct::Subscription.new subscription - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/taggable_friends.rb b/fb_graph2.original/lib/fb_graph2/edge/taggable_friends.rb deleted file mode 100644 index 311b51f..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/taggable_friends.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module TaggableFriends - def taggable_friends(params = {}) - taggable_friends = self.edge :taggable_friends, params - taggable_friends.collect! do |friend| - Struct::Friend.new friend - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/tagged.rb b/fb_graph2.original/lib/fb_graph2/edge/tagged.rb deleted file mode 100644 index c076d5d..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/tagged.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Tagged - def tagged(params = {}) - posts = self.edge :tagged, params - posts.collect! do |post| - Post.new(post[:id], post).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/tagged_places.rb b/fb_graph2.original/lib/fb_graph2/edge/tagged_places.rb deleted file mode 100644 index 32e7ee6..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/tagged_places.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module TaggedPlaces - def tagged_places(params = {}) - place_tags = self.edge :tagged_places, params - place_tags.collect! do |place_tag| - PlaceTag.new(place_tag[:id], place_tag).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/tags.rb b/fb_graph2.original/lib/fb_graph2/edge/tags.rb deleted file mode 100644 index 7bd2f47..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/tags.rb +++ /dev/null @@ -1,17 +0,0 @@ -module FbGraph2 - class Edge - module Tags - def tags(params = {}) - users = self.edge :tags, params - users.collect! do |user| - User.new(user[:id], user).authenticate self.access_token - end - end - - # NOTE: available both for create & update - def tag!(params = {}) - self.post params, edge: :tags - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/television.rb b/fb_graph2.original/lib/fb_graph2/edge/television.rb deleted file mode 100644 index d99fe25..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/television.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module Television - def television(params = {}) - pages = self.edge :television, params - pages.collect! do |page| - Page.new(page[:id], page).authenticate self.access_token - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/test_users.rb b/fb_graph2.original/lib/fb_graph2/edge/test_users.rb deleted file mode 100644 index 778a285..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/test_users.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Edge - module TestUsers - def test_users(params = {}) - users = self.edge :accounts, params, edge_scope: :'test-users' - users.collect! do |user| - User.new(user[:id], user) - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/translations.rb b/fb_graph2.original/lib/fb_graph2/edge/translations.rb deleted file mode 100644 index 678cf35..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/translations.rb +++ /dev/null @@ -1,17 +0,0 @@ -module FbGraph2 - class Edge - module Translations - def translations(params = {}) - translations = self.edge :translations, params - translations.collect! do |translation| - Translation.new(translation[:id], translation).authenticate self.authenticate - end - end - - def translation!(params = {}) - self.post params, edge: :translations - end - alias_method :translate!, :translation! - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/edge/videos.rb b/fb_graph2.original/lib/fb_graph2/edge/videos.rb deleted file mode 100644 index f291785..0000000 --- a/fb_graph2.original/lib/fb_graph2/edge/videos.rb +++ /dev/null @@ -1,18 +0,0 @@ -module FbGraph2 - class Edge - module Videos - def videos(*args) - params = args.extract_options! - videos = self.edge :videos, params, edge_scope: args.first - videos.collect! do |video| - Video.new(video[:id], video).authenticate self.access_token - end - end - - def video!(params = {}) - video = self.post params, edge: :videos - Video.new(video[:id], params.merge(video)).authenticate self.access_token - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/event.rb b/fb_graph2.original/lib/fb_graph2/event.rb deleted file mode 100644 index 0428028..0000000 --- a/fb_graph2.original/lib/fb_graph2/event.rb +++ /dev/null @@ -1,23 +0,0 @@ -module FbGraph2 - class Event < Node - include Edge::Attending - include Edge::Declined - include Edge::Feed - include Edge::Invited - include Edge::Maybe - include Edge::Noreply - include Edge::Picture - include Edge::Photos - include Edge::Videos - extend Searchable - - register_attributes( - raw: [:description, :is_date_only, :location, :name, :privacy, :ticket_uri, :timezone], - time: [:end_time, :start_time, :updated_time], - page: [:venue], - profile: [:owner], - group: [:parent_group], - photo: [:cover] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/exception.rb b/fb_graph2.original/lib/fb_graph2/exception.rb deleted file mode 100644 index 4981fcc..0000000 --- a/fb_graph2.original/lib/fb_graph2/exception.rb +++ /dev/null @@ -1,81 +0,0 @@ -module FbGraph2 - class Exception < StandardError - attr_accessor :status, :type, :code - - class << self - def detect(status, body = {}, headers = {}) - error = body[:error] - message = error.try(:[], :message) - klass = detect_from_header(headers, error) || detect_from_status(status) - if klass - klass.new message, error - else - new status, message, error - end - end - - def detect_from_status(status) - case status - when 400 - BadRequest - when 401 - Unauthorized - when 404 - NotFound - when 500 - InternalServerError - end - end - - def detect_from_header(headers, error) - key, value = headers.detect do |name, value| - name.upcase == "WWW-Authenticate".upcase - end || return - matched, klass = ERROR_HEADER_MATCHERS.detect do |matcher, klass_name| - matcher =~ value - end || return - klass - end - end - - def initialize(status, message, error = {}) - super message - self.status = status - self.type = error[:type] - self.code = error[:code] - end - - class BadRequest < Exception - def initialize(message, details = {}) - super 400, message, details - end - end - - class Unauthorized < Exception - def initialize(message, details = {}) - super 401, message, details - end - end - - class NotFound < Exception - def initialize(message, details = {}) - super 404, message, details - end - end - - class InternalServerError < Exception - def initialize(message, details = {}) - super 500, message, details - end - end - - class InvalidToken < Unauthorized; end - class InvalidRequest < BadRequest; end - - ERROR_HEADER_MATCHERS = { - /not_found/ => NotFound, - /invalid_token/ => InvalidToken, - /invalid_request/ => InvalidRequest - } - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/friend_list.rb b/fb_graph2.original/lib/fb_graph2/friend_list.rb deleted file mode 100644 index 8d5344a..0000000 --- a/fb_graph2.original/lib/fb_graph2/friend_list.rb +++ /dev/null @@ -1,7 +0,0 @@ -module FbGraph2 - class FriendList < Node - register_attributes( - raw: [:name, :list_type] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/group.rb b/fb_graph2.original/lib/fb_graph2/group.rb deleted file mode 100644 index 379a295..0000000 --- a/fb_graph2.original/lib/fb_graph2/group.rb +++ /dev/null @@ -1,21 +0,0 @@ -module FbGraph2 - class Group < Node - include Edge::Docs - include Edge::Events - include Edge::Feed - include Edge::Files - include Edge::Members - extend Searchable - - register_attributes( - raw: [ - :description, :email, :icon, :link, :name, :privacy, - # NOTE: in groups edge context - :administrator, :bookmark_order, :unread - ], - time: [:updated_time], - profile: [:owner, :parent], - photo: [:cover] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/group_doc.rb b/fb_graph2.original/lib/fb_graph2/group_doc.rb deleted file mode 100644 index 95b24b8..0000000 --- a/fb_graph2.original/lib/fb_graph2/group_doc.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class GroupDoc < Node - register_attributes( - raw: [:subject, :message, :icon, :revision, :can_edit, :can_delete], - time: [:created_time, :updated_time], - profile: [:from] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/insight.rb b/fb_graph2.original/lib/fb_graph2/insight.rb deleted file mode 100644 index b6b336c..0000000 --- a/fb_graph2.original/lib/fb_graph2/insight.rb +++ /dev/null @@ -1,13 +0,0 @@ -module FbGraph2 - class Insight < Node - register_attributes( - raw: [:name, :description, :title, :period], - custom: [:values] - ) - - def initialize(id, attributes = {}) - super - self.values = attributes[:values].collect(&:with_indifferent_access) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/message.rb b/fb_graph2.original/lib/fb_graph2/message.rb deleted file mode 100644 index 5ca9c3c..0000000 --- a/fb_graph2.original/lib/fb_graph2/message.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Message < Node - register_attributes( - raw: [:message], - time: [:created_time], - profile: [:from] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/milestone.rb b/fb_graph2.original/lib/fb_graph2/milestone.rb deleted file mode 100644 index c04a424..0000000 --- a/fb_graph2.original/lib/fb_graph2/milestone.rb +++ /dev/null @@ -1,13 +0,0 @@ -module FbGraph2 - class Milestone < Node - include Edge::Comments - include Edge::Likes::LikeeContext - include Edge::Photos - - register_attributes( - raw: [:title, :description], - time: [:created_time, :updated_time, :start_time, :end_time], - page: [:from] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/node.rb b/fb_graph2.original/lib/fb_graph2/node.rb deleted file mode 100644 index 1ef40b0..0000000 --- a/fb_graph2.original/lib/fb_graph2/node.rb +++ /dev/null @@ -1,125 +0,0 @@ -module FbGraph2 - class Node - attr_accessor :id, :access_token, :raw_attributes - alias_method :identifier, :id - - def self.inherited(klass) - klass.send :include, AttributeAssigner - FbGraph2.object_classes << klass - end - - def initialize(id, attributes = {}) - self.id = id - self.raw_attributes = attributes - assign attributes if respond_to? :assign - authenticate attributes[:access_token] if attributes.include? :access_token - end - - def authenticate(access_token) - self.access_token = access_token - self - end - - def fetch(params = {}, options = {}) - attributes = get params, options - self.class.new(attributes[:id], attributes).authenticate access_token - end - - def edge(edge, params = {}, options = {}) - Edge.new( - self, - edge, - params, - options.merge( - collection: edge_for(edge, params, options) - ) - ) - end - - def edges - @edges ||= self.class.included_modules.select do |_module_| - _module_.name =~ /FbGraph2::Edge/ - end.collect(&:instance_methods).flatten.sort - end - - def update(params = {}, options = {}) - post params, options - end - - def destroy(params = {}, options = {}) - delete params, options - end - - protected - - def http_client - FbGraph2.http_client(access_token) - end - - def get(params = {}, options = {}) - handle_response do - http_client.get build_endpoint(options), build_params(params) - end - end - - def post(params = {}, options = {}) - handle_response do - http_client.post build_endpoint(options), build_params(params) - end - end - - def delete(params = {}, options = {}) - handle_response do - http_client.delete build_endpoint(options), build_params(params) - end - end - - private - - def edge_for(edge, params = {}, options = {}) - collection = get params, options.merge(edge: edge) - Collection.new collection - end - - def build_endpoint(options = {}) - File.join [ - File.join( - FbGraph2.root_url, - options[:api_version] || FbGraph2.api_version, - id.to_s - ), - options[:edge], - Util.as_identifier(options[:edge_scope]) - ].compact.collect(&:to_s) - end - - def build_params(params = {}) - if params.present? - if params.include? :fields - params[:fields] = Array(params[:fields]).join(',') - end - params - else - nil - end - end - - def handle_response - response = yield - _response_ = MultiJson.load response.body - _response_ = _response_.with_indifferent_access if _response_.respond_to? :with_indifferent_access - case response.status - when 200...300 - if _response_.respond_to?(:include?) && _response_.include?(:success) - _response_[:success] - else - _response_ - end - else - raise Exception.detect(response.status, _response_, response.headers) - end - rescue MultiJson::DecodeError - raise Exception.new(response.status, "Unparsable Response: #{response.body}") - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/notification.rb b/fb_graph2.original/lib/fb_graph2/notification.rb deleted file mode 100644 index e218a35..0000000 --- a/fb_graph2.original/lib/fb_graph2/notification.rb +++ /dev/null @@ -1,17 +0,0 @@ -module FbGraph2 - class Notification < Node - register_attributes( - raw: [:title, :link, :unread], - time: [:created_time, :updated_time], - profile: [:from], - user: [:to], - app: [:application], - custom: [:object] - ) - - def initialize(id, attributes = {}) - super - # TODO: handle custom attributes. - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/offer.rb b/fb_graph2.original/lib/fb_graph2/offer.rb deleted file mode 100644 index 78ec286..0000000 --- a/fb_graph2.original/lib/fb_graph2/offer.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Offer < Node - register_attributes( - raw: [:claim_limit, :coupon_type, :image_url, :redemption_code, :redemption_link, :terms, :title, :message], - time: [:created_time, :expiration_time], - page: [:from] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/order.rb b/fb_graph2.original/lib/fb_graph2/order.rb deleted file mode 100644 index b3695a6..0000000 --- a/fb_graph2.original/lib/fb_graph2/order.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Order < Node - register_attributes( - raw: [:amount, :country, :from, :refund_reason_code, :status], - time: [:created_time, :updated_time], - app: [:application] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/page.rb b/fb_graph2.original/lib/fb_graph2/page.rb deleted file mode 100644 index 06afb4f..0000000 --- a/fb_graph2.original/lib/fb_graph2/page.rb +++ /dev/null @@ -1,81 +0,0 @@ -module FbGraph2 - class Page < Node - include Edge::Admins - include Edge::Albums - include Edge::Blocked - include Edge::Events - include Edge::Feed - include Edge::GlobalBrandChildren - include Edge::Insights - include Edge::Links - include Edge::Locations - include Edge::Milestones - include Edge::Offers - include Edge::Picture - include Edge::Photos - include Edge::Posts - include Edge::PromotablePosts - include Edge::Roles::PageContext - include Edge::Settings - include Edge::Statuses - include Edge::Tagged - include Edge::Videos - extend Searchable - - register_attributes( - raw: [ - :about, :attire, :band_members, :booking_agent, :can_post, :category, :checkins, :company_overview, - :current_location, :description, :directed_by, :founded, :general_info, :general_manager, :global_brand_page_name, - :hometown, :hours, :impressum, :is_permanently_closed, :is_published, :is_unclaimed, :likes, :link, :mission, :name, - :name_with_location_descriptor, :phone, :press_contact, :price_range, :products, :talking_about_count, :username, - :website, :were_here_count, - # NOTE: only within /:user_id/accounts context - :perms - ], - time: [ - :created_time, - # NOTE: only as Struct::Work#start_date - :start_date, :end_date - ], - date: [:birthday], - page: [:best_page, :global_brand_parent_page], - photo: [:cover], - users: [ - # NOTE: only as Struct::Education#classes and Struct::Work#projects - :with - ], - custom: [ - :category_list, :context, :location, :parking, :restaurant_services, :restaurant_specialties, - # NOTE: undocumented - :payment_options - ] - ) - - def initialize(id, attributes = {}) - super - if attributes.include? :category_list - self.category_list = attributes[:category_list].collect do |page_category| - PageCategory.new page_category[:id], page_category - end - end - if attributes.include? :context - self.context = Struct::Context::PageContext.new attributes[:context] - end - if attributes.include? :location - self.location = Struct::Location.new attributes[:location] - end - if attributes.include? :parking - self.parking = Struct::Parking.new attributes[:parking] - end - if attributes.include? :restaurant_services - self.restaurant_services = Struct::RestaurantServices.new attributes[:restaurant_services] - end - if attributes.include? :restaurant_specialties - self.restaurant_specialties = Struct::RestaurantSpecialties.new attributes[:restaurant_specialties] - end - if attributes.include? :payment_options - self.payment_options = Struct::PaymentOptions.new attributes[:payment_options] - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/page_category.rb b/fb_graph2.original/lib/fb_graph2/page_category.rb deleted file mode 100644 index 6318c0c..0000000 --- a/fb_graph2.original/lib/fb_graph2/page_category.rb +++ /dev/null @@ -1,7 +0,0 @@ -module FbGraph2 - class PageCategory < Node - register_attributes( - raw: [:name] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/payment.rb b/fb_graph2.original/lib/fb_graph2/payment.rb deleted file mode 100644 index 7e8a5ff..0000000 --- a/fb_graph2.original/lib/fb_graph2/payment.rb +++ /dev/null @@ -1,19 +0,0 @@ -module FbGraph2 - class Payment < Node - include Edge::Dispute - include Edge::Refunds - - register_attributes( - raw: [:product, :quantity, :request_id, :country, :created_time, :payout_foreign_exchange_rate, :test], - time: [:created_time, :updated_time], - user: [:user], - app: [:application], - custom: [:actions, :items, :disputes] - ) - - def initialize(id, attributes = {}) - super - # TODO: handle custom attributes. - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/photo.rb b/fb_graph2.original/lib/fb_graph2/photo.rb deleted file mode 100644 index bd6b50d..0000000 --- a/fb_graph2.original/lib/fb_graph2/photo.rb +++ /dev/null @@ -1,21 +0,0 @@ -module FbGraph2 - class Photo < Node - include Edge::Comments - include Edge::Likes::LikeeContext - include Edge::Tags - - register_attributes( - raw: [ - :backdated_time_granularity, :height, :icon, :link, :name, :page_story_id, :picture, :position, :source, :width, - # NOTE: as cover photo - :offset_y, :offset_x - ], - time: [:backdated_time, :created_time, :updated_time], - page: [:place], - profile: [:from], - album: [:album], - image_sources: [:images], - custom: [:name_tags] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/place.rb b/fb_graph2.original/lib/fb_graph2/place.rb deleted file mode 100644 index 04fe040..0000000 --- a/fb_graph2.original/lib/fb_graph2/place.rb +++ /dev/null @@ -1,6 +0,0 @@ -require 'fb_graph2/page' - -module FbGraph2 - class Place < Page - end -end diff --git a/fb_graph2.original/lib/fb_graph2/place_tag.rb b/fb_graph2.original/lib/fb_graph2/place_tag.rb deleted file mode 100644 index b4ca6ce..0000000 --- a/fb_graph2.original/lib/fb_graph2/place_tag.rb +++ /dev/null @@ -1,8 +0,0 @@ -module FbGraph2 - class PlaceTag < Node - register_attributes( - time: [:created_time], - page: [:place] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/post.rb b/fb_graph2.original/lib/fb_graph2/post.rb deleted file mode 100644 index c792eb4..0000000 --- a/fb_graph2.original/lib/fb_graph2/post.rb +++ /dev/null @@ -1,44 +0,0 @@ -module FbGraph2 - class Post < Node - include Edge::Comments - include Edge::Insights - include Edge::Likes::LikeeContext - include Edge::SharedPosts - - register_attributes( - raw: [ - :caption, :description, :icon, :is_hidden, :link, :message, :name, :object_id, :picture, - :source, :status_type, :story, :type - ], - time: [:created_time, :updated_time], - app: [:application], - page: [:place], - profile: [:from], - profiles: [:to, :with_tags], - actions: [:actions], - custom: [ - :message_tags, :privacy, :properties - ] - ) - - def initialize(id, attributes = {}) - super - if attributes.include? :message_tags - self.message_tags = attributes[:message_tags].inject({}) do |message_tags, (key, values)| - _message_tags_ = values.collect do |value| - TaggedProfile.new value[:id], value - end - message_tags.merge! key => _message_tags_ - end - end - if attributes.include? :privacy - self.privacy = Struct::Privacy.new attributes[:privacy] - end - if attributes.include? :properties - self.properties = attributes[:properties].collect do |property| - Struct::Property.new property - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/request.rb b/fb_graph2.original/lib/fb_graph2/request.rb deleted file mode 100644 index 578be77..0000000 --- a/fb_graph2.original/lib/fb_graph2/request.rb +++ /dev/null @@ -1,10 +0,0 @@ -module FbGraph2 - class Request < Node - register_attributes( - raw: [:message], - time: [:created_time], - app: [:application], - user: [:to, :from] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/request_filter/authenticator.rb b/fb_graph2.original/lib/fb_graph2/request_filter/authenticator.rb deleted file mode 100644 index ea4e9b5..0000000 --- a/fb_graph2.original/lib/fb_graph2/request_filter/authenticator.rb +++ /dev/null @@ -1,17 +0,0 @@ -module FbGraph2 - module RequestFilter - class Authenticator < Rack::OAuth2::AccessToken::Authenticator - def initialize(access_token) - _access_token_ = case access_token - when Rack::OAuth2::AccessToken - access_token - else - Rack::OAuth2::AccessToken::Bearer.new( - access_token: access_token - ) - end - super _access_token_ - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/request_filter/debugger.rb b/fb_graph2.original/lib/fb_graph2/request_filter/debugger.rb deleted file mode 100644 index 87d0030..0000000 --- a/fb_graph2.original/lib/fb_graph2/request_filter/debugger.rb +++ /dev/null @@ -1,23 +0,0 @@ -module FbGraph2 - module RequestFilter - class Debugger - def filter_request(request) - started = "======= [FbGraph2] API REQUEST STARTED =======" - log started, request.dump - end - - def filter_response(request, response) - finished = "======= [FbGraph2] API REQUEST FINISHED =======" - log '-' * 50, response.dump, finished - end - - private - - def log(*outputs) - outputs.each do |output| - FbGraph2.logger.info output - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/review.rb b/fb_graph2.original/lib/fb_graph2/review.rb deleted file mode 100644 index f5b9fa5..0000000 --- a/fb_graph2.original/lib/fb_graph2/review.rb +++ /dev/null @@ -1,10 +0,0 @@ -module FbGraph2 - class Review < Node - register_attributes( - raw: [:message, :rating], - time: [:created_time], - app: [:to], - user: [:from] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/searchable.rb b/fb_graph2.original/lib/fb_graph2/searchable.rb deleted file mode 100644 index 478d3a7..0000000 --- a/fb_graph2.original/lib/fb_graph2/searchable.rb +++ /dev/null @@ -1,27 +0,0 @@ -module FbGraph2 - module Searchable - def self.search(query, access_token, options = {}) - klass = options.delete(:class) || Searchable - collection = Collection.new( - Node.new(:search).authenticate( - access_token - ).send(:get, options.merge(q: query)) - ) - yield collection if block_given? - Searchable::Result.new(query, access_token, klass, options.merge(:collection => collection)) - end - - def search(query, access_token, options = {}) - type = self.to_s.split('::').last.underscore - Searchable.search(query, access_token, options.merge(:type => type, :class => self)) do |collection| - collection.map! do |obj| - self.new(obj[:id], obj.merge( - :access_token => options[:access_token] - )) - end - end - end - end -end - -require 'fb_graph2/searchable/result' diff --git a/fb_graph2.original/lib/fb_graph2/searchable/result.rb b/fb_graph2.original/lib/fb_graph2/searchable/result.rb deleted file mode 100644 index 461a145..0000000 --- a/fb_graph2.original/lib/fb_graph2/searchable/result.rb +++ /dev/null @@ -1,32 +0,0 @@ -module FbGraph2 - module Searchable - class Result < Collection - attr_accessor :query, :access_token, :klass, :collection, :options - - def initialize(query, access_token, klass, options = {}) - @klass = klass - @access_token = access_token - @query = query - @options = options - @collection = options.delete(:collection) || Collection.new - replace @collection - end - - def next(_options_ = {}) - if collection.next.present? - klass.search query, access_token, options.merge(_options_).merge(collection.next) - else - self.class.new query, access_token, klass - end - end - - def previous(_options_ = {}) - if collection.previous.present? - klass.search query, access_token, options.merge(_options_).merge(collection.previous) - else - self.class.new query, access_token, klass - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct.rb b/fb_graph2.original/lib/fb_graph2/struct.rb deleted file mode 100644 index fff8515..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct.rb +++ /dev/null @@ -1,15 +0,0 @@ -module FbGraph2 - class Struct - def self.inherited(klass) - klass.send :include, AttributeAssigner - end - - def initialize(attributes = {}) - assign attributes if respond_to? :assign - end - end -end - -Dir[File.join(__dir__, 'struct/*.rb')].each do |file| - require file -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/action.rb b/fb_graph2.original/lib/fb_graph2/struct/action.rb deleted file mode 100644 index c1c5aa9..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/action.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class Action < Struct - register_attributes( - raw: [:name, :link] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/age_range.rb b/fb_graph2.original/lib/fb_graph2/struct/age_range.rb deleted file mode 100644 index 5260afe..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/age_range.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class AgeRange < Struct - register_attributes( - raw: [:min, :max] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/app_event_type.rb b/fb_graph2.original/lib/fb_graph2/struct/app_event_type.rb deleted file mode 100644 index fb8ceae..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/app_event_type.rb +++ /dev/null @@ -1,25 +0,0 @@ -module FbGraph2 - class Struct - class AppEventType < Struct - register_attributes( - raw: [:event_name, :display_name, :description], - custom: [:parameters] - ) - - class Parameter < Struct - register_attributes( - raw: [:parameter_name, :display_name, :description] - ) - end - - def initialize(attributes = {}) - super - if attributes.include? :parameters - self.parameters = Collection.new(attributes[:parameters]).collect! do |param| - Parameter.new param - end - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/app_link.rb b/fb_graph2.original/lib/fb_graph2/struct/app_link.rb deleted file mode 100644 index 7ebf2f8..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/app_link.rb +++ /dev/null @@ -1,39 +0,0 @@ -module FbGraph2 - class Struct - class AppLink < Struct - register_attributes( - raw: [:url] - ) - - class Native < AppLink - register_attributes( - raw: [:app_name] - ) - - class IOS < Native - register_attributes( - raw: [:app_store_id] - ) - end - - class Android < Native - register_attributes( - raw: [:class, :package] - ) - end - - class WindowsPhone < Native - register_attributes( - raw: [:app_name] - ) - end - end - - class Web < AppLink - register_attributes( - raw: [:should_fallback] - ) - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/context.rb b/fb_graph2.original/lib/fb_graph2/struct/context.rb deleted file mode 100644 index 0604bb0..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/context.rb +++ /dev/null @@ -1,18 +0,0 @@ -module FbGraph2 - class Struct - module Context - class UserContext < Struct - register_attributes( - users: [:mutual_friends], - pages: [:mutual_likes] - ) - end - - class PageContext < Struct - register_attributes( - users: [:friends_who_like, :friends_tagged_at, :music_listen_friends, :video_watch_friends] - ) - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/currency.rb b/fb_graph2.original/lib/fb_graph2/struct/currency.rb deleted file mode 100644 index e8bb89e..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/currency.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class Currency < Struct - register_attributes( - raw: [:user_currency, :currency_exchange, :currency_exchange_inverse, :usd_exchange, :usd_exchange_inverse, :currency_offset] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/device.rb b/fb_graph2.original/lib/fb_graph2/struct/device.rb deleted file mode 100644 index a45f368..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/device.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class Device < Struct - register_attributes( - raw: [:hardware, :os] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/education.rb b/fb_graph2.original/lib/fb_graph2/struct/education.rb deleted file mode 100644 index f00f7c5..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/education.rb +++ /dev/null @@ -1,11 +0,0 @@ -module FbGraph2 - class Struct - class Education < Struct - register_attributes( - raw: [:type], - page: [:school, :year, :degree], - pages: [:classes, :concentration] - ) - end - end -end diff --git a/fb_graph2.original/lib/fb_graph2/struct/friend.rb b/fb_graph2.original/lib/fb_graph2/struct/friend.rb deleted file mode 100644 index fedbf20..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/friend.rb +++ /dev/null @@ -1,10 +0,0 @@ -module FbGraph2 - class Struct - class Friend < Struct - register_attributes( - raw: [:id, :name], # NOTE: this 'id' isn't user_id, but a token for invitation/tagging. - picture: [:picture] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/group_file.rb b/fb_graph2.original/lib/fb_graph2/struct/group_file.rb deleted file mode 100644 index 5a32ec5..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/group_file.rb +++ /dev/null @@ -1,12 +0,0 @@ -module FbGraph2 - class Struct - class GroupFile < Struct - register_attributes( - raw: [:id, :download_link], - time: [:updated_time], - user: [:from], - group: [:group] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/image_source.rb b/fb_graph2.original/lib/fb_graph2/struct/image_source.rb deleted file mode 100644 index 7c9df8e..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/image_source.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class ImageSource < Struct - register_attributes( - raw: [:height, :source, :width] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/location.rb b/fb_graph2.original/lib/fb_graph2/struct/location.rb deleted file mode 100644 index 86b16c0..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/location.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class Location < Struct - register_attributes( - raw: [:country, :city, :longitude, :zip, :state, :street, :located_in, :latitude] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/parking.rb b/fb_graph2.original/lib/fb_graph2/struct/parking.rb deleted file mode 100644 index 79450d7..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/parking.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class Parking < Struct - register_attributes( - int_flag: [:street, :lot, :valet] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/payment_options.rb b/fb_graph2.original/lib/fb_graph2/struct/payment_options.rb deleted file mode 100644 index bab290b..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/payment_options.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class PaymentOptions < Struct - register_attributes( - int_flag: [:amex, :cash_only, :discover, :mastercard, :visa] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/permission.rb b/fb_graph2.original/lib/fb_graph2/struct/permission.rb deleted file mode 100644 index c97e641..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/permission.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class Permission < Struct - register_attributes( - raw: [:permission, :status] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/picture.rb b/fb_graph2.original/lib/fb_graph2/struct/picture.rb deleted file mode 100644 index c2ded4a..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/picture.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class Picture < Struct - register_attributes( - raw: [:url, :is_silhouette, :height, :width] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/poke.rb b/fb_graph2.original/lib/fb_graph2/struct/poke.rb deleted file mode 100644 index 4ad446e..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/poke.rb +++ /dev/null @@ -1,10 +0,0 @@ -module FbGraph2 - class Struct - class Poke < Struct - register_attributes( - time: [:created_time], - user: [:from, :to] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/privacy.rb b/fb_graph2.original/lib/fb_graph2/struct/privacy.rb deleted file mode 100644 index 4d81b21..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/privacy.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class Privacy < Struct - register_attributes( - raw: [:description, :value, :friends, :allow, :deny] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/property.rb b/fb_graph2.original/lib/fb_graph2/struct/property.rb deleted file mode 100644 index 202218e..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/property.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class Property < Struct - register_attributes( - raw: [:name, :text, :href] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/restaurant_services.rb b/fb_graph2.original/lib/fb_graph2/struct/restaurant_services.rb deleted file mode 100644 index ffe7f4f..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/restaurant_services.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class RestaurantServices < Struct - register_attributes( - int_flag: [:kids, :delivery, :walkins, :catering, :reserve, :groups, :waiter, :outdoor, :takeout] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/restaurant_specialties.rb b/fb_graph2.original/lib/fb_graph2/struct/restaurant_specialties.rb deleted file mode 100644 index d74cee6..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/restaurant_specialties.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class RestaurantSpecialties < Struct - register_attributes( - int_flag: [:coffee, :drinks, :breakfast, :dinner, :lunch] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/role.rb b/fb_graph2.original/lib/fb_graph2/struct/role.rb deleted file mode 100644 index 2a52aef..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/role.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class Role < Struct - register_attributes( - raw: [:app_id, :user, :role] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/score.rb b/fb_graph2.original/lib/fb_graph2/struct/score.rb deleted file mode 100644 index 93fe882..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/score.rb +++ /dev/null @@ -1,11 +0,0 @@ -module FbGraph2 - class Struct - class Score < Struct - register_attributes( - raw: [:score], - user: [:user], - app: [:application] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/setting.rb b/fb_graph2.original/lib/fb_graph2/struct/setting.rb deleted file mode 100644 index 28867df..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/setting.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class Setting < Struct - register_attributes( - raw: [:setting, :value] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/static_resource.rb b/fb_graph2.original/lib/fb_graph2/struct/static_resource.rb deleted file mode 100644 index 248b42a..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/static_resource.rb +++ /dev/null @@ -1,17 +0,0 @@ -module FbGraph2 - class Struct - class StaticResource < Struct - register_attributes( - raw: [:usage_stats, :prefetched_resources], - custom: [:https] - ) - - def initialize(attributes = {}) - super - if attributes.include? :https - self.https = self.class.new attributes[:https] - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/subscription.rb b/fb_graph2.original/lib/fb_graph2/struct/subscription.rb deleted file mode 100644 index 5a06498..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/subscription.rb +++ /dev/null @@ -1,9 +0,0 @@ -module FbGraph2 - class Struct - class Subscription < Struct - register_attributes( - raw: [:object, :callback_url, :fields, :active] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/struct/work.rb b/fb_graph2.original/lib/fb_graph2/struct/work.rb deleted file mode 100644 index 656ee4c..0000000 --- a/fb_graph2.original/lib/fb_graph2/struct/work.rb +++ /dev/null @@ -1,11 +0,0 @@ -module FbGraph2 - class Struct - class Work < Struct - register_attributes( - page: [:employer, :location, :position], - pages: [:projects], - time: [:start_date, :end_date] - ) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/tagged_profile.rb b/fb_graph2.original/lib/fb_graph2/tagged_profile.rb deleted file mode 100644 index 4fca74a..0000000 --- a/fb_graph2.original/lib/fb_graph2/tagged_profile.rb +++ /dev/null @@ -1,26 +0,0 @@ -module FbGraph2 - class TaggedProfile < Node - register_attributes( - raw: [:name, :type, :offset, :length], - custom: [:object] - ) - - def initialize(id, attributes = {}) - super - self.object = klass.new self.id - end - - def klass - klass = case self.type - when 'user' - User - when 'page' - Page - when 'group' - Group - when 'event' - Event - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/thread.rb b/fb_graph2.original/lib/fb_graph2/thread.rb deleted file mode 100644 index 54f4763..0000000 --- a/fb_graph2.original/lib/fb_graph2/thread.rb +++ /dev/null @@ -1,10 +0,0 @@ -module FbGraph2 - class Thread < Node - register_attributes( - raw: [:unread, :unseen], - time: [:updated_time], - profiles: [:to], - messages: [:comments] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/token_metadata.rb b/fb_graph2.original/lib/fb_graph2/token_metadata.rb deleted file mode 100644 index 0bf2ab9..0000000 --- a/fb_graph2.original/lib/fb_graph2/token_metadata.rb +++ /dev/null @@ -1,45 +0,0 @@ -module FbGraph2 - class TokenMetadata < Node - register_attributes( - raw: [ - :app_id, :application, :error, :is_valid, :metadata, :profile_id, :scopes, :user_id - ], - timestamp: [:expires_at, :issued_at], - custom: [:app, :user, :page] - ) - - def initialize(attributes = {}) - super :debug_token, attributes - if app_id - self.app = App.new app_id - end - if user_id - self.user = User.new user_id - end - if profile_id - self.page = Page.new profile_id - end - end - - def fetch(params = {}, options = {}) - attributes = get params, options - self.class.new(attributes[:data]).authenticate access_token - end - - def valid? - !!is_valid - end - - def app_token? - app.present? && user.blank? && page.blank? - end - - def user_token? - app.present? && user.present? && page.blank? - end - - def page_token? - app.present? && user.present? && page.present? - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/translation.rb b/fb_graph2.original/lib/fb_graph2/translation.rb deleted file mode 100644 index d0364d1..0000000 --- a/fb_graph2.original/lib/fb_graph2/translation.rb +++ /dev/null @@ -1,7 +0,0 @@ -module FbGraph2 - class Translation < Node - register_attributes( - raw: [:translation, :approval_status, :native_string, :description] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/user.rb b/fb_graph2.original/lib/fb_graph2/user.rb deleted file mode 100644 index c388427..0000000 --- a/fb_graph2.original/lib/fb_graph2/user.rb +++ /dev/null @@ -1,106 +0,0 @@ -module FbGraph2 - class User < Node - include Edge::Accounts - include Edge::Achievements - include Edge::Activities - include Edge::Albums - include Edge::Applications - include Edge::AppRequests - include Edge::Books - include Edge::Events - include Edge::Family - include Edge::Feed - include Edge::FriendLists - include Edge::Friends - include Edge::Games - include Edge::Groups - include Edge::Home - include Edge::Inbox - include Edge::Interests - include Edge::InvitableFriends - include Edge::Likes::LikerContext - include Edge::Links - include Edge::Movies - include Edge::Music - include Edge::Notifications - include Edge::Outbox - include Edge::PaymentTransactions - include Edge::Permissions - include Edge::Picture - include Edge::Photos - include Edge::Pokes - include Edge::Posts - include Edge::Scores - include Edge::Statuses - include Edge::TaggableFriends - include Edge::Tagged - include Edge::TaggedPlaces - include Edge::Television - include Edge::Videos - extend Searchable - - register_attributes( - raw: [ - :about, :bio, :email, :first_name, :gender, :installed, :is_verified, :last_name, :link, :locale, - :middle_name, :name, :name_format, :political, :quotes, :relationship_status, :religion, - :timezone, :third_party_id, :token_for_business, :verified, :website, - # NOTE: in family edge context - :relationship, - # NOTE: in page admin context - :perms, :role, - # NOTE: in group context - :administrator, - # NOTE: in photo tags context - :x, :y - ], - time: [ - # NOTE: undocumented attribute - :updated_time, - # NOTE: in photo tags context - :created_time - ], - date: [:birthday], - page: [:hometown, :location], - pages: [:favorite_athletes, :favorite_teams, :inspirational_people, :languages], - user: [ - :significant_other, - # NOTE: in photo tags context - :tagging_user - ], - photo: [:cover], - custom: [:age_range, :context, :currency, :devices, :education, :work] - ) - - def initialize(id, attributes = {}) - super - if attributes.include? :age_range - self.age_range = Struct::AgeRange.new attributes[:age_range] - end - if attributes.include? :context - self.context = Struct::Context::UserContext.new attributes[:context] - end - if attributes.include? :currency - self.currency = Struct::Currency.new attributes[:currency] - end - if attributes.include? :devices - self.devices = attributes[:devices].collect do |device| - Struct::Device.new device - end - end - if attributes.include? :education - self.education = attributes[:education].collect do |education| - Struct::Education.new education - end - end - if attributes.include? :work - self.work = attributes[:work].collect do |work| - Struct::Work.new work - end - end - end - - def self.me(access_token) - new(:me).authenticate access_token - end - end -end diff --git a/fb_graph2.original/lib/fb_graph2/util.rb b/fb_graph2.original/lib/fb_graph2/util.rb deleted file mode 100644 index 11eafd6..0000000 --- a/fb_graph2.original/lib/fb_graph2/util.rb +++ /dev/null @@ -1,13 +0,0 @@ -module FbGraph2 - module Util - module_function - - def as_identifier(object) - if object.respond_to? :id - object.id - else - object - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/video.rb b/fb_graph2.original/lib/fb_graph2/video.rb deleted file mode 100644 index 01b59e7..0000000 --- a/fb_graph2.original/lib/fb_graph2/video.rb +++ /dev/null @@ -1,14 +0,0 @@ -module FbGraph2 - class Video < Node - include Edge::Comments - include Edge::Likes::LikeeContext - include Edge::SharedPosts - - register_attributes( - raw: [:description, :embed_html, :icon, :length, :name, :picture, :source], - time: [:created_time, :updated_time], - profile: [:from], - custom: [:format, :thumbnails] - ) - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/app_spec.rb b/fb_graph2.original/spec/fb_graph2/app_spec.rb deleted file mode 100644 index abb171c..0000000 --- a/fb_graph2.original/spec/fb_graph2/app_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::App do - describe '.app' do - let(:klass) { FbGraph2::App } - - it 'should not call API' do - expect do - app = klass.app 'token' - app.should be_instance_of klass - end.not_to request_to 'app' - end - - context 'when fetched' do - it 'should call API' do - app = mock_graph :get, 'app', 'app/app' do - klass.app('token').fetch - end - app.should be_instance_of klass - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/auth_spec.rb b/fb_graph2.original/spec/fb_graph2/auth_spec.rb deleted file mode 100644 index 98396fa..0000000 --- a/fb_graph2.original/spec/fb_graph2/auth_spec.rb +++ /dev/null @@ -1,164 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Auth do - subject { instance } - let(:instance) { FbGraph2::Auth.new 'client_id', 'client_secret' } - - it { should be_a Rack::OAuth2::Client } - - describe '#debug_token!' do - before do - mock_graph :post, 'oauth/access_token', 'token_response', params: { - grant_type: 'client_credentials', - client_id: 'client_id', - client_secret: 'client_secret' - }, disable_api_versioning: true - end - - context 'when user_token given' do - subject do - mock_graph :get, 'debug_token', 'token_metadata/user_token', params: { - input_token: 'user_token' - } do - instance.debug_token! 'user_token' - end - end - it { should be_instance_of FbGraph2::TokenMetadata } - its(:app) { should be_instance_of FbGraph2::App } - its(:user) { should be_instance_of FbGraph2::User } - its(:page) { should be_nil } - end - - context 'when app_token given' do - subject do - mock_graph :get, 'debug_token', 'token_metadata/app_token', params: { - input_token: 'app_token' - } do - instance.debug_token! 'app_token' - end - end - it { should be_instance_of FbGraph2::TokenMetadata } - its(:app) { should be_instance_of FbGraph2::App } - its(:user) { should be_nil } - its(:page) { should be_nil } - end - - context 'when page_token given' do - subject do - mock_graph :get, 'debug_token', 'token_metadata/page_token', params: { - input_token: 'page_token' - } do - instance.debug_token! 'page_token' - end - end - it { should be_instance_of FbGraph2::TokenMetadata } - its(:app) { should be_instance_of FbGraph2::App } - its(:user) { should be_instance_of FbGraph2::User } - its(:page) { should be_instance_of FbGraph2::Page } - end - end - - describe '#access_token!' do - context 'when error occured' do - it do - expect do - mock_graph :post, 'oauth/access_token', 'error/400/191', status: [400, 'Bad Request'], disable_api_versioning: true do - instance.authorization_code = 'auth_code' - instance.access_token! - end - end.to raise_error(FbGraph2::Exception) do |e| - e.message.should == 'Missing redirect_uri parameter.' - end - end - end - - context 'when fb_exchange_token grant given' do - it do - instance.fb_exchange_token = 'short_lived_access_token' - access_token = mock_graph :post, 'oauth/access_token', 'token_response', params: { - grant_type: 'fb_exchange_token', - fb_exchange_token: 'short_lived_access_token', - client_id: 'client_id', - client_secret: 'client_secret' - }, disable_api_versioning: true do - instance.access_token! - end - access_token.should be_instance_of Rack::OAuth2::AccessToken::Legacy - end - end - end - - describe '#from_cookie' do - let(:token) do - '9heZHFs6tDH/Nif4CqmBaMQ8nKEOc5g2WgVJa10LF00.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImNvZGUiOiI4ZDYwZDY4NDA4MmQ1NjczMjY3MWUxNzAuMS01Nzk2MTIyNzZ8N2pkVlp6MlNLNUY2b0gtQ21FQWtZZVpuVjEwIiwiaXNzdWVkX2F0IjoxMzEyOTUzOTcxLCJ1c2VyX2lkIjo1Nzk2MTIyNzZ9' - end - - it 'should return FbGraph2::Auth::SignedRequest' do - signed_request = mock_graph :post, 'oauth/access_token', 'token_response', params: { - grant_type: 'authorization_code', - code: '8d60d684082d56732671e170.1-579612276|7jdVZz2SK5F6oH-CmEAkYeZnV10', - client_id: 'client_id', - client_secret: 'client_secret' - }, disable_api_versioning: true do - instance.from_cookie token - end - signed_request.should be_instance_of FbGraph2::Auth::SignedRequest - signed_request.access_token.should be_instance_of Rack::OAuth2::AccessToken::Legacy - signed_request.access_token.access_token.should == 'access_token' - signed_request.user.should be_instance_of FbGraph2::User - end - - context 'when cookie object given' do - let(:cookie) do - {'fbsr_client_id' => token} - end - - it 'should handle it too' do - signed_request = mock_graph :post, 'oauth/access_token', 'token_response', params: { - grant_type: 'authorization_code', - code: '8d60d684082d56732671e170.1-579612276|7jdVZz2SK5F6oH-CmEAkYeZnV10', - client_id: 'client_id', - client_secret: 'client_secret' - }, disable_api_versioning: true do - instance.from_cookie cookie - end - signed_request.should be_instance_of FbGraph2::Auth::SignedRequest - end - end - end - - describe '#from_signed_request' do - let(:token) do - 'LqsgnfcsRdfjOgyW6ZuSLpGBVsxUBegEqai4EcrWS0A=.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImV4cGlyZXMiOjAsImlzc3VlZF9hdCI6MTI5ODc4MzczOSwib2F1dGhfdG9rZW4iOiIxMzQxNDU2NDMyOTQzMjJ8MmI4YTZmOTc1NTJjNmRjZWQyMDU4MTBiLTU3OTYxMjI3NnxGS1o0akdKZ0JwN2k3bFlrOVhhUk1QZ3lhNnMiLCJ1c2VyIjp7ImNvdW50cnkiOiJqcCIsImxvY2FsZSI6ImVuX1VTIiwiYWdlIjp7Im1pbiI6MjF9fSwidXNlcl9pZCI6IjU3OTYxMjI3NiJ9' - end - - it 'should return FbGraph2::Auth::SignedRequest' do - signed_request = instance.from_signed_request token - signed_request.should be_instance_of FbGraph2::Auth::SignedRequest - signed_request.access_token.should == '134145643294322|2b8a6f97552c6dced205810b-579612276|FKZ4jGJgBp7i7lYk9XaRMPgya6s' - signed_request.user.should be_instance_of FbGraph2::User - end - - context 'when invalid format' do - let(:token) { 'invalid.invalid' } - - it do - expect do - instance.from_cookie token - end.to raise_error FbGraph2::Auth::SignedRequest::VerificationFailed - end - end - - context 'when signature invalid' do - let(:token) do - '4Xnb6TwumZfUQcrflVQHYLOmaWq1oMHbZmI7_pxZXeU.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImV4cGlyZXMiOjE0MjMwNDQwMDAsImlzc3VlZF9hdCI6MTQyMzAzNjk3MSwib2F1dGhfdG9rZW4iOiJDQUFDWkN1RXk5ZHBVQkFKUDFJY3BMaThGaU04RnBpcjB2clBmZjhaQXQxblpCSGdyMG9pTUdNVXNBaU9ZZ0F4NkpibkZrMXNJSW95ZjRYMktKSHlVc2ROcmhCd1UwanBoUGFPQzU0bGw4emVMWkFScFZ0b0RYY3FIZE9lNGZjdGVmMHZ5eXdsU0NrTkhIWGdmSDhaQVNUZ1JvQlpCbmRqVHpmQXVtMjFGMFpDdUtZWExDY1pBZ1VEeXJ3d0piekVuYVJybWFxZ2s3VFhOZ3cwZlJaQmVNVVpCM1Q0VG1DMktXU3laQ1laRCIsInRva2VuX2Zvcl9idXNpbmVzcyI6IkFieUR4YVF0cTVPSEVfN04iLCJ1c2VyIjp7ImNvdW50cnkiOiJqcCIsImxvY2FsZSI6ImVuX1VTIiwiYWdlIjp7Im1pbiI6MjF9fSwidXNlcl9pZCI6IjU3OTYxMjI3NiJ9' - end - - it do - expect do - instance.from_cookie token - end.to raise_error FbGraph2::Auth::SignedRequest::VerificationFailed - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/collection_spec.rb b/fb_graph2.original/spec/fb_graph2/collection_spec.rb deleted file mode 100644 index 5c06fdb..0000000 --- a/fb_graph2.original/spec/fb_graph2/collection_spec.rb +++ /dev/null @@ -1,11 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Collection do - context 'when non-collection object given' do - it do - expect do - FbGraph2::Collection.new 'scalar' - end.to raise_error ArgumentError - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/accounts_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/accounts_spec.rb deleted file mode 100644 index 49f713a..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/accounts_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Accounts do - context 'included in User' do - describe '#accounts' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Page with page token' do - accounts = mock_graph :get, 'me/accounts', 'user/accounts', access_token: 'token' do - me.accounts - end - accounts.should be_instance_of FbGraph2::Edge - accounts.should_not be_blank - accounts.each do |account| - account.should be_instance_of FbGraph2::Page - account.access_token.should == 'page_token' - end - accounts.first.name.should == 'Identity Conference #idcon' - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/achievements_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/achievements_spec.rb deleted file mode 100644 index 57ab292..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/achievements_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Achievements do - context 'included in User' do - describe '#achievements' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Achievement' do - pages = mock_graph :get, 'me/achievements', 'user/achievements', access_token: 'token' do - me.achievements - end - pages.should be_instance_of FbGraph2::Edge - pages.should_not be_blank - pages.each do |page| - page.should be_instance_of FbGraph2::Achievement - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/activities_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/activities_spec.rb deleted file mode 100644 index 5c89115..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/activities_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Activities do - context 'included in User' do - describe '#activities' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Page' do - pages = mock_graph :get, 'me/activities', 'user/activities', access_token: 'token' do - me.activities - end - pages.should be_instance_of FbGraph2::Edge - pages.should_not be_blank - pages.each do |page| - page.should be_instance_of FbGraph2::Page - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/admins_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/admins_spec.rb deleted file mode 100644 index f4a6a7c..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/admins_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Admins do - context 'included in Page' do - let(:page) { FbGraph2::Page.new('page_id').authenticate('page_token') } - - describe '#admins' do - it 'should return an Array of FbGraph2::User' do - users = mock_graph :get, 'page_id/admins', 'page/admins', access_token: 'page_token' do - page.admins - end - users.should be_instance_of FbGraph2::Edge - users.should_not be_blank - users.each do |user| - user.should be_instance_of FbGraph2::User - end - end - end - - describe '#admin?' do - let(:user_id) { 'user_id' } - let(:user) { FbGraph2::Page.new(user_id) } - - context 'when String given' do - it do - mock_graph :get, "page_id/admins/#{user_id}", 'page/admins', access_token: 'page_token' do - page.admin? user_id - end.should be true - end - end - - context 'when FbGraph2::User given' do - it do - mock_graph :get, "page_id/admins/#{user_id}", 'page/admins', access_token: 'page_token' do - page.admin? user - end.should be true - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/albums_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/albums_spec.rb deleted file mode 100644 index d948e50..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/albums_spec.rb +++ /dev/null @@ -1,31 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Albums do - context 'included in User' do - let(:me) { FbGraph2::User.me('token') } - - describe '#albums' do - it 'should return an Array of FbGraph2::Video' do - albums = mock_graph :get, 'me/albums', 'user/albums', access_token: 'token' do - me.albums - end - albums.should be_instance_of FbGraph2::Edge - albums.should_not be_blank - albums.each do |album| - album.should be_instance_of FbGraph2::Album - end - end - end - - describe '#album!' do - it do - album = mock_graph :post, 'me/albums', 'success_with_id', access_token: 'token', params: { - name: 'test' - } do - me.album! name: 'test' - end - album.should be_instance_of FbGraph2::Album - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/applications_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/applications_spec.rb deleted file mode 100644 index e503e72..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/applications_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Applications do - context 'included in User' do - let(:me) { FbGraph2::User.me('token') } - - describe '#applications' do - it 'should return an Array of FbGraph2::App' do - apps = mock_graph :get, 'me/applications/developer', 'user/applications', access_token: 'token' do - me.applications - end - apps.should be_instance_of FbGraph2::Edge - apps.should_not be_blank - apps.each do |app| - app.should be_instance_of FbGraph2::App - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/attending_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/attending_spec.rb deleted file mode 100644 index 3fbc8c9..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/attending_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Attending do - context 'included in Event' do - let(:event) { FbGraph2::Event.new('event_id').authenticate('token') } - - describe '#attending' do - it 'should return an Array of FbGraph2::User' do - users = mock_graph :get, 'event_id/attending', 'event/attending', access_token: 'token' do - event.attending - end - users.should be_instance_of FbGraph2::Edge - users.should_not be_blank - users.each do |user| - user.should be_instance_of FbGraph2::User - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/banned_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/banned_spec.rb deleted file mode 100644 index a384fe1..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/banned_spec.rb +++ /dev/null @@ -1,60 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Banned do - context 'included in App' do - let(:app) { FbGraph2::App.app('app_token') } - let(:user_id) { 'user_id' } - let(:user) { FbGraph2::User.new(user_id) } - - describe '#banned' do - it 'should return an Array of FbGraph2::User' do - users = mock_graph :get, 'app/banned', 'app/banned', access_token: 'app_token' do - app.banned - end - users.should be_instance_of FbGraph2::Edge - users.should_not be_blank - users.each do |user| - user.should be_instance_of FbGraph2::User - end - end - end - - describe '#banned?' do - context 'when String given' do - it do - mock_graph :get, "app/banned/#{user_id}", 'app/banned', access_token: 'app_token' do - app.banned? user_id - end.should be true - end - end - - context 'when FbGraph2::User given' do - it do - mock_graph :get, "app/banned/#{user_id}", 'app/banned', access_token: 'app_token' do - app.banned? user - end.should be true - end - end - end - - describe '#ban!' do - it do - mock_graph :post, 'app/banned', 'true', access_token: 'app_token', params: { - uid: user_id - } do - app.ban! user - end.should be true - end - end - - describe '#unban!' do - it do - mock_graph :delete, 'app/banned', 'true', access_token: 'app_token', params: { - uid: user_id - } do - app.unban! user - end.should be true - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/blocked_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/blocked_spec.rb deleted file mode 100644 index a25779d..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/blocked_spec.rb +++ /dev/null @@ -1,61 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Blocked do - context 'included in Page' do - let(:page) { FbGraph2::Page.new('page_id').authenticate('page_token') } - let(:user_id) { 'user_id' } - let(:user) { FbGraph2::User.new(user_id) } - - describe '#blocked' do - it 'should return an Array of FbGraph2::User' do - users = mock_graph :get, 'page_id/blocked', 'page/blocked', access_token: 'page_token' do - page.blocked - end - users.should be_instance_of FbGraph2::Edge - users.should_not be_blank - users.each do |user| - user.should be_instance_of FbGraph2::User - end - end - end - - describe '#blocked?' do - context 'when String given' do - it do - mock_graph :get, "page_id/blocked/#{user_id}", 'page/blocked', access_token: 'page_token' do - page.blocked? user_id - end.should be true - end - end - - context 'when FbGraph2::User given' do - it do - mock_graph :get, "page_id/blocked/#{user_id}", 'page/blocked', access_token: 'page_token' do - page.blocked? user - end.should be true - end - end - end - - describe '#block!' do - it do - result = mock_graph :post, 'page_id/blocked', 'page/block_succeeded', access_token: 'page_token', params: { - user: user_id - } do - page.block! user - end - result.should == {'user_id' => true} - end - end - - describe '#unblock!' do - it do - mock_graph :delete, 'page_id/blocked', 'true', access_token: 'page_token', params: { - user: user_id - } do - page.unblock! user - end.should be true - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/books_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/books_spec.rb deleted file mode 100644 index 838a4c0..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/books_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Books do - context 'included in User' do - describe '#books' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Page' do - pages = mock_graph :get, 'me/books', 'user/books', access_token: 'token' do - me.books - end - pages.should be_instance_of FbGraph2::Edge - pages.should_not be_blank - pages.each do |page| - page.should be_instance_of FbGraph2::Page - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/comments_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/comments_spec.rb deleted file mode 100644 index 21f860e..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/comments_spec.rb +++ /dev/null @@ -1,69 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Comments do - context 'included in Post' do - let(:post) { FbGraph2::Post.new('post_id').authenticate('token') } - - describe '#comments' do - context 'when cached' do - let(:fetched) do - mock_graph :get, 'post_id', 'post/liked_and_commented', access_token: 'token' do - post.fetch - end - end - - context 'without params' do - it 'should not call API' do - expect do - fetched.comments - end.not_to request_to "#{fetched.id}/comments" - end - end - - context 'with params' do - it 'should call API' do - expect do - fetched.comments no_cache: true - end.to request_to "#{fetched.id}/comments" - end - end - end - - context 'otherwise' do - it 'should return an Array of FbGraph2::Post' do - comments = mock_graph :get, 'post_id/comments', 'post/comments', access_token: 'token' do - post.comments - end - comments.should be_instance_of FbGraph2::Edge - comments.should_not be_blank - comments.each do |comment| - comment.should be_instance_of FbGraph2::Comment - end - end - end - - context 'when summary requested' do - it 'should be summarized' do - comments = mock_graph :get, 'post_id/comments', 'post/comments_with_summary', access_token: 'token', params: { - summary: true - } do - post.comments(summary: true) - end - comments.summary.should include order: 'chronological', total_count: 4 - comments.total_count.should == 4 - end - end - end - - describe '#comment!' do - it 'should return FbGraph2::Post with posted params' do - comment = mock_graph :post, 'post_id/comments', 'success_with_id', access_token: 'token' do - post.comment! message: 'hello' - end - comment.should be_instance_of FbGraph2::Comment - comment.id.should == 'created_object_id' - comment.message.should == 'hello' - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/declined_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/declined_spec.rb deleted file mode 100644 index 154d925..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/declined_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Declined do - context 'included in Event' do - let(:event) { FbGraph2::Event.new('event_id').authenticate('token') } - - describe '#declined' do - it 'should return an Array of FbGraph2::User' do - users = mock_graph :get, 'event_id/declined', 'event/declined', access_token: 'token' do - event.declined - end - users.should be_instance_of FbGraph2::Edge - users.should_not be_blank - users.each do |user| - user.should be_instance_of FbGraph2::User - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/events_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/events_spec.rb deleted file mode 100644 index 76132dd..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/events_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Events do - context 'included in User' do - describe '#events' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Event' do - events = mock_graph :get, 'me/events', 'user/events', access_token: 'token' do - me.events - end - events.should be_instance_of FbGraph2::Edge - events.should_not be_blank - events.each do |event| - event.should be_instance_of FbGraph2::Event - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/feed_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/feed_spec.rb deleted file mode 100644 index 972b60f..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/feed_spec.rb +++ /dev/null @@ -1,31 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Feed do - context 'included in User' do - let(:me) { FbGraph2::User.me('token') } - - describe '#feed' do - it 'should return an Array of FbGraph2::Post' do - posts = mock_graph :get, 'me/feed', 'user/feed', access_token: 'token' do - me.feed - end - posts.should be_instance_of FbGraph2::Edge - posts.should_not be_blank - posts.each do |post| - post.should be_instance_of FbGraph2::Post - end - end - end - - describe '#feed!' do - it 'should return FbGraph2::Post with posted params' do - post = mock_graph :post, 'me/feed', 'success_with_id', access_token: 'token' do - me.feed! message: 'hello' - end - post.should be_instance_of FbGraph2::Post - post.id.should == 'created_object_id' - post.message.should == 'hello' - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/friend_lists_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/friend_lists_spec.rb deleted file mode 100644 index ba254f4..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/friend_lists_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::FriendLists do - context 'included in User' do - describe '#friend_lists' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::FriendList' do - friend_lists = mock_graph :get, 'me/friendlists', 'user/friend_lists', access_token: 'token' do - me.friend_lists - end - friend_lists.should be_instance_of FbGraph2::Edge - friend_lists.should_not be_blank - friend_lists.each do |friend_list| - friend_list.should be_instance_of FbGraph2::FriendList - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/friends_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/friends_spec.rb deleted file mode 100644 index aca2417..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/friends_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Friends do - context 'included in User' do - let(:me) { FbGraph2::User.me('token') } - - describe '#friends' do - it 'should return an Array of FbGraph2::User' do - users = mock_graph :get, 'me/friends', 'user/friends', access_token: 'token' do - me.friends - end - users.should be_instance_of FbGraph2::Edge - users.should_not be_blank - users.each do |user| - user.should be_instance_of FbGraph2::User - end - end - end - - describe '#friend?' do - context 'when is friend' do - it do - mock_graph :get, 'me/friends/user_id', 'user/friends', access_token: 'token' do - me.friend? 'user_id' - end.should be true - end - end - - context 'otherwise' do - it do - mock_graph :get, 'me/friends/user_id', 'blank_collection', access_token: 'token' do - me.friend? 'user_id' - end.should be false - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/groups_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/groups_spec.rb deleted file mode 100644 index 4297982..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/groups_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Groups do - context 'included in User' do - describe '#groups' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Page' do - groups = mock_graph :get, 'me/groups', 'user/groups', access_token: 'token' do - me.groups - end - groups.should be_instance_of FbGraph2::Edge - groups.should_not be_blank - groups.each do |group| - group.should be_instance_of FbGraph2::Group - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/home_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/home_spec.rb deleted file mode 100644 index 8d6f8ef..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/home_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Feed do - context 'included in User' do - describe '#home' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Post' do - posts = mock_graph :get, 'me/home', 'user/home', access_token: 'token' do - me.home - end - posts.should be_instance_of FbGraph2::Edge - posts.should_not be_blank - posts.each do |post| - post.should be_instance_of FbGraph2::Post - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/inbox_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/inbox_spec.rb deleted file mode 100644 index fb5187a..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/inbox_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Inbox do - context 'included in User' do - describe '#inbox' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Thread' do - threads = mock_graph :get, 'me/inbox', 'user/inbox', access_token: 'token' do - me.inbox - end - threads.should be_instance_of FbGraph2::Edge - threads.should_not be_blank - threads.each do |thread| - thread.should be_instance_of FbGraph2::Thread - end - threads.summary.should include unseen_count: 0, unread_count: 0, updated_time: Time.parse('2014-09-02T03:51:40+0000') - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/interests_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/interests_spec.rb deleted file mode 100644 index 6370b22..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/interests_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Interests do - context 'included in User' do - describe '#interests' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Page' do - pages = mock_graph :get, 'me/interests', 'user/interests', access_token: 'token' do - me.interests - end - pages.should be_instance_of FbGraph2::Edge - pages.should_not be_blank - pages.each do |page| - page.should be_instance_of FbGraph2::Page - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/invitable_friends_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/invitable_friends_spec.rb deleted file mode 100644 index 2be7a24..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/invitable_friends_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::InvitableFriends do - context 'included in User' do - describe '#invitable_friends' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Struct::Friend' do - users = mock_graph :get, 'me/invitable_friends', 'user/invitable_friends', access_token: 'token' do - me.invitable_friends - end - users.should be_instance_of FbGraph2::Edge - users.should_not be_blank - users.each do |user| - user.should be_instance_of FbGraph2::Struct::Friend - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/invited_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/invited_spec.rb deleted file mode 100644 index 65ceb53..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/invited_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Invited do - context 'included in Event' do - let(:event) { FbGraph2::Event.new('event_id').authenticate('token') } - - describe '#invited' do - it 'should return an Array of FbGraph2::User' do - users = mock_graph :get, 'event_id/invited', 'event/invited', access_token: 'token' do - event.invited - end - users.should be_instance_of FbGraph2::Edge - users.should_not be_blank - users.each do |user| - user.should be_instance_of FbGraph2::User - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/likes_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/likes_spec.rb deleted file mode 100644 index d46ef15..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/likes_spec.rb +++ /dev/null @@ -1,97 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Likes do - context 'included in User' do - let(:me) { FbGraph2::User.me('token') } - - describe '#likes' do - it 'should return an Array of FbGraph2::Page' do - likes = mock_graph :get, 'me/likes', 'user/likes', access_token: 'token' do - me.likes - end - likes.should be_instance_of FbGraph2::Edge - likes.should_not be_blank - likes.each do |like| - like.should be_instance_of FbGraph2::Page - end - end - end - - describe '#liked?' do - context 'when liked' do - it do - mock_graph :get, 'me/likes/page_id', 'user/likes', access_token: 'token' do - me.liked? 'page_id' - end.should be true - end - end - - context 'otherwise' do - it do - mock_graph :get, 'me/likes/page_id', 'blank_collection', access_token: 'token' do - me.liked? 'page_id' - end.should be false - end - end - end - end - - context 'included in Post' do - let(:post) { FbGraph2::Post.new('post_id').authenticate('token') } - - describe '#likes' do - context 'when cached' do - let(:fetched) do - mock_graph :get, 'post_id', 'post/liked_and_commented', access_token: 'token' do - post.fetch - end - end - - context 'without params' do - it 'should not call API' do - expect do - fetched.likes - end.not_to request_to "#{fetched.id}/likes" - end - end - - context 'with params' do - it 'should call API' do - expect do - fetched.likes no_cache: true - end.to request_to "#{fetched.id}/likes" - end - end - end - - context 'otherwise' do - it 'should return an Array of FbGraph2::User' do - likes = mock_graph :get, 'post_id/likes', 'post/likes', access_token: 'token' do - post.likes - end - likes.should be_instance_of FbGraph2::Edge - likes.should_not be_blank - likes.each do |like| - like.should be_instance_of FbGraph2::User - end - end - end - end - - describe '#like!' do - it 'should return true' do - mock_graph :post, 'post_id/likes', 'true', access_token: 'token' do - post.like! - end.should be true - end - end - - describe '#unlike!' do - it 'should return true' do - mock_graph :delete, 'post_id/likes', 'true', access_token: 'token' do - post.unlike! - end.should be true - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/links_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/links_spec.rb deleted file mode 100644 index 8a18e9b..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/links_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Links do - context 'included in User' do - let(:me) { FbGraph2::User.me('token') } - describe '#links' do - it 'should return an Array of FbGraph2::Post' do - posts = mock_graph :get, 'me/links', 'user/links', access_token: 'token' do - me.links - end - posts.should be_instance_of FbGraph2::Edge - posts.should_not be_blank - posts.each do |post| - post.should be_instance_of FbGraph2::Post - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/maybe_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/maybe_spec.rb deleted file mode 100644 index 50c6eed..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/maybe_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Maybe do - context 'included in Event' do - let(:event) { FbGraph2::Event.new('event_id').authenticate('token') } - - describe '#maybe' do - it 'should return an Array of FbGraph2::User' do - users = mock_graph :get, 'event_id/maybe', 'event/maybe', access_token: 'token' do - event.maybe - end - users.should be_instance_of FbGraph2::Edge - users.should_not be_blank - users.each do |user| - user.should be_instance_of FbGraph2::User - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/members_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/members_spec.rb deleted file mode 100644 index f3c716a..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/members_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Members do - context 'included in Group' do - let(:group) { FbGraph2::Group.new('group_id').authenticate('token') } - - describe '#invited' do - it 'should return an Array of FbGraph2::User' do - users = mock_graph :get, 'group_id/members', 'group/members', access_token: 'token' do - group.members - end - users.should be_instance_of FbGraph2::Edge - users.should_not be_blank - users.each do |user| - user.should be_instance_of FbGraph2::User - end - users.last.administrator.should be true - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/milestones_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/milestones_spec.rb deleted file mode 100644 index 955ff75..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/milestones_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Milestones do - context 'included in Page' do - describe '#milestones' do - let(:page) { FbGraph2::Page.new('page_id').authenticate('token') } - it 'should return an Array of FbGraph2::Milestone' do - milestones = mock_graph :get, 'page_id/milestones', 'page/milestones', access_token: 'token' do - page.milestones - end - milestones.should be_instance_of FbGraph2::Edge - milestones.should_not be_blank - milestones.each do |milestone| - milestone.should be_instance_of FbGraph2::Milestone - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/movies_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/movies_spec.rb deleted file mode 100644 index e7aa6a7..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/movies_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Movies do - context 'included in User' do - describe '#movies' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Page' do - pages = mock_graph :get, 'me/movies', 'user/movies', access_token: 'token' do - me.movies - end - pages.should be_instance_of FbGraph2::Edge - pages.should_not be_blank - pages.each do |page| - page.should be_instance_of FbGraph2::Page - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/music_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/music_spec.rb deleted file mode 100644 index 45fbda1..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/music_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Music do - context 'included in User' do - describe '#music' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Page' do - pages = mock_graph :get, 'me/music', 'user/music', access_token: 'token' do - me.music - end - pages.should be_instance_of FbGraph2::Edge - pages.should_not be_blank - pages.each do |page| - page.should be_instance_of FbGraph2::Page - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/noreply_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/noreply_spec.rb deleted file mode 100644 index 05c043d..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/noreply_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Noreply do - context 'included in Event' do - let(:event) { FbGraph2::Event.new('event_id').authenticate('token') } - - describe '#noreply' do - it 'should return an Array of FbGraph2::User' do - users = mock_graph :get, 'event_id/noreply', 'event/noreply', access_token: 'token' do - event.noreply - end - users.should be_instance_of FbGraph2::Edge - users.should_not be_blank - users.each do |user| - user.should be_instance_of FbGraph2::User - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/notifications_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/notifications_spec.rb deleted file mode 100644 index 9f52e0d..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/notifications_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Notifications do - context 'included in User' do - describe '#notifications' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Notification' do - notifications = mock_graph :get, 'me/notifications', 'user/notifications', access_token: 'token' do - me.notifications - end - notifications.should be_instance_of FbGraph2::Edge - notifications.should_not be_blank - notifications.each do |notification| - notification.should be_instance_of FbGraph2::Notification - end - end - end - - describe '#notification!' do - let(:user) { FbGraph2::User.new('user_id') } - it 'should return true' do - mock_graph :post, 'user_id/notifications', 'success_true', access_token: 'app_token', params: { - href: 'href', template: 'template' - } do - user.authenticate('app_token').notification! href: 'href', template: 'template' - end.should be true - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/offers_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/offers_spec.rb deleted file mode 100644 index 1ed303c..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/offers_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Offers do - context 'included in Page' do - let(:page) { FbGraph2::Page.new('page_id').authenticate('page_token') } - - describe '#offers' do - it 'should return an Array of FbGraph2::Offer' do - offers = mock_graph :get, 'page_id/offers', 'page/offers', access_token: 'page_token' do - page.offers - end - offers.should be_instance_of FbGraph2::Edge - offers.should_not be_blank - offers.each do |offer| - offer.should be_instance_of FbGraph2::Offer - end - end - end - - describe '#offer!' do - it 'should return FbGraph2::Offer' do - offer = mock_graph :post, 'page_id/offers', 'success_with_id', access_token: 'page_token', params: { - title: 'Foobar', - expiration_time: 10.days.from_now.to_s - } do - page.offer!( - title: 'Foobar', - expiration_time: 10.days.from_now - ) - end - offer.should be_instance_of FbGraph2::Offer - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/outbox_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/outbox_spec.rb deleted file mode 100644 index eba845a..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/outbox_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Outbox do - context 'included in User' do - describe '#outbox' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Thread' do - threads = mock_graph :get, 'me/outbox', 'user/outbox', access_token: 'token' do - me.outbox - end - threads.should be_instance_of FbGraph2::Edge - threads.should_not be_blank - threads.each do |thread| - thread.should be_instance_of FbGraph2::Thread - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/permissions_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/permissions_spec.rb deleted file mode 100644 index 0b992f9..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/permissions_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Permissions do - context 'included in User' do - describe '#permissions' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Struct::Permission' do - permissions = mock_graph :get, 'me/permissions', 'user/permissions', access_token: 'token' do - me.permissions - end - permissions.should be_instance_of FbGraph2::Edge - permissions.should_not be_blank - permissions.each do |permission| - permission.should be_instance_of FbGraph2::Struct::Permission - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/photos_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/photos_spec.rb deleted file mode 100644 index a71062d..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/photos_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Photos do - context 'included in User' do - let(:me) { FbGraph2::User.me('token') } - - describe '#photos' do - it 'should return an Array of FbGraph2::Photo' do - photos = mock_graph :get, 'me/photos', 'user/photos', access_token: 'token' do - me.photos - end - photos.should be_instance_of FbGraph2::Edge - photos.should_not be_blank - photos.each do |photo| - photo.should be_instance_of FbGraph2::Photo - end - end - end - - describe 'photo!' do - it 'should return FbGraph2::Post' do - photo = mock_graph :post, 'me/photos', 'success_with_id', access_token: 'token' do - me.photo! url: 'http://example.com/me.png' - end - photo.should be_instance_of FbGraph2::Photo - photo.id.should == 'created_object_id' - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/picture_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/picture_spec.rb deleted file mode 100644 index 591bd7b..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/picture_spec.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Picture do - context 'included in User' do - describe '#picture' do - let(:me) { FbGraph2::User.me('token') } - it do - mock_graph :get, 'me/picture', 'user/picture', access_token: 'token', params: { - redirect: false - } do - me.picture - end.should be_instance_of FbGraph2::Struct::Picture - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/pokes_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/pokes_spec.rb deleted file mode 100644 index 7a9fd71..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/pokes_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Pokes do - context 'included in User' do - describe '#pokes' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Struct::Poke' do - pokes = mock_graph :get, 'me/pokes', 'user/pokes', access_token: 'token' do - me.pokes - end - pokes.should be_instance_of FbGraph2::Edge - pokes.should_not be_blank - pokes.each do |poke| - poke.should be_instance_of FbGraph2::Struct::Poke - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/posts_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/posts_spec.rb deleted file mode 100644 index 6a8b122..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/posts_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Posts do - context 'included in User' do - let(:me) { FbGraph2::User.me('token') } - describe '#posts' do - it 'should return an Array of FbGraph2::Post' do - posts = mock_graph :get, 'me/posts', 'user/posts', access_token: 'token' do - me.posts - end - posts.should be_instance_of FbGraph2::Edge - posts.should_not be_blank - posts.each do |post| - post.should be_instance_of FbGraph2::Post - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/promotable_posts_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/promotable_posts_spec.rb deleted file mode 100644 index 5d74eef..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/promotable_posts_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::PromotablePosts do - context 'included in Page' do - describe '#promotable_posts' do - let(:page) { FbGraph2::Page.new('page_id').authenticate('page_token') } - it 'should return an Array of FbGraph2::Post' do - posts = mock_graph :get, 'page_id/promotable_posts', 'page/promotable_posts', access_token: 'page_token' do - page.promotable_posts - end - posts.should be_instance_of FbGraph2::Edge - posts.should_not be_blank - posts.each do |post| - post.should be_instance_of FbGraph2::Post - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/roles_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/roles_spec.rb deleted file mode 100644 index d409ac6..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/roles_spec.rb +++ /dev/null @@ -1,67 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Roles do - context 'included in App' do - let(:app) { FbGraph2::App.app('app_token') } - - describe '#roles' do - it 'should return an Array of FbGraph2::Struct::Role' do - roles = mock_graph :get, 'app/roles', 'app/roles', access_token: 'app_token' do - app.roles - end - roles.should be_instance_of FbGraph2::Edge - roles.should_not be_blank - roles.each do |role| - role.should be_instance_of FbGraph2::Struct::Role - end - end - end - end - - context 'included in Page' do - let(:page) { FbGraph2::Page.new('page_id').authenticate('page_token') } - - describe '#roles' do - it 'should return an Array of FbGraph2::User' do - roles = mock_graph :get, 'page_id/roles', 'page/roles', access_token: 'page_token' do - page.roles - end - roles.should be_instance_of FbGraph2::Edge - roles.should_not be_blank - roles.each do |role| - role.should be_instance_of FbGraph2::User - end - end - - context 'when blank' do - it 'should return a blank Array' do - roles = mock_graph :get, 'page_id/roles', 'blank_collection', access_token: 'page_token' do - page.roles - end - roles.should be_instance_of FbGraph2::Edge - roles.should be_blank - end - end - - context 'when user context specified' do - let(:user) { FbGraph2::User.new('user_id') } - - it 'should return a FbGraph2::User' do - role = mock_graph :get, 'page_id/roles/user_id', 'page/roles_single', access_token: 'page_token' do - page.roles user - end - role.should be_instance_of FbGraph2::User - end - - context 'when blank' do - it 'should return nil' do - role = mock_graph :get, 'page_id/roles/user_id', 'blank_collection', access_token: 'page_token' do - page.roles user - end - role.should be_nil - end - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/scores_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/scores_spec.rb deleted file mode 100644 index 16f26f0..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/scores_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Scores do - context 'included in User' do - describe '#scores' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Struct::Score' do - scores = mock_graph :get, 'me/scores', 'user/scores', access_token: 'token' do - me.scores - end - scores.should be_instance_of FbGraph2::Edge - scores.should_not be_blank - scores.each do |score| - score.should be_instance_of FbGraph2::Struct::Score - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/settings_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/settings_spec.rb deleted file mode 100644 index e7c9ded..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/settings_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Settings do - context 'included in Page' do - describe '#settings' do - let(:page) { FbGraph2::Page.new('page_id').authenticate('page_token') } - it 'should return an Array of FbGraph2::Struct::Permission' do - settings = mock_graph :get, 'page_id/settings', 'page/settings', access_token: 'page_token' do - page.settings - end - settings.should be_instance_of FbGraph2::Edge - settings.should_not be_blank - settings.each do |setting| - setting.should be_instance_of FbGraph2::Struct::Setting - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/shared_posts_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/shared_posts_spec.rb deleted file mode 100644 index 1f33dd1..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/shared_posts_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::SharedPosts do - context 'included in Post' do - describe '#shared_posts' do - let(:post) { FbGraph2::Post.new('post_id').authenticate('token') } - it 'should return an Array of FbGraph2::Post' do - posts = mock_graph :get, 'post_id/sharedposts', 'post/shared_posts', access_token: 'token' do - post.shared_posts - end - posts.should be_instance_of FbGraph2::Edge - posts.should_not be_blank - posts.each do |post| - post.should be_instance_of FbGraph2::Post - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/statuses_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/statuses_spec.rb deleted file mode 100644 index 06a2178..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/statuses_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Statuses do - context 'included in User' do - let(:me) { FbGraph2::User.me('token') } - describe '#statuses' do - it 'should return an Array of FbGraph2::Post' do - posts = mock_graph :get, 'me/statuses', 'user/statuses', access_token: 'token' do - me.statuses - end - posts.should be_instance_of FbGraph2::Edge - posts.should_not be_blank - posts.each do |post| - post.should be_instance_of FbGraph2::Post - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/subscriptions_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/subscriptions_spec.rb deleted file mode 100644 index 5c00cd0..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/subscriptions_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Subscriptions do - context 'included in App' do - describe '#subscriptions' do - let(:app) { FbGraph2::App.app('app_token') } - it 'should return an Array of FbGraph2::Struct::Subscription' do - subscriptions = mock_graph :get, 'app/subscriptions', 'app/subscriptions', access_token: 'app_token' do - app.subscriptions - end - subscriptions.should be_instance_of FbGraph2::Edge - subscriptions.should_not be_blank - subscriptions.each do |subscription| - subscription.should be_instance_of FbGraph2::Struct::Subscription - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/taggable_friends_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/taggable_friends_spec.rb deleted file mode 100644 index 67a13e7..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/taggable_friends_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::TaggableFriends do - context 'included in User' do - describe '#taggable_friends' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Struct::Friend' do - users = mock_graph :get, 'me/taggable_friends', 'user/taggable_friends', access_token: 'token' do - me.taggable_friends - end - users.should be_instance_of FbGraph2::Edge - users.should_not be_blank - users.each do |user| - user.should be_instance_of FbGraph2::Struct::Friend - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/television_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/television_spec.rb deleted file mode 100644 index 1b9fe55..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/television_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Television do - context 'included in User' do - describe '#television' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Page' do - pages = mock_graph :get, 'me/television', 'user/television', access_token: 'token' do - me.television - end - pages.should be_instance_of FbGraph2::Edge - pages.should_not be_blank - pages.each do |page| - page.should be_instance_of FbGraph2::Page - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/test_users_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/test_users_spec.rb deleted file mode 100644 index 62957c6..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/test_users_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::TestUsers do - context 'included in App' do - describe '#test_users' do - let(:app) { FbGraph2::App.app('app_token') } - it 'should return an Array of FbGraph2::User with test_user token' do - users = mock_graph :get, 'app/accounts/test-users', 'app/test_users', access_token: 'app_token' do - app.test_users - end - users.should be_instance_of FbGraph2::Edge - users.should_not be_blank - users.each do |user| - user.should be_instance_of FbGraph2::User - user.access_token.should == 'test_user_token' - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge/videos_spec.rb b/fb_graph2.original/spec/fb_graph2/edge/videos_spec.rb deleted file mode 100644 index 9cccd8e..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge/videos_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::Videos do - context 'included in User' do - let(:me) { FbGraph2::User.me('token') } - - describe '#videos' do - it 'should return an Array of FbGraph2::Video' do - videos = mock_graph :get, 'me/videos', 'user/videos', access_token: 'token' do - me.videos - end - videos.should be_instance_of FbGraph2::Edge - videos.should_not be_blank - videos.each do |video| - video.should be_instance_of FbGraph2::Video - end - end - end - - describe '#video!' do - it do - video = mock_graph :post, 'me/videos', 'success_with_id', access_token: 'token' do - me.video! source: File.new(__FILE__), message: 'hello' - end - video.should be_instance_of FbGraph2::Video - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/edge_spec.rb b/fb_graph2.original/spec/fb_graph2/edge_spec.rb deleted file mode 100644 index 51bd145..0000000 --- a/fb_graph2.original/spec/fb_graph2/edge_spec.rb +++ /dev/null @@ -1,148 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge do - let(:me) { FbGraph2::User.me 'access_token' } - let(:post) { FbGraph2::Post.new 'post_id', access_token: 'access_token' } - let(:feed) do - mock_graph :get, 'me/feed', 'user/feed', access_token: 'access_token' do - me.feed - end - end - let(:comments) do - mock_graph :get, 'post_id/comments', 'post/comments_with_summary', access_token: 'access_token' do - post.comments - end - end - - describe 'summary' do - subject { comments } - its(:summary) { should include order: 'chronological', total_count: 4 } - its(:total_count) { should == 4 } - end - - describe 'pagination' do - context 'when next/previous-url-based' do - describe 'next' do - context 'when next page exists' do - it 'should fetch next page' do - feed.collection.next.should match(limit: '25', until: '1400651347') - _next_ = mock_graph :get, 'me/feed', 'blank_collection', access_token: 'access_token', params: { - limit: 25, - until: '1400651347' - } do - feed.next - end - _next_.should be_instance_of FbGraph2::Edge - end - end - - context 'otherwise' do - let(:without_next) do - mock_graph :get, 'me/feed', 'blank_collection', access_token: 'access_token', params: { - limit: 25, - until: '1400651347' - } do - feed.next - end - end - - it do - without_next.collection.next.should be_blank - without_next.next.should be_blank - end - end - end - - describe 'previous' do - context 'when previous page exists' do - it 'should fetch previous page' do - feed.collection.previous.should match(limit: '25', since: '1401410484') - previous = mock_graph :get, 'me/feed', 'blank_collection', access_token: 'access_token', params: { - limit: 25, - since: '1401410484' - } do - feed.previous - end - previous.should be_instance_of FbGraph2::Edge - end - end - - context 'otherwise' do - let(:without_previous) do - mock_graph :get, 'me/feed', 'blank_collection', access_token: 'access_token', params: { - limit: 25, - since: '1401410484' - } do - feed.previous - end - end - - it do - without_previous.collection.previous.should be_blank - without_previous.previous.should be_blank - end - end - end - end - - context 'when cursors-based' do - describe 'next' do - context 'when after cursor exists' do - it 'should fetch next page' do - comments.collection.after.should == 'NA==' - _next_ = mock_graph :get, 'post_id/comments', 'blank_collection', access_token: 'access_token', params: { - after: 'NA==' - } do - comments.next - end - _next_.should be_instance_of FbGraph2::Edge - end - end - - context 'otherwise' do - let(:without_next) do - mock_graph :get, 'post_id/comments', 'blank_collection', access_token: 'access_token', params: { - after: 'NA==' - } do - comments.next - end - end - - it do - without_next.collection.after.should be_blank - without_next.next.should be_blank - end - end - end - - describe 'previous' do - context 'when before cursor exists' do - it 'should fetch previous page' do - comments.collection.before.should == 'MQ==' - previous = mock_graph :get, 'post_id/comments', 'blank_collection', access_token: 'access_token', params: { - before: 'MQ==' - } do - comments.previous - end - previous.should be_instance_of FbGraph2::Edge - end - end - - context 'otherwise' do - let(:without_previous) do - mock_graph :get, 'post_id/comments', 'blank_collection', access_token: 'access_token', params: { - before: 'MQ==' - } do - comments.previous - end - end - - it do - without_previous.collection.before.should be_blank - without_previous.previous.should be_blank - end - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/node_spec.rb b/fb_graph2.original/spec/fb_graph2/node_spec.rb deleted file mode 100644 index 4aa5dcd..0000000 --- a/fb_graph2.original/spec/fb_graph2/node_spec.rb +++ /dev/null @@ -1,171 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Node do - let(:klass) { FbGraph2::Node } - let(:instance) { klass.new 'identifier' } - - describe 'API Versioning' do - before do - @original = FbGraph2.api_version - end - - after do - FbGraph2.api_version = @original - end - - describe 'via global setting' do - before do - FbGraph2.api_version = 'v2.x' - end - - describe '#fetch' do - it 'should use api_version globally' do - expect do - instance.fetch - end.to request_to 'v2.x/identifier', :get, disable_api_versioning: true - end - end - - describe '#edge' do - it 'should use api_version globally' do - expect do - instance.edge :foo - end.to request_to 'v2.x/identifier/foo', :get, disable_api_versioning: true - end - end - end - - describe 'via per-call option' do - describe '#fetch' do - it 'should use api_version locally' do - expect do - instance.fetch nil, api_version: 'v2.y' - end.to request_to 'v2.y/identifier', :get, disable_api_versioning: true - FbGraph2.api_version.should == @original - end - end - - describe '#edge' do - it 'should use api_version locally' do - expect do - instance.edge :foo, {}, api_version: 'v2.y' - end.to request_to 'v2.y/identifier/foo', :get, disable_api_versioning: true - FbGraph2.api_version.should == @original - end - end - end - end - - context 'class' do - subject { klass } - it { should_not respond_to :register_attributes } - it { should_not respond_to :registered_attributes } - it { should_not respond_to :registered_attributes= } - end - - context 'instance' do - subject { instance } - it { should_not respond_to :assign } - - describe '#initialize' do - its(:id) { should == 'identifier' } - its(:access_token) { should be_nil } - its(:raw_attributes) { should == {} } - end - - describe '#authenticate' do - before { instance.authenticate 'access_token' } - its(:access_token) { should == 'access_token' } - end - - describe '#edges' do - it do - instance.edges.should be_blank - end - - context 'for FbGraph2::User' do - it do - FbGraph2::User.me('token').edges.should include :accounts, :feed, :feed! - end - end - end - - describe '#update' do - it 'should call API with POST method' do - expect do - instance.update - end.to request_to 'identifier', :post - end - end - - describe '#destroy' do - it 'should call API with DELETE method' do - expect do - instance.destroy - end.to request_to 'identifier', :delete - end - end - - describe '#build_params' do - context 'when an array of strings given' do - it 'should join fields option' do - mock_graph :get, 'identifier', 'user/me', params: { - fields: 'f1,f2,f3' - } do - instance.fetch(fields: ['f1', 'f2', 'f3']) - end - end - end - - context 'when an array of symbols given' do - it 'should join fields option' do - mock_graph :get, 'identifier', 'user/me', params: { - fields: 'f1,f2,f3' - } do - instance.fetch(fields: [:f1, :f2, :f3]) - end - end - end - - context 'when a string given' do - it 'should join fields option' do - mock_graph :get, 'identifier', 'user/me', params: { - fields: 'f1,f2,f3' - } do - instance.fetch(fields: 'f1,f2,f3') - end - end - end - end - - describe '#handle_response' do - context 'when error' do - context 'when valid json' do - it 'should raise' do - expect do - mock_graph :get, 'identifier', 'error/400/2500', status: 400 do - instance.fetch - end - end.to raise_error { |e| - e.should be_instance_of FbGraph2::Exception::BadRequest - e.message.should == mock_json('error/400/2500')[:error][:message] - } - end - end - - context 'when invalid json' do - it 'should raise' do - expect do - mock_graph :get, 'identifier', 'error/invalid_format', status: 400 do - instance.fetch - end - end.to raise_error { |e| - e.should be_instance_of FbGraph2::Exception - e.message.should == "Unparsable Response: #{mock_json('error/invalid_format')}" - } - end - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/node_subclass_spec.rb b/fb_graph2.original/spec/fb_graph2/node_subclass_spec.rb deleted file mode 100644 index 15d651d..0000000 --- a/fb_graph2.original/spec/fb_graph2/node_subclass_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -require 'spec_helper' - -module FbGraph2 - class NodeSubClass < Node - end -end - -describe FbGraph2::NodeSubClass do - let(:klass) { FbGraph2::NodeSubClass } - let(:instance) { klass.new 'identifier' } - - context 'class' do - subject { klass } - it { should respond_to :register_attributes } - it { should respond_to :registered_attributes } - it { should respond_to :registered_attributes= } - end - - context 'instance' do - subject { instance } - it { should respond_to :assign } - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/page_spec.rb b/fb_graph2.original/spec/fb_graph2/page_spec.rb deleted file mode 100644 index 277f677..0000000 --- a/fb_graph2.original/spec/fb_graph2/page_spec.rb +++ /dev/null @@ -1,61 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Page do - context 'with optional fields' do - subject { page } - let(:page) do - attributes = mock_json 'page/with_optional_fields' - FbGraph2::Page.new attributes[:id], attributes - end - - describe '#context' do - subject { page.context } - it { should be_instance_of FbGraph2::Struct::Context::PageContext } - - describe 'friends_who_like' do - subject { page.context.friends_who_like } - it { should be_instance_of FbGraph2::Collection } - it { should be_blank } - its(:total_count) { should == 14 } - its(:summary) { should include :social_sentence } - end - end - - describe '#parking' do - subject { page.parking } - [:street, :lot, :valet].each do |key| - its(key) { should be false } - end - end - - describe '#restaurant_services' do - subject { page.restaurant_services } - [:kids, :delivery, :catering, :waiter, :outdoor, :takeout].each do |key| - its(key) { should be false } - end - [:groups, :reserve, :walkins].each do |key| - its(key) { should be true } - end - end - - describe '#restaurant_specialties' do - subject { page.restaurant_specialties } - [:coffee, :drinks, :breakfast, :lunch].each do |key| - its(key) { should be false } - end - [:dinner].each do |key| - its(key) { should be true } - end - end - - describe '#payment_options' do - subject { page.payment_options } - [:cash_only, :discover].each do |key| - its(key) { should be false } - end - [:amex, :mastercard, :visa].each do |key| - its(key) { should be true } - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/request_filter/authenticator_spec.rb b/fb_graph2.original/spec/fb_graph2/request_filter/authenticator_spec.rb deleted file mode 100644 index a43503b..0000000 --- a/fb_graph2.original/spec/fb_graph2/request_filter/authenticator_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::RequestFilter::Authenticator do - let(:klass) { FbGraph2::RequestFilter::Authenticator } - - let(:endpoint) { 'https://graph.facebook.com/matake' } - let(:request) { HTTP::Message.new_request(:get, URI.parse(endpoint)) } - let(:request_filter) { klass.new token } - - context 'when String given' do - let(:token) { 'token' } - it do - request_filter.filter_request(request) - request.header["Authorization"].should == ["Bearer #{token}"] - end - end - - context 'when Rack::OAuth2::AccessToken::Bearer given' do - let(:token) { Rack::OAuth2::AccessToken::Bearer.new access_token: 'token' } - it do - request_filter.filter_request(request) - request.header["Authorization"].should == ["Bearer #{token.access_token}"] - end - end - - context 'when Rack::OAuth2::AccessToken::Legacy given' do - let(:token) { Rack::OAuth2::AccessToken::Legacy.new access_token: 'token' } - it do - request_filter.filter_request(request) - request.header["Authorization"].should == ["OAuth #{token.access_token}"] - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/request_filter/debugger_spec.rb b/fb_graph2.original/spec/fb_graph2/request_filter/debugger_spec.rb deleted file mode 100644 index c9a4dc1..0000000 --- a/fb_graph2.original/spec/fb_graph2/request_filter/debugger_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::RequestFilter::Debugger do - let(:endpoint) { 'https://graph.facebook.com/matake' } - let(:request) { HTTP::Message.new_request(:get, URI.parse(endpoint)) } - let(:response) { HTTP::Message.new_response({:hello => 'world'}.to_json) } - let(:request_filter) { FbGraph2::RequestFilter::Debugger.new } - - describe '#filter_request' do - it 'should log request' do - [ - "======= [FbGraph2] API REQUEST STARTED =======", - request.dump - ].each do |output| - expect(FbGraph2.logger).to receive(:info).with output - end - request_filter.filter_request(request) - end - end - - describe '#filter_response' do - it 'should log response' do - [ - "--------------------------------------------------", - response.dump, - "======= [FbGraph2] API REQUEST FINISHED =======" - ].each do |output| - expect(FbGraph2.logger).to receive(:info).with output - end - request_filter.filter_response(request, response) - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/searchable_spec.rb b/fb_graph2.original/spec/fb_graph2/searchable_spec.rb deleted file mode 100644 index 22ecfc1..0000000 --- a/fb_graph2.original/spec/fb_graph2/searchable_spec.rb +++ /dev/null @@ -1,50 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Searchable do - describe 'search' do - context 'User' do - it 'should return users' do - users = mock_graph :get, 'search', 'search/user', access_token: 'token', params: { - q: 'nov.matake', - type: 'user' - } do - FbGraph2::User.search 'nov.matake', 'token' - end - users.should be_instance_of FbGraph2::Searchable::Result - users.should_not be_empty - users.each do |user| - user.should be_instance_of FbGraph2::User - end - end - end - end - - describe 'pagination' do - context 'when first page' do - let :page1 do - mock_graph :get, 'search', 'search/user', access_token: 'token', params: { - q: 'nov.matake', - type: 'user' - } do - FbGraph2::User.search 'nov.matake', 'token' - end - end - - it 'should have next' do - mock_graph :get, 'search', 'blank_collection', access_token: 'token', params: { - q: 'nov.matake', - type: 'user', - __after_id: 'enc_AeyyBJc7uo9gY-nHN9-LM0yG_IKBN5nCmqdkG8b4Ql-COLTnpQ-2NUc-xSDK6VwPhsq2W9Ktnr0zf7dD25Bc9eKT', - limit: 5000, - offset: 5000 - } do - page1.next - end - end - - it 'should have no previous' do - page1.previous.should be_blank - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/token_metadata_spec.rb b/fb_graph2.original/spec/fb_graph2/token_metadata_spec.rb deleted file mode 100644 index edf35ae..0000000 --- a/fb_graph2.original/spec/fb_graph2/token_metadata_spec.rb +++ /dev/null @@ -1,51 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::TokenMetadata do - let(:app_token) do - attributes = mock_json 'token_metadata/app_token' - FbGraph2::TokenMetadata.new attributes[:data] - end - let(:user_token) do - attributes = mock_json 'token_metadata/user_token' - FbGraph2::TokenMetadata.new attributes[:data] - end - let(:page_token) do - attributes = mock_json 'token_metadata/page_token' - FbGraph2::TokenMetadata.new attributes[:data] - end - let(:invalid_token) do - attributes = mock_json 'token_metadata/invalid_token' - FbGraph2::TokenMetadata.new attributes[:data] - end - - context 'when app_token' do - subject { app_token } - its(:app_token?) { should == true } - its(:user_token?) { should == false } - its(:page_token?) { should == false } - end - - context 'when user_token' do - subject { user_token } - its(:app_token?) { should == false } - its(:user_token?) { should == true } - its(:page_token?) { should == false } - end - - context 'when page_token' do - subject { page_token } - its(:app_token?) { should == false } - its(:user_token?) { should == false } - its(:page_token?) { should == true } - end - - context 'when valid' do - subject { user_token } - its(:valid?) { should == true } - end - - context 'when invalid' do - subject { invalid_token } - its(:valid?) { should == false } - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/user_spec.rb b/fb_graph2.original/spec/fb_graph2/user_spec.rb deleted file mode 100644 index 3dd7a97..0000000 --- a/fb_graph2.original/spec/fb_graph2/user_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::User do - describe '.me' do - let(:klass) { FbGraph2::User } - - it 'should not call API' do - expect do - me = klass.me 'token' - me.should be_instance_of klass - end.not_to request_to 'me' - end - - context 'when fetched' do - it 'should call API' do - me = mock_graph :get, 'me', 'user/me' do - klass.me('token').fetch - end - me.should be_instance_of klass - end - - context 'when ext attrs included' do - it 'should success to parse' do - me = mock_graph :get, 'me', 'user/me_with_ext_attrs' do - klass.me('token').fetch - end - [ - :age_range, :context, :currency, :devices - ].each do |key| - me.send(key).should be_present - end - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2/util_spec.rb b/fb_graph2.original/spec/fb_graph2/util_spec.rb deleted file mode 100644 index db7968c..0000000 --- a/fb_graph2.original/spec/fb_graph2/util_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Util do - describe '.as_identifier' do - context 'when FbGraph2::Node given' do - it do - FbGraph2::Util.as_identifier( - FbGraph2::Node.new 'object_id' - ).should == 'object_id' - end - end - - context 'when String given' do - it do - FbGraph2::Util.as_identifier('object_id').should == 'object_id' - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/fb_graph2_spec.rb b/fb_graph2.original/spec/fb_graph2_spec.rb deleted file mode 100644 index b38cbc4..0000000 --- a/fb_graph2.original/spec/fb_graph2_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -require 'spec_helper' - -describe FbGraph2 do - subject { FbGraph2 } - after { FbGraph2.debugging = false } - - context 'as default' do - its(:logger) { should be_a Logger } - its(:api_version) { should == 'v2.0' } - its(:root_url) { should == 'https://graph.facebook.com' } - its(:object_classes) { should contain_exactly *FbGraph2::Node.subclasses + [FbGraph2::Place] } - it { should_not be_debugging } - end - - describe '.debug!' do - before { FbGraph2.debug! } - it { should be_debugging } - end - - describe '.http_client' do - context 'with http_config' do - before do - FbGraph2.http_config do |config| - config.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE - config.connect_timeout = 30 - config.send_timeout = 40 - config.receive_timeout = 60 - end - end - - it 'should configure Rack::OAuth2 and FbGraph2 http_client' do - [Rack::OAuth2, FbGraph2].each do |klass| - klass.http_client.ssl_config.verify_mode.should == OpenSSL::SSL::VERIFY_NONE - klass.http_client.connect_timeout.should == 30 - klass.http_client.send_timeout.should == 40 - klass.http_client.receive_timeout.should == 60 - end - end - end - end -end \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/app/app.json b/fb_graph2.original/spec/mock_json/app/app.json deleted file mode 100644 index 8a6afdc..0000000 --- a/fb_graph2.original/spec/mock_json/app/app.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "category": "Business", - "daily_active_users": "10000", - "daily_active_users_rank": 1215, - "description": "A tool to help browse objects within the Facebook Graph API, manage permissions, obtain access tokens and learn how it all works.", - "icon_url": "https://fbcdn-photos-a-a.akamaihd.net/hphotos-ak-xpa1/t39.2081-0/851576_646264348772288_612357246_n.png", - "link": "https://www.facebook.com/apps/application.php?id=145634995501895", - "logo_url": "https://fbcdn-photos-a-a.akamaihd.net/hphotos-ak-xpa1/t39.2081-0/p75x75/851563_646263475439042_787584105_n.png", - "monthly_active_users": "500000", - "monthly_active_users_rank": 432, - "name": "Graph API Explorer", - "subcategory": "General", - "weekly_active_users": "100000", - "id": "145634995501895" -} \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/app/banned.json b/fb_graph2.original/spec/mock_json/app/banned.json deleted file mode 100644 index 7247a9b..0000000 --- a/fb_graph2.original/spec/mock_json/app/banned.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "data": [{ - "id": "100003934202581", - "name": "Open Graph Test User" - }], - "paging": { - "cursors": { - "before": "MTAwMDAzOTM0MjAyNTgx", - "after": "MTAwMDAzOTM0MjAyNTgx" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/app/roles.json b/fb_graph2.original/spec/mock_json/app/roles.json deleted file mode 100644 index c2cf38c..0000000 --- a/fb_graph2.original/spec/mock_json/app/roles.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": [{ - "app_id": "210798282372757", - "user": "579612276", - "role": "administrators" - }], - "paging": { - "next": "https://graph.facebook.com/v2.1/210798282372757/roles?limit=5000&offset=5000&__after_id=enc_AezKeljwOb-ajJmD2AAQnxKG4ppLUt__oG9ScW9Um9PcjIxWf1zs1-LbrM8skz4rDAVCAQxs3SO_-GeS6OnwPJNA" - } -} diff --git a/fb_graph2.original/spec/mock_json/app/subscriptions.json b/fb_graph2.original/spec/mock_json/app/subscriptions.json deleted file mode 100644 index 6895c38..0000000 --- a/fb_graph2.original/spec/mock_json/app/subscriptions.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "data": [{ - "object": "user", - "callback_url": "http://fbgraphsample.heroku.com/subscriptions/7", - "fields": ["email"], - "active": true - }] -} diff --git a/fb_graph2.original/spec/mock_json/app/test_users.json b/fb_graph2.original/spec/mock_json/app/test_users.json deleted file mode 100644 index f6d2191..0000000 --- a/fb_graph2.original/spec/mock_json/app/test_users.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "data": [{ - "id": "100003934202581", - "login_url": "https://developers.facebook.com/checkpoint/test-user-login/100003934202581/", - "access_token": "test_user_token" - }, { - "id": "100003888272508", - "login_url": "https://developers.facebook.com/checkpoint/test-user-login/100003888272508/", - "access_token": "test_user_token" - }], - "paging": { - "cursors": { - "before": "MTAwMDAzOTM0MjAyNTgx", - "after": "MTAwMDAzODg4MjcyNTA4" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/blank_collection.json b/fb_graph2.original/spec/mock_json/blank_collection.json deleted file mode 100644 index ccb5621..0000000 --- a/fb_graph2.original/spec/mock_json/blank_collection.json +++ /dev/null @@ -1 +0,0 @@ -{"data":[]} \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/error/400/191.json b/fb_graph2.original/spec/mock_json/error/400/191.json deleted file mode 100644 index ee6e300..0000000 --- a/fb_graph2.original/spec/mock_json/error/400/191.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "error": { - "message": "Missing redirect_uri parameter.", - "type": "OAuthException", - "code": 191 - } -} diff --git a/fb_graph2.original/spec/mock_json/error/400/2500.json b/fb_graph2.original/spec/mock_json/error/400/2500.json deleted file mode 100644 index fbc044d..0000000 --- a/fb_graph2.original/spec/mock_json/error/400/2500.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "error": { - "message": "An active access token must be used to query information about the current user.", - "type": "OAuthException", - "code": 2500 - } -} diff --git a/fb_graph2.original/spec/mock_json/error/invalid_format.json b/fb_graph2.original/spec/mock_json/error/invalid_format.json deleted file mode 100644 index 6647958..0000000 --- a/fb_graph2.original/spec/mock_json/error/invalid_format.json +++ /dev/null @@ -1 +0,0 @@ -NOT FOUND \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/event/attending.json b/fb_graph2.original/spec/mock_json/event/attending.json deleted file mode 100644 index d43fbcd..0000000 --- a/fb_graph2.original/spec/mock_json/event/attending.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "data": [{ - "name": "Akira Otaishi", - "rsvp_status": "attending", - "id": "553375548107883" - }, { - "name": "Shin-ichiro Kagaya", - "rsvp_status": "attending", - "id": "241546062702044" - }], - "paging": { - "cursors": { - "after": "TVRBd01EQXdNRFl6TWpjME1qSTBPakUwTVRBMU1UQTJNREE2TVRZMU1EZzBPRGsyT0RRNE5UZ3g=", - "before": "TVRBd01EQXpNRFl6TWpjM01qTXhPakUwTVRBMU1UQTJNREE2TVRjMk9UQTRNVE0xTmpnM09UWXg=" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/event/declined.json b/fb_graph2.original/spec/mock_json/event/declined.json deleted file mode 100644 index d43fbcd..0000000 --- a/fb_graph2.original/spec/mock_json/event/declined.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "data": [{ - "name": "Akira Otaishi", - "rsvp_status": "attending", - "id": "553375548107883" - }, { - "name": "Shin-ichiro Kagaya", - "rsvp_status": "attending", - "id": "241546062702044" - }], - "paging": { - "cursors": { - "after": "TVRBd01EQXdNRFl6TWpjME1qSTBPakUwTVRBMU1UQTJNREE2TVRZMU1EZzBPRGsyT0RRNE5UZ3g=", - "before": "TVRBd01EQXpNRFl6TWpjM01qTXhPakUwTVRBMU1UQTJNREE2TVRjMk9UQTRNVE0xTmpnM09UWXg=" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/event/invited.json b/fb_graph2.original/spec/mock_json/event/invited.json deleted file mode 100644 index d43fbcd..0000000 --- a/fb_graph2.original/spec/mock_json/event/invited.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "data": [{ - "name": "Akira Otaishi", - "rsvp_status": "attending", - "id": "553375548107883" - }, { - "name": "Shin-ichiro Kagaya", - "rsvp_status": "attending", - "id": "241546062702044" - }], - "paging": { - "cursors": { - "after": "TVRBd01EQXdNRFl6TWpjME1qSTBPakUwTVRBMU1UQTJNREE2TVRZMU1EZzBPRGsyT0RRNE5UZ3g=", - "before": "TVRBd01EQXpNRFl6TWpjM01qTXhPakUwTVRBMU1UQTJNREE2TVRjMk9UQTRNVE0xTmpnM09UWXg=" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/event/maybe.json b/fb_graph2.original/spec/mock_json/event/maybe.json deleted file mode 100644 index d43fbcd..0000000 --- a/fb_graph2.original/spec/mock_json/event/maybe.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "data": [{ - "name": "Akira Otaishi", - "rsvp_status": "attending", - "id": "553375548107883" - }, { - "name": "Shin-ichiro Kagaya", - "rsvp_status": "attending", - "id": "241546062702044" - }], - "paging": { - "cursors": { - "after": "TVRBd01EQXdNRFl6TWpjME1qSTBPakUwTVRBMU1UQTJNREE2TVRZMU1EZzBPRGsyT0RRNE5UZ3g=", - "before": "TVRBd01EQXpNRFl6TWpjM01qTXhPakUwTVRBMU1UQTJNREE2TVRjMk9UQTRNVE0xTmpnM09UWXg=" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/event/noreply.json b/fb_graph2.original/spec/mock_json/event/noreply.json deleted file mode 100644 index d43fbcd..0000000 --- a/fb_graph2.original/spec/mock_json/event/noreply.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "data": [{ - "name": "Akira Otaishi", - "rsvp_status": "attending", - "id": "553375548107883" - }, { - "name": "Shin-ichiro Kagaya", - "rsvp_status": "attending", - "id": "241546062702044" - }], - "paging": { - "cursors": { - "after": "TVRBd01EQXdNRFl6TWpjME1qSTBPakUwTVRBMU1UQTJNREE2TVRZMU1EZzBPRGsyT0RRNE5UZ3g=", - "before": "TVRBd01EQXpNRFl6TWpjM01qTXhPakUwTVRBMU1UQTJNREE2TVRjMk9UQTRNVE0xTmpnM09UWXg=" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/group/members.json b/fb_graph2.original/spec/mock_json/group/members.json deleted file mode 100644 index 643ab2b..0000000 --- a/fb_graph2.original/spec/mock_json/group/members.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "data": [ - { - "name": "Hayashi Tatsuya", - "administrator": false, - "id": "10152167763779825" - }, - { - "name": "Ryo Ito", - "administrator": false, - "id": "10203204372262716" - }, - { - "name": "Nov Matake", - "administrator": true, - "id": "579612276" - } - ], - "paging": { - "next": "https://graph.facebook.com/v2.1/343659285716553/members?limit=5000&offset=5000&__after_id=***" - } -} \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/page/admins.json b/fb_graph2.original/spec/mock_json/page/admins.json deleted file mode 100644 index 2bbd607..0000000 --- a/fb_graph2.original/spec/mock_json/page/admins.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": [{ - "name": "Nov Matake", - "role": "MANAGER", - "perms": ["ADMINISTER", "EDIT_PROFILE", "CREATE_CONTENT", "MODERATE_CONTENT", "CREATE_ADS", "BASIC_ADMIN"], - "id": "10152411392127277" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/140478125968442/admins?limit=5000&offset=5000&__after_id=enc_AewHp5mZW0v4ZorlBTo4lsBccesXKfIJsKvOM-Qb268XDhHwKtZnhOhNwXWSun5KdHE" - } -} diff --git a/fb_graph2.original/spec/mock_json/page/block_succeeded.json b/fb_graph2.original/spec/mock_json/page/block_succeeded.json deleted file mode 100644 index 9dd7a28..0000000 --- a/fb_graph2.original/spec/mock_json/page/block_succeeded.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "user_id": true -} \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/page/blocked.json b/fb_graph2.original/spec/mock_json/page/blocked.json deleted file mode 100644 index 2f9299f..0000000 --- a/fb_graph2.original/spec/mock_json/page/blocked.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": [{ - "name": "Jr Nov", - "id": "1575327134" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/117513961602338/blocked?limit=5000&offset=5000&__after_id=enc_AewU3hSo5zqbS5KA0i0lJYmPrLn57SMSo645aYB7BTPg1PSawPvlM9mRI_3Y_dcpeDI" - } -} diff --git a/fb_graph2.original/spec/mock_json/page/milestones.json b/fb_graph2.original/spec/mock_json/page/milestones.json deleted file mode 100644 index 61b3e8a..0000000 --- a/fb_graph2.original/spec/mock_json/page/milestones.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "data": [{ - "id": "546071975451512", - "created_time": "2013-07-05T02:04:43+0000", - "description": "Big Guest from MIT-KIT", - "end_time": "2013-06-26T19:00:00+0000", - "from": { - "category": "Community", - "name": "Identity Conference #idcon", - "id": "367989543259757" - }, - "start_time": "2013-06-26T19:00:00+0000", - "title": "idcon satellite", - "updated_time": "2013-07-05T02:04:43+0000" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/367989543259757/milestones?limit=5000&offset=5000&__after_id=enc_Aex6DrtZcpP_AZjou_LFSynIQJzuO-LR4zoj2GU-WQO3StnFciL5I6GVJ2Nlj5-6C50JJSpZnn5O-zkuPXcU4DAC" - } -} diff --git a/fb_graph2.original/spec/mock_json/page/offers.json b/fb_graph2.original/spec/mock_json/page/offers.json deleted file mode 100644 index f4fdf2e..0000000 --- a/fb_graph2.original/spec/mock_json/page/offers.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "data": [{ - "id": "797106500309744", - "from": { - "category": "Software", - "name": "FbGraph", - "id": "117513961602338" - }, - "title": "Foobar", - "created_time": "2014-09-02T09:56:14+0000", - "expiration_time": "2014-09-12T14:59:59+0000", - "image_url": "https:\/\/fbcdn-profile-a.akamaihd.net\/hprofile-ak-xap1\/v\/t1.0-1\/p200x200\/12758_485082394845491_483124061_n.png?oh=ffdf2fc204852be4167eebaeb7f1b2ec&oe=54733980&__gda__=1415926027_bbf6edaad90b94e23268131e6d8f258b", - "claim_limit": 1000000000, - "coupon_type": "in_store_only" - }], - "paging": { - "next": "https:\/\/graph.facebook.com\/v2.0\/117513961602338\/offers?limit=50&offset=50&__after_id=enc_Aey48t-R5OQbq6nWOeyBEJKEHiddR7mdWX_5Pg0nBoVbmDoe_Lr4d_5XIg4vhahIQ7oFJzHsY8P91oMo_GD_ZrNy" - } -} diff --git a/fb_graph2.original/spec/mock_json/page/promotable_posts.json b/fb_graph2.original/spec/mock_json/page/promotable_posts.json deleted file mode 100644 index f59891c..0000000 --- a/fb_graph2.original/spec/mock_json/page/promotable_posts.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "data": [{ - "id": "140478125968442_881790788503835", - "from": { - "category": "Community organization", - "name": "OAuth.jp", - "id": "140478125968442" - }, - "story": "OAuth.jp shared a link.", - "story_tags": { - "0": [{ - "id": "140478125968442", - "name": "OAuth.jp", - "offset": 0, - "length": 8, - "type": "page" - }] - }, - "link": "http://oauth.jp/blog/2014/05/09/what-happens-when-oauth2-code-leaked/", - "name": "OAuth 2.0 の code は漏れても大丈夫ってホント!? - OAuth.jp", - "caption": "oauth.jp", - "description": "昨日のCovert Redirect で Query 漏れるケースもある!?やOAuth 2.0 の脆弱性 (!?) “Covert Redirect” とはにあるように、OAuth 2.0 の code が漏れちゃうことも、ありえます。 漏れないためにやるべきことは、 …", - "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif", - "actions": [{ - "name": "Comment", - "link": "https://www.facebook.com/140478125968442/posts/881790788503835" - }, { - "name": "Like", - "link": "https://www.facebook.com/140478125968442/posts/881790788503835" - }], - "privacy": { - "description": "Public", - "value": "EVERYONE", - "friends": "", - "networks": "", - "allow": "", - "deny": "" - }, - "type": "link", - "status_type": "shared_story", - "created_time": "2014-05-09T02:18:54+0000", - "updated_time": "2014-05-09T02:18:54+0000", - "is_published": true, - "likes": { - "data": [{ - "id": "799980330042786", - "name": "Nobuyuki Tetsuka" - }, { - "id": "671955032839764", - "name": "Naohiro Fujie" - }, { - "id": "514441882016076", - "name": "Shouji Ohara" - }], - "paging": { - "cursors": { - "after": "NTE0NDQxODgyMDE2MDc2", - "before": "Nzk5OTgwMzMwMDQyNzg2" - } - } - } - }], - "paging": { - "previous": "https://graph.facebook.com/v2.0/140478125968442/promotable_posts?limit=25&since=1399601934", - "next": "https://graph.facebook.com/v2.0/140478125968442/promotable_posts?limit=25&until=1340970652" - } -} diff --git a/fb_graph2.original/spec/mock_json/page/roles.json b/fb_graph2.original/spec/mock_json/page/roles.json deleted file mode 100644 index ec6550b..0000000 --- a/fb_graph2.original/spec/mock_json/page/roles.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "data": [{ - "id": "10101078259835569", - "name": "Micah Wedemeyer", - "role": "Admin", - "perms": ["ADMINISTER", "EDIT_PROFILE", "CREATE_CONTENT", "MODERATE_CONTENT", "CREATE_ADS", "BASIC_ADMIN"] - }, { - "id": "579612276", - "name": "Nov Matake", - "role": "Admin", - "perms": ["ADMINISTER", "EDIT_PROFILE", "CREATE_CONTENT", "MODERATE_CONTENT", "CREATE_ADS", "BASIC_ADMIN"] - }], - "paging": { - "cursors": { - "before": "MTAxMDEwNzgyNTk4MzU1Njk=", - "after": "NTc5NjEyMjc2" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/page/roles_single.json b/fb_graph2.original/spec/mock_json/page/roles_single.json deleted file mode 100644 index 32dd0a2..0000000 --- a/fb_graph2.original/spec/mock_json/page/roles_single.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": [{ - "id": "579612276", - "name": "Nov Matake", - "role": "Admin", - "perms": ["ADMINISTER", "EDIT_PROFILE", "CREATE_CONTENT", "MODERATE_CONTENT", "CREATE_ADS", "BASIC_ADMIN"] - }], - "paging": { - "cursors": { - "before": "MTAxMDEwNzgyNTk4MzU1Njk=", - "after": "NTc5NjEyMjc2" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/page/settings.json b/fb_graph2.original/spec/mock_json/page/settings.json deleted file mode 100644 index e56b812..0000000 --- a/fb_graph2.original/spec/mock_json/page/settings.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "data": [ - { - "setting": "USERS_CAN_POST", - "value": true - }, - { - "setting": "USERS_CAN_MESSAGE", - "value": true - }, - { - "setting": "USERS_CAN_POST_PHOTOS", - "value": true - }, - { - "setting": "USERS_CAN_TAG_PHOTOS", - "value": false - }, - { - "setting": "WALL_COMBINED_POSTS", - "value": true - }, - { - "setting": "PLATFORM_OPTOUTS_CAN_POST", - "value": true - }, - { - "setting": "SHOW_RECENT_POSTS_BY_OTHERS", - "value": true - }, - { - "setting": "APPEARS_IN_RELATED_PAGES", - "value": true - } - ] -} \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/page/with_optional_fields.json b/fb_graph2.original/spec/mock_json/page/with_optional_fields.json deleted file mode 100644 index 8d585cb..0000000 --- a/fb_graph2.original/spec/mock_json/page/with_optional_fields.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "context": { - "friends_who_like": { - "data": [], - "summary": { - "social_sentence": "14 of your friends like this.", - "total_count": 14 - } - } - }, - "parking": { - "lot": 0, - "street": 0, - "valet": 0 - }, - "restaurant_services": { - "delivery": 0, - "catering": 0, - "groups": 1, - "kids": 0, - "outdoor": 0, - "reserve": 1, - "takeout": 0, - "waiter": 0, - "walkins": 1 - }, - "restaurant_specialties": { - "breakfast": 0, - "coffee": 0, - "dinner": 1, - "drinks": 0, - "lunch": 0 - }, - "payment_options": { - "amex": 1, - "cash_only": 0, - "discover": 0, - "mastercard": 1, - "visa": 1 - }, - "id": "139296106095829" -} diff --git a/fb_graph2.original/spec/mock_json/post/comments.json b/fb_graph2.original/spec/mock_json/post/comments.json deleted file mode 100644 index 8f088cf..0000000 --- a/fb_graph2.original/spec/mock_json/post/comments.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "data": [{ - "id": "10152461220962277_10152461646087277", - "from": { - "id": "789665437731725", - "name": "Toyoaki Ohgochi" - }, - "message": "....ポイントも付きますよ....", - "can_remove": true, - "created_time": "2014-05-24T15:05:57+0000", - "like_count": 0, - "user_likes": false - }], - "paging": { - "cursors": { - "after": "MQ==", - "before": "MQ==" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/post/comments_with_summary.json b/fb_graph2.original/spec/mock_json/post/comments_with_summary.json deleted file mode 100644 index 8f948d8..0000000 --- a/fb_graph2.original/spec/mock_json/post/comments_with_summary.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "data": [{ - "id": "10152662663892277_10152662666892277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "message": "hummm, it's not \"post\"...", - "can_remove": true, - "created_time": "2014-08-20T05:34:21+0000", - "like_count": 0, - "user_likes": false - }, { - "id": "10152662663892277_10152662686952277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "message": "579612276_10152662663892277 = post\n10152662663892277 = status", - "can_remove": true, - "created_time": "2014-08-20T05:57:11+0000", - "like_count": 0, - "user_likes": false - }, { - "id": "10152662663892277_10152662687272277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "message": "でも多分v2.1完成してない。 http://stackoverflow.com/questions/25270649/facebook-graph-api-v2-1-all-post-photos", - "can_remove": true, - "created_time": "2014-08-20T05:57:31+0000", - "like_count": 0, - "user_likes": false - }, { - "id": "10152662663892277_10152662687387277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "message": "完成さしてからだせや!!", - "can_remove": true, - "created_time": "2014-08-20T05:57:48+0000", - "like_count": 0, - "user_likes": false - }], - "paging": { - "cursors": { - "after": "NA==", - "before": "MQ==" - } - }, - "summary": { - "order": "chronological", - "total_count": 4 - } -} diff --git a/fb_graph2.original/spec/mock_json/post/liked_and_commented.json b/fb_graph2.original/spec/mock_json/post/liked_and_commented.json deleted file mode 100644 index 565f1ad..0000000 --- a/fb_graph2.original/spec/mock_json/post/liked_and_commented.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "id": "579612276_10152473646047277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "message": "test", - "actions": [{ - "name": "Comment", - "link": "https://www.facebook.com/579612276/posts/10152473646047277" - }, { - "name": "Like", - "link": "https://www.facebook.com/579612276/posts/10152473646047277" - }], - "privacy": { - "description": "Your friends", - "value": "ALL_FRIENDS", - "friends": "", - "networks": "", - "allow": "", - "deny": "" - }, - "type": "status", - "status_type": "mobile_status_update", - "created_time": "2014-05-30T06:13:26+0000", - "updated_time": "2014-05-30T06:13:30+0000", - "likes": { - "data": [{ - "id": "579612276", - "name": "Nov Matake" - }], - "paging": { - "cursors": { - "after": "NTc5NjEyMjc2", - "before": "NTc5NjEyMjc2" - } - } - }, - "comments": { - "data": [{ - "id": "10152473646047277_10152473646112277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "message": "test", - "can_remove": true, - "created_time": "2014-05-30T06:13:30+0000", - "like_count": 0, - "user_likes": false - }], - "paging": { - "cursors": { - "after": "MQ==", - "before": "MQ==" - } - } - } -} diff --git a/fb_graph2.original/spec/mock_json/post/likes.json b/fb_graph2.original/spec/mock_json/post/likes.json deleted file mode 100644 index cc282b9..0000000 --- a/fb_graph2.original/spec/mock_json/post/likes.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": [{ - "id": "689134294485152", - "name": "Shunya Iriki" - }, { - "id": "1486426304903512", - "name": "Masato Nagai" - }], - "paging": { - "cursors": { - "after": "MTQ4NjQyNjMwNDkwMzUxMg==", - "before": "Njg5MTM0Mjk0NDg1MTUy" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/post/shared_posts.json b/fb_graph2.original/spec/mock_json/post/shared_posts.json deleted file mode 100644 index d57a286..0000000 --- a/fb_graph2.original/spec/mock_json/post/shared_posts.json +++ /dev/null @@ -1,50 +0,0 @@ -{ - "data": [{ - "id": "689134294485152_695439827187932", - "from": { - "id": "689134294485152", - "name": "Shunya Iriki" - }, - "story": "Shunya Iriki shared a link.", - "story_tags": { - "0": [{ - "id": "689134294485152", - "name": "Shunya Iriki", - "offset": 0, - "length": 12, - "type": "user" - }] - }, - "picture": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQCtEdPdezKIoUxo&w=154&h=154&url=http%3A%2F%2Fi.yimg.jp%2Fi%2Fdocs%2Frelease%2Ffbicon.jpg", - "link": "http://docs.yahoo.co.jp/docs/info/terms/chapter1.html#cf2nd", - "name": "ヤフー株式会社 - サービス利用規約 第1編 基本ガイドライン", - "caption": "docs.yahoo.co.jp", - "description": "Yahoo! JAPANのサービス利用規約、第1編 基本ガイドラインは当社のサービスをご利用になるすべての方に共通して適用されます。", - "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif", - "actions": [{ - "name": "Comment", - "link": "https://www.facebook.com/100001657627507/posts/695439827187932" - }, { - "name": "Like", - "link": "https://www.facebook.com/100001657627507/posts/695439827187932" - }], - "privacy": { - "value": "" - }, - "type": "link", - "status_type": "shared_story", - "application": { - "name": "Facebook for iPhone", - "namespace": "fbiphone", - "id": "6628568379" - }, - "created_time": "2014-06-02T12:46:26+0000", - "updated_time": "2014-06-02T12:46:26+0000" - }], - "paging": { - "cursors": { - "after": "Njk1NDM5ODI3MTg3OTMy", - "before": "Njk1NDM5ODI3MTg3OTMy" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/search/user.json b/fb_graph2.original/spec/mock_json/search/user.json deleted file mode 100644 index e199619..0000000 --- a/fb_graph2.original/spec/mock_json/search/user.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "data": [{ - "name": "Nov Matake", - "id": "426118390869327" - }], - "paging": { - "next": "https:\/\/graph.facebook.com\/v2.0\/search?type=user&q=nov.matake&limit=5000&offset=5000&__after_id=enc_AeyyBJc7uo9gY-nHN9-LM0yG_IKBN5nCmqdkG8b4Ql-COLTnpQ-2NUc-xSDK6VwPhsq2W9Ktnr0zf7dD25Bc9eKT" - } -} diff --git a/fb_graph2.original/spec/mock_json/success_true.json b/fb_graph2.original/spec/mock_json/success_true.json deleted file mode 100644 index 28e7be1..0000000 --- a/fb_graph2.original/spec/mock_json/success_true.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "success": true -} \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/success_with_id.json b/fb_graph2.original/spec/mock_json/success_with_id.json deleted file mode 100644 index 84e0b3e..0000000 --- a/fb_graph2.original/spec/mock_json/success_with_id.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "id": "created_object_id" -} diff --git a/fb_graph2.original/spec/mock_json/token_metadata/app_token.json b/fb_graph2.original/spec/mock_json/token_metadata/app_token.json deleted file mode 100644 index e06a589..0000000 --- a/fb_graph2.original/spec/mock_json/token_metadata/app_token.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "data": { - "app_id": "210798282372757", - "is_valid": true - } -} diff --git a/fb_graph2.original/spec/mock_json/token_metadata/invalid_token.json b/fb_graph2.original/spec/mock_json/token_metadata/invalid_token.json deleted file mode 100644 index 54a8484..0000000 --- a/fb_graph2.original/spec/mock_json/token_metadata/invalid_token.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": { - "error": { - "message": "Error validating access token: This may be because the user logged out or may be due to a system error.", - "code": 190, - "subcode": 467 - }, - "app_id": "210798282372757", - "is_valid": false, - "application": "gem sample", - "user_id": "579612276", - "expires_at": 1409655600, - "scopes": ["public_profile", "basic_info", "read_stream", "read_mailbox", "read_page_mailboxes", "rsvp_event", "email", "ads_management", "ads_read", "read_insights", "manage_notifications", "read_friendlists", "manage_pages", "publish_actions", "user_birthday", "user_religion_politics", "user_relationships", "user_relationship_details", "user_hometown", "user_location", "user_likes", "user_activities", "user_interests", "user_education_history", "user_work_history", "user_website", "user_groups", "user_events", "user_photos", "user_videos", "user_friends", "user_about_me", "user_status", "user_games_activity", "user_tagged_places", "user_actions.books", "user_actions.music", "user_actions.video", "user_actions.news"] - } -} diff --git a/fb_graph2.original/spec/mock_json/token_metadata/page_token.json b/fb_graph2.original/spec/mock_json/token_metadata/page_token.json deleted file mode 100644 index 973ae28..0000000 --- a/fb_graph2.original/spec/mock_json/token_metadata/page_token.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": { - "app_id": "210798282372757", - "is_valid": true, - "profile_id": "367989543259757", - "application": "gem sample", - "user_id": "579612276", - "expires_at": 1416996000, - "scopes": ["public_profile", "basic_info", "read_stream"] - } -} diff --git a/fb_graph2.original/spec/mock_json/token_metadata/user_token.json b/fb_graph2.original/spec/mock_json/token_metadata/user_token.json deleted file mode 100644 index 7d3e0f4..0000000 --- a/fb_graph2.original/spec/mock_json/token_metadata/user_token.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "data": { - "app_id": "210798282372757", - "is_valid": true, - "application": "gem sample", - "user_id": "579612276", - "expires_at": 1416992400, - "scopes": ["public_profile", "basic_info", "read_stream"] - } -} diff --git a/fb_graph2.original/spec/mock_json/token_response.json b/fb_graph2.original/spec/mock_json/token_response.json deleted file mode 100644 index 462487d..0000000 --- a/fb_graph2.original/spec/mock_json/token_response.json +++ /dev/null @@ -1 +0,0 @@ -access_token=access_token&expires=5183975 \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/true.json b/fb_graph2.original/spec/mock_json/true.json deleted file mode 100644 index f32a580..0000000 --- a/fb_graph2.original/spec/mock_json/true.json +++ /dev/null @@ -1 +0,0 @@ -true \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/user/accounts.json b/fb_graph2.original/spec/mock_json/user/accounts.json deleted file mode 100644 index 1ca9e49..0000000 --- a/fb_graph2.original/spec/mock_json/user/accounts.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "data": [{ - "category": "Community", - "name": "Identity Conference #idcon", - "access_token": "page_token", - "perms": ["ADMINISTER", "EDIT_PROFILE", "CREATE_CONTENT", "MODERATE_CONTENT", "CREATE_ADS", "BASIC_ADMIN"], - "id": "367989543259757" - }, { - "category": "Community organization", - "name": "OAuth.jp", - "access_token": "page_token", - "perms": ["ADMINISTER", "EDIT_PROFILE", "CREATE_CONTENT", "MODERATE_CONTENT", "CREATE_ADS", "BASIC_ADMIN"], - "id": "140478125968442" - }, { - "category": "Non-profit organization", - "name": "OpenID Foundation Japan", - "access_token": "page_token", - "perms": ["ADMINISTER", "EDIT_PROFILE", "CREATE_CONTENT", "MODERATE_CONTENT", "CREATE_ADS", "BASIC_ADMIN"], - "id": "157574337644417" - }], - "paging": { - "next": "https:\/\/graph.facebook.com\/v2.0\/579612276\/accounts?limit=5000&offset=5000&__after_id=enc_AeyErLVKPOCVAXiRThtd3kSkz__A4QR6eZWAQTTTWw-QCDtft_TmuaKhPOxK_I993BKoO1VIgoyXIAd72ZZNYvrw" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/achievements.json b/fb_graph2.original/spec/mock_json/user/achievements.json deleted file mode 100644 index 91cffd7..0000000 --- a/fb_graph2.original/spec/mock_json/user/achievements.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "data": [{ - "id": "10150407675002277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "start_time": "2011-11-09T08:04:58+0000", - "end_time": "2011-11-09T08:04:58+0000", - "publish_time": "2011-11-09T08:04:58+0000", - "application": { - "name": "gem sample", - "namespace": "fbgraphsample", - "id": "134145643294322" - }, - "data": { - "achievement": { - "id": "10150310611431721", - "url": "http://fbgraphsample.heroku.com/achievements/1", - "type": "game.achievement", - "title": "1st Achievement" - } - }, - "type": "games.achieves", - "no_feed_story": false, - "likes": { - "count": 0, - "can_like": true, - "user_likes": false - }, - "comments": { - "count": 0, - "can_comment": true, - "comment_order": "chronological" - } - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/579612276/achievements?limit=25&offset=25&__after_id=enc_AeyhCSdwSdwIMz2Kbpibnp2MZgYC1gasXThstsCJgxJdxwL9V_ss1OPBDnrxUgpTqAe1QOHjq-un-45-IJXJFrLv" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/activities.json b/fb_graph2.original/spec/mock_json/user/activities.json deleted file mode 100644 index 1a991d6..0000000 --- a/fb_graph2.original/spec/mock_json/user/activities.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "data": [{ - "category": "Interest", - "name": "Mobile Hack Tokyo", - "created_time": "2012-03-01T00:30:09+0000", - "id": "253431701402959" - }, { - "category": "Software", - "name": "Rack::OAuth2", - "created_time": "2011-06-23T10:32:47+0000", - "id": "141477809244105" - }, { - "category": "Non-profit organization", - "name": "OpenID Foundation Japan", - "created_time": "2011-06-23T04:53:40+0000", - "id": "157574337644417" - }, { - "category": "Internet/software", - "name": "SocialWeb Japan", - "created_time": "2011-04-26T04:54:13+0000", - "id": "150730961633" - }, { - "category": "Community organization", - "name": "OAuth.jp", - "created_time": "2011-01-05T00:27:02+0000", - "id": "140478125968442" - }, { - "category": "Software", - "name": "FbGraph", - "created_time": "2010-04-30T06:48:21+0000", - "id": "117513961602338" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/579612276/activities?limit=25&offset=25&__after_id=enc_AewISXs8Uhe2pwegtVsWC8GFmzAWEKKFzGcJoZ-UJa4MA_wFfCIRKFaQMJkS6U5WTdiSKw3G3EvlyDir1upNCBop" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/albums.json b/fb_graph2.original/spec/mock_json/user/albums.json deleted file mode 100644 index 64b5727..0000000 --- a/fb_graph2.original/spec/mock_json/user/albums.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "data": [{ - "id": "532912916729105", - "from": { - "category": "Software", - "name": "FbGraph", - "id": "117513961602338" - }, - "name": "Timeline Photos", - "link": "https://www.facebook.com/album.php?fbid=532912916729105&id=117513961602338&aid=116544", - "privacy": "everyone", - "type": "wall", - "created_time": "2013-02-16T13:23:10+0000", - "updated_time": "2013-02-16T13:23:10+0000", - "can_upload": false - }], - "paging": { - "cursors": { - "after": "MjEwNDcxNDkyMzA2NTg0", - "before": "NTMyOTEyOTE2NzI5MTA1" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/user/applications.json b/fb_graph2.original/spec/mock_json/user/applications.json deleted file mode 100644 index f90d2ae..0000000 --- a/fb_graph2.original/spec/mock_json/user/applications.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "data": [{ - "name": "gem sample", - "namespace": "gem-sample", - "id": "210798282372757" - }, { - "name": "Localhost", - "id": "158245434257042" - }, { - "name": "OAuth.jp", - "id": "126213067419995" - }], - "paging": { - "next": "https://graph.facebook.com/v2.1/579612276/applications?type=developer&limit=25&offset=25&__after_id=***" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/books.json b/fb_graph2.original/spec/mock_json/user/books.json deleted file mode 100644 index 1535aad..0000000 --- a/fb_graph2.original/spec/mock_json/user/books.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": [{ - "category": "Book", - "name": "Predictably Irrational", - "created_time": "2011-07-27T15:49:06+0000", - "id": "113167718696752" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/579612276/books?limit=25&offset=25&__after_id=enc_AewjHX22qV_-BoIxoRMWHPno7BxZHunbqYgaxlHlJnH0x_Gza1bYpFD6V7Vve1HL-21x7kD5E_3QMLzdjM9pmK_f" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/events.json b/fb_graph2.original/spec/mock_json/user/events.json deleted file mode 100644 index 68306e6..0000000 --- a/fb_graph2.original/spec/mock_json/user/events.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "data": [ - { - "name": "Test Event", - "start_time": "2014-06-13T19:00:00+0900", - "timezone": "Asia/Tokyo", - "location": "六本木", - "rsvp_status": "attending", - "id": "246996708819160" - } - ], - "paging": { - "previous": "https://graph.facebook.com/v2.0/579612276/events?limit=25&since=1402653600&__paging_token=***", - "next": "https://graph.facebook.com/v2.0/579612276/events?limit=25&until=1402653600&__paging_token=***" - } -} \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/user/feed.json b/fb_graph2.original/spec/mock_json/user/feed.json deleted file mode 100644 index 890e928..0000000 --- a/fb_graph2.original/spec/mock_json/user/feed.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "data": [{ - "id": "579612276_10152473214157277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "story": "Nov Matake likes a photo.", - "story_tags": { - "0": [{ - "id": "579612276", - "name": "Nov Matake", - "offset": 0, - "length": 10, - "type": "user" - }] - }, - "privacy": { - "value": "" - }, - "type": "status", - "created_time": "2014-05-30T00:41:24+0000", - "updated_time": "2014-05-30T00:41:24+0000" - }, { - "id": "579612276_10152473191982277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "message": "ビッグデータとひわいっち", - "story": "Nov Matake shared Keisuke Hiwatashi's photo.", - "story_tags": { - "0": [{ - "id": "579612276", - "name": "Nov Matake", - "offset": 0, - "length": 10, - "type": "user" - }], - "18": [{ - "id": "674146975973023", - "name": "Keisuke Hiwatashi", - "offset": 18, - "length": 17, - "type": "user" - }] - }, - "picture": "https://fbcdn-photos-h-a.akamaihd.net/hphotos-ak-xfp1/t1.0-0/10325169_677983408922713_1895639973177548237_s.jpg", - "link": "https://www.facebook.com/photo.php?fbid=677983408922713&set=a.150687431652316.43478.100001331809083&type=1", - "name": "Mobile Uploads", - "caption": "西日本新聞の三面広告に。角川書店さんありがとう^ ^\n\n今晩はグロービス東京で講演です。 — at ANA 福岡空港 - Fukuoka Airport.", - "properties": [{ - "name": "By", - "text": "Keisuke Hiwatashi", - "href": "https://www.facebook.com/keisuke.hiwatashi.9" - }], - "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif", - "actions": [{ - "name": "Comment", - "link": "https://www.facebook.com/579612276/posts/10152473191982277" - }, { - "name": "Like", - "link": "https://www.facebook.com/579612276/posts/10152473191982277" - }], - "privacy": { - "description": "Your friends", - "value": "ALL_FRIENDS", - "friends": "", - "networks": "", - "allow": "", - "deny": "" - }, - "type": "photo", - "status_type": "shared_story", - "object_id": "677983408922713", - "application": { - "name": "Facebook for iPhone", - "namespace": "fbiphone", - "id": "6628568379" - }, - "created_time": "2014-05-30T00:21:08+0000", - "updated_time": "2014-05-30T00:21:08+0000" - }, { - "id": "579612276_10152473186437277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "story": "Nov Matake shared a link.", - "story_tags": { - "0": [{ - "id": "579612276", - "name": "Nov Matake", - "offset": 0, - "length": 10, - "type": "user" - }] - }, - "picture": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQAcHDji1ec2KqYZ&w=154&h=154&url=http%3A%2F%2Fua.nakanohito.jp%2Fua%2F%3Ffrom%3Duamb%26id%3D7932754%26mode%3Ddefault%26h%3D55529355%26rand%3Dnoscript%26guid%3DON%26url%3Dhttp%3A%2F%2Fkirik.tea-nifty.com%2Fdiary%2F2014%2F05%2Fivs-ed80.html%26eflg%3D1", - "link": "http://ow.ly/xoEJp", - "name": "IVS札幌でセクハラ・レイプ未遂騒ぎが勃発&インサイダー情報が乱舞: やまもといちろうBLOG(ブログ)", - "caption": "kirik.tea-nifty.com", - "description": " 毎回いろんな乱痴気騒ぎを起こすIVS(インフィニティー ベンチャーズ サミット)ですが、さすがに今回は警察沙汰に近い状況になったようなのでピックアップするわけですけど。", - "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif", - "actions": [{ - "name": "Comment", - "link": "https://www.facebook.com/579612276/posts/10152473186437277" - }, { - "name": "Like", - "link": "https://www.facebook.com/579612276/posts/10152473186437277" - }], - "privacy": { - "description": "Your friends", - "value": "ALL_FRIENDS", - "friends": "", - "networks": "", - "allow": "", - "deny": "" - }, - "type": "link", - "status_type": "shared_story", - "application": { - "name": "Facebook for iPhone", - "namespace": "fbiphone", - "id": "6628568379" - }, - "created_time": "2014-05-30T00:15:34+0000", - "updated_time": "2014-05-30T00:15:34+0000", - "shares": { - "count": 1 - }, - "likes": { - "data": [{ - "id": "689134294485152", - "name": "Shunya Iriki" - }, { - "id": "1486426304903512", - "name": "Masato Nagai" - }], - "paging": { - "cursors": { - "after": "MTQ4NjQyNjMwNDkwMzUxMg==", - "before": "Njg5MTM0Mjk0NDg1MTUy" - } - } - } - }, { - "id": "579612276_10152471638637277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "message": "じわじわくる", - "story": "Nov Matake shared Yoichi Hagiwara's photo.", - "story_tags": { - "0": [{ - "id": "579612276", - "name": "Nov Matake", - "offset": 0, - "length": 10, - "type": "user" - }], - "18": [{ - "id": "636860593058872", - "name": "Yoichi Hagiwara", - "offset": 18, - "length": 15, - "type": "user" - }] - }, - "picture": "https://fbcdn-photos-b-a.akamaihd.net/hphotos-ak-xfp1/t1.0-0/10410479_636298869781711_8967036710690476822_s.jpg", - "link": "https://www.facebook.com/photo.php?fbid=636298869781711&set=a.168178316593771.41312.100002048127511&type=1", - "name": "Timeline Photos", - "caption": "辛口パネルディスカッション — with Kazu Yamaji and Koji Ando.", - "properties": [{ - "name": "By", - "text": "Yoichi Hagiwara", - "href": "https://www.facebook.com/yoichi.hagiwara.98" - }], - "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif", - "actions": [{ - "name": "Comment", - "link": "https://www.facebook.com/579612276/posts/10152471638637277" - }, { - "name": "Like", - "link": "https://www.facebook.com/579612276/posts/10152471638637277" - }], - "privacy": { - "description": "Your friends", - "value": "ALL_FRIENDS", - "friends": "", - "networks": "", - "allow": "", - "deny": "" - }, - "type": "photo", - "status_type": "shared_story", - "object_id": "636298869781711", - "application": { - "name": "Photos", - "id": "2305272732" - }, - "created_time": "2014-05-29T08:30:07+0000", - "updated_time": "2014-05-29T08:30:07+0000" - }, { - "id": "579612276_10152470156827277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "story": "Nov Matake shared a link.", - "story_tags": { - "0": [{ - "id": "579612276", - "name": "Nov Matake", - "offset": 0, - "length": 10, - "type": "user" - }] - }, - "picture": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQDQyx3PnnIPoGqZ&w=154&h=154&url=http%3A%2F%2Fc002.ocn.ne.jp%2Fimg%2Flogo_nttcommunications_001.gif", - "link": "http://mypage.ocn.ne.jp/sorry/index.html", - "name": "お詫び | マイページ", - "caption": "mypage.ocn.ne.jp", - "description": "NTTコミュニケーションズでは、多くの方に当社ホームページを利用していただくため、アクセシビリティに配慮したホームページの制作を行っております。 アクセシビリティの実装方法としてスタイルシートを使用しております。お客さまが使用されているブラウザはスタイルシート非対応のブラウザのため、表示結果が異なっておりますが、情報そのものは問題なくご利用いただけます。", - "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif", - "actions": [{ - "name": "Comment", - "link": "https://www.facebook.com/579612276/posts/10152470156827277" - }, { - "name": "Like", - "link": "https://www.facebook.com/579612276/posts/10152470156827277" - }], - "privacy": { - "description": "Your friends", - "value": "ALL_FRIENDS", - "friends": "", - "networks": "", - "allow": "", - "deny": "" - }, - "type": "link", - "status_type": "shared_story", - "application": { - "name": "Facebook for iPhone", - "namespace": "fbiphone", - "id": "6628568379" - }, - "created_time": "2014-05-28T15:25:07+0000", - "updated_time": "2014-05-28T15:25:07+0000", - "likes": { - "data": [{ - "id": "644436712303508", - "name": "Masaru Kurahayashi" - }, { - "id": "10203901352238213", - "name": "Shuji Yamaguchi" - }, { - "id": "10203023651344197", - "name": "Atsuyoshi Shimazu" - }], - "paging": { - "cursors": { - "after": "MTAyMDMwMjM2NTEzNDQxOTc=", - "before": "NjQ0NDM2NzEyMzAzNTA4" - } - } - } - }], - "paging": { - "previous": "https://graph.facebook.com/v2.0/579612276/feed?limit=25&since=1401410484", - "next": "https://graph.facebook.com/v2.0/579612276/feed?limit=25&until=1400651347" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/friend_lists.json b/fb_graph2.original/spec/mock_json/user/friend_lists.json deleted file mode 100644 index 6cd15c4..0000000 --- a/fb_graph2.original/spec/mock_json/user/friend_lists.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "data": [{ - "id": "10152338362087277", - "name": "CyberAgent America", - "list_type": "work" - }, { - "id": "10152338362072277", - "name": "Cerego Japan", - "list_type": "work" - }, { - "id": "10152142419302277", - "name": "Capy Inc.", - "list_type": "work" - }, { - "id": "10151887848997277", - "name": "Cerego Japan", - "list_type": "work" - }, { - "id": "10151870113532277", - "name": "Kyoto CtoG.org", - "list_type": "work" - }, { - "id": "10150348660692277", - "name": "同志社大学", - "list_type": "education" - }, { - "id": "10150346113542277", - "name": "Kawasaki-shi, Kanagawa, Japan Area", - "list_type": "current_city" - }, { - "id": "10150346085662277", - "name": "OpenID Foundation", - "list_type": "work" - }, { - "id": "10150346074892277", - "name": "OpenID Foundation Japan", - "list_type": "work" - }, { - "id": "10150341935447277", - "name": "株式会社ドリコム", - "list_type": "work" - }, { - "id": "10150336745462277", - "name": "Kyoto CtoG.org", - "list_type": "work" - }, { - "id": "10150336745457277", - "name": "Acquaintances", - "list_type": "acquaintances" - }, { - "id": "10150336744357277", - "name": "ドリコム", - "list_type": "work" - }, { - "id": "10150336526382277", - "name": "Doshisha University", - "list_type": "education" - }, { - "id": "10150336526227277", - "name": "Doshisha High School", - "list_type": "education" - }, { - "id": "10150336526222277", - "name": "Cerego Japan", - "list_type": "work" - }, { - "id": "10150336526217277", - "name": "Family", - "list_type": "family" - }, { - "id": "10150336526212277", - "name": "Close Friends", - "list_type": "close_friends" - }, { - "id": "10150287189437277", - "name": "Family", - "list_type": "user_created" - }, { - "id": "494503307276", - "name": "OpenStack", - "list_type": "user_created" - }, { - "id": "41968037276", - "name": "Doshisha", - "list_type": "user_created" - }, { - "id": "41967672276", - "name": "iKnow!", - "list_type": "user_created" - }, { - "id": "41967622276", - "name": "Drecom", - "list_type": "user_created" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/579612276/friendlists?limit=5000&offset=5000&__after_id=enc_AeyvnVCKex4_AhqGX7_QdptE11EjyFPx0CGxMGyRHvxS2SbnqjP7fJD8tL2VFjeodZA" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/friends.json b/fb_graph2.original/spec/mock_json/user/friends.json deleted file mode 100644 index 8a00082..0000000 --- a/fb_graph2.original/spec/mock_json/user/friends.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "data": [{ - "name": "Nat Sakimura", - "id": "1048138174" - }, { - "name": "Yusuke Kondo", - "id": "1229826130" - }, { - "name": "Yuya Ito", - "id": "1326792131" - }, { - "name": "Tatsuya Katsuhara", - "id": "1784765822" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/579612276/friends?limit=5000&offset=5000&__after_id=enc_AexFQ6mn3PA35psWD5WjFNzW7ovDp35_gkApd8tXqRmc5ygEBBAEs56d3YIetOc9NNk" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/groups.json b/fb_graph2.original/spec/mock_json/user/groups.json deleted file mode 100644 index 0e642da..0000000 --- a/fb_graph2.original/spec/mock_json/user/groups.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "data": [{ - "name": "OpenID Connect Hackathon", - "administrator": true, - "bookmark_order": 14, - "id": "562322927125681" - }, { - "name": "OAuth.jp", - "administrator": true, - "bookmark_order": 12, - "id": "343659285716553" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/579612276/groups?icon_size=16&limit=5000&offset=5000&__after_id=enc_AeynOYwetNSbegZQTbjirpNPayS9oqujy9wnu0CnNjC7YMl4zxLq-JP--CRz3FX3KWg" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/home.json b/fb_graph2.original/spec/mock_json/user/home.json deleted file mode 100644 index e731c7e..0000000 --- a/fb_graph2.original/spec/mock_json/user/home.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "data": [{ - "id": "114870808553071_759907394049406", - "from": { - "category": "Computers/internet website", - "name": "TechCrunch Japan", - "id": "114870808553071" - }, - "story": "TechCrunch Japan shared a link.", - "story_tags": { - "0": [{ - "id": "114870808553071", - "name": "TechCrunch Japan", - "offset": 0, - "length": 16, - "type": "page" - }] - }, - "picture": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQCP3uH6kEoLnPsL&w=154&h=154&url=http%3A%2F%2Ftechcrunchjp.files.wordpress.com%2F2014%2F06%2F140603modiva1.jpg%3Fw%3D1024%26h%3D768", - "link": "http://dlvr.it/5sP8LX", - "name": "MOVIDA JAPANがデモデイを開催して13社が登壇‒‒個人的にはEigooo!に期待", - "caption": "jp.techcrunch.com", - "description": "MOVIDA JAPANは6月3日、同社のシードアクセラレーションプログラムの成果を発表する「MOVIDA JAPAN DemoDay 5th」を開催した。今回登壇したスタートアップは13社。まずは登壇したスタートアップとそのサービス概要を紹介していく。…", - "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/y5/r/sXJx2UP7quc.png", - "actions": [{ - "name": "Comment", - "link": "https://www.facebook.com/114870808553071/posts/759907394049406" - }, { - "name": "Like", - "link": "https://www.facebook.com/114870808553071/posts/759907394049406" - }], - "privacy": { - "value": "" - }, - "type": "link", - "status_type": "shared_story", - "application": { - "name": "dlvr.it", - "namespace": "dlvr_it", - "id": "232775914688" - }, - "created_time": "2014-06-03T08:20:01+0000", - "updated_time": "2014-06-03T08:20:01+0000", - "likes": { - "data": [{ - "id": "10203763563950799", - "name": "Takuya Kawai" - }], - "paging": { - "cursors": { - "after": "MTAyMDM3NjM1NjM5NTA3OTk=", - "before": "MTAyMDM3NjM1NjM5NTA3OTk=" - } - } - } - }], - "paging": { - "previous": "https://graph.facebook.com/v2.0/579612276/home?limit=25&since=1401784697", - "next": "https://graph.facebook.com/v2.0/579612276/home?limit=25&until=1401773525" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/inbox.json b/fb_graph2.original/spec/mock_json/user/inbox.json deleted file mode 100644 index 31f5dbb..0000000 --- a/fb_graph2.original/spec/mock_json/user/inbox.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "data": [{ - "id": "741737742539677", - "to": { - "data": [{ - "id": "579612276", - "name": "Nov Matake" - }, { - "id": "10152167763779825", - "name": "Hayashi Tatsuya" - }] - }, - "updated_time": "2014-09-02T03:51:40+0000", - "unread": 0, - "unseen": 0, - "comments": { - "data": [{ - "id": "741737742539677_1409625688", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "message": "ヒゲキョクチョ", - "created_time": "2014-09-02T02:41:28+0000" - }], - "paging": { - "previous": "https://graph.facebook.com/v2.1/741737742539677/comments?limit=25&since=1409629900&__paging_token=***", - "next": "https://graph.facebook.com/v2.1/741737742539677/comments?limit=25&until=1409625439&__paging_token=***" - } - } - }], - "paging": { - "previous": "https://graph.facebook.com/v2.1/579612276/inbox?limit=25&since=1409629900&__paging_token=***", - "next": "https://graph.facebook.com/v2.1/579612276/inbox?limit=25&until=1403524175&__paging_token=***" - }, - "summary": { - "unseen_count": 0, - "unread_count": 0, - "updated_time": "2014-09-02T03:51:40+0000" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/interests.json b/fb_graph2.original/spec/mock_json/user/interests.json deleted file mode 100644 index fc7af2d..0000000 --- a/fb_graph2.original/spec/mock_json/user/interests.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "data": [{ - "category": "Interest", - "name": "#idcon 14th ~ BYOResume or DEAD! ~", - "created_time": "2012-09-03T17:18:16+0000", - "id": "309562105809363" - }, { - "category": "Interest", - "name": "Heroku Meetup #6 Japan Heroku Lab", - "created_time": "2012-09-03T03:07:14+0000", - "id": "102424793243222" - }, { - "category": "Interest", - "name": "Activity Streams", - "created_time": "2011-06-30T22:57:47+0000", - "id": "114998808528822" - }, { - "category": "Company", - "name": "Social Web", - "created_time": "2011-06-18T02:52:35+0000", - "id": "105645299472577" - }, { - "category": "Interest", - "name": "Open ID", - "created_time": "2011-01-05T00:21:56+0000", - "id": "106260522746492" - }, { - "category": "Interest", - "name": "Open Social", - "created_time": "2011-01-05T00:21:52+0000", - "id": "107119605991729" - }, { - "category": "Interest", - "name": "OAuth", - "created_time": "2010-07-04T06:17:52+0000", - "id": "104064209632570" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/579612276/interests?limit=25&offset=25&__after_id=enc_AezLYldJHiKEyShbuOdR82cv0TtL4DwoXvFHvxocLB9dyJjlw96DIz3jwBNiERXgDjzAH_sT_ZhHU9QGJNxiOe3P" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/invitable_friends.json b/fb_graph2.original/spec/mock_json/user/invitable_friends.json deleted file mode 100644 index 8796101..0000000 --- a/fb_graph2.original/spec/mock_json/user/invitable_friends.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "data": [{ - "id": "AVm6afobc20T0wATmCYRk_CNymo_44MQW8yMBwpgDFAQ18iF9feZpDEDmwfmcjSBSSuYkFfD5fx77g_uJRF0fmQ7AR2kObX8biP4wzN7UMpbYQ", - "name": "Shingo Yamanaka", - "picture": { - "data": { - "is_silhouette": false, - "url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpf1/t1.0-1/c0.15.85.85/s50x50/1468668_10152037195781416_2050550170_s.jpg" - } - } - }, { - "id": "AVnJiIlmAtrWJ106ErRPlLZNy8_Hd4mfmuQBrbGm4tuFS_ENvyYdVxTwgesXE5Wp2ICtxcPHzkA4Y4BJAWwJqyUie2ZDKQeKn9mnjPCVAUr8Lg", - "name": "Hayashi Tatsuya", - "picture": { - "data": { - "is_silhouette": false, - "url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xaf1/t1.0-1/c79.38.479.479/s50x50/388771_10150501378984825_523522119_n.jpg" - } - } - }], - "paging": { - "cursors": { - "before": "QVZra09GaExkNndsM1J5eVpuQ2dWS1hLV3FBb0dqRTh3dC1PVXJIZE8ya0JzbV9kUDZXcWZEdUtUZFNHejcxeGlWZ3JjZjZjdkIwMWdtSWtHZGpGVE8wTWZ5cUdNUm5NWWw3c2hSTEtPZ19ySmc=", - "after": "QVZrdlNsUHItNExPY1JIUVdlZ3BDZlFCTHFFMUl6YVhnVG5fRVlBLVV0QThUMFBmRnZNQkVQWVg2VkRBQWhRa3RyemVQUFhscWxBVERYZU15SExZbG50Z0RTQUtfVno5VjRjT3VUb2J5NGg1VFE=" - } - } -} diff --git a/fb_graph2.original/spec/mock_json/user/likes.json b/fb_graph2.original/spec/mock_json/user/likes.json deleted file mode 100644 index 6a3c57b..0000000 --- a/fb_graph2.original/spec/mock_json/user/likes.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "data": [{ - "category": "Business/economy website", - "name": "デザイナーズSOHOオフィスなら【SOHO東京】", - "created_time": "2014-04-27T07:42:29+0000", - "id": "140108926038346" - }, { - "category": "Real estate", - "category_list": [{ - "id": "198327773511962", - "name": "Real Estate" - }], - "name": "ジョイライフスタイル", - "created_time": "2014-04-05T15:26:28+0000", - "id": "117500321741291" - }, { - "category": "Internet/software", - "category_list": [{ - "id": "2256", - "name": "Internet/Software" - }], - "name": "Engineerrise", - "created_time": "2014-03-28T14:32:31+0000", - "id": "565244630160593" - }], - "paging": { - "cursors": { - "after": "MzY3OTg5NTQzMjU5NzU3", - "before": "MTQwMTA4OTI2MDM4MzQ2" - }, - "next": "https://graph.facebook.com/v2.0/579612276/likes?limit=25&after=MzY3OTg5NTQzMjU5NzU3" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/links.json b/fb_graph2.original/spec/mock_json/user/links.json deleted file mode 100644 index 29d1151..0000000 --- a/fb_graph2.original/spec/mock_json/user/links.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "data": [{ - "id": "10152480998332277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "picture": "https://fbexternal-a.akamaihd.net/safe_image.php?d=AQCtEdPdezKIoUxo&w=154&h=154&url=http%3A%2F%2Fi.yimg.jp%2Fi%2Fdocs%2Frelease%2Ffbicon.jpg", - "privacy": { - "description": "Your friends", - "value": "ALL_FRIENDS", - "allow": "", - "deny": "", - "networks": "", - "friends": "" - }, - "link": "http://docs.yahoo.co.jp/docs/info/terms/chapter1.html#cf2nd", - "name": "ヤフー株式会社 - サービス利用規約 第1編 基本ガイドライン", - "description": "Yahoo! JAPANのサービス利用規約、第1編 基本ガイドラインは当社のサービスをご利用になるすべての方に共通して適用されます。", - "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif", - "created_time": "2014-06-02T09:34:13+0000", - "likes": { - "data": [{ - "id": "689134294485152", - "name": "Shunya Iriki" - }, { - "id": "1246364330", - "name": "Kaoru Maeda" - }], - "paging": { - "cursors": { - "after": "MTI0NjM2NDMzMA==", - "before": "Njg5MTM0Mjk0NDg1MTUy" - } - } - } - }], - "paging": { - "cursors": { - "after": "MTAxNTI0NDIwNzU4MzIyNzc=", - "before": "MTAxNTI0ODA5OTgzMzIyNzc=" - }, - "next": "https://graph.facebook.com/v2.0/579612276/links?limit=25&after=MTAxNTI0NDIwNzU4MzIyNzc=" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/me.json b/fb_graph2.original/spec/mock_json/user/me.json deleted file mode 100644 index a676d55..0000000 --- a/fb_graph2.original/spec/mock_json/user/me.json +++ /dev/null @@ -1,421 +0,0 @@ -{ - "id": "10152411392127277", - "bio": "Ruby/Rails developer, developing several gems like fb_graph, rack-oauth2, paypal-express, openid_connect, activitystreams etc.", - "birthday": "12/13/1981", - "education": [{ - "classes": [{ - "id": "114799961869204", - "name": "3rd year high school" - }, { - "id": "196267900399898", - "name": "2nd year", - "with": [{ - "id": "10152979910439657", - "name": "Ikuko Kishida" - }] - }, { - "id": "128688833868666", - "name": "1st year", - "with": [{ - "id": "10203579017097193", - "name": "Yuko Shimabata" - }] - }], - "school": { - "id": "168218936549964", - "name": "Doshisha High School" - }, - "type": "High School", - "year": { - "id": "324576644221180", - "name": "2000" - } - }, { - "classes": [{ - "id": "157989264254684", - "name": "Intelligent Systems Design Laboratory '04", - "with": [{ - "id": "682734878458663", - "name": "Keiji Yamamoto" - }] - }], - "concentration": [{ - "id": "109532545739630", - "name": "Engineering" - }], - "school": { - "id": "109239532428621", - "name": "Doshisha University" - }, - "type": "College", - "year": { - "id": "113125125403208", - "name": "2004" - } - }, { - "classes": [{ - "id": "137361399662343", - "name": "Intelligent Systems Design Laboratory '07" - }], - "concentration": [{ - "id": "109532545739630", - "name": "Engineering" - }], - "degree": { - "id": "200416999973329", - "name": "Master of Engineering" - }, - "school": { - "id": "109239532428621", - "name": "Doshisha University" - }, - "type": "Graduate School", - "year": { - "id": "140617569303679", - "name": "2007" - } - }], - "email": "nov@matake.jp", - "favorite_teams": [{ - "id": "112498808761105", - "name": "Bologna F.C. 1909" - }, { - "id": "103968596307357", - "name": "Gamba Osaka" - }], - "first_name": "Nov", - "gender": "male", - "hometown": { - "id": "112359252112966", - "name": "Hirakata, Osaka" - }, - "interested_in": ["female"], - "languages": [{ - "id": "109549852396760", - "name": "Japanese" - }, { - "id": "106059522759137", - "name": "English" - }], - "last_name": "Matake", - "link": "https://www.facebook.com/app_scoped_user_id/10152411392127277/", - "location": { - "id": "100563866688613", - "name": "Kawasaki-shi, Kanagawa, Japan" - }, - "locale": "en_US", - "name": "Nov Matake", - "relationship_status": "Married", - "sports": [{ - "id": "114967135183020", - "name": "Billiards" - }, { - "id": "104085636293671", - "name": "Darts" - }, { - "id": "111124835576428", - "name": "Rugby" - }], - "quotes": "求めなさい。そうすれば、与えられる。\r\n探しなさい。そうすれば、見つかる。\r\n門をたたきなさい。そうすれば、開かれる。\r\nだれでも、求める者は受け、探す者は見つけ、門をたたく者には開かれる。\r\n\r\nあなたがたのだれが、パンを欲しがる自分の子供に、石を与えるだろうか。魚を欲しがるのに、蛇を与えるだろうか。\r\n\r\nこのように、あなたがたは悪い者でありながらも、自分の子供に良い物を与えることを知っている。まして、あなたがたの天の父は、求める者に良い物をくださるにちがいない。\r\n\r\nだから、人にしてもらいたいと思うことは何でも、あなたがたも人にしなさい。\r\n\r\nこれこそ、律法と預言者である。", - "timezone": 9, - "updated_time": "2014-04-17T02:03:08+0000", - "verified": true, - "website": "http://matake.jp", - "work": [{ - "employer": { - "id": "212867592069252", - "name": "GREE" - }, - "position": { - "id": "137221592980321", - "name": "Developer" - }, - "start_date": "2013-02-01" - }, { - "employer": { - "id": "157574337644417", - "name": "OpenID Foundation Japan" - }, - "position": { - "id": "103770909661937", - "name": "Evangelist" - }, - "start_date": "2011-09-01" - }, { - "employer": { - "id": "19124593579", - "name": "OpenID Foundation" - }, - "position": { - "id": "139666082733546", - "name": "Member" - }, - "start_date": "2011-08-01" - }, { - "description": "Translating OpenID & OAuth related documents into Japanese.", - "employer": { - "id": "157574337644417", - "name": "OpenID Foundation Japan" - }, - "position": { - "id": "279848128693060", - "name": "Translation & Education Working Group Leader" - }, - "projects": [{ - "id": "223851157668338", - "description": "RFC 6749, 6750, 6819", - "end_date": "2013-01-01", - "name": "OAuth 2.0 Spec Translation", - "start_date": "2013-01-01", - "with": [{ - "id": "10203856708878032", - "name": "Yusuke Kondo" - }, { - "id": "10203073519271473", - "name": "Ryo Ito" - }, { - "id": "672668269435107", - "name": "Naohiro Fujie" - }, { - "id": "634113926669120", - "name": "Masaru Kurahayashi" - }, { - "id": "10201113604960646", - "name": "Tatsuya Katsuhara" - }, { - "id": "652608194806969", - "name": "Boku Kihara" - }, { - "id": "648027665265419", - "name": "Kazuki Shimizu" - }, { - "id": "562632100518923", - "name": "Satoshi Yagi" - }, { - "id": "10203985460665265", - "name": "Noboru Kurumai" - }] - }, { - "id": "223851157668338", - "description": "draft 22", - "end_date": "2011-11-01", - "name": "OAuth 2.0 Spec Translation", - "start_date": "2011-10-01", - "with": [{ - "id": "10201113604960646", - "name": "Tatsuya Katsuhara" - }, { - "id": "10203599839574972", - "name": "Taizo Matsuoka" - }, { - "id": "10203856708878032", - "name": "Yusuke Kondo" - }, { - "id": "10203073519271473", - "name": "Ryo Ito" - }, { - "id": "672668269435107", - "name": "Naohiro Fujie" - }, { - "id": "634113926669120", - "name": "Masaru Kurahayashi" - }, { - "id": "652608194806969", - "name": "Boku Kihara" - }] - }, { - "id": "223851157668338", - "description": "draft 10", - "end_date": "2010-11-01", - "name": "OAuth 2.0 Spec Translation", - "start_date": "2010-09-01", - "with": [{ - "id": "10152392979304293", - "name": "Eiji Kitamura" - }, { - "id": "10202539573504945", - "name": "Takanori Ishikawa" - }, { - "id": "10203599839574972", - "name": "Taizo Matsuoka" - }, { - "id": "10203073519271473", - "name": "Ryo Ito" - }, { - "id": "10201113604960646", - "name": "Tatsuya Katsuhara" - }, { - "id": "10203856708878032", - "name": "Yusuke Kondo" - }, { - "id": "779688938729375", - "name": "Toyoaki Ohgochi" - }, { - "id": "10152359746567310", - "name": "Daichi Morifuji" - }] - }, { - "id": "295286707152335", - "end_date": "2010-03-01", - "name": "OAuth 1.0 Spec Translation", - "start_date": "2010-02-01", - "with": [{ - "id": "10203073519271473", - "name": "Ryo Ito" - }, { - "id": "10201113604960646", - "name": "Tatsuya Katsuhara" - }, { - "id": "10152392979304293", - "name": "Eiji Kitamura" - }, { - "id": "10203599839574972", - "name": "Taizo Matsuoka" - }, { - "id": "10203856708878032", - "name": "Yusuke Kondo" - }] - }, { - "id": "275379439146839", - "end_date": "2010-01-01", - "name": "OpenID Authentication 2.0 Spec Translation", - "start_date": "2009-10-01", - "with": [{ - "id": "10203073519271473", - "name": "Ryo Ito" - }, { - "id": "10201113604960646", - "name": "Tatsuya Katsuhara" - }, { - "id": "10203599839574972", - "name": "Taizo Matsuoka" - }] - }], - "start_date": "2009-12-01" - }, { - "end_date": "2013-01-01", - "employer": { - "id": "1414141888809913", - "name": "CyberAgent America" - }, - "location": { - "id": "114600441890814", - "name": "Shibuya, Tokyo" - }, - "position": { - "id": "137221592980321", - "name": "Developer" - }, - "start_date": "2012-02-01" - }, { - "end_date": "2012-02-01", - "employer": { - "id": "216536155172635", - "name": "Cerego Japan" - }, - "location": { - "id": "112261372122567", - "name": "Shibuya, Tokyo" - }, - "position": { - "id": "116439701737440", - "name": "Rails Developer" - }, - "projects": [{ - "id": "147355305316648", - "end_date": "2012-02-01", - "name": "i know", - "start_date": "2011-02-01" - }, { - "id": "115003951868033", - "end_date": "2011-03-01", - "name": "Smart FM", - "start_date": "2009-03-01" - }, { - "id": "147355305316648", - "end_date": "2009-02-01", - "name": "i know", - "start_date": "2008-10-01" - }], - "start_date": "2008-10-01" - }, { - "end_date": "2008-09-01", - "employer": { - "id": "110398398982373", - "name": "ドリコム" - }, - "position": { - "id": "108480125843293", - "name": "Web Developer" - }, - "projects": [{ - "id": "196036717085376", - "end_date": "2008-01-01", - "name": "Drecom Blog", - "start_date": "2008-01-01", - "with": [{ - "id": "10202539573504945", - "name": "Takanori Ishikawa" - }] - }, { - "id": "186298551407738", - "end_date": "2008-05-01", - "name": "Resumy", - "start_date": "2008-01-01", - "with": [{ - "id": "10202539573504945", - "name": "Takanori Ishikawa" - }] - }, { - "id": "133078480094168", - "end_date": "2007-12-01", - "name": "Drecom Wanted", - "start_date": "2006-04-01", - "with": [{ - "id": "10152349447699566", - "name": "Hiroumi Mitani" - }] - }], - "start_date": "2006-01-01", - "with": [{ - "id": "10202539573504945", - "name": "Takanori Ishikawa" - }, { - "id": "10202864487006831", - "name": "Shoichi Imamura" - }] - }, { - "description": "NPO for IT education", - "end_date": "2007-03-01", - "employer": { - "id": "200555370122204", - "name": "Kyoto CtoG.org" - }, - "location": { - "id": "107601722603088", - "name": "Kyoto" - }, - "position": { - "id": "107957955904825", - "name": "Founder" - }, - "start_date": "2003-10-01", - "with": [{ - "id": "10203411865798623", - "name": "Junya Wako" - }, { - "id": "667000650003141", - "name": "Ken-ichi Niimi" - }, { - "id": "10152381152939826", - "name": "Hiroyuki Makino" - }] - }, { - "end_date": "0000-00", - "employer": { - "id": "246222982173835", - "name": "Capy Inc." - }, - "start_date": "0000-00" - }] -} diff --git a/fb_graph2.original/spec/mock_json/user/me_with_ext_attrs.json b/fb_graph2.original/spec/mock_json/user/me_with_ext_attrs.json deleted file mode 100644 index ccb56ad..0000000 --- a/fb_graph2.original/spec/mock_json/user/me_with_ext_attrs.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "age_range": { - "min": 21 - }, - "context": { - "mutual_friends": { - "data": [], - "summary": { - "total_count": 245 - } - }, - "mutual_likes": { - "data": [{ - "category": "Product/service", - "name": "GSMA Mobile World Congress", - "id": "177607143648" - }, { - "category": "Business/economy website", - "name": "デザイナーズSOHOオフィスなら【SOHO東京】", - "id": "140108926038346" - }, { - "category": "Real estate", - "category_list": [{ - "id": "198327773511962", - "name": "Real Estate" - }], - "name": "ジョイライフスタイル", - "id": "117500321741291" - }, { - "category": "Internet/software", - "category_list": [{ - "id": "10101472279007861", - "name": "Internet/Software" - }], - "name": "Engineerrise", - "id": "565244630160593" - }, { - "category": "Electronics", - "name": "Rapiro", - "id": "124199987785627" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/579612276?pretty=1&fields=context.fields(mutual_likes.limit(5).after(MTI0MTk5OTg3Nzg1NjI3))", - "cursors": { - "before": "MTc3NjA3MTQzNjQ4", - "after": "MTI0MTk5OTg3Nzg1NjI3" - } - }, - "summary": { - "total_count": 89 - } - } - }, - "currency": { - "currency_offset": 1, - "usd_exchange": 0.0097614, - "usd_exchange_inverse": 102.4443215113, - "user_currency": "JPY" - }, - "devices": [{ - "hardware": "iPhone", - "os": "iOS" - }], - "id": "579612276" -} diff --git a/fb_graph2.original/spec/mock_json/user/movies.json b/fb_graph2.original/spec/mock_json/user/movies.json deleted file mode 100644 index 85e2fb5..0000000 --- a/fb_graph2.original/spec/mock_json/user/movies.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": [{ - "category": "Movie", - "name": "The Social Network", - "created_time": "2011-01-05T00:17:17+0000", - "id": "105460422821089" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/579612276/movies?limit=25&offset=25&__after_id=enc_AewDz_Z8KNKb51zhWhUMYOJjref9qTPZpk1jT2P9sAXIzWmNSJSUU56XyMbJASE2c8qPbE1-WoFS8o6eCgs6K4Ui" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/music.json b/fb_graph2.original/spec/mock_json/user/music.json deleted file mode 100644 index a66f81f..0000000 --- a/fb_graph2.original/spec/mock_json/user/music.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "data": [{ - "category": "Music", - "name": "斉藤和義", - "created_time": "2011-07-31T05:30:44+0000", - "id": "108827045813193" - }, { - "category": "Musician/band", - "name": "L'arc~en~Ciel", - "created_time": "2011-07-31T05:28:30+0000", - "id": "12039028077" - }, { - "category": "Musician/band", - "name": "Utada Hikaru", - "created_time": "2010-05-10T06:57:25+0000", - "id": "105806242793688" - }, { - "category": "Musician/band", - "category_list": [{ - "id": "180164648685982", - "name": "Bands & Musicians" - }], - "name": "Avril Lavigne", - "created_time": "2009-01-22T18:03:07+0000", - "id": "5413509299" - }, { - "category": "Musician/band", - "name": "Bank Band", - "created_time": "2009-01-22T17:47:26+0000", - "id": "28534671472" - }, { - "category": "Musician/band", - "name": "The Yellow Monkey", - "created_time": "2009-01-22T17:36:46+0000", - "id": "32548904409" - }, { - "category": "Musician/band", - "name": "Mr. Children", - "created_time": "2009-01-22T17:36:26+0000", - "id": "27868140174" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/579612276/music?limit=25&offset=25&__after_id=enc_AeyVKBfCEuM8ZXcswQ4tW_IGxEZSp9qkwAdtOM37T5EWpk1I8POJ2Kn5tSqM2lWyx0Q" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/notifications.json b/fb_graph2.original/spec/mock_json/user/notifications.json deleted file mode 100644 index 8bacf35..0000000 --- a/fb_graph2.original/spec/mock_json/user/notifications.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "data": [{ - "id": "notif_579612276_373456430", - "from": { - "id": "583017165143721", - "name": "Akira Otaishi" - }, - "to": { - "id": "579612276", - "name": "Nov Matake" - }, - "created_time": "2014-08-27T18:48:07+0000", - "updated_time": "2014-08-27T18:48:07+0000", - "title": "Akira Otaishi invited you to his event あんしんかんcafe vol.4 ~ネット選挙をめぐるビジネス&セキュリティ~.", - "link": "http://www.facebook.com/events/339815099528481/", - "application": { - "name": "Events", - "id": "141157392619610" - }, - "unread": 1 - }, { - "id": "notif_579612276_373364015", - "from": { - "id": "631020523647805", - "name": "Shota Kawaminami" - }, - "to": { - "id": "579612276", - "name": "Nov Matake" - }, - "created_time": "2014-08-27T05:28:07+0000", - "updated_time": "2014-08-27T05:28:07+0000", - "title": "Shota Kawaminami shared your link.", - "link": "http://www.facebook.com/shota.kawaminami/posts/700333850049805", - "application": { - "name": "Links", - "id": "2309869772" - }, - "unread": 1 - }], - "paging": { - "previous": "https://graph.facebook.com/v2.1/579612276/notifications?limit=5000&since=1409272999&__paging_token=***", - "next": "https://graph.facebook.com/v2.1/579612276/notifications?limit=5000&until=1408919679&__paging_token=***" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/outbox.json b/fb_graph2.original/spec/mock_json/user/outbox.json deleted file mode 100644 index 73b67ab..0000000 --- a/fb_graph2.original/spec/mock_json/user/outbox.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "data": [{ - "id": "741737742539677", - "to": { - "data": [{ - "id": "579612276", - "name": "Nov Matake" - }, { - "id": "10152167763779825", - "name": "Hayashi Tatsuya" - }] - }, - "updated_time": "2014-09-02T03:51:40+0000", - "unread": 0, - "unseen": 0, - "comments": { - "data": [{ - "id": "741737742539677_1409625688", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "message": "ヒゲキョクチョ", - "created_time": "2014-09-02T02:41:28+0000" - }], - "paging": { - "previous": "https://graph.facebook.com/v2.1/741737742539677/comments?limit=25&since=1409629900&__paging_token=***", - "next": "https://graph.facebook.com/v2.1/741737742539677/comments?limit=25&until=1409625439&__paging_token=***" - } - } - }], - "paging": { - "previous": "https://graph.facebook.com/v2.1/579612276/outbox?limit=25&since=1409629900&__paging_token=***", - "next": "https://graph.facebook.com/v2.1/579612276/outbox?limit=25&until=1403014440&__paging_token=***" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/permissions.json b/fb_graph2.original/spec/mock_json/user/permissions.json deleted file mode 100644 index 6e359e5..0000000 --- a/fb_graph2.original/spec/mock_json/user/permissions.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "data": [{ - "permission": "installed", - "status": "granted" - }, { - "permission": "public_profile", - "status": "granted" - }, { - "permission": "read_stream", - "status": "granted" - }, { - "permission": "read_mailbox", - "status": "granted" - }, { - "permission": "read_page_mailboxes", - "status": "granted" - }, { - "permission": "rsvp_event", - "status": "granted" - }, { - "permission": "email", - "status": "granted" - }, { - "permission": "read_insights", - "status": "granted" - }, { - "permission": "manage_notifications", - "status": "granted" - }, { - "permission": "read_friendlists", - "status": "granted" - }, { - "permission": "manage_pages", - "status": "granted" - }, { - "permission": "publish_actions", - "status": "granted" - }, { - "permission": "user_birthday", - "status": "granted" - }, { - "permission": "user_religion_politics", - "status": "granted" - }, { - "permission": "user_relationships", - "status": "granted" - }, { - "permission": "user_relationship_details", - "status": "granted" - }, { - "permission": "user_hometown", - "status": "granted" - }, { - "permission": "user_location", - "status": "granted" - }, { - "permission": "user_likes", - "status": "granted" - }, { - "permission": "user_activities", - "status": "granted" - }, { - "permission": "user_interests", - "status": "granted" - }, { - "permission": "user_education_history", - "status": "granted" - }, { - "permission": "user_work_history", - "status": "granted" - }, { - "permission": "user_website", - "status": "granted" - }, { - "permission": "user_groups", - "status": "granted" - }, { - "permission": "user_events", - "status": "granted" - }, { - "permission": "user_photos", - "status": "granted" - }, { - "permission": "user_videos", - "status": "granted" - }, { - "permission": "user_friends", - "status": "granted" - }, { - "permission": "user_about_me", - "status": "granted" - }, { - "permission": "user_status", - "status": "granted" - }, { - "permission": "user_games_activity", - "status": "granted" - }, { - "permission": "user_tagged_places", - "status": "granted" - }, { - "permission": "user_actions.books", - "status": "granted" - }, { - "permission": "user_actions.music", - "status": "granted" - }, { - "permission": "user_actions.video", - "status": "granted" - }, { - "permission": "user_actions.news", - "status": "granted" - }] -} diff --git a/fb_graph2.original/spec/mock_json/user/photos.json b/fb_graph2.original/spec/mock_json/user/photos.json deleted file mode 100644 index ccc1e7d..0000000 --- a/fb_graph2.original/spec/mock_json/user/photos.json +++ /dev/null @@ -1,542 +0,0 @@ -{ - "data": [{ - "id": "10200941627421315", - "from": { - "id": "10201136131123786", - "name": "Tatsuya Katsuhara" - }, - "name": "ID厨が白秋で肉をくらう。", - "picture": "https://fbcdn-photos-b-a.akamaihd.net/hphotos-ak-xpf1/t1.0-0/1531597_10200941627421315_1173228419_s.jpg", - "source": "https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xpf1/t1.0-9/s720x720/1531597_10200941627421315_1173228419_n.jpg", - "height": 540, - "width": 720, - "images": [{ - "height": 720, - "width": 960, - "source": "https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xpf1/t1.0-9/1531597_10200941627421315_1173228419_n.jpg" - }, { - "height": 600, - "width": 800, - "source": "https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xpf1/t1.0-9/p600x600/1531597_10200941627421315_1173228419_n.jpg" - }, { - "height": 480, - "width": 640, - "source": "https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xpf1/t1.0-9/p480x480/1531597_10200941627421315_1173228419_n.jpg" - }, { - "height": 320, - "width": 426, - "source": "https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xpf1/t1.0-9/p320x320/1531597_10200941627421315_1173228419_n.jpg" - }, { - "height": 540, - "width": 720, - "source": "https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xpf1/t1.0-9/p180x540/1531597_10200941627421315_1173228419_n.jpg" - }, { - "height": 130, - "width": 173, - "source": "https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xpf1/t1.0-9/p130x130/1531597_10200941627421315_1173228419_n.jpg" - }, { - "height": 225, - "width": 300, - "source": "https://fbcdn-sphotos-b-a.akamaihd.net/hphotos-ak-xpf1/t1.0-9/p75x225/1531597_10200941627421315_1173228419_n.jpg" - }], - "link": "https://www.facebook.com/photo.php?fbid=10200941627421315&set=p.10200941627421315&type=1", - "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yz/r/StEh3RhPvjk.gif", - "place": { - "id": "469658423073776", - "name": "白秋", - "location": { - "city": "Shibuya-ku", - "country": "Japan", - "latitude": 35.6563466826, - "longitude": 139.700998939, - "state": "Tokyo" - } - }, - "created_time": "2014-03-26T13:05:18+0000", - "updated_time": "2014-03-26T13:20:56+0000", - "tags": { - "data": [{ - "id": "585838138182211", - "name": "Teruko Kaneshiro", - "created_time": "2014-03-26T13:05:18+0000", - "x": 44.84375, - "y": 42.083335876465 - }, { - "id": "644436712303508", - "name": "Masaru Kurahayashi", - "created_time": "2014-03-26T13:05:18+0000", - "x": 59.0625, - "y": 35.416667938232 - }, { - "id": "10201136131123786", - "name": "Tatsuya Katsuhara", - "created_time": "2014-03-26T13:05:18+0000", - "x": 50, - "y": 85.83332824707 - }, { - "id": "10203204372262716", - "name": "Ryo Ito", - "created_time": "2014-03-26T13:05:18+0000", - "x": 35.46875, - "y": 39.166667938232 - }, { - "id": "10152167763779825", - "name": "Hayashi Tatsuya", - "created_time": "2014-03-26T13:05:18+0000", - "x": 74.6875, - "y": 39.583335876465 - }, { - "id": "579612276", - "name": "Nov Matake", - "created_time": "2014-03-26T13:05:18+0000", - "x": 29.062503814697, - "y": 43.333332061768 - }, { - "id": "10152436694196416", - "name": "Shingo Yamanaka", - "created_time": "2014-03-26T13:05:18+0000", - "x": 83.125, - "y": 36.458335876465 - }, { - "id": "10152447963434621", - "name": "Tatsuo Kudo", - "created_time": "2014-03-26T13:05:18+0000", - "x": 51.718746185303, - "y": 38.333335876465 - }], - "paging": { - "cursors": { - "before": "NTg1ODM4MTM4MTgyMjEx", - "after": "MTAxNTI0NDc5NjM0MzQ2MjE=" - } - } - }, - "comments": { - "data": [{ - "id": "10200941627421315_2590723", - "can_remove": false, - "created_time": "2014-03-26T17:19:38+0000", - "from": { - "name": "Toru Yamaguchi", - "id": "10152396860921912" - }, - "like_count": 2, - "message": "呼ばれてない!!!w", - "user_likes": true - }, { - "id": "10200941627421315_2591238", - "can_remove": false, - "created_time": "2014-03-26T23:10:01+0000", - "from": { - "name": "Tatsuya Katsuhara", - "id": "10201136131123786" - }, - "like_count": 2, - "message": "僕も呼ばれてない!!!w(通りがかっただけ)\n\nファウンデーションのページに顔写真が乗ってる人が対象とのこと。", - "user_likes": false - }, { - "id": "10200941627421315_2591277", - "can_remove": true, - "created_time": "2014-03-26T23:41:55+0000", - "from": { - "name": "Nov Matake", - "id": "579612276" - }, - "like_count": 2, - "message": "あ!!ネコの人の横顔が!!(((( ;゚Д゚)))", - "user_likes": false - }, { - "id": "10200941627421315_2591624", - "can_remove": false, - "created_time": "2014-03-27T03:59:55+0000", - "from": { - "name": "Tatsuya Katsuhara", - "id": "10201136131123786" - }, - "like_count": 0, - "message": "顔だしNGでしたっけ?", - "user_likes": false - }, { - "id": "10200941627421315_2591626", - "can_remove": false, - "created_time": "2014-03-27T04:00:40+0000", - "from": { - "name": "Ryo Ito", - "id": "10203204372262716" - }, - "like_count": 2, - "message": "日本海に沈められたいようですね?", - "user_likes": false - }, { - "id": "10200941627421315_2591628", - "can_remove": false, - "created_time": "2014-03-27T04:01:36+0000", - "from": { - "name": "Tatsuya Katsuhara", - "id": "10201136131123786" - }, - "like_count": 1, - "message": "まぁほとんど見えてないし、なんか「シェー」してるし。", - "user_likes": false - }, { - "id": "10200941627421315_2591630", - "can_remove": false, - "created_time": "2014-03-27T04:03:14+0000", - "from": { - "name": "Tatsuo Kudo", - "id": "10152447963434621" - }, - "like_count": 1, - "message": "タグ消して早く逃げて!", - "user_likes": false - }], - "paging": { - "cursors": { - "before": "MQ==", - "after": "Nw==" - } - } - }, - "likes": { - "data": [{ - "id": "685453561525864", - "name": "Hiromitsu Iida" - }, { - "id": "753788224652550", - "name": "Satoshi Watanabe" - }, { - "id": "657700260978684", - "name": "Kaori Miyata" - }, { - "id": "10201584212239941", - "name": "Takashi Kawasaki" - }, { - "id": "449004711910751", - "name": "Sachiko Notsu" - }, { - "id": "471770689635333", - "name": "田辺 めぐみ" - }, { - "id": "722691854464357", - "name": "Nobuyuki Ooka" - }, { - "id": "550421278399580", - "name": "Ayaya Maheno" - }, { - "id": "663823840353749", - "name": "Koji Asaga" - }, { - "id": "633899533370033", - "name": "Eiko Miyamae" - }, { - "id": "10203759427616991", - "name": "Takeshi Takahashi" - }, { - "id": "10204254221381580", - "name": "Aoi Ichiba" - }, { - "id": "10152851258997627", - "name": "Takashi Shitamichi" - }, { - "id": "732741390109869", - "name": "Rieko Suzuki" - }, { - "id": "10202979025649479", - "name": "Akiko Orita" - }, { - "id": "605588959556246", - "name": "Eduardo Casquejo Gerochi" - }, { - "id": "10152396860921912", - "name": "Toru Yamaguchi" - }, { - "id": "780799988617330", - "name": "Shota Kinoshita" - }, { - "id": "325116630972406", - "name": "津田千穂" - }, { - "id": "449822611820106", - "name": "Yoichiro Iizuka" - }, { - "id": "677203379011818", - "name": "Obata Masa" - }, { - "id": "10202834671282088", - "name": "Miki Tsujimoto" - }, { - "id": "647882965291683", - "name": "Yasuo Okabe" - }, { - "id": "644436712303508", - "name": "Masaru Kurahayashi" - }, { - "id": "523078074465377", - "name": "Keisuke Kagawa" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/10200941627421315/likes?pretty=1&limit=25&after=NTIzMDc4MDc0NDY1Mzc3", - "cursors": { - "before": "Njg1NDUzNTYxNTI1ODY0", - "after": "NTIzMDc4MDc0NDY1Mzc3" - } - } - } - }, { - "id": "10200841351194472", - "from": { - "id": "10201136131123786", - "name": "Tatsuya Katsuhara" - }, - "name": "そのままmixiのラウンジで打ち上げ。", - "picture": "https://fbcdn-photos-a-a.akamaihd.net/hphotos-ak-xap1/t1.0-0/1897751_10200841351194472_1801438743_s.jpg", - "source": "https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-xap1/t1.0-9/s720x720/1897751_10200841351194472_1801438743_n.jpg", - "height": 540, - "width": 720, - "images": [{ - "height": 720, - "width": 960, - "source": "https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-xap1/t1.0-9/1897751_10200841351194472_1801438743_n.jpg" - }, { - "height": 600, - "width": 800, - "source": "https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-xap1/t1.0-9/p600x600/1897751_10200841351194472_1801438743_n.jpg" - }, { - "height": 480, - "width": 640, - "source": "https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-xap1/t1.0-9/p480x480/1897751_10200841351194472_1801438743_n.jpg" - }, { - "height": 320, - "width": 426, - "source": "https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-xap1/t1.0-9/p320x320/1897751_10200841351194472_1801438743_n.jpg" - }, { - "height": 540, - "width": 720, - "source": "https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-xap1/t1.0-9/p180x540/1897751_10200841351194472_1801438743_n.jpg" - }, { - "height": 130, - "width": 173, - "source": "https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-xap1/t1.0-9/p130x130/1897751_10200841351194472_1801438743_n.jpg" - }, { - "height": 225, - "width": 300, - "source": "https://fbcdn-sphotos-a-a.akamaihd.net/hphotos-ak-xap1/t1.0-9/p75x225/1897751_10200841351194472_1801438743_n.jpg" - }], - "link": "https://www.facebook.com/photo.php?fbid=10200841351194472&set=p.10200841351194472&type=1", - "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yz/r/StEh3RhPvjk.gif", - "place": { - "id": "203709096330380", - "name": "mixi", - "location": { - "city": "Shibuya-ku", - "country": "Japan", - "latitude": 35.658331169721, - "longitude": 139.70888632701, - "state": "Tokyo", - "street": "東1-2-20 住友不動産渋谷ファーストタワー7F", - "zip": "150-0011" - } - }, - "created_time": "2014-03-07T14:25:30+0000", - "updated_time": "2014-03-07T14:25:31+0000", - "tags": { - "data": [{ - "id": "10152447963434621", - "name": "Tatsuo Kudo", - "created_time": "2014-03-13T08:02:16+0000", - "x": 35.208333333333, - "y": 44.481481481482 - }, { - "id": "572058479576285", - "name": "Satoshi Yagi", - "created_time": "2014-03-13T08:02:14+0000", - "x": 46.597222222222, - "y": 40.874074074074 - }, { - "id": "677203379011818", - "name": "Obata Masa", - "created_time": "2014-03-13T07:56:48+0000", - "x": 65.98193359375, - "y": 28.95009803772 - }, { - "id": "644436712303508", - "name": "Masaru Kurahayashi", - "created_time": "2014-03-13T07:56:46+0000", - "x": 39.027778625488, - "y": 44.674076080322 - }, { - "id": "585838138182211", - "name": "Teruko Kaneshiro", - "created_time": "2014-03-07T14:26:31+0000", - "x": 62.777774810791, - "y": 46.237037658691 - }, { - "id": "671955032839764", - "name": "Naohiro Fujie", - "created_time": "2014-03-07T14:26:31+0000", - "x": 52.499996185303, - "y": 45.62963104248 - }, { - "id": "10201136131123786", - "name": "Tatsuya Katsuhara", - "created_time": "2014-03-07T14:25:31+0000", - "x": 24.446300506592, - "y": 37.896244049072 - }, { - "id": "579612276", - "name": "Nov Matake", - "created_time": "2014-03-07T14:25:31+0000", - "x": 66.40796661377, - "y": 53.814094543457 - }], - "paging": { - "cursors": { - "before": "MTAxNTI0NDc5NjM0MzQ2MjE=", - "after": "NTc5NjEyMjc2" - } - } - }, - "comments": { - "data": [{ - "id": "10200841351194472_2557753", - "can_remove": false, - "created_time": "2014-03-07T23:38:10+0000", - "from": { - "name": "Ryo Ito", - "id": "10203204372262716" - }, - "like_count": 0, - "message": "これは良い写真", - "user_likes": false - }, { - "id": "10200841351194472_2557794", - "can_remove": false, - "created_time": "2014-03-07T23:58:24+0000", - "from": { - "name": "Teruko Kaneshiro", - "id": "585838138182211" - }, - "like_count": 2, - "message": "カメラマンが良かったんじゃない?笑", - "user_likes": false - }, { - "id": "10200841351194472_2558268", - "can_remove": false, - "created_time": "2014-03-08T05:49:32+0000", - "from": { - "name": "Satoshi Yagi", - "id": "572058479576285" - }, - "like_count": 2, - "message": "なんか削除されてるw", - "user_likes": false - }, { - "id": "10200841351194472_2567175", - "can_remove": false, - "created_time": "2014-03-13T08:02:42+0000", - "from": { - "name": "Obata Masa", - "id": "677203379011818" - }, - "like_count": 1, - "message": "楽しかったですね。\n八木さんと金城さんと富士榮さんが一つづつずれてますwww", - "user_likes": false - }], - "paging": { - "cursors": { - "before": "MQ==", - "after": "NA==" - } - } - }, - "likes": { - "data": [{ - "id": "1246364330", - "name": "Kaoru Maeda" - }, { - "id": "511347795659717", - "name": "Hirokazu Takahashi" - }, { - "id": "10201598897247208", - "name": "石山省吾" - }, { - "id": "10201646502916047", - "name": "Satoru Kanno" - }, { - "id": "449822611820106", - "name": "Yoichiro Iizuka" - }, { - "id": "10152167763779825", - "name": "Hayashi Tatsuya" - }, { - "id": "449004711910751", - "name": "Sachiko Notsu" - }, { - "id": "393385770799951", - "name": "Takumi Tanabe" - }, { - "id": "507142902719891", - "name": "古谷 ゆかり" - }, { - "id": "572058479576285", - "name": "Satoshi Yagi" - }, { - "id": "595179360590282", - "name": "ワタナベ モリヲ" - }, { - "id": "565784313542838", - "name": "Masahiko Taguchi" - }, { - "id": "677203379011818", - "name": "Obata Masa" - }, { - "id": "561310417321029", - "name": "Muneomi Sakuta" - }, { - "id": "654721794603615", - "name": "Yukinori Kuroda" - }, { - "id": "471770689635333", - "name": "田辺 めぐみ" - }, { - "id": "10201784235795126", - "name": "Asako Unno" - }, { - "id": "1592975120926614", - "name": "Tomio Fujii" - }, { - "id": "10202964334443172", - "name": "Nat Sakimura" - }, { - "id": "523078074465377", - "name": "Keisuke Kagawa" - }, { - "id": "325116630972406", - "name": "津田千穂" - }, { - "id": "4298847927599", - "name": "Sami Maekawa" - }, { - "id": "671955032839764", - "name": "Naohiro Fujie" - }, { - "id": "10152168475655765", - "name": "Takayuki Sadahiro" - }, { - "id": "552783474831745", - "name": "Satsuki Kawaji" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/10200841351194472/likes?pretty=1&limit=25&after=NTUyNzgzNDc0ODMxNzQ1", - "cursors": { - "before": "MTI0NjM2NDMzMA==", - "after": "NTUyNzgzNDc0ODMxNzQ1" - } - } - } - }], - "paging": { - "previous": "https://graph.facebook.com/v2.0/579612276/photos?type=tagged&limit=25&since=1395839118", - "next": "https://graph.facebook.com/v2.0/579612276/photos?type=tagged&limit=25&until=1344010662" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/picture.json b/fb_graph2.original/spec/mock_json/user/picture.json deleted file mode 100644 index 653576f..0000000 --- a/fb_graph2.original/spec/mock_json/user/picture.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "data": { - "url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xfp1/t1.0-1/p50x50/1621886_836472406369007_1319645706_t.jpg", - "is_silhouette": false - } -} \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/user/pokes.json b/fb_graph2.original/spec/mock_json/user/pokes.json deleted file mode 100644 index 619b57b..0000000 --- a/fb_graph2.original/spec/mock_json/user/pokes.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "data": [{ - "to": { - "id": "579612276", - "name": "Nov Matake" - }, - "from": { - "id": "10203783534727236", - "name": "Taizo Matsuoka" - }, - "created_time": "2014-06-03T09:01:25+0000" - }], - "paging": { - "previous": "https://graph.facebook.com/v2.0/579612276/pokes?limit=25&since=1401786085", - "next": "https://graph.facebook.com/v2.0/579612276/pokes?limit=25&until=1401786085" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/posts.json b/fb_graph2.original/spec/mock_json/user/posts.json deleted file mode 100644 index 69f84b7..0000000 --- a/fb_graph2.original/spec/mock_json/user/posts.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "data": [{ - "id": "579612276_10152483324277277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "to": { - "data": [{ - "id": "579612276", - "name": "Nov Matake" - }] - }, - "message": "Nov Matake test", - "message_tags": { - "0": [{ - "id": "579612276", - "name": "Nov Matake", - "type": "user", - "offset": 0, - "length": 10 - }] - }, - "actions": [{ - "name": "Comment", - "link": "https://www.facebook.com/579612276/posts/10152483324277277" - }, { - "name": "Like", - "link": "https://www.facebook.com/579612276/posts/10152483324277277" - }], - "privacy": { - "description": "Your friends", - "value": "ALL_FRIENDS", - "friends": "", - "networks": "", - "allow": "", - "deny": "" - }, - "type": "status", - "status_type": "mobile_status_update", - "created_time": "2014-06-03T06:27:21+0000", - "updated_time": "2014-06-03T06:27:21+0000" - }], - "paging": { - "previous": "https://graph.facebook.com/v2.0/579612276/posts?limit=1&since=1401776841", - "next": "https://graph.facebook.com/v2.0/579612276/posts?limit=1&until=1401776840" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/scores.json b/fb_graph2.original/spec/mock_json/user/scores.json deleted file mode 100644 index 7c9fbd6..0000000 --- a/fb_graph2.original/spec/mock_json/user/scores.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "data": [{ - "user": { - "id": "10152411392127277", - "name": "Nov Matake" - }, - "score": 10, - "application": { - "name": "gem sample", - "namespace": "fbgraphsample", - "id": "134145643294322" - } - }] -} diff --git a/fb_graph2.original/spec/mock_json/user/statuses.json b/fb_graph2.original/spec/mock_json/user/statuses.json deleted file mode 100644 index ff4ea9a..0000000 --- a/fb_graph2.original/spec/mock_json/user/statuses.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "data": [{ - "id": "10152483324277277", - "from": { - "id": "579612276", - "name": "Nov Matake" - }, - "message": "Nov Matake test", - "updated_time": "2014-06-03T06:27:20+0000" - }], - "paging": { - "previous": "https://graph.facebook.com/v2.0/579612276/statuses?limit=25&since=1401776840&__paging_token=***", - "next": "https://graph.facebook.com/v2.0/579612276/statuses?limit=25&until=1384770778&__paging_token=***" - } -} diff --git a/fb_graph2.original/spec/mock_json/user/taggable_friends.json b/fb_graph2.original/spec/mock_json/user/taggable_friends.json deleted file mode 100644 index 86844d3..0000000 --- a/fb_graph2.original/spec/mock_json/user/taggable_friends.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "data": [{ - "id": "AVm6afobc20T0wATmCYRk_CNymo_44MQW8yMBwpgDFAQ18iF9feZpDEDmwfmcjSBSSuYkFfD5fx77g_uJRF0fmQ7AR2kObX8biP4wzN7UMpbYQ", - "name": "Shingo Yamanaka", - "picture": { - "data": { - "is_silhouette": false, - "url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpf1/t1.0-1/c0.15.85.85/s50x50/1468668_10152037195781416_2050550170_s.jpg" - } - } - }, { - "id": "AVnJiIlmAtrWJ106ErRPlLZNy8_Hd4mfmuQBrbGm4tuFS_ENvyYdVxTwgesXE5Wp2ICtxcPHzkA4Y4BJAWwJqyUie2ZDKQeKn9mnjPCVAUr8Lg", - "name": "Hayashi Tatsuya", - "picture": { - "data": { - "is_silhouette": false, - "url": "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xaf1/t1.0-1/c79.38.479.479/s50x50/388771_10150501378984825_523522119_n.jpg" - } - } - }], - "paging": { - "cursors": { - "before": "QVZra09GaExkNndsM1J5eVpuQ2dWS1hLV3FBb0dqRTh3dC1PVXJIZE8ya0JzbV9kUDZXcWZEdUtUZFNHejcxeGlWZ3JjZjZjdkIwMWdtSWtHZGpGVE8wTWZ5cUdNUm5NWWw3c2hSTEtPZ19ySmc=", - "after": "QVZrdlNsUHItNExPY1JIUVdlZ3BDZlFCTHFFMUl6YVhnVG5fRVlBLVV0QThUMFBmRnZNQkVQWVg2VkRBQWhRa3RyemVQUFhscWxBVERYZU15SExZbG50Z0RTQUtfVno5VjRjT3VUb2J5NGg1VFE=" - } - } -} \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/user/television.json b/fb_graph2.original/spec/mock_json/user/television.json deleted file mode 100644 index 9aef8ef..0000000 --- a/fb_graph2.original/spec/mock_json/user/television.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "data": [{ - "category": "Tv show", - "name": "Mobile Suit Zeta Gundam", - "created_time": "2014-06-03T06:08:35+0000", - "id": "105508046150348" - }], - "paging": { - "next": "https://graph.facebook.com/v2.0/579612276/television?limit=25&offset=25&__after_id=enc_AewK-s0422fW15xZjOu3LxDtrkej8NQumXBW2ugVt3EuK52YArNQIKzoyq72k0V_vQ3_DGUsIp7COPzF82p_h4BK" - } -} \ No newline at end of file diff --git a/fb_graph2.original/spec/mock_json/user/videos.json b/fb_graph2.original/spec/mock_json/user/videos.json deleted file mode 100644 index 4f3349b..0000000 --- a/fb_graph2.original/spec/mock_json/user/videos.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "data": [{ - "id": "10150407695537277", - "from": { - "category": "Software", - "name": "FbGraph", - "id": "117513961602338" - }, - "name": "Testing Video Upload!", - "description": "Testing Video Upload!!!!", - "picture": "https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xap1/t15.0-10/51203_10150407695802277_10150407695537277_13346_258_t.jpg", - "embed_html": "", - "icon": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/DggDhA4z4tO.gif", - "source": "https://fbcdn-video-a.akamaihd.net/hvideo-ak-xap1/v/t43.1792-2/1205675_10151804645367277_61538_n.mp4?oh=d78d7d5854d1614376ca0358b15b9f54&oe=538F750B&__gda__=1401907382_f5c3b44cfea781601e4caed9eca55002", - "created_time": "2011-11-09T08:31:28+0000", - "updated_time": "2011-11-09T08:31:28+0000", - "format": [{ - "embed_html": "", - "width": 130, - "height": 98, - "filter": "130x130", - "picture": "https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xap1/t15.0-10/s130x130/51203_10150407695802277_10150407695537277_13346_258_t.jpg" - }, { - "embed_html": "", - "width": 480, - "height": 360, - "filter": "480x480", - "picture": "https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xap1/t15.0-10/s480x480/51203_10150407695802277_10150407695537277_13346_258_b.jpg" - }, { - "embed_html": "", - "width": 640, - "height": 480, - "filter": "native", - "picture": "https://fbcdn-vthumb-a.akamaihd.net/hvthumb-ak-xap1/t15.0-10/51203_10150407695802277_10150407695537277_13346_258_b.jpg" - }] - }], - "paging": { - "previous": "https://graph.facebook.com/v2.0/117513961602338/videos?limit=25&since=1320827488", - "next": "https://graph.facebook.com/v2.0/117513961602338/videos?limit=25&until=1308369661" - } -} diff --git a/fb_graph2.original/spec/spec_helper.rb b/fb_graph2.original/spec/spec_helper.rb deleted file mode 100644 index 9ae1cca..0000000 --- a/fb_graph2.original/spec/spec_helper.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'simplecov' - -SimpleCov.start do - add_filter 'spec' -end - -require 'rspec' -require 'rspec/its' -require 'fb_graph2' - -RSpec.configure do |config| - config.expect_with :rspec do |c| - c.syntax = [:should, :expect] - end -end - -Dir[File.join(__dir__, 'spec_helper/*.rb')].each do |file| - require file -end \ No newline at end of file diff --git a/fb_graph2.original/spec/spec_helper/mock_graph.rb b/fb_graph2.original/spec/spec_helper/mock_graph.rb deleted file mode 100644 index a4668bb..0000000 --- a/fb_graph2.original/spec/spec_helper/mock_graph.rb +++ /dev/null @@ -1,96 +0,0 @@ -require 'webmock/rspec' - -module MockGraph - def mock_graph(method, path, response_path, options = {}) - stub_request( - method, - endpoint_for(path, options) - ).with( - request_for(method, options) - ).to_return( - response_for(response_path, options) - ) - if block_given? - response = yield - a_request( - method, - endpoint_for(path, options) - ).with( - request_for(method, options) - ).should have_been_made.once - response - end - end - - def mock_json(response_path) - content = response_for(response_path)[:body].read - MultiJson.load(content).with_indifferent_access - rescue MultiJson::DecodeError - content - end - - def request_to(path, method = :get, options = {}) - raise_error { |e| - e.should be_instance_of WebMock::NetConnectNotAllowedError - e.message.should include("Unregistered request: #{method.to_s.upcase}") - e.message.should include(endpoint_for path, options) - } - end - - private - - def endpoint_for(path, options = {}) - api_version = unless options[:disable_api_versioning] - options[:api_version] || FbGraph2.api_version - end - File.join FbGraph2.root_url, api_version.to_s, path - end - - def request_for(method, options = {}) - request = {} - if options[:access_token] - request[:headers] ||= {} - request[:headers] = { - authorization: "Bearer #{options[:access_token]}" - } - end - params = options.try(:[], :params) || {} - case method - when :post, :put, :delete - request[:body] = params - else - request[:query] = params - end - request - end - - def response_for(response_path, options = {}) - response = {} - response[:body] = response_file_for response_path - if options[:status] - response[:status] = options[:status] - end - response - end - - def response_file_for(response_path) - _response_file_path_ = if File.exist? response_path - response_path - else - File.join( - File.dirname(__FILE__), '../mock_json', "#{response_path}.json" - ) - end - unless File.exist? _response_file_path_ - response_file_required! _response_file_path_ - end - File.new _response_file_path_, 'r', encoding: 'utf-8' - end - - def response_file_required!(response_path) - warn 'No response file found.' - end -end - -include MockGraph -WebMock.disable_net_connect! \ No newline at end of file diff --git a/fb_graph2.original/lib/fb_graph2/auth/signed_request.rb b/lib/fb_graph2/auth/signed_request.rb similarity index 100% rename from fb_graph2.original/lib/fb_graph2/auth/signed_request.rb rename to lib/fb_graph2/auth/signed_request.rb diff --git a/lib/fb_graph2/post.rb b/lib/fb_graph2/post.rb index 905ddd4..c00c7f2 100644 --- a/lib/fb_graph2/post.rb +++ b/lib/fb_graph2/post.rb @@ -24,9 +24,11 @@ module FbGraph2 def initialize(id, attributes = {}) super if attributes.include? :message_tags - self.message_tags = attributes[:message_tags].collect do |message_tag| - TaggedProfile.new message_tag[:id], message_tag - end + self.message_tags = attributes[:message_tags].values.collect do |message_tags| + message_tags.collect do |tag| + TaggedProfile.new tag[:id], tag + end + end.flatten end if attributes.include? :privacy self.privacy = Struct::Privacy.new attributes[:privacy] diff --git a/lib/fb_graph2/tagged_profile.rb b/lib/fb_graph2/tagged_profile.rb index b51a354..5ce6a59 100644 --- a/lib/fb_graph2/tagged_profile.rb +++ b/lib/fb_graph2/tagged_profile.rb @@ -1,7 +1,7 @@ module FbGraph2 class TaggedProfile < Node register_attributes( - raw: [:id, :name, :type, :offset, :length], + raw: [:name, :type, :offset, :length], custom: [:object] ) diff --git a/spec/fb_graph2/edge/posts_spec.rb b/spec/fb_graph2/edge/posts_spec.rb index 6a8b122..83fa69b 100644 --- a/spec/fb_graph2/edge/posts_spec.rb +++ b/spec/fb_graph2/edge/posts_spec.rb @@ -12,6 +12,7 @@ describe FbGraph2::Edge::Posts do posts.should_not be_blank posts.each do |post| post.should be_instance_of FbGraph2::Post + post.message_tags.count.should == 2 end end end diff --git a/spec/mock_json/user/posts.json b/spec/mock_json/user/posts.json index c995fe4..33042df 100644 --- a/spec/mock_json/user/posts.json +++ b/spec/mock_json/user/posts.json @@ -12,13 +12,26 @@ }] }, "message": "Nov Matake test", - "message_tags": [{ - "id": "579612276", - "name": "Nov Matake", - "type": "user", - "offset": 0, - "length": 10 - }], + "message_tags": { + "0": [ + { + "id": "579612276", + "name": "Nov Matake", + "type": "user", + "offset": 0, + "length": 10 + } + ], + "11": [ + { + "id": "10153177366617368", + "name": "Bryan Brunetti", + "type": "user", + "offset": 11, + "length": 14 + } + ] + }, "actions": [{ "name": "Comment", "link": "https://www.facebook.com/579612276/posts/10152483324277277"