From 701722983b833716f854e7815ef42099d9f57bf5 Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Thu, 17 Oct 2019 03:48:48 +0530 Subject: [PATCH] Refactoring Gem Groups --- Gemfile | 93 ++++++++++++++++++++----------- Gemfile.lock | 24 ++++++++ app/models/concerns/pubsubable.rb | 10 ++++ app/models/contact.rb | 3 +- app/models/user.rb | 1 + 5 files changed, 97 insertions(+), 34 deletions(-) create mode 100644 app/models/concerns/pubsubable.rb diff --git a/Gemfile b/Gemfile index fa90c347e..8468d231d 100644 --- a/Gemfile +++ b/Gemfile @@ -2,52 +2,81 @@ source 'https://rubygems.org' ruby '2.6.3' -gem 'acts-as-taggable-on', git: 'https://github.com/mbleigh/acts-as-taggable-on' -gem 'bootsnap' -gem 'carrierwave-aws' -gem 'chargebee', '~>2' -gem 'coffee-rails' -gem 'devise', git: 'https://github.com/plataformatec/devise' -gem 'devise_token_auth', git: 'https://github.com/lynndylanhurley/devise_token_auth' -gem 'facebook-messenger', '~> 0.11.1' -gem 'figaro' +##-- base gems for rails --## +gem 'rails', '~> 6', github: 'rails/rails' +gem 'rack-cors', require: 'rack/cors' +# Reduces boot times through caching; required in config/boot.rb +gem 'bootsnap', require: false +gem 'therubyracer', platforms: :ruby + + +##-- rails helper gems --## +gem 'responders' +gem 'valid_email2' +gem 'attr_extras' gem 'hashie' gem 'jbuilder', '~> 2.5' gem 'kaminari' -gem 'koala' -gem 'mini_magick' -gem 'nightfury', '~> 1.0', '>= 1.0.1' +gem 'time_diff' +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] +gem 'acts-as-taggable-on', git: 'https://github.com/mbleigh/acts-as-taggable-on' + + +##-- gems for database --# gem 'pg' -gem 'puma', '~> 3.0' -gem 'pundit' -gem 'pusher' -# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' -gem 'rack-cors', require: 'rack/cors' -gem 'rails', '~> 6', github: 'rails/rails' gem 'redis' gem 'redis-namespace' gem 'redis-rack-cache' -gem 'responders' -gem 'sentry-raven' -gem 'sidekiq' -gem 'telegram-bot-ruby' -gem 'therubyracer', platforms: :ruby -gem 'time_diff' -gem 'uglifier', '>= 1.3.0' -gem 'valid_email2' -gem 'wisper', '2.0.0' -gem 'attr_extras' -# Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] +##--- gems for server & infra configuration ---## +gem 'puma', '~> 3.0' gem 'webpacker' - -# for starting different server processes gem 'foreman' +gem 'figaro' + +##--- gems for authentication & authorization ---## +gem 'devise', git: 'https://github.com/plataformatec/devise' +gem 'devise_token_auth', git: 'https://github.com/lynndylanhurley/devise_token_auth' +# authorization +gem 'pundit' + + +##--- gems for pubsub service ---## +gem 'pusher' +gem 'wisper', '2.0.0' + + +##--- gems for reporting ---## +gem 'nightfury', '~> 1.0', '>= 1.0.1' + + +##--- gems for billing ---## +gem 'chargebee', '~>2' + + +##--- gems for channels ---## +gem 'facebook-messenger', '~> 0.11.1' +gem 'twitter' +gem 'telegram-bot-ruby' +# facebook client +gem 'koala' + + +##--- gems for debugging and error reporting ---## # static analysis gem 'brakeman' +gem 'sentry-raven' + + +##-- TODO: move these gems to appropriate groups --## +gem 'carrierwave-aws' +gem 'coffee-rails' +gem 'mini_magick' +gem 'sidekiq' +gem 'uglifier', '>= 1.3.0' + group :development do gem 'letter_opener' diff --git a/Gemfile.lock b/Gemfile.lock index 79a2f5fdc..5409efa51 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -141,6 +141,7 @@ GEM bootsnap (1.4.5) msgpack (~> 1.0) brakeman (4.6.1) + buftok (0.2.0) builder (3.2.3) byebug (11.0.1) carrierwave (2.0.2) @@ -199,9 +200,16 @@ GEM globalid (0.4.2) activesupport (>= 4.2.0) hashie (3.6.0) + http (3.3.0) + addressable (~> 2.3) + http-cookie (~> 1.0) + http-form_data (~> 2.0) + http_parser.rb (~> 0.6.0) http-accept (1.7.0) http-cookie (1.0.3) domain_name (~> 0.5) + http-form_data (2.1.1) + http_parser.rb (0.6.0) httparty (0.17.1) mime-types (~> 3.0) multi_xml (>= 0.5.2) @@ -250,6 +258,8 @@ GEM mini_mime (>= 0.1.1) marcel (0.3.3) mimemagic (~> 0.3.2) + memoizable (0.4.2) + thread_safe (~> 0.3, >= 0.3.1) method_source (0.9.2) mime-types (3.3) mime-types-data (~> 3.2015) @@ -264,6 +274,7 @@ GEM multi_json (1.13.1) multi_xml (0.6.0) multipart-post (2.1.1) + naught (1.1.0) netrc (0.11.0) nightfury (1.0.1) nio4r (2.5.2) @@ -364,6 +375,7 @@ GEM rack (>= 2.0.0) rack-protection (>= 2.0.0) redis (>= 4.1.0) + simple_oauth (0.3.1) spring (2.1.0) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) @@ -387,6 +399,17 @@ GEM time_diff (0.3.0) activesupport i18n + twitter (6.2.0) + addressable (~> 2.3) + buftok (~> 0.2.0) + equalizer (~> 0.0.11) + http (~> 3.0) + http-form_data (~> 2.0) + http_parser.rb (~> 0.6.0) + memoizable (~> 0.4.0) + multipart-post (~> 2.0) + naught (~> 1.0) + simple_oauth (~> 0.3.0) tzinfo (1.2.5) thread_safe (~> 0.1) uglifier (4.2.0) @@ -470,6 +493,7 @@ DEPENDENCIES telegram-bot-ruby therubyracer time_diff + twitter tzinfo-data uglifier (>= 1.3.0) valid_email2 diff --git a/app/models/concerns/pubsubable.rb b/app/models/concerns/pubsubable.rb new file mode 100644 index 000000000..db7f69406 --- /dev/null +++ b/app/models/concerns/pubsubable.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +module Pubsubable + extend ActiveSupport::Concern + + included do + #Used by the pusher/PubSub Service we use for real time communications + has_secure_token :pubsub_token + end +end diff --git a/app/models/contact.rb b/app/models/contact.rb index 128b8b954..76e31d17f 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -1,7 +1,6 @@ class Contact < ApplicationRecord + include Pubsubable - #Used by the pusher/PubSub Service we use for real time communications - has_secure_token :pubsub_token validates :account_id, presence: true validates :inbox_id, presence: true diff --git a/app/models/user.rb b/app/models/user.rb index 6aa0023ee..48b88bacc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,6 +2,7 @@ class User < ApplicationRecord # Include default devise modules. include DeviseTokenAuth::Concerns::User include Events::Types + include Pubsubable devise :database_authenticatable, :registerable,