Merge branch 'stable' into develop
This commit is contained in:
commit
ad52eaf6d7
6 changed files with 35 additions and 22 deletions
|
|
@ -60,6 +60,7 @@ Ruby 2.0 is no longer officially supported.
|
||||||
* Make used post title lengths more consistent [#6022](https://github.com/diaspora/diaspora/pull/6022)
|
* Make used post title lengths more consistent [#6022](https://github.com/diaspora/diaspora/pull/6022)
|
||||||
* Improved logging source [#6041](https://github.com/diaspora/diaspora/pull/6041)
|
* Improved logging source [#6041](https://github.com/diaspora/diaspora/pull/6041)
|
||||||
* Gracefully handle duplicate entry while receiving share-visibility in parallel [#6068](https://github.com/diaspora/diaspora/pull/6068)
|
* Gracefully handle duplicate entry while receiving share-visibility in parallel [#6068](https://github.com/diaspora/diaspora/pull/6068)
|
||||||
|
* Update twitter gem to get rid of deprecation warnings [#6083](https://github.com/diaspora/diaspora/pull/6083)
|
||||||
|
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
* Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846)
|
* Disable auto follow back on aspect deletion [#5846](https://github.com/diaspora/diaspora/pull/5846)
|
||||||
|
|
|
||||||
2
Gemfile
2
Gemfile
|
|
@ -142,7 +142,7 @@ gem "omniauth", "1.2.2"
|
||||||
gem "omniauth-facebook", "2.0.1"
|
gem "omniauth-facebook", "2.0.1"
|
||||||
gem "omniauth-tumblr", "1.1"
|
gem "omniauth-tumblr", "1.1"
|
||||||
gem "omniauth-twitter", "1.2.0"
|
gem "omniauth-twitter", "1.2.0"
|
||||||
gem "twitter", "4.8.1"
|
gem "twitter", "5.14.0"
|
||||||
gem "omniauth-wordpress", "0.2.2"
|
gem "omniauth-wordpress", "0.2.2"
|
||||||
|
|
||||||
# Serializers
|
# Serializers
|
||||||
|
|
|
||||||
24
Gemfile.lock
24
Gemfile.lock
|
|
@ -73,6 +73,7 @@ GEM
|
||||||
bootstrap-sass (3.3.4.1)
|
bootstrap-sass (3.3.4.1)
|
||||||
autoprefixer-rails (>= 5.0.0.1)
|
autoprefixer-rails (>= 5.0.0.1)
|
||||||
sass (>= 3.2.19)
|
sass (>= 3.2.19)
|
||||||
|
buftok (0.2.0)
|
||||||
builder (3.2.2)
|
builder (3.2.2)
|
||||||
byebug (4.0.5)
|
byebug (4.0.5)
|
||||||
columnize (= 0.9.0)
|
columnize (= 0.9.0)
|
||||||
|
|
@ -172,6 +173,7 @@ GEM
|
||||||
hiredis (~> 0.5.0)
|
hiredis (~> 0.5.0)
|
||||||
entypo-rails (2.2.3)
|
entypo-rails (2.2.3)
|
||||||
railties (>= 3.1, <= 5)
|
railties (>= 3.1, <= 5)
|
||||||
|
equalizer (0.0.11)
|
||||||
erubis (2.7.0)
|
erubis (2.7.0)
|
||||||
ethon (0.7.3)
|
ethon (0.7.3)
|
||||||
ffi (>= 1.3.0)
|
ffi (>= 1.3.0)
|
||||||
|
|
@ -349,6 +351,8 @@ GEM
|
||||||
hike (1.2.3)
|
hike (1.2.3)
|
||||||
hiredis (0.5.2)
|
hiredis (0.5.2)
|
||||||
hitimes (1.2.2)
|
hitimes (1.2.2)
|
||||||
|
http (0.6.4)
|
||||||
|
http_parser.rb (~> 0.6.0)
|
||||||
http-cookie (1.0.2)
|
http-cookie (1.0.2)
|
||||||
domain_name (~> 0.5)
|
domain_name (~> 0.5)
|
||||||
http_accept_language (2.0.5)
|
http_accept_language (2.0.5)
|
||||||
|
|
@ -410,6 +414,8 @@ GEM
|
||||||
mime-types (>= 1.16, < 3)
|
mime-types (>= 1.16, < 3)
|
||||||
markerb (1.0.2)
|
markerb (1.0.2)
|
||||||
redcarpet (>= 2.0)
|
redcarpet (>= 2.0)
|
||||||
|
memoizable (0.4.2)
|
||||||
|
thread_safe (~> 0.3, >= 0.3.1)
|
||||||
messagebus_ruby_api (1.0.3)
|
messagebus_ruby_api (1.0.3)
|
||||||
method_source (0.8.2)
|
method_source (0.8.2)
|
||||||
mime-types (2.5)
|
mime-types (2.5)
|
||||||
|
|
@ -424,6 +430,7 @@ GEM
|
||||||
multi_xml (0.5.5)
|
multi_xml (0.5.5)
|
||||||
multipart-post (2.0.0)
|
multipart-post (2.0.0)
|
||||||
mysql2 (0.3.18)
|
mysql2 (0.3.18)
|
||||||
|
naught (1.0.0)
|
||||||
nenv (0.2.0)
|
nenv (0.2.0)
|
||||||
nested_form (0.3.2)
|
nested_form (0.3.2)
|
||||||
net-scp (1.2.1)
|
net-scp (1.2.1)
|
||||||
|
|
@ -696,10 +703,17 @@ GEM
|
||||||
timecop (0.7.3)
|
timecop (0.7.3)
|
||||||
timers (4.0.1)
|
timers (4.0.1)
|
||||||
hitimes
|
hitimes
|
||||||
twitter (4.8.1)
|
twitter (5.14.0)
|
||||||
faraday (~> 0.8, < 0.10)
|
addressable (~> 2.3)
|
||||||
multi_json (~> 1.0)
|
buftok (~> 0.2.0)
|
||||||
simple_oauth (~> 0.2)
|
equalizer (~> 0.0.9)
|
||||||
|
faraday (~> 0.9.0)
|
||||||
|
http (~> 0.6.0)
|
||||||
|
http_parser.rb (~> 0.6.0)
|
||||||
|
json (~> 1.8)
|
||||||
|
memoizable (~> 0.4.0)
|
||||||
|
naught (~> 1.0)
|
||||||
|
simple_oauth (~> 0.3.0)
|
||||||
twitter-text (1.12.0)
|
twitter-text (1.12.0)
|
||||||
unf (~> 0.1.0)
|
unf (~> 0.1.0)
|
||||||
typhoeus (0.7.1)
|
typhoeus (0.7.1)
|
||||||
|
|
@ -854,7 +868,7 @@ DEPENDENCIES
|
||||||
spring-commands-rspec (= 1.0.4)
|
spring-commands-rspec (= 1.0.4)
|
||||||
test_after_commit (= 0.4.1)
|
test_after_commit (= 0.4.1)
|
||||||
timecop (= 0.7.3)
|
timecop (= 0.7.3)
|
||||||
twitter (= 4.8.1)
|
twitter (= 5.14.0)
|
||||||
twitter-text (= 1.12.0)
|
twitter-text (= 1.12.0)
|
||||||
typhoeus (= 0.7.1)
|
typhoeus (= 0.7.1)
|
||||||
uglifier (= 2.7.1)
|
uglifier (= 2.7.1)
|
||||||
|
|
|
||||||
|
|
@ -30,10 +30,12 @@ class Services::Twitter < Service
|
||||||
private
|
private
|
||||||
|
|
||||||
def client
|
def client
|
||||||
@client ||= Twitter::Client.new(
|
@client ||= Twitter::REST::Client.new do |config|
|
||||||
oauth_token: self.access_token,
|
config.consumer_key = AppConfig.services.twitter.key
|
||||||
oauth_token_secret: self.access_secret
|
config.consumer_secret = AppConfig.services.twitter.secret
|
||||||
)
|
config.access_token = access_token
|
||||||
|
config.access_token_secret = access_secret
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def attempt_post post, retry_count=0
|
def attempt_post post, retry_count=0
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,6 @@
|
||||||
Rails.application.config.middleware.use OmniAuth::Builder do
|
Rails.application.config.middleware.use OmniAuth::Builder do
|
||||||
if AppConfig.services.twitter.enable?
|
if AppConfig.services.twitter.enable?
|
||||||
provider :twitter, AppConfig.services.twitter.key, AppConfig.services.twitter.secret
|
provider :twitter, AppConfig.services.twitter.key, AppConfig.services.twitter.secret
|
||||||
Twitter.configure do |config|
|
|
||||||
config.consumer_key = AppConfig.services.twitter.key
|
|
||||||
config.consumer_secret = AppConfig.services.twitter.secret
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
if AppConfig.services.tumblr.enable?
|
if AppConfig.services.tumblr.enable?
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,11 @@ describe Services::Twitter, :type => :model do
|
||||||
describe '#post' do
|
describe '#post' do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
allow_any_instance_of(Twitter::Client).to receive(:update) { Twitter::Tweet.new(id: "1234") }
|
allow_any_instance_of(Twitter::REST::Client).to receive(:update) { Twitter::Tweet.new(id: "1234") }
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'posts a status message to twitter' do
|
it 'posts a status message to twitter' do
|
||||||
expect_any_instance_of(Twitter::Client).to receive(:update).with(instance_of(String))
|
expect_any_instance_of(Twitter::REST::Client).to receive(:update).with(instance_of(String))
|
||||||
@service.post(@post)
|
@service.post(@post)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -27,7 +27,7 @@ describe Services::Twitter, :type => :model do
|
||||||
|
|
||||||
it 'swallows exception raised by twitter always being down' do
|
it 'swallows exception raised by twitter always being down' do
|
||||||
skip
|
skip
|
||||||
expect_any_instance_of(Twitter::Client).to receive(:update).and_raise(StandardError)
|
expect_any_instance_of(Twitter::REST::Client).to receive(:update).and_raise(StandardError)
|
||||||
@service.post(@post)
|
@service.post(@post)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -141,7 +141,7 @@ describe Services::Twitter, :type => :model do
|
||||||
it 'returns the original profile photo url' do
|
it 'returns the original profile photo url' do
|
||||||
user_double = double
|
user_double = double
|
||||||
expect(user_double).to receive(:profile_image_url_https).with("original").and_return("http://a2.twimg.com/profile_images/uid/avatar.png")
|
expect(user_double).to receive(:profile_image_url_https).with("original").and_return("http://a2.twimg.com/profile_images/uid/avatar.png")
|
||||||
expect_any_instance_of(Twitter::Client).to receive(:user).with("joindiaspora").and_return(user_double)
|
expect_any_instance_of(Twitter::REST::Client).to receive(:user).with("joindiaspora").and_return(user_double)
|
||||||
|
|
||||||
@service.nickname = "joindiaspora"
|
@service.nickname = "joindiaspora"
|
||||||
expect(@service.profile_photo_url).to eq("http://a2.twimg.com/profile_images/uid/avatar.png")
|
expect(@service.profile_photo_url).to eq("http://a2.twimg.com/profile_images/uid/avatar.png")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue