Sha256: 2711543f2b5c01519b5110c82832a75703b4f505fc4d602bec2f1629c7349ba9

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

require "daengine/version"
require 'daengine/engine'
require File.expand_path('../../app/models/digital_asset',__FILE__)
require 'daengine/teamsite_metadata_parser'
require 'daengine/digital_asset_processor'
require 'mongoid'

module Daengine
  @config = {
    :assets_path => '/digital-assets'
  }

  @mongoid_config = {
    'database' => 'ssc_assets', # mongoid database name
    'host' => 'foo', # mongoid server
    'port' => 27017, # mongodb server port
  }

  @valid_mongoid_keys = @mongoid_config.keys

  # yaml file config
  def self.configure(config_options)
    config_options.each {|k,v| @config[k.to_sym] = v} 
    config_options.each {|k,v| 
p "configuring mongoid option #{k} value #{v}"
      @mongoid_config[k] = v if @valid_mongoid_keys.include? k
    } 
    Mongoid.configure do |config|
      config.from_hash(@mongoid_config)
    end
    p "configured with keys #{@config.keys}"
  end

  def self.config
    @config
  end

  def self.execute(config_options)
    self.configure(config_options)
    return DigitalAssetProcessor.execute  # start the thread daemon
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
daengine-0.0.7.alpha lib/daengine.rb