fb_graph2 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +3 -3
- data/VERSION +1 -1
- data/lib/fb_graph2.rb +19 -3
- data/lib/fb_graph2/edge/messages.rb +0 -5
- data/lib/fb_graph2/edge/send_api.rb +10 -0
- data/lib/fb_graph2/page.rb +1 -0
- data/lib/fb_graph2/post.rb +5 -3
- data/spec/fb_graph2/edge/posts_spec.rb +1 -0
- data/spec/mock_json/user/posts.json +20 -7
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e87fd28def83c12eb21c7cc0bf48da97e62a9f7a1293176a9089a2fc804f00f7
|
4
|
+
data.tar.gz: 47d983c6bae06db3edfb8fcde72d01969539e84cc0da0ffb30334129df35de0b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68ad0497ce2cf75c03d001889b909e8c721f97c4b909da128e5e52f62f11b8229cdc2e8b81b5ac03e5674a0107a5d774f2fdfd983256fa64e1fc9145967c7d6a
|
7
|
+
data.tar.gz: d4d4043c2313988ce74ee064a617e21413b77ed22f9fadc1ab4ace48bb9d490786420cf9c5f59c90df378be52f8e5ad9cc7c1f92bcb1883fc9461e714ca99085
|
data/.travis.yml
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.2.0
|
data/lib/fb_graph2.rb
CHANGED
@@ -6,15 +6,31 @@ require 'rack/oauth2'
|
|
6
6
|
require 'patch/rack/oauth2/util'
|
7
7
|
|
8
8
|
module FbGraph2
|
9
|
-
mattr_accessor :
|
9
|
+
mattr_accessor :gem_version, :logger, :debugging, :_http_config_, :object_classes
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
DEFAULT_ROOT_URL = 'https://graph.facebook.com'
|
12
|
+
DEFAULT_API_VERSION = 'v7.0'
|
13
13
|
self.gem_version = File.read(File.join(__dir__, '../VERSION')).strip
|
14
14
|
self.logger = Logger.new(STDOUT)
|
15
15
|
self.logger.progname = 'FbGraph2'
|
16
16
|
|
17
17
|
class << self
|
18
|
+
def root_url
|
19
|
+
::Thread.current['fb_graph2_root_url'] || DEFAULT_ROOT_URL
|
20
|
+
end
|
21
|
+
|
22
|
+
def root_url=(value)
|
23
|
+
::Thread.current['fb_graph2_root_url'] = value
|
24
|
+
end
|
25
|
+
|
26
|
+
def api_version
|
27
|
+
::Thread.current['fb_graph2_api_version'] || DEFAULT_API_VERSION
|
28
|
+
end
|
29
|
+
|
30
|
+
def api_version=(value)
|
31
|
+
::Thread.current['fb_graph2_api_version'] = value
|
32
|
+
end
|
33
|
+
|
18
34
|
def object_classes
|
19
35
|
FbGraph2::Node.descendants
|
20
36
|
end
|
@@ -18,11 +18,6 @@ module FbGraph2
|
|
18
18
|
Message.new(message[:id], message).authenticate self.access_token
|
19
19
|
end
|
20
20
|
end
|
21
|
-
|
22
|
-
def message!(params = {})
|
23
|
-
message = self.post params, edge: :messages
|
24
|
-
Message.new(message[:id], params.merge(message)).authenticate self.access_token
|
25
|
-
end
|
26
21
|
end
|
27
22
|
end
|
28
23
|
end
|
data/lib/fb_graph2/page.rb
CHANGED
data/lib/fb_graph2/post.rb
CHANGED
@@ -24,9 +24,11 @@ module FbGraph2
|
|
24
24
|
def initialize(id, attributes = {})
|
25
25
|
super
|
26
26
|
if attributes.include? :message_tags
|
27
|
-
self.message_tags = attributes[:message_tags].collect do |
|
28
|
-
|
29
|
-
|
27
|
+
self.message_tags = attributes[:message_tags].values.collect do |message_tags|
|
28
|
+
message_tags.collect do |tag|
|
29
|
+
TaggedProfile.new tag[:id], tag
|
30
|
+
end
|
31
|
+
end.flatten
|
30
32
|
end
|
31
33
|
if attributes.include? :privacy
|
32
34
|
self.privacy = Struct::Privacy.new attributes[:privacy]
|
@@ -12,13 +12,26 @@
|
|
12
12
|
}]
|
13
13
|
},
|
14
14
|
"message": "Nov Matake test",
|
15
|
-
"message_tags":
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
15
|
+
"message_tags": {
|
16
|
+
"0": [
|
17
|
+
{
|
18
|
+
"id": "579612276",
|
19
|
+
"name": "Nov Matake",
|
20
|
+
"type": "user",
|
21
|
+
"offset": 0,
|
22
|
+
"length": 10
|
23
|
+
}
|
24
|
+
],
|
25
|
+
"11": [
|
26
|
+
{
|
27
|
+
"id": "10153177366617368",
|
28
|
+
"name": "Bryan Brunetti",
|
29
|
+
"type": "user",
|
30
|
+
"offset": 11,
|
31
|
+
"length": 14
|
32
|
+
}
|
33
|
+
]
|
34
|
+
},
|
22
35
|
"actions": [{
|
23
36
|
"name": "Comment",
|
24
37
|
"link": "https://www.facebook.com/579612276/posts/10152483324277277"
|
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: 1.
|
4
|
+
version: 1.2.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:
|
11
|
+
date: 2020-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|
@@ -233,6 +233,7 @@ files:
|
|
233
233
|
- lib/fb_graph2/edge/refunds.rb
|
234
234
|
- lib/fb_graph2/edge/roles.rb
|
235
235
|
- lib/fb_graph2/edge/scores.rb
|
236
|
+
- lib/fb_graph2/edge/send_api.rb
|
236
237
|
- lib/fb_graph2/edge/settings.rb
|
237
238
|
- lib/fb_graph2/edge/shared_posts.rb
|
238
239
|
- lib/fb_graph2/edge/static_resources.rb
|
@@ -473,8 +474,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
473
474
|
- !ruby/object:Gem::Version
|
474
475
|
version: '0'
|
475
476
|
requirements: []
|
476
|
-
|
477
|
-
rubygems_version: 2.6.11
|
477
|
+
rubygems_version: 3.0.3
|
478
478
|
signing_key:
|
479
479
|
specification_version: 4
|
480
480
|
summary: Facebook Graph API v2.x Wrapper in Ruby
|