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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: c165d9490bff1fa6fa7fe8d9c86eec08adb13e3f
4
- data.tar.gz: ac0f031a488b428a8ca96a62753c13b00c33dba0
2
+ SHA256:
3
+ metadata.gz: e87fd28def83c12eb21c7cc0bf48da97e62a9f7a1293176a9089a2fc804f00f7
4
+ data.tar.gz: 47d983c6bae06db3edfb8fcde72d01969539e84cc0da0ffb30334129df35de0b
5
5
  SHA512:
6
- metadata.gz: 515892c8476f7ba38ab4c9b3d7e4284ccd967f91f0883a66396947bbbb0815060707b4aa1e1f93fd2d608649fea72ae6152b30ec8895baf23fe6790899d6a14b
7
- data.tar.gz: 5b0c061c9dc42fef1426a558f725a0025152b6eb12f8a6dc7b474dbd53e1c41940c6aa6d77ab41536cd151be25f49e5e408f10e68cd3dcd2e688e60c426ced76
6
+ metadata.gz: 68ad0497ce2cf75c03d001889b909e8c721f97c4b909da128e5e52f62f11b8229cdc2e8b81b5ac03e5674a0107a5d774f2fdfd983256fa64e1fc9145967c7d6a
7
+ data.tar.gz: d4d4043c2313988ce74ee064a617e21413b77ed22f9fadc1ab4ace48bb9d490786420cf9c5f59c90df378be52f8e5ad9cc7c1f92bcb1883fc9461e714ca99085
@@ -2,7 +2,7 @@ before_install:
2
2
  - gem install bundler
3
3
 
4
4
  rvm:
5
- - 2.2.2 # NOTE: 2.2.1 or lower aren't supported by activesupport 5.0, CI isn't needed for such legacy versions.
6
- - 2.2.6
7
5
  - 2.3.3
8
- - 2.4.0
6
+ - 2.4.0
7
+ - 2.5.6
8
+ - 2.6.4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.1
1
+ 1.2.0
@@ -6,15 +6,31 @@ require 'rack/oauth2'
6
6
  require 'patch/rack/oauth2/util'
7
7
 
8
8
  module FbGraph2
9
- mattr_accessor :root_url, :api_version, :gem_version, :logger, :debugging, :_http_config_, :object_classes
9
+ mattr_accessor :gem_version, :logger, :debugging, :_http_config_, :object_classes
10
10
 
11
- self.root_url = 'https://graph.facebook.com'
12
- self.api_version = 'v2.11'
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
@@ -0,0 +1,10 @@
1
+ module FbGraph2
2
+ class Edge
3
+ module SendApi
4
+ def message!(params = {})
5
+ message = self.post params, edge: :messages
6
+ Message.new(message[:message_id], params.merge(message)).authenticate self.access_token
7
+ end
8
+ end
9
+ end
10
+ end
@@ -4,6 +4,7 @@ module FbGraph2
4
4
  include Edge::Albums
5
5
  include Edge::Blocked
6
6
  include Edge::Conversations
7
+ include Edge::SendApi
7
8
  include Edge::Events
8
9
  include Edge::Feed
9
10
  include Edge::GlobalBrandChildren
@@ -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 |message_tag|
28
- TaggedProfile.new message_tag[:id], message_tag
29
- end
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,6 +12,7 @@ describe FbGraph2::Edge::Posts do
12
12
  posts.should_not be_blank
13
13
  posts.each do |post|
14
14
  post.should be_instance_of FbGraph2::Post
15
+ post.message_tags.count.should == 2
15
16
  end
16
17
  end
17
18
  end
@@ -12,13 +12,26 @@
12
12
  }]
13
13
  },
14
14
  "message": "Nov Matake test",
15
- "message_tags": [{
16
- "id": "579612276",
17
- "name": "Nov Matake",
18
- "type": "user",
19
- "offset": 0,
20
- "length": 10
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.1.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: 2018-03-27 00:00:00.000000000 Z
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
- rubyforge_project:
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