social_rails 2.1.1 → 2.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 697d9cf3e95c5b1d7305f681762e6811dc4db271
4
- data.tar.gz: 1ceffcbad95942d948341010e7d61610803bd6ff
3
+ metadata.gz: 8eaca17a99cbd1763331bfb09b21e84548590e3d
4
+ data.tar.gz: 4296fc279955ccfcb4f7c82c681026bb550b792c
5
5
  SHA512:
6
- metadata.gz: 17572d52a3d2b837940a9c22517f2afdd46e8ace219e78b5c8eaf0253ef5b75ed6b7f31885c8e942d59eaf2c8da730919c7c58a15f75869fc20b61db0e0d2046
7
- data.tar.gz: 96c4ed6bea6735ddc395dc2a55ee21c6ff604a6c2d9ee6b293c1cba3bc57b3ac7412ec84f2b6461d11ed86926ffdb05ac32d1d39223fa04129754009a65af7c5
6
+ metadata.gz: fab702d002ca2b88f557d856d6c76c32f68eaf5f80b58069bc0d7f7ca052404195547d2f77f03d8f73943cfbd6b9092fa0e4e7ec154a6a858b0c6ead7d742503
7
+ data.tar.gz: 1628bec42e661f3bf349515bd141a60126f40e9ceff37046ef5932ea0ede007074c4d9fb45250a73e470d0816812f78a1702bc21ee33daf5c89da09d0fd4f498
@@ -0,0 +1,5 @@
1
+ module SocialRails
2
+ class ApplicationController < ActionController::Base
3
+ protect_from_forgery with: :exception
4
+ end
5
+ end
@@ -1,5 +1,9 @@
1
- class SocialRails::SocialController < ActionController::Base
2
- def latest
3
- render ["social_rails", params[:template], "latest"].compact.join("/"), layout: false
1
+ require_dependency "social_rails/application_controller"
2
+
3
+ module SocialRails
4
+ class SocialController < ApplicationController
5
+ def latest
6
+ render ["social_rails", params[:template], "latest"].compact.join("/"), layout: false
7
+ end
4
8
  end
5
- end
9
+ end
@@ -24,17 +24,21 @@ module SocialRails
24
24
  client = Koala::Facebook::API.new(oAuth.get_app_access_token)
25
25
 
26
26
  feed = client.get_connection(self.config.page_name, 'posts', {fields: ['link', 'message', 'full_picture'] })
27
- self.find_posts(feed)
27
+ posts = self.find_posts(feed)
28
+ return posts
28
29
  end
29
30
 
30
31
  # Loop through Facebook feed to find posts with message
31
32
  def self.find_posts feed
32
33
  items = []
33
- feed.each do |item|
34
- items.push(item) if item.has_key?("message")
35
- return items if items.count == self.config.public[:post_count]
34
+ while items.count < self.config.public[:post_count] || feed.size == 0
35
+ feed.each do |item|
36
+ items.push(item) if item.has_key?("message")
37
+ return items if items.count == self.config.public[:post_count]
38
+ end
39
+ feed = feed.next_page
36
40
  end
37
- feed.next_page
41
+ return items
38
42
  end
39
43
 
40
44
  end
@@ -1,9 +1,14 @@
1
+ require 'social_rails/helpers/helper_methods'
2
+
1
3
  module SocialRails
2
4
  class Engine < ::Rails::Engine
3
5
  isolate_namespace SocialRails
4
6
 
5
- require 'social_rails/helpers/helper_methods'
6
- initializer "social_rails.view_helpers" do
7
+ initializer :add_to_precompile do |app|
8
+ app.config.assets.precompile += %w( social_rails/social-rails.js )
9
+ end
10
+
11
+ initializer :include_view_helpers do
7
12
  ActionView::Base.send :include, SocialRails::Helpers::HelperMethods
8
13
  end
9
14
  end
@@ -1,3 +1,3 @@
1
1
  module SocialRails
2
- VERSION = '2.1.1'
2
+ VERSION = '2.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis G
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-23 00:00:00.000000000 Z
11
+ date: 2017-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -87,6 +87,7 @@ files:
87
87
  - app/assets/javascripts/app.js
88
88
  - app/assets/javascripts/social_rails/social-rails.js
89
89
  - app/assets/stylesheets/social_rails/application.css
90
+ - app/controllers/social_rails/application_controller.rb
90
91
  - app/controllers/social_rails/social_controller.rb
91
92
  - app/views/social_rails/facebook/_description.html.erb
92
93
  - app/views/social_rails/facebook/_full_picture.html.erb
@@ -137,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
138
  version: '0'
138
139
  requirements: []
139
140
  rubyforge_project:
140
- rubygems_version: 2.5.2
141
+ rubygems_version: 2.6.14
141
142
  signing_key:
142
143
  specification_version: 4
143
144
  summary: Ease the pain of integrating social media posts in a Rails app.