fb_graph2 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f05a10f821a086f7ea190dbcc24779b6be74800
4
- data.tar.gz: a5f88f9a3b0d588ad8cc347ea87d7981d68a3a9c
3
+ metadata.gz: f69edefe6360dd69310ab6c2c87dc9d94890d93b
4
+ data.tar.gz: 8fcb5375fd51300055fe9e69779a0e75ca09da80
5
5
  SHA512:
6
- metadata.gz: 02d5b41196ae8d6736e0573b8ea6140b397ae64657595c9f6b991d2b9e41363a64d9600600989771ae3b75d203ec249c420fa71654984289d37e3e179c297006
7
- data.tar.gz: 99cc98fd43dd6f6a7f5923bd06f352a1ce8f136d335827cf09acf9b0f286e010ff8429a83e24f9527f5fa7f9c9992bedbd32c04d9b012762f7556ec30a5f54c4
6
+ metadata.gz: 0884c7248761519272ae057eddff6051121f5ae3b8138bb72e78152c39a94ae416e1368bd01d4172bc6c3dd7486952438582b994837fbd132e7fb50ca3044a78
7
+ data.tar.gz: 465fef0736338ec0a102dc70c256a1b05ac103cff882b85aa24a5b586322191b9f2bf2b52b8aa230234ec176d028e3fb427602aa27fe9046450b2879128b8d82
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
@@ -13,10 +13,10 @@ Gem::Specification.new do |gem|
13
13
  gem.test_files = gem.files.grep(%r{^(test|gem|features)/})
14
14
  gem.require_paths = ['lib']
15
15
 
16
- gem.add_runtime_dependency 'httpclient', '>= 2.3'
16
+ gem.add_runtime_dependency 'httpclient', '>= 2.4'
17
17
  gem.add_runtime_dependency 'rack-oauth2', '>= 1.0'
18
18
  gem.add_runtime_dependency 'multi_json'
19
- gem.add_runtime_dependency 'activesupport', '>= 4.0'
19
+ gem.add_runtime_dependency 'activesupport', '>= 3.2'
20
20
  gem.add_development_dependency 'rake'
21
21
  gem.add_development_dependency 'simplecov'
22
22
  gem.add_development_dependency 'webmock'
@@ -5,6 +5,7 @@ module FbGraph2
5
5
  include Edge::AppEventTypes
6
6
  include Edge::Banned
7
7
  include Edge::Groups
8
+ include Edge::Permissions
8
9
  include Edge::Picture
9
10
  include Edge::Roles
10
11
  include Edge::Scores
@@ -4,7 +4,7 @@ module FbGraph2
4
4
  include Edge::Likes::LikeeContext
5
5
 
6
6
  register_attributes(
7
- raw: [:can_comment, :can_remove, :comment_count, :like_count, :message, :user_likes],
7
+ raw: [:can_comment, :can_remove, :comment_count, :like_count, :message, :user_likes, :is_hidden, :can_hide],
8
8
  time: [:created_time],
9
9
  user: [:from],
10
10
  comment: [:parent],
@@ -0,0 +1,12 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module Settings
4
+ def settings(params = {})
5
+ settings = self.edge :settings, params
6
+ settings.collect! do |setting|
7
+ Struct::Setting.new setting
8
+ end
9
+ end
10
+ end
11
+ end
12
+ end
@@ -14,6 +14,7 @@ module FbGraph2
14
14
  include Edge::Photos
15
15
  include Edge::Posts
16
16
  include Edge::PromotablePosts
17
+ include Edge::Settings
17
18
  include Edge::Statuses
18
19
  include Edge::Tagged
19
20
  include Edge::Videos
@@ -21,9 +22,10 @@ module FbGraph2
21
22
  register_attributes(
22
23
  raw: [
23
24
  :about, :attire, :band_members, :booking_agent, :can_post, :category, :checkins, :company_overview,
24
- :current_location, :description, :directed_by, :founded, :general_info, :general_manager, :hometown, :hours,
25
- :is_permanently_closed, :is_published, :is_unclaimed, :likes, :link, :mission, :name, :phone, :press_contact,
26
- :price_range, :products, :talking_about_count, :username, :website, :were_here_count,
25
+ :current_location, :description, :directed_by, :founded, :general_info, :general_manager, :global_brand_page_name,
26
+ :hometown, :hours, :impressum, :is_permanently_closed, :is_published, :is_unclaimed, :likes, :link, :mission, :name,
27
+ :name_with_location_descriptor, :phone, :press_contact, :price_range, :products, :talking_about_count, :username,
28
+ :website, :were_here_count,
27
29
  # NOTE: only within /:user_id/accounts context
28
30
  :perms
29
31
  ],
@@ -33,7 +35,7 @@ module FbGraph2
33
35
  :start_date, :end_date
34
36
  ],
35
37
  date: [:birthday],
36
- page: [:best_page],
38
+ page: [:best_page, :global_brand_parent_page],
37
39
  photo: [:cover],
38
40
  users: [
39
41
  # NOTE: only as Struct::Education#classes and Struct::Work#projects
@@ -0,0 +1,9 @@
1
+ module FbGraph2
2
+ class Struct
3
+ class Setting < Struct
4
+ register_attributes(
5
+ raw: [:setting, :value]
6
+ )
7
+ end
8
+ end
9
+ end
@@ -42,7 +42,7 @@ module FbGraph2
42
42
  raw: [
43
43
  :about, :bio, :email, :first_name, :gender, :installed, :is_verified, :last_name, :link, :locale,
44
44
  :middle_name, :name, :name_format, :political, :quotes, :relationship_status, :religion,
45
- :timezone, :third_party_id, :verified, :website,
45
+ :timezone, :third_party_id, :token_for_business, :verified, :website,
46
46
  # NOTE: in family edge context
47
47
  :relationship,
48
48
  # NOTE: in page admin context
@@ -0,0 +1,19 @@
1
+ require 'spec_helper'
2
+
3
+ describe FbGraph2::Edge::Settings do
4
+ context 'included in Page' do
5
+ describe '#settings' do
6
+ let(:page) { FbGraph2::Page.new('page_id').authenticate('page_token') }
7
+ it 'should return an Array of FbGraph2::Struct::Permission' do
8
+ settings = mock_graph :get, 'page_id/settings', 'page/settings', access_token: 'page_token' do
9
+ page.settings
10
+ end
11
+ settings.should be_instance_of FbGraph2::Edge
12
+ settings.should_not be_blank
13
+ settings.each do |setting|
14
+ setting.should be_instance_of FbGraph2::Struct::Setting
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,36 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "setting": "USERS_CAN_POST",
5
+ "value": true
6
+ },
7
+ {
8
+ "setting": "USERS_CAN_MESSAGE",
9
+ "value": true
10
+ },
11
+ {
12
+ "setting": "USERS_CAN_POST_PHOTOS",
13
+ "value": true
14
+ },
15
+ {
16
+ "setting": "USERS_CAN_TAG_PHOTOS",
17
+ "value": false
18
+ },
19
+ {
20
+ "setting": "WALL_COMBINED_POSTS",
21
+ "value": true
22
+ },
23
+ {
24
+ "setting": "PLATFORM_OPTOUTS_CAN_POST",
25
+ "value": true
26
+ },
27
+ {
28
+ "setting": "SHOW_RECENT_POSTS_BY_OTHERS",
29
+ "value": true
30
+ },
31
+ {
32
+ "setting": "APPEARS_IN_RELATED_PAGES",
33
+ "value": true
34
+ }
35
+ ]
36
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fb_graph2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - nov matake
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-04 00:00:00.000000000 Z
11
+ date: 2014-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httpclient
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '2.3'
19
+ version: '2.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '2.3'
26
+ version: '2.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rack-oauth2
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '4.0'
61
+ version: '3.2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '4.0'
68
+ version: '3.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -217,6 +217,7 @@ files:
217
217
  - lib/fb_graph2/edge/refunds.rb
218
218
  - lib/fb_graph2/edge/roles.rb
219
219
  - lib/fb_graph2/edge/scores.rb
220
+ - lib/fb_graph2/edge/settings.rb
220
221
  - lib/fb_graph2/edge/shared_posts.rb
221
222
  - lib/fb_graph2/edge/static_resources.rb
222
223
  - lib/fb_graph2/edge/statuses.rb
@@ -274,6 +275,7 @@ files:
274
275
  - lib/fb_graph2/struct/restaurant_specialties.rb
275
276
  - lib/fb_graph2/struct/role.rb
276
277
  - lib/fb_graph2/struct/score.rb
278
+ - lib/fb_graph2/struct/setting.rb
277
279
  - lib/fb_graph2/struct/static_resource.rb
278
280
  - lib/fb_graph2/struct/subscription.rb
279
281
  - lib/fb_graph2/struct/work.rb
@@ -327,6 +329,7 @@ files:
327
329
  - spec/fb_graph2/edge/promotable_posts_spec.rb
328
330
  - spec/fb_graph2/edge/roles_spec.rb
329
331
  - spec/fb_graph2/edge/scores_spec.rb
332
+ - spec/fb_graph2/edge/settings_spec.rb
330
333
  - spec/fb_graph2/edge/shared_posts_spec.rb
331
334
  - spec/fb_graph2/edge/statuses_spec.rb
332
335
  - spec/fb_graph2/edge/subscriptions_spec.rb
@@ -364,6 +367,7 @@ files:
364
367
  - spec/mock_json/page/milestones.json
365
368
  - spec/mock_json/page/offers.json
366
369
  - spec/mock_json/page/promotable_posts.json
370
+ - spec/mock_json/page/settings.json
367
371
  - spec/mock_json/page/with_optional_fields.json
368
372
  - spec/mock_json/post/comments.json
369
373
  - spec/mock_json/post/comments_with_summary.json