Browse Source

Maintenance: Updated all non-pinned gems.

Special thanks to @thorsteneckel for fixing the VCR/Twitter problems!
Martin Gruner 3 years ago
parent
commit
0f61a7e6ca

+ 1 - 0
.rubocop/default.yml

@@ -2,6 +2,7 @@
 # https://github.com/rubocop-hq/rubocop/blob/master/config/default.yml
 
 require:
+  - rubocop-faker
   - rubocop-performance
   - rubocop-rails
   - rubocop-rspec

+ 4 - 2
Gemfile

@@ -70,7 +70,7 @@ gem 'execjs'
 #   Instead, use an external node.js binary.
 group :mini_racer, optional: true do
   gem 'libv8'
-  gem 'mini_racer'
+  gem 'mini_racer', '0.2.9' # Newer versions require libv8-node instead which does not compile on older platforms.
 end
 
 # authentication - provider
@@ -95,7 +95,8 @@ gem 'omniauth-weibo-oauth2'
 gem 'gmail_xoauth'
 gem 'koala'
 gem 'telegramAPI'
-gem 'twitter', git: 'https://github.com/sferik/twitter.git'
+# Updating twitter to 'master' seems to break things, so freeze the revision for now.
+gem 'twitter', git: 'https://github.com/sferik/twitter.git', ref: '29a18644e3c433f53ed76f0867f9b9734f7a7357'
 
 # channels - email additions
 gem 'htmlentities'
@@ -190,6 +191,7 @@ group :development, :test do
   gem 'coffeelint'
   gem 'pre-commit'
   gem 'rubocop'
+  gem 'rubocop-faker'
   gem 'rubocop-performance'
   gem 'rubocop-rails'
   gem 'rubocop-rspec'

+ 233 - 182
Gemfile.lock

@@ -1,12 +1,13 @@
 GIT
   remote: https://github.com/sferik/twitter.git
-  revision: 844818cad07ce490ccb9d8542ebb6b4fc7a61cb4
+  revision: 29a18644e3c433f53ed76f0867f9b9734f7a7357
+  ref: 29a18644e3c433f53ed76f0867f9b9734f7a7357
   specs:
-    twitter (6.2.0)
+    twitter (7.0.0)
       addressable (~> 2.3)
       buftok (~> 0.2.0)
       equalizer (~> 0.0.11)
-      http (~> 3.0)
+      http (~> 4.0)
       http-form_data (~> 2.0)
       http_parser.rb (~> 0.6.0)
       memoizable (~> 0.4.0)
@@ -47,7 +48,7 @@ GIT
 GEM
   remote: https://rubygems.org/
   specs:
-    aasm (5.0.0)
+    aasm (5.2.0)
       concurrent-ruby (~> 1.0)
     actioncable (6.0.4)
       actionpack (= 6.0.4)
@@ -93,10 +94,10 @@ GEM
     activerecord (6.0.4)
       activemodel (= 6.0.4)
       activesupport (= 6.0.4)
-    activerecord-import (1.0.5)
+    activerecord-import (1.1.0)
       activerecord (>= 3.2)
-    activerecord-nulldb-adapter (0.4.0)
-      activerecord (>= 2.0.0)
+    activerecord-nulldb-adapter (0.7.0)
+      activerecord (>= 5.2.0, < 6.3)
     activerecord-session_store (2.0.0)
       actionpack (>= 5.2.4.1)
       activerecord (>= 5.2.4.1)
@@ -114,42 +115,59 @@ GEM
       minitest (~> 5.1)
       tzinfo (~> 1.1)
       zeitwerk (~> 2.2, >= 2.2.2)
-    acts_as_list (1.0.1)
+    acts_as_list (1.0.4)
       activerecord (>= 4.2)
-    addressable (2.5.2)
-      public_suffix (>= 2.0.2, < 4.0)
-    argon2 (2.0.2)
-      ffi (~> 1.9)
-      ffi-compiler (>= 0.1)
+    addressable (2.7.0)
+      public_suffix (>= 2.0.2, < 5.0)
+    argon2 (2.0.3)
+      ffi (~> 1.14)
+      ffi-compiler (~> 1.0)
     ast (2.4.2)
-    autoprefixer-rails (9.5.1)
-      execjs
-    binding_of_caller (0.8.0)
+    async (1.29.1)
+      console (~> 1.10)
+      nio4r (~> 2.3)
+      timers (~> 4.1)
+    async-http (0.56.3)
+      async (~> 1.25)
+      async-io (~> 1.28)
+      async-pool (~> 0.2)
+      protocol-http (~> 0.22.0)
+      protocol-http1 (~> 0.14.0)
+      protocol-http2 (~> 0.14.0)
+    async-http-faraday (0.11.0)
+      async-http (~> 0.42)
+      faraday
+    async-io (1.32.1)
+      async (~> 1.14)
+    async-pool (0.3.7)
+      async (~> 1.25)
+    autoprefixer-rails (10.2.5.1)
+      execjs (> 0)
+    binding_of_caller (1.0.0)
       debug_inspector (>= 0.0.1)
     biz (1.8.2)
       clavius (~> 1.0)
       tzinfo
-    bootsnap (1.5.1)
+    bootsnap (1.7.5)
       msgpack (~> 1.0)
-    browser (2.5.3)
+    browser (5.3.1)
     buftok (0.2.0)
     builder (3.2.4)
-    byebug (11.0.1)
-    capybara (3.32.2)
+    byebug (11.1.3)
+    capybara (3.35.3)
       addressable
       mini_mime (>= 0.1.3)
       nokogiri (~> 1.8)
       rack (>= 1.6.0)
       rack-test (>= 0.6.3)
-      regexp_parser (~> 1.5)
+      regexp_parser (>= 1.5, < 3.0)
       xpath (~> 3.2)
-    childprocess (1.0.1)
-      rake (< 13.0)
-    chunky_png (1.3.12)
+    childprocess (3.0.0)
+    chunky_png (1.4.0)
     clavius (1.0.4)
-    clearbit (0.2.8)
+    clearbit (0.3.3)
       nestful (~> 1.1.0)
-    coderay (1.1.2)
+    coderay (1.1.3)
     coffee-rails (5.0.0)
       coffee-script (>= 2.2.0)
       railties (>= 5.2.0)
@@ -161,34 +179,36 @@ GEM
       coffee-script
       execjs
       json
-    composite_primary_keys (12.0.2)
+    composite_primary_keys (12.0.10)
       activerecord (~> 6.0.0)
     concurrent-ruby (1.1.9)
-    coveralls (0.8.23)
-      json (>= 1.8, < 3)
-      simplecov (~> 0.16.1)
-      term-ansicolor (~> 1.3)
-      thor (>= 0.19.4, < 2.0)
-      tins (~> 1.6)
-    crack (0.4.3)
-      safe_yaml (~> 1.0.0)
+    console (1.13.1)
+      fiber-local
+    coveralls (0.7.1)
+      multi_json (~> 1.3)
+      rest-client
+      simplecov (>= 0.7)
+      term-ansicolor
+      thor
+    crack (0.4.5)
+      rexml
     crass (1.0.6)
-    daemons (1.3.1)
-    dalli (2.7.10)
-    debug_inspector (0.0.3)
-    delayed_job (4.1.8)
-      activesupport (>= 3.0, < 6.1)
-    delayed_job_active_record (4.1.4)
-      activerecord (>= 3.0, < 6.1)
+    daemons (1.4.0)
+    dalli (2.7.11)
+    debug_inspector (1.1.0)
+    delayed_job (4.1.9)
+      activesupport (>= 3.0, < 6.2)
+    delayed_job_active_record (4.1.6)
+      activerecord (>= 3.0, < 6.2)
       delayed_job (>= 3.0, < 5)
-    deprecation_toolkit (1.4.0)
+    deprecation_toolkit (1.5.1)
       activesupport (>= 4.2)
-    diff-lcs (1.3)
-    diffy (3.3.0)
-    docile (1.3.1)
-    domain_name (0.5.20180417)
+    diff-lcs (1.4.4)
+    diffy (3.4.0)
+    docile (1.4.0)
+    domain_name (0.5.20190701)
       unf (>= 0.0.5, < 1.0.0)
-    doorkeeper (5.3.2)
+    doorkeeper (5.5.2)
       railties (>= 5)
     dotenv (2.7.6)
     eco (1.0.0)
@@ -196,42 +216,55 @@ GEM
       eco-source
       execjs
     eco-source (1.1.0.rc.1)
-    em-websocket (0.5.1)
+    em-websocket (0.5.2)
       eventmachine (>= 0.12.9)
       http_parser.rb (~> 0.6.0)
     equalizer (0.0.11)
     erubi (1.10.0)
     eventmachine (1.2.7)
-    execjs (2.7.0)
-    factory_bot (5.0.2)
-      activesupport (>= 4.2.0)
-    factory_bot_rails (5.0.2)
-      factory_bot (~> 5.0.2)
-      railties (>= 4.2.0)
-    faker (1.9.3)
-      i18n (>= 0.7)
-    faraday (0.17.3)
+    execjs (2.8.1)
+    factory_bot (6.2.0)
+      activesupport (>= 5.0.0)
+    factory_bot_rails (6.2.0)
+      factory_bot (~> 6.2.0)
+      railties (>= 5.0.0)
+    faker (2.18.0)
+      i18n (>= 1.6, < 2)
+    faraday (1.4.2)
+      faraday-em_http (~> 1.0)
+      faraday-em_synchrony (~> 1.0)
+      faraday-excon (~> 1.1)
+      faraday-net_http (~> 1.0)
+      faraday-net_http_persistent (~> 1.1)
       multipart-post (>= 1.2, < 3)
-    faraday-http-cache (2.0.0)
-      faraday (~> 0.8)
-    ffi (1.15.0)
+      ruby2_keywords (>= 0.0.4)
+    faraday-em_http (1.0.0)
+    faraday-em_synchrony (1.0.0)
+    faraday-excon (1.1.0)
+    faraday-http-cache (2.2.0)
+      faraday (>= 0.8)
+    faraday-net_http (1.0.1)
+    faraday-net_http_persistent (1.1.0)
+    ffi (1.15.3)
     ffi-compiler (1.0.1)
       ffi (>= 1.0.0)
       rake
-    formatador (0.2.5)
-    github_changelog_generator (1.14.3)
+    fiber-local (1.0.0)
+    formatador (0.3.0)
+    github_changelog_generator (1.16.4)
       activesupport
+      async (>= 1.25.0)
+      async-http-faraday
       faraday-http-cache
       multi_json
       octokit (~> 4.6)
-      rainbow (>= 2.1)
+      rainbow (>= 2.2.1)
       rake (>= 10.0)
-      retriable (~> 2.1)
     globalid (0.4.2)
       activesupport (>= 4.2.0)
     gmail_xoauth (0.4.2)
       oauth (>= 0.3.6)
-    guard (2.15.0)
+    guard (2.17.0)
       formatador (>= 0.2.4)
       listen (>= 2.7, < 4.0)
       lumberjack (>= 1.0.12, < 2.0)
@@ -249,94 +282,97 @@ GEM
     guard-symlink (0.1.1)
       guard
       guard-compat (~> 1.1)
-    hashdiff (0.3.8)
-    hashie (3.6.0)
+    hashdiff (1.0.1)
+    hashie (4.1.0)
     hiredis (0.6.3)
     htmlentities (4.3.4)
-    http (3.3.0)
+    http (4.4.1)
       addressable (~> 2.3)
       http-cookie (~> 1.0)
-      http-form_data (~> 2.0)
-      http_parser.rb (~> 0.6.0)
-    http-cookie (1.0.3)
+      http-form_data (~> 2.2)
+      http-parser (~> 1.2.0)
+    http-accept (1.7.0)
+    http-cookie (1.0.4)
       domain_name (~> 0.5)
-    http-form_data (2.1.1)
+    http-form_data (2.3.0)
+    http-parser (1.2.3)
+      ffi-compiler (>= 1.0, < 2.0)
     http_parser.rb (0.6.0)
     httpclient (2.8.3)
     i18n (1.8.10)
       concurrent-ruby (~> 1.0)
-    icalendar (2.5.3)
+    icalendar (2.7.1)
       ice_cube (~> 0.16)
-    icalendar-recurrence (1.1.2)
+    icalendar-recurrence (1.1.3)
       icalendar (~> 2.0)
-      ice_cube (~> 0.13)
+      ice_cube (~> 0.16)
     ice_cube (0.16.3)
     inflection (1.0.0)
     interception (0.5)
     ipaddr (1.2.2)
-    json (2.3.0)
-    jwt (2.2.2)
-    kgio (2.11.2)
+    json (2.5.1)
+    jwt (2.2.3)
+    kgio (2.11.4)
     koala (3.0.0)
       addressable
       faraday
       json (>= 1.8)
-    libv8 (7.3.492.27.1)
-    listen (3.1.5)
-      rb-fsevent (~> 0.9, >= 0.9.4)
-      rb-inotify (~> 0.9, >= 0.9.7)
-      ruby_dep (~> 1.2)
+    libv8 (8.4.255.0)
+    listen (3.5.1)
+      rb-fsevent (~> 0.10, >= 0.10.3)
+      rb-inotify (~> 0.9, >= 0.9.10)
     little-plugger (1.1.4)
-    logging (2.2.2)
+    logging (2.3.0)
       little-plugger (~> 1.1)
-      multi_json (~> 1.10)
+      multi_json (~> 1.14)
     loofah (2.10.0)
       crass (~> 1.0.2)
       nokogiri (>= 1.5.9)
-    lumberjack (1.0.13)
+    lumberjack (1.2.8)
     marcel (1.0.1)
     memoizable (0.4.2)
       thread_safe (~> 0.3, >= 0.3.1)
-    method_source (0.9.2)
+    method_source (1.0.0)
     mime-types (3.3.1)
       mime-types-data (~> 3.2015)
-    mime-types-data (3.2020.1104)
+    mime-types-data (3.2021.0225)
     mini_mime (1.1.0)
     mini_portile2 (2.5.3)
     mini_racer (0.2.9)
       libv8 (>= 6.9.411)
     minitest (5.14.4)
-    msgpack (1.3.3)
+    msgpack (1.4.2)
     multi_json (1.15.0)
     multi_xml (0.6.0)
     multipart-post (2.1.1)
     mysql2 (0.5.3)
     naught (1.1.0)
     nenv (0.3.0)
-    nestful (1.1.3)
-    net-ldap (0.16.1)
+    nestful (1.1.4)
+    net-ldap (0.17.0)
     netrc (0.11.0)
     nio4r (2.5.7)
     nokogiri (1.11.7)
       mini_portile2 (~> 2.5.0)
       racc (~> 1.4)
     nori (2.6.0)
-    notiffany (0.1.1)
+    notiffany (0.1.3)
       nenv (~> 0.1)
       shellany (~> 0.0)
     oauth (0.5.6)
-    oauth2 (1.4.4)
+    oauth2 (1.4.7)
       faraday (>= 0.8, < 2.0)
       jwt (>= 1.0, < 3.0)
       multi_json (~> 1.3)
       multi_xml (~> 0.5)
       rack (>= 1.2, < 3)
-    octokit (4.13.0)
+    octokit (4.21.0)
+      faraday (>= 0.9)
       sawyer (~> 0.8.0, >= 0.5.3)
     omniauth (1.9.1)
       hashie (>= 3.4.6)
       rack (>= 1.6.2, < 3)
-    omniauth-facebook (5.0.0)
+    omniauth-facebook (8.0.0)
       omniauth-oauth2 (~> 1.2)
     omniauth-github (1.4.0)
       omniauth (~> 1.5)
@@ -344,61 +380,69 @@ GEM
     omniauth-gitlab (2.0.0)
       omniauth (~> 1.0)
       omniauth-oauth2 (~> 1.0)
-    omniauth-google-oauth2 (0.6.1)
+    omniauth-google-oauth2 (0.8.2)
       jwt (>= 2.0)
-      omniauth (>= 1.1.1)
-      omniauth-oauth2 (>= 1.5)
+      oauth2 (~> 1.1)
+      omniauth (~> 1.1)
+      omniauth-oauth2 (>= 1.6)
     omniauth-linkedin-oauth2 (1.0.0)
       omniauth-oauth2
     omniauth-microsoft-office365 (0.0.8)
       omniauth
       omniauth-oauth2
-    omniauth-oauth (1.1.0)
+    omniauth-oauth (1.2.0)
       oauth
-      omniauth (~> 1.0)
-    omniauth-oauth2 (1.7.0)
+      omniauth (>= 1.0, < 3)
+    omniauth-oauth2 (1.7.1)
       oauth2 (~> 1.4)
-      omniauth (~> 1.9)
+      omniauth (>= 1.9, < 3)
     omniauth-rails_csrf_protection (0.1.2)
       actionpack (>= 4.2)
       omniauth (>= 1.3.1)
-    omniauth-saml (1.10.1)
+    omniauth-saml (1.10.3)
       omniauth (~> 1.3, >= 1.3.2)
-      ruby-saml (~> 1.7)
+      ruby-saml (~> 1.9)
     omniauth-twitter (1.4.0)
       omniauth-oauth (~> 1.1)
       rack
     omniauth-weibo-oauth2 (0.5.2)
       omniauth (~> 1.5)
       omniauth-oauth2 (>= 1.4.0)
-    openssl (2.1.2)
+    openssl (2.2.0)
       ipaddr
     parallel (1.20.1)
     parser (3.0.1.1)
       ast (~> 2.4.1)
     pg (0.21.0)
     pluginator (1.5.0)
-    power_assert (1.1.4)
+    power_assert (2.0.0)
     pre-commit (0.39.0)
       pluginator (~> 1.5)
-    pry (0.12.2)
-      coderay (~> 1.1.0)
-      method_source (~> 0.9.0)
+    protocol-hpack (1.4.2)
+    protocol-http (0.22.4)
+    protocol-http1 (0.14.1)
+      protocol-http (~> 0.22)
+    protocol-http2 (0.14.2)
+      protocol-hpack (~> 1.4)
+      protocol-http (~> 0.18)
+    pry (0.14.1)
+      coderay (~> 1.1)
+      method_source (~> 1.0)
     pry-rails (0.3.9)
       pry (>= 0.10.4)
     pry-remote (0.1.8)
       pry (~> 0.9)
       slop (~> 3.0)
-    pry-rescue (1.5.0)
+    pry-rescue (1.5.2)
       interception (>= 0.5)
       pry (>= 0.12.0)
-    pry-stack_explorer (0.4.9.3)
-      binding_of_caller (>= 0.7)
-      pry (>= 0.9.11)
-    public_suffix (3.1.1)
+    pry-stack_explorer (0.6.1)
+      binding_of_caller (~> 1.0)
+      pry (~> 0.13)
+    public_suffix (4.0.6)
     puma (4.3.8)
       nio4r (~> 2.0)
-    pundit (2.0.1)
+    pundit (2.1.0)
       activesupport (>= 3.0.0)
     pundit-matchers (1.6.0)
       rspec-rails (>= 3.0.0)
@@ -423,10 +467,10 @@ GEM
       bundler (>= 1.3.0)
       railties (= 6.0.4)
       sprockets-rails (>= 2.0.0)
-    rails-controller-testing (1.0.4)
-      actionpack (>= 5.0.1.x)
-      actionview (>= 5.0.1.x)
-      activesupport (>= 5.0.1.x)
+    rails-controller-testing (1.0.5)
+      actionpack (>= 5.0.1.rc1)
+      actionview (>= 5.0.1.rc1)
+      activesupport (>= 5.0.1.rc1)
     rails-dom-testing (2.0.3)
       activesupport (>= 4.2.0)
       nokogiri (>= 1.6)
@@ -439,37 +483,37 @@ GEM
       rake (>= 0.8.7)
       thor (>= 0.20.3, < 2.0)
     rainbow (3.0.0)
-    raindrops (0.19.0)
-    rake (12.3.3)
-    rb-fsevent (0.10.3)
-    rb-inotify (0.10.0)
+    raindrops (0.19.2)
+    rake (13.0.3)
+    rb-fsevent (0.11.0)
+    rb-inotify (0.10.1)
       ffi (~> 1.0)
     rchardet (1.8.0)
     redis (4.2.5)
-    regexp_parser (1.8.2)
-    rest-client (2.0.2)
+    regexp_parser (2.1.1)
+    rest-client (2.1.0)
+      http-accept (>= 1.7.0, < 2.0)
       http-cookie (>= 1.0.2, < 2.0)
       mime-types (>= 1.16, < 4.0)
       netrc (~> 0.8)
-    retriable (2.1.0)
     rexml (3.2.5)
-    rspec-core (3.9.2)
-      rspec-support (~> 3.9.3)
-    rspec-expectations (3.9.2)
+    rspec-core (3.10.1)
+      rspec-support (~> 3.10.0)
+    rspec-expectations (3.10.1)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.9.0)
-    rspec-mocks (3.9.1)
+      rspec-support (~> 3.10.0)
+    rspec-mocks (3.10.2)
       diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.9.0)
-    rspec-rails (3.9.1)
-      actionpack (>= 3.0)
-      activesupport (>= 3.0)
-      railties (>= 3.0)
-      rspec-core (~> 3.9.0)
-      rspec-expectations (~> 3.9.0)
-      rspec-mocks (~> 3.9.0)
-      rspec-support (~> 3.9.0)
-    rspec-support (3.9.3)
+      rspec-support (~> 3.10.0)
+    rspec-rails (5.0.1)
+      actionpack (>= 5.2)
+      activesupport (>= 5.2)
+      railties (>= 5.2)
+      rspec-core (~> 3.10)
+      rspec-expectations (~> 3.10)
+      rspec-mocks (~> 3.10)
+      rspec-support (~> 3.10)
+    rspec-support (3.10.2)
     rszr (0.5.2)
     rubocop (1.16.0)
       parallel (~> 1.10)
@@ -482,6 +526,9 @@ GEM
       unicode-display_width (>= 1.4.0, < 3.0)
     rubocop-ast (1.7.0)
       parser (>= 3.0.1.1)
+    rubocop-faker (1.1.0)
+      faker (>= 2.12.0)
+      rubocop (>= 0.82.0)
     rubocop-performance (1.11.3)
       rubocop (>= 1.7.0, < 2.0)
       rubocop-ast (>= 0.4.0)
@@ -493,40 +540,40 @@ GEM
       rubocop (~> 1.0)
       rubocop-ast (>= 1.1.0)
     ruby-progressbar (1.11.0)
-    ruby-saml (1.10.2)
-      nokogiri (>= 1.5.10)
-    ruby_dep (1.5.0)
-    rubyzip (1.3.0)
-    safe_yaml (1.0.5)
-    sassc (2.0.1)
+    ruby-saml (1.12.2)
+      nokogiri (>= 1.10.5)
+      rexml
+    ruby2_keywords (0.0.4)
+    rubyzip (2.3.0)
+    sassc (2.4.0)
       ffi (~> 1.9)
-      rake
-    sassc-rails (2.1.1)
+    sassc-rails (2.1.2)
       railties (>= 4.0.0)
       sassc (>= 2.0)
       sprockets (> 3.0)
       sprockets-rails
       tilt
-    sawyer (0.8.1)
-      addressable (>= 2.3.5, < 2.6)
-      faraday (~> 0.8, < 1.0)
-    selenium-webdriver (3.142.3)
-      childprocess (>= 0.5, < 2.0)
-      rubyzip (~> 1.2, >= 1.2.2)
+    sawyer (0.8.2)
+      addressable (>= 2.3.5)
+      faraday (> 0.8, < 2.0)
+    selenium-webdriver (3.142.7)
+      childprocess (>= 0.5, < 4.0)
+      rubyzip (>= 1.2.2)
     shellany (0.0.1)
-    shoulda-matchers (4.0.1)
+    shoulda-matchers (4.5.1)
       activesupport (>= 4.2.0)
     simple_oauth (0.3.1)
-    simplecov (0.16.1)
+    simplecov (0.21.2)
       docile (~> 1.1)
-      json (>= 1.8, < 3)
-      simplecov-html (~> 0.10.0)
-    simplecov-html (0.10.2)
+      simplecov-html (~> 0.11)
+      simplecov_json_formatter (~> 0.1)
+    simplecov-html (0.12.3)
     simplecov-rcov (0.2.3)
       simplecov (>= 0.4.1)
-    slack-notifier (2.3.2)
+    simplecov_json_formatter (0.1.3)
+    slack-notifier (2.4.0)
     slop (3.6.0)
-    spring (2.1.0)
+    spring (2.1.1)
     spring-commands-rspec (1.0.4)
       spring (>= 0.9.1)
     spring-commands-testunit (1.0.1)
@@ -538,45 +585,48 @@ GEM
       actionpack (>= 4.0)
       activesupport (>= 4.0)
       sprockets (>= 3.0.0)
+    sync (0.5.0)
     telegramAPI (1.4.2)
       rest-client (~> 2.0, >= 2.0.2)
-    telephone_number (1.4.0)
+    telephone_number (1.4.11)
     term-ansicolor (1.7.1)
       tins (~> 1.0)
-    test-unit (3.3.3)
+    test-unit (3.4.4)
       power_assert
     thor (1.1.0)
     thread_safe (0.3.6)
-    tilt (2.0.9)
-    tins (1.20.2)
-    twilio-ruby (5.23.0)
-      faraday (~> 0.9)
+    tilt (2.0.10)
+    timers (4.3.3)
+    tins (1.29.1)
+      sync
+    twilio-ruby (5.55.0)
+      faraday (>= 0.9, < 2.0)
       jwt (>= 1.5, <= 2.5)
       nokogiri (>= 1.6, < 2.0)
     tzinfo (1.2.9)
       thread_safe (~> 0.1)
-    uglifier (4.1.20)
+    uglifier (4.2.0)
       execjs (>= 0.3.0, < 3)
     unf (0.1.4)
       unf_ext
-    unf_ext (0.0.7.5)
+    unf_ext (0.0.7.7)
     unicode-display_width (2.0.0)
-    unicorn (5.5.0)
+    unicorn (6.0.0)
       kgio (~> 2.6)
       raindrops (~> 0.7)
-    valid_email2 (3.0.1)
+    valid_email2 (3.6.1)
       activemodel (>= 3.2)
       mail (~> 2.5)
-    vcr (4.0.0)
-    viewpoint (1.1.0)
+    vcr (6.0.0)
+    viewpoint (1.1.1)
       httpclient
       logging
       nokogiri
       rubyntlm
-    webmock (3.5.1)
+    webmock (3.13.0)
       addressable (>= 2.3.6)
       crack (>= 0.3.2)
-      hashdiff
+      hashdiff (>= 0.4.0, < 2.0.0)
     websocket-driver (0.7.5)
       websocket-extensions (>= 0.1.0)
     websocket-extensions (0.1.5)
@@ -584,11 +634,11 @@ GEM
     xpath (3.2.0)
       nokogiri (~> 1.8)
     zeitwerk (2.4.2)
-    zendesk_api (1.19.0)
-      faraday (~> 0.9)
-      hashie (>= 3.5.2, < 4.0.0)
+    zendesk_api (1.30.0)
+      faraday (>= 0.9.0, < 2.0.0)
+      hashie (>= 3.5.2, < 5.0.0)
       inflection
-      mime-types
+      mini_mime
       multipart-post (~> 2.0)
 
 PLATFORMS
@@ -642,7 +692,7 @@ DEPENDENCIES
   libv8
   mail!
   mime-types
-  mini_racer
+  mini_racer (= 0.2.9)
   mysql2
   net-ldap
   oauth2
@@ -675,6 +725,7 @@ DEPENDENCIES
   rspec-rails
   rszr (= 0.5.2)
   rubocop
+  rubocop-faker
   rubocop-performance
   rubocop-rails
   rubocop-rspec

+ 15 - 19
app/jobs/communicate_twitter_job.rb

@@ -53,26 +53,22 @@ class CommunicateTwitterJob < ApplicationJob
     # fill article with tweet info
 
     # direct message
-    if tweet.is_a?(Hash)
+    if tweet.is_a?(Twitter::DirectMessage)
       tweet_type = 'DirectMessage'
-      article.message_id = tweet[:event][:id].to_s
-      if tweet[:event] && tweet[:event][:type] == 'message_create'
-        #article.from = "@#{tweet.sender.screen_name}"
-        #article.to = "@#{tweet.recipient.screen_name}"
-
-        article.preferences['twitter'] = {
-          recipient_id: tweet[:event][:message_create][:target][:recipient_id],
-          sender_id:    tweet[:event][:message_create][:sender_id],
-        }
-
-        article.preferences['links'] = [
-          {
-            url:    TwitterSync::DM_URL_TEMPLATE % article.preferences[:twitter].slice(:recipient_id, :sender_id).values.map(&:to_i).sort.join('-'),
-            target: '_blank',
-            name:   'on Twitter',
-          },
-        ]
-      end
+      article.message_id = tweet.id.to_s
+
+      article.preferences['twitter'] = {
+        recipient_id: tweet.recipient_id.to_s,
+        sender_id:    tweet.sender_id.to_s,
+      }
+
+      article.preferences['links'] = [
+        {
+          url:    TwitterSync::DM_URL_TEMPLATE % article.preferences[:twitter].slice(:recipient_id, :sender_id).values.map(&:to_i).sort.join('-'),
+          target: '_blank',
+          name:   'on Twitter',
+        },
+      ]
 
     # regular tweet
     elsif tweet.instance_of?(Twitter::Tweet)

+ 2 - 2
app/models/user_device.rb

@@ -81,11 +81,11 @@ store new device for user if device not already known
     end
 
     # generate device name
-    if browser[:name] == 'Generic Browser'
+    if browser[:name] == 'Unknown Browser'
       browser[:name] = user_agent
     end
     name = ''
-    if browser[:plattform].present? && browser[:plattform] != 'Other'
+    if browser[:plattform].present? && browser[:plattform] != 'UnknownPlatform'
       name = browser[:plattform]
     end
     if browser[:name].present? && browser[:name] != 'Other'

+ 1 - 1
lib/external_credential/twitter.rb

@@ -32,7 +32,7 @@ class ExternalCredential::Twitter
       request_token = consumer.get_request_token(oauth_callback: ExternalCredential.callback_url('twitter'))
     rescue => e
       case e.message
-      when '401 Authorization Required'
+      when '401 Unauthorized'
         raise "#{e.message} (Invalid credentials may be to blame.)"
       when '403 Forbidden'
         raise "#{e.message} (Your app's callback URL configuration on developer.twitter.com may be to blame.)"

+ 9 - 22
lib/twitter_sync.rb

@@ -130,6 +130,14 @@ class TwitterSync
       state = get_state(channel, tweet)
     end
 
+    if tweet.is_a?(Twitter::DirectMessage)
+      message = {
+        type: 'direct_message',
+        text: tweet.text,
+      }
+      state = get_state(channel, tweet)
+    end
+
     if tweet.is_a?(Hash) && tweet['type'] == 'message_create'
       message = {
         type: 'direct_message',
@@ -478,38 +486,17 @@ create a tweet or direct message from an article
 =end
 
   def from_article(article)
-
     tweet = nil
     case article[:type]
     when 'twitter direct-message'
 
       Rails.logger.debug { "Create twitter direct message from article to '#{article[:to]}'..." }
 
-      #      tweet = @client.create_direct_message(
-      #        article[:to],
-      #        article[:body],
-      #        {}
-      #      )
       article[:to].delete!('@')
       authorization = Authorization.find_by(provider: 'twitter', username: article[:to])
       raise "Unable to lookup user_id for @#{article[:to]}" if !authorization
 
-      data = {
-        event: {
-          type:           'message_create',
-          message_create: {
-            target:       {
-              recipient_id: authorization.uid,
-            },
-            message_data: {
-              text: article[:body],
-            }
-          }
-        }
-      }
-
-      tweet = Twitter::REST::Request.new(@client, :json_post, '/1.1/direct_messages/events/new.json', data).perform
-
+      tweet = @client.create_direct_message(authorization.uid.to_i, article[:body])
     when 'twitter status'
 
       Rails.logger.debug { 'Create tweet from article...' }

+ 1 - 1
spec/factories/authorization.rb

@@ -8,7 +8,7 @@ FactoryBot.define do
 
     factory :twitter_authorization do
       provider { 'twitter' }
-      uid      { Faker::Number.number(10) }
+      uid      { Faker::Number.number(digits: 10) }
       username { Faker::Internet.username }
       user_id  { user.id }
     end

+ 1 - 1
spec/factories/external_credential.rb

@@ -20,7 +20,7 @@ FactoryBot.define do
           controller:         'external_credentials',
           action:             'app_verify',
           provider:           'twitter',
-          webhook_id:         Faker::Number.number(19),
+          webhook_id:         Faker::Number.number(digits: 19),
         }
       end
 

+ 1 - 1
spec/factories/knowledge_base/answer/translation/content.rb

@@ -3,7 +3,7 @@
 FactoryBot.define do
   factory 'knowledge_base/answer/translation/content', aliases: %i[knowledge_base_answer_translation_content] do
     translation { nil }
-    body        { Faker::Lorem.paragraph(3) }
+    body        { Faker::Lorem.paragraph(sentence_count: 3) }
 
     before(:create) do |content|
       if content.translation.nil?

Some files were not shown because too many files changed in this diff