Module: Refinery

Defined in:
lib/refinery.rb,
lib/refinery/config.rb,
lib/refinery/daemon.rb,
lib/refinery/server.rb,
lib/refinery/worker.rb,
lib/refinery/monitor.rb,
lib/refinery/loggable.rb,
lib/refinery/heartbeat.rb,
lib/refinery/processor.rb,
lib/refinery/publisher.rb,
lib/refinery/queueable.rb,
lib/refinery/utilities.rb,
lib/refinery/statistics.rb,
lib/refinery/validations.rb,
lib/refinery/configurable.rb,
lib/refinery/stats_server.rb,
lib/refinery/event_publisher.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Configurable, Loggable, Queueable, Utilities, Validations Classes: Config, CustomFormatter, Daemon, EventPublisher, Heartbeat, InvalidMessageError, Monitor, Processor, Publisher, Server, SourceFileNotFound, Statistics, StatsServer, Worker

Class Method Summary collapse

Class Method Details

.require_internalsObject

Require internal code files



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/refinery.rb', line 47

def self.require_internals
  require 'thwait'
  
  require 'refinery/loggable'
  require 'refinery/configurable'
  require 'refinery/queueable'

  require 'refinery/utilities'
  
  require 'refinery/validations'

  require 'refinery/config'
  require 'refinery/heartbeat'
  require 'refinery/server'
  require 'refinery/processor'
  require 'refinery/daemon'
  require 'refinery/worker'
  require 'refinery/event_publisher'
  require 'refinery/publisher'
  require 'refinery/monitor'
  require 'refinery/statistics'
  require 'refinery/stats_server'
  
end

.require_librariesObject

Require all of the dependencies.



26
27
28
29
30
31
32
# File 'lib/refinery.rb', line 26

def self.require_libraries
  require_library('rubygems', 'Rubygems')
  require_library('right_aws', 'RightScale AWS gem')
  require_library('json', 'JSON gem')
  require_library('moneta', 'Moneta gem')
  require_library('moneta/s3', 'Moneta S3 implementation')
end

.require_library(short_name, display_name) ⇒ Object

Require the specified library.

The short name is the require path and the display_name will be shown if the library cannot be loaded.



16
17
18
19
20
21
22
23
# File 'lib/refinery.rb', line 16

def self.require_library(short_name, display_name)
  begin
    require short_name
  rescue LoadError
    puts "#{display_name} is required, please install it"
    exit
  end
end

.require_optional_librariesObject



41
42
43
44
# File 'lib/refinery.rb', line 41

def self.require_optional_libraries
  require_optional_library('sequel', 'Sequel gem')
  require_optional_library('ramaze', 'Ramaze')
end

.require_optional_library(short_name, display_name) ⇒ Object



34
35
36
37
38
39
# File 'lib/refinery.rb', line 34

def self.require_optional_library(short_name, display_name)
  begin
    require short_name
  rescue LoadError
  end
end