Sha256: e3e16f4b93d38c1108e7a30a65740b71663376ac55d6ee7af24067905155c8e6

Contents?: true

Size: 902 Bytes

Versions: 4

Compression:

Stored size: 902 Bytes

Contents

module Dashing
  class << self

    delegate :scheduler, :redis, to: :config

    attr_accessor :configuration

    def config
      self.configuration ||= Configuration.new
    end

    def configure
      yield config if block_given?
    end

    def first_dashboard
      files = Dir[config.dashboards_views_path.call.join('*')].collect { |f| File.basename(f, '.*') }
      files.sort.first
    end

    def send_event(id, data)
      redis.publish("#{Dashing.config.redis_namespace}.create", data.merge(id: id, updatedAt: Time.now.utc.to_i).to_json)
    end

  end
end

begin
  require 'rails'
rescue LoadError
end

$stderr.puts <<-EOC if !defined?(Rails)
warning: no framework detected.

Your Gemfile might not be configured properly.
---- e.g. ----
Rails:
    gem 'dashing-rails'

EOC

require 'dashing/configuration'

if defined? Rails
  require 'dashing/engine'
  require 'dashing/railtie'
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dashing-rails-2.4.0 lib/dashing.rb
dashing-rails-2.3.2 lib/dashing.rb
dashing-rails-2.3.1 lib/dashing.rb
dashing-rails-2.3.0 lib/dashing.rb