Sha256: 107145965762557b552ffc412cb0f3b169e245c6634450d4b26412bc218f6983

Contents?: true

Size: 1.66 KB

Versions: 49

Compression:

Stored size: 1.66 KB

Contents

# frozen_string_literal: true

require 'concurrent/executor/fixed_thread_pool'
require 'concurrent/timer_task'
require 'cancancan'
require 'ar_lazy_preload'
require 'fugit'
require 'csv'
require 'active_record/filter'
require 'audited'
require 'uri'
require 'net/http'
require 'net/https'

module Motor
  PATH = Pathname.new(__dir__)

  module_function

  def reload!
    Kernel.silence_warnings do
      Dir[PATH.join('./motor/**/*.rb')].each do |f|
        next if f.ends_with?('alerts/scheduler.rb')
        next if f.ends_with?('alerts/scheduled_alerts_cache.rb')
        next if f.ends_with?('configs/load_from_cache.rb')
        next if f.ends_with?('configs/sync_from_file.rb')
        next if f.ends_with?('resources/custom_sql_columns_cache.rb')

        load f
      end
    end

    true
  end

  def server?
    defined?(::Rails::Server) ||
      defined?(::Thin::Server) ||
      defined?(::PhusionPassenger) ||
      (defined?(::Puma) && File.basename($PROGRAM_NAME) == 'puma') ||
      defined?(::Unicorn::HttpServer) ||
      defined?(::Mongrel::HttpServer) ||
      defined?(JRuby::Rack::VERSION) ||
      defined?(::Trinidad::Server)
  end

  def development?
    ENV['MOTOR_DEVELOPMENT'].present?
  end
end

require 'motor/version'
require 'motor/admin'
require 'motor/assets'
require 'motor/active_record_utils'
require 'motor/cancan_utils'
require 'motor/build_schema'
require 'motor/api_query'
require 'motor/tags'
require 'motor/configs'
require 'motor/queries'
require 'motor/dashboards'
require 'motor/forms'
require 'motor/api_configs'
require 'motor/alerts'
require 'motor/resources'
require 'motor/hash_serializer'
require 'motor/net_http_utils'
require 'motor/railtie'

Version data entries

49 entries across 49 versions & 1 rubygems

Version Path
motor-admin-0.3.4 lib/motor.rb
motor-admin-0.3.3 lib/motor.rb
motor-admin-0.3.2 lib/motor.rb
motor-admin-0.3.1 lib/motor.rb
motor-admin-0.3.0 lib/motor.rb
motor-admin-0.2.89 lib/motor.rb
motor-admin-0.2.88 lib/motor.rb
motor-admin-0.2.87 lib/motor.rb
motor-admin-0.2.86 lib/motor.rb
motor-admin-0.2.85 lib/motor.rb
motor-admin-0.2.84 lib/motor.rb
motor-admin-0.2.83 lib/motor.rb
motor-admin-0.2.82 lib/motor.rb
motor-admin-0.2.81 lib/motor.rb
motor-admin-0.2.80 lib/motor.rb
motor-admin-0.2.79 lib/motor.rb
motor-admin-0.2.78 lib/motor.rb
motor-admin-0.2.77 lib/motor.rb
motor-admin-0.2.76 lib/motor.rb
motor-admin-0.2.75 lib/motor.rb