fb_graph2 1.0.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +3 -4
- data/VERSION +1 -1
- data/lib/fb_graph2/auth/signed_request.rb +1 -2
- 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/lib/fb_graph2.rb +25 -3
- data/spec/fb_graph2/edge/posts_spec.rb +1 -0
- data/spec/fb_graph2_spec.rb +2 -2
- 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: 8b78918c26f4bd98699a0850e7a87745cc36624b8302fc6c6407eebf04bff568
|
4
|
+
data.tar.gz: 2ad5f7c82abd4fe19e56d67e7bfc71eeb8b764147e255e24550b6e7d23e1ed2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ec2238a424c786bce0c8d7992aad00f599e480be4500427c0b2b36f6667160d668e16b5846f46d2c2fd185cc1df536243f1594feaea20551f6fc95494d14f3c
|
7
|
+
data.tar.gz: 28d874e1a551bc4472fc634ca7f23c633500cb067635dc78bc782c0353fa7ef16305aa21a2d8a0d1cc7100f92d5d094056fb060dced8fc414ff57b4a8322239c
|
data/.travis.yml
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0
|
1
|
+
1.3.0
|
@@ -17,7 +17,6 @@ module FbGraph2
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def verify!(client)
|
20
|
-
digest = OpenSSL::Digest::SHA256.new
|
21
20
|
signature = OpenSSL::HMAC.digest OpenSSL::Digest::SHA256.new, client.secret, @payload_str
|
22
21
|
raise VerificationFailed.new('Verification failed') unless @signature == signature
|
23
22
|
instantiate client
|
@@ -38,4 +37,4 @@ module FbGraph2
|
|
38
37
|
end
|
39
38
|
end
|
40
39
|
end
|
41
|
-
end
|
40
|
+
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]
|
data/lib/fb_graph2.rb
CHANGED
@@ -1,19 +1,36 @@
|
|
1
1
|
require 'active_support'
|
2
2
|
require 'active_support/core_ext'
|
3
3
|
require 'active_support/concern'
|
4
|
+
require 'multi_json'
|
4
5
|
require 'rack/oauth2'
|
5
6
|
require 'patch/rack/oauth2/util'
|
6
7
|
|
7
8
|
module FbGraph2
|
8
|
-
mattr_accessor :
|
9
|
+
mattr_accessor :gem_version, :logger, :debugging, :_http_config_, :object_classes
|
9
10
|
|
10
|
-
|
11
|
-
|
11
|
+
DEFAULT_ROOT_URL = 'https://graph.facebook.com'
|
12
|
+
DEFAULT_API_VERSION = 'v7.0'
|
12
13
|
self.gem_version = File.read(File.join(__dir__, '../VERSION')).strip
|
13
14
|
self.logger = Logger.new(STDOUT)
|
14
15
|
self.logger.progname = 'FbGraph2'
|
15
16
|
|
16
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
|
+
|
17
34
|
def object_classes
|
18
35
|
FbGraph2::Node.descendants
|
19
36
|
end
|
@@ -30,6 +47,11 @@ module FbGraph2
|
|
30
47
|
_http_client_ = HTTPClient.new(
|
31
48
|
agent_name: "FbGraph2 (#{gem_version})"
|
32
49
|
)
|
50
|
+
|
51
|
+
# NOTE: httpclient gem seems stopped maintaining root certtificate set, use OS default.
|
52
|
+
_http_client_.ssl_config.clear_cert_store
|
53
|
+
_http_client_.ssl_config.cert_store.set_default_paths
|
54
|
+
|
33
55
|
_http_client_.request_filter.delete_if do |filter|
|
34
56
|
filter.is_a? HTTPClient::WWWAuth
|
35
57
|
end
|
data/spec/fb_graph2_spec.rb
CHANGED
@@ -6,7 +6,7 @@ describe FbGraph2 do
|
|
6
6
|
|
7
7
|
context 'as default' do
|
8
8
|
its(:logger) { should be_a Logger }
|
9
|
-
its(:api_version) { should == '
|
9
|
+
its(:api_version) { should == 'v7.0' }
|
10
10
|
its(:root_url) { should == 'https://graph.facebook.com' }
|
11
11
|
it { should_not be_debugging }
|
12
12
|
end
|
@@ -37,4 +37,4 @@ describe FbGraph2 do
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
40
|
-
end
|
40
|
+
end
|
@@ -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.0
|
4
|
+
version: 1.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:
|
11
|
+
date: 2021-10-01 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.13
|
477
|
+
rubygems_version: 3.1.4
|
478
478
|
signing_key:
|
479
479
|
specification_version: 4
|
480
480
|
summary: Facebook Graph API v2.x Wrapper in Ruby
|