From 182f1e9c64b444505a29146773c4322eab5ac357 Mon Sep 17 00:00:00 2001 From: nov Date: Mon, 13 Jul 2015 15:16:19 +0900 Subject: [PATCH 1/9] default v2.4 --- lib/fb_graph2.rb | 2 +- spec/fb_graph2_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/fb_graph2.rb b/lib/fb_graph2.rb index f41a679..0ede856 100644 --- a/lib/fb_graph2.rb +++ b/lib/fb_graph2.rb @@ -8,7 +8,7 @@ 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.3' + self.api_version = 'v2.4' self.gem_version = File.read(File.join(__dir__, '../VERSION')).strip self.logger = Logger.new(STDOUT) self.logger.progname = 'FbGraph2' diff --git a/spec/fb_graph2_spec.rb b/spec/fb_graph2_spec.rb index 672e128..f77334d 100644 --- a/spec/fb_graph2_spec.rb +++ b/spec/fb_graph2_spec.rb @@ -6,7 +6,7 @@ describe FbGraph2 do context 'as default' do its(:logger) { should be_a Logger } - its(:api_version) { should == 'v2.3' } + its(:api_version) { should == 'v2.4' } its(:root_url) { should == 'https://graph.facebook.com' } it { should_not be_debugging } end From 687e2035108aa3caf4454e0ce08d5a4039e8e5a5 Mon Sep 17 00:00:00 2001 From: nov Date: Mon, 13 Jul 2015 15:17:00 +0900 Subject: [PATCH 2/9] links edge is no longer available. use feed https://developers.facebook.com/docs/apps/changelog#v2_4_changes --- lib/fb_graph2/edge/links.rb | 12 --------- lib/fb_graph2/page.rb | 1 - lib/fb_graph2/user.rb | 1 - spec/fb_graph2/edge/links_spec.rb | 19 ------------- spec/mock_json/user/links.json | 45 ------------------------------- 5 files changed, 78 deletions(-) delete mode 100644 lib/fb_graph2/edge/links.rb delete mode 100644 spec/fb_graph2/edge/links_spec.rb delete mode 100644 spec/mock_json/user/links.json diff --git a/lib/fb_graph2/edge/links.rb b/lib/fb_graph2/edge/links.rb deleted file mode 100644 index f18bcca..0000000 --- a/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/lib/fb_graph2/page.rb b/lib/fb_graph2/page.rb index 08a29ae..87e65e1 100644 --- a/lib/fb_graph2/page.rb +++ b/lib/fb_graph2/page.rb @@ -8,7 +8,6 @@ module FbGraph2 include Edge::Feed include Edge::GlobalBrandChildren include Edge::Insights - include Edge::Links include Edge::Locations include Edge::Milestones include Edge::Offers diff --git a/lib/fb_graph2/user.rb b/lib/fb_graph2/user.rb index 70f7cbe..a434466 100644 --- a/lib/fb_graph2/user.rb +++ b/lib/fb_graph2/user.rb @@ -20,7 +20,6 @@ module FbGraph2 include Edge::Interests include Edge::InvitableFriends include Edge::Likes::LikerContext - include Edge::Links include Edge::Movies include Edge::Music include Edge::Notifications diff --git a/spec/fb_graph2/edge/links_spec.rb b/spec/fb_graph2/edge/links_spec.rb deleted file mode 100644 index 8a18e9b..0000000 --- a/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/spec/mock_json/user/links.json b/spec/mock_json/user/links.json deleted file mode 100644 index 29d1151..0000000 --- a/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=" - } -} From 83e17307d66870c1056923d834bea88403e392f4 Mon Sep 17 00:00:00 2001 From: nov Date: Mon, 13 Jul 2015 15:19:12 +0900 Subject: [PATCH 3/9] statuses edge is no longer available. use feed https://developers.facebook.com/docs/apps/changelog#v2_4_changes --- lib/fb_graph2/edge/statuses.rb | 12 ------------ lib/fb_graph2/page.rb | 1 - lib/fb_graph2/user.rb | 1 - spec/fb_graph2/edge/statuses_spec.rb | 19 ------------------- spec/mock_json/user/statuses.json | 15 --------------- 5 files changed, 48 deletions(-) delete mode 100644 lib/fb_graph2/edge/statuses.rb delete mode 100644 spec/fb_graph2/edge/statuses_spec.rb delete mode 100644 spec/mock_json/user/statuses.json diff --git a/lib/fb_graph2/edge/statuses.rb b/lib/fb_graph2/edge/statuses.rb deleted file mode 100644 index 4ec379f..0000000 --- a/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/lib/fb_graph2/page.rb b/lib/fb_graph2/page.rb index 87e65e1..1041708 100644 --- a/lib/fb_graph2/page.rb +++ b/lib/fb_graph2/page.rb @@ -18,7 +18,6 @@ module FbGraph2 include Edge::Ratings include Edge::Roles::PageContext include Edge::Settings - include Edge::Statuses include Edge::Tagged include Edge::Videos extend Searchable diff --git a/lib/fb_graph2/user.rb b/lib/fb_graph2/user.rb index a434466..39a4bd8 100644 --- a/lib/fb_graph2/user.rb +++ b/lib/fb_graph2/user.rb @@ -32,7 +32,6 @@ module FbGraph2 include Edge::Pokes include Edge::Posts include Edge::Scores - include Edge::Statuses include Edge::TaggableFriends include Edge::Tagged include Edge::TaggedPlaces diff --git a/spec/fb_graph2/edge/statuses_spec.rb b/spec/fb_graph2/edge/statuses_spec.rb deleted file mode 100644 index 06a2178..0000000 --- a/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/spec/mock_json/user/statuses.json b/spec/mock_json/user/statuses.json deleted file mode 100644 index ff4ea9a..0000000 --- a/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=***" - } -} From 7813618a96a4aa903dc3b234296880027195e0c6 Mon Sep 17 00:00:00 2001 From: nov Date: Mon, 13 Jul 2015 15:33:27 +0900 Subject: [PATCH 4/9] invited edge is no longer available https://developers.facebook.com/docs/apps/changelog#v2_4_changes --- lib/fb_graph2/edge/invited.rb | 12 ------------ lib/fb_graph2/event.rb | 1 - spec/fb_graph2/edge/invited_spec.rb | 20 -------------------- spec/fb_graph2/edge/members_spec.rb | 2 +- spec/mock_json/event/invited.json | 17 ----------------- 5 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 lib/fb_graph2/edge/invited.rb delete mode 100644 spec/fb_graph2/edge/invited_spec.rb delete mode 100644 spec/mock_json/event/invited.json diff --git a/lib/fb_graph2/edge/invited.rb b/lib/fb_graph2/edge/invited.rb deleted file mode 100644 index 2b3f0ee..0000000 --- a/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/lib/fb_graph2/event.rb b/lib/fb_graph2/event.rb index 0428028..c52108d 100644 --- a/lib/fb_graph2/event.rb +++ b/lib/fb_graph2/event.rb @@ -3,7 +3,6 @@ module FbGraph2 include Edge::Attending include Edge::Declined include Edge::Feed - include Edge::Invited include Edge::Maybe include Edge::Noreply include Edge::Picture diff --git a/spec/fb_graph2/edge/invited_spec.rb b/spec/fb_graph2/edge/invited_spec.rb deleted file mode 100644 index 65ceb53..0000000 --- a/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/spec/fb_graph2/edge/members_spec.rb b/spec/fb_graph2/edge/members_spec.rb index f3c716a..5d0c731 100644 --- a/spec/fb_graph2/edge/members_spec.rb +++ b/spec/fb_graph2/edge/members_spec.rb @@ -4,7 +4,7 @@ describe FbGraph2::Edge::Members do context 'included in Group' do let(:group) { FbGraph2::Group.new('group_id').authenticate('token') } - describe '#invited' do + describe '#members' 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 diff --git a/spec/mock_json/event/invited.json b/spec/mock_json/event/invited.json deleted file mode 100644 index d43fbcd..0000000 --- a/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=" - } - } -} From cbfbdfbf3d4f7ea438b4a70784ed29d756fb696b Mon Sep 17 00:00:00 2001 From: nov Date: Mon, 13 Jul 2015 15:39:23 +0900 Subject: [PATCH 5/9] home edge is no longer available. https://developers.facebook.com/docs/apps/changelog#v2_4_changes --- lib/fb_graph2/edge/home.rb | 12 ------- lib/fb_graph2/user.rb | 1 - spec/fb_graph2/edge/home_spec.rb | 19 ---------- spec/mock_json/user/home.json | 61 -------------------------------- 4 files changed, 93 deletions(-) delete mode 100644 lib/fb_graph2/edge/home.rb delete mode 100644 spec/fb_graph2/edge/home_spec.rb delete mode 100644 spec/mock_json/user/home.json diff --git a/lib/fb_graph2/edge/home.rb b/lib/fb_graph2/edge/home.rb deleted file mode 100644 index 14037a0..0000000 --- a/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/lib/fb_graph2/user.rb b/lib/fb_graph2/user.rb index 39a4bd8..2eecf4f 100644 --- a/lib/fb_graph2/user.rb +++ b/lib/fb_graph2/user.rb @@ -15,7 +15,6 @@ module FbGraph2 include Edge::Friends include Edge::Games include Edge::Groups - include Edge::Home include Edge::Inbox include Edge::Interests include Edge::InvitableFriends diff --git a/spec/fb_graph2/edge/home_spec.rb b/spec/fb_graph2/edge/home_spec.rb deleted file mode 100644 index 8d6f8ef..0000000 --- a/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/spec/mock_json/user/home.json b/spec/mock_json/user/home.json deleted file mode 100644 index e731c7e..0000000 --- a/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" - } -} From 400cdd4ea0206ab361a2ff2c15bf3ae2a9c141a4 Mon Sep 17 00:00:00 2001 From: nov Date: Mon, 13 Jul 2015 15:40:40 +0900 Subject: [PATCH 6/9] inbox edge is no longer available. https://developers.facebook.com/docs/apps/changelog#v2_4_changes --- lib/fb_graph2/edge/inbox.rb | 12 --------- lib/fb_graph2/user.rb | 1 - spec/fb_graph2/edge/inbox_spec.rb | 20 --------------- spec/mock_json/user/inbox.json | 41 ------------------------------- 4 files changed, 74 deletions(-) delete mode 100644 lib/fb_graph2/edge/inbox.rb delete mode 100644 spec/fb_graph2/edge/inbox_spec.rb delete mode 100644 spec/mock_json/user/inbox.json diff --git a/lib/fb_graph2/edge/inbox.rb b/lib/fb_graph2/edge/inbox.rb deleted file mode 100644 index b739c5a..0000000 --- a/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/lib/fb_graph2/user.rb b/lib/fb_graph2/user.rb index 2eecf4f..5055be0 100644 --- a/lib/fb_graph2/user.rb +++ b/lib/fb_graph2/user.rb @@ -15,7 +15,6 @@ module FbGraph2 include Edge::Friends include Edge::Games include Edge::Groups - include Edge::Inbox include Edge::Interests include Edge::InvitableFriends include Edge::Likes::LikerContext diff --git a/spec/fb_graph2/edge/inbox_spec.rb b/spec/fb_graph2/edge/inbox_spec.rb deleted file mode 100644 index fb5187a..0000000 --- a/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/spec/mock_json/user/inbox.json b/spec/mock_json/user/inbox.json deleted file mode 100644 index 31f5dbb..0000000 --- a/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" - } -} From 750280706165248847a69b256432a0dcfb5a45cd Mon Sep 17 00:00:00 2001 From: nov Date: Mon, 13 Jul 2015 15:47:23 +0900 Subject: [PATCH 7/9] notifications and outbox edges are no longer availabe. https://developers.facebook.com/docs/apps/changelog#v2_4_changes ps. outbox isn't mentioned in the doc, but read_mailbox deprecation causes outbox deprecation too. --- lib/fb_graph2/edge/notifications.rb | 17 --------- lib/fb_graph2/edge/outbox.rb | 12 ------ lib/fb_graph2/user.rb | 3 -- spec/fb_graph2/edge/notifications_spec.rb | 30 --------------- spec/fb_graph2/edge/outbox_spec.rb | 19 ---------- spec/mock_json/user/notifications.json | 45 ----------------------- spec/mock_json/user/outbox.json | 36 ------------------ 7 files changed, 162 deletions(-) delete mode 100644 lib/fb_graph2/edge/notifications.rb delete mode 100644 lib/fb_graph2/edge/outbox.rb delete mode 100644 spec/fb_graph2/edge/notifications_spec.rb delete mode 100644 spec/fb_graph2/edge/outbox_spec.rb delete mode 100644 spec/mock_json/user/notifications.json delete mode 100644 spec/mock_json/user/outbox.json diff --git a/lib/fb_graph2/edge/notifications.rb b/lib/fb_graph2/edge/notifications.rb deleted file mode 100644 index 0537781..0000000 --- a/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/lib/fb_graph2/edge/outbox.rb b/lib/fb_graph2/edge/outbox.rb deleted file mode 100644 index c6b2e87..0000000 --- a/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/lib/fb_graph2/user.rb b/lib/fb_graph2/user.rb index 5055be0..3fc0abf 100644 --- a/lib/fb_graph2/user.rb +++ b/lib/fb_graph2/user.rb @@ -20,9 +20,6 @@ module FbGraph2 include Edge::Likes::LikerContext include Edge::Movies include Edge::Music - include Edge::Notifications - include Edge::OpenGraph::Actions - include Edge::Outbox include Edge::PaymentTransactions include Edge::Permissions include Edge::Picture diff --git a/spec/fb_graph2/edge/notifications_spec.rb b/spec/fb_graph2/edge/notifications_spec.rb deleted file mode 100644 index 9f52e0d..0000000 --- a/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/spec/fb_graph2/edge/outbox_spec.rb b/spec/fb_graph2/edge/outbox_spec.rb deleted file mode 100644 index eba845a..0000000 --- a/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/spec/mock_json/user/notifications.json b/spec/mock_json/user/notifications.json deleted file mode 100644 index 8bacf35..0000000 --- a/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/spec/mock_json/user/outbox.json b/spec/mock_json/user/outbox.json deleted file mode 100644 index 73b67ab..0000000 --- a/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=***" - } -} From 847f7cb33867f838320f718e82bf7fa5918cb0c3 Mon Sep 17 00:00:00 2001 From: nov Date: Tue, 28 Feb 2017 18:06:28 +0900 Subject: [PATCH 8/9] Edge::OpenGraph::Actions isn't included by User anymore --- .../fb_graph2/edge/open_graph/actions_spec.rb | 28 ------------------- 1 file changed, 28 deletions(-) delete mode 100644 spec/fb_graph2/edge/open_graph/actions_spec.rb diff --git a/spec/fb_graph2/edge/open_graph/actions_spec.rb b/spec/fb_graph2/edge/open_graph/actions_spec.rb deleted file mode 100644 index 8d0ad42..0000000 --- a/spec/fb_graph2/edge/open_graph/actions_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -require 'spec_helper' - -describe FbGraph2::Edge::OpenGraph::Actions do - context 'included in User' do - describe '#og_actions' do - let(:me) { FbGraph2::User.me('token') } - it 'should return an Array of FbGraph2::Post' do - actions = mock_graph :get, 'me/og.likes', 'user/og_actions_likes', access_token: 'token' do - me.og_actions 'og.likes' - end - actions.should be_instance_of FbGraph2::Edge - actions.should_not be_blank - actions.each do |action| - action.should be_instance_of FbGraph2::OpenGraph::Action - end - end - end - - describe '#og_action!' do - let(:user) { FbGraph2::User.new('user_id') } - it 'should return a FbGraph2::Post' do - mock_graph :post, 'user_id/og.likes', 'success_with_id', access_token: 'app_token' do - user.authenticate('app_token').og_action! 'og.likes', object: 'https://github.com/nov/fb_graph2/' - end.should be_instance_of FbGraph2::OpenGraph::Action - end - end - end -end From e2b4f4b048e061503775100ed603612adafff796 Mon Sep 17 00:00:00 2001 From: nov Date: Tue, 28 Feb 2017 18:08:34 +0900 Subject: [PATCH 9/9] add 2.4.0 and update others --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e280e95..a742b12 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,5 +3,6 @@ before_install: rvm: - 2.2.2 # NOTE: 2.2.1 or lower aren't supported by activesupport 5.0, CI isn't needed for such legacy versions. - - 2.2.5 - - 2.3.1 \ No newline at end of file + - 2.2.6 + - 2.3.3 + - 2.4.0 \ No newline at end of file