Sha256: a56f9cec00a5f95c6aa12b7b1167fa7ade3108b4bf074b472efd93e6a1d25624

Contents?: true

Size: 902 Bytes

Versions: 7

Compression:

Stored size: 902 Bytes

Contents

module Oxidized
  require 'oxidized/log'
  require 'oxidized/string'
  require 'oxidized/config'
  require 'oxidized/config/vars'
  require 'oxidized/worker'
  require 'oxidized/nodes'
  require 'oxidized/manager'
  class << self
    def new *args
      Core.new args
    end
  end

  class Core
    def initialize args
      Oxidized.mgr = Manager.new
      nodes        = Nodes.new
      @worker      = Worker.new nodes
      if CFG.rest?
        begin
          require 'oxidized/web'
        rescue LoadError
          raise OxidizedError, 'oxidized-web not found: sudo gem install oxidized-web - or disable web support by setting "rest: false" in your configuration'
        end
        @rest        = API::Web.new nodes, CFG.rest
        @rest.run
      end
      run
    end

    private

    def run
      while true
        @worker.work
        sleep Config::Sleep
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
oxidized-0.3.0 lib/oxidized/core.rb
oxidized-0.2.4 lib/oxidized/core.rb
oxidized-0.2.3 lib/oxidized/core.rb
oxidized-0.2.2 lib/oxidized/core.rb
oxidized-0.2.1 lib/oxidized/core.rb
oxidized-0.2.0 lib/oxidized/core.rb
oxidized-0.1.1 lib/oxidized/core.rb