Sha256: b3a182e4deb58128a5a1a5cd55056a7e502294082a2fda49847ca7eeffa3f49b

Contents?: true

Size: 1.53 KB

Versions: 1

Compression:

Stored size: 1.53 KB

Contents

unless defined? Bj 
  class Bj 
  #
  # constants and associated attrs
  #
    Bj::VERSION = "0.0.1" unless
      defined? Bj::VERSION
    def self.version() Bj::VERSION end

    Bj::LIBDIR = File.expand_path(File::join(File.dirname(__FILE__), "bj")) + File::SEPARATOR unless
      defined? Bj::LIBDIR
    def self.libdir(*value) 
      unless value.empty?
        File.join libdir, *value
      else
        Bj::LIBDIR 
      end
    end

    module EXIT 
      SUCCESS = 0
      FAILURE = 1
      WARNING = 42
    end
  #
  # built-in
  #
    require "socket"
    require "yaml"
    require "thread"
    require "rbconfig"
  #
  # bootstrap rubygems 
  #
    begin
      require "rubygems"
    rescue LoadError
      42
    end
  #
  # rubyforge/remote
  #
    require "active_record"
  #
  # rubyforge/remote or local/lib 
  #
    %w[ attributes main systemu orderedhash ].each do |lib|
      begin
        require lib
      rescue
        require libdir(lib)
      end
    end
  #
  # local 
  #
    load libdir("stdext.rb")
    load libdir("util.rb")
    load libdir("errors.rb")
    load libdir("logger.rb")
    load libdir("bj.rb")
    load libdir("joblist.rb")
    load libdir("table.rb")
    load libdir("runner.rb")
    load libdir("api.rb")
  #
  # an imperfect reloading hook - because neither rails' plugins nor gems provide one, sigh...
  #
    def self.reload!
      ::Object.module_eval do
        remove_const :Bj rescue nil
        remove_const :BackgroundJob rescue nil
      end
      load __FILE__ rescue nil
    end
  end

  BackgroundJob = Bj
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bj-0.0.1 lib/bj.rb