Class: Bj

Inherits:
Object show all
Defined in:
lib/bj.rb,
lib/bj/bj.rb,
lib/bj/api.rb,
lib/bj/util.rb,
lib/bj/table.rb,
lib/bj/errors.rb,
lib/bj/logger.rb,
lib/bj/runner.rb,
lib/bj/joblist.rb

Defined Under Namespace

Modules: API, ClassMethods, EXIT, Util Classes: Error, JobList, Logger, RailsRoot, Runner, Table

Constant Summary collapse

VERSION =

constants and associated attrs

"0.0.4"
LIBDIR =
File.expand_path(File::join(File.dirname(__FILE__), "bj")) + File::SEPARATOR
Joblist =
JobList

Class Method Summary collapse

Class Method Details

.libdir(*value) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/bj.rb', line 11

def self.libdir(*value) 
  unless value.empty?
    File.join libdir, *value
  else
    Bj::LIBDIR 
  end
end

.reload!Object

an imperfect reloading hook - because neither rails’ plugins nor gems provide one, sigh…



70
71
72
73
74
75
76
77
78
79
80
# File 'lib/bj.rb', line 70

def self.reload!
  background = nil
  ::Object.module_eval do
    background = Bj.runner.background
    remove_const :Bj rescue nil
    remove_const :BackgroundJob rescue nil
  end
  returned = load __FILE__ rescue nil
  Bj.runner.background = background if background
  returned
end

.versionObject

unless defined? Bj::VERSION



7
# File 'lib/bj.rb', line 7

def self.version() Bj::VERSION end