Sha256: db7c67a0dd45e5631ca318580342c3b5f2e4133ebc851bea4338bf9747a2d824

Contents?: true

Size: 1.39 KB

Versions: 1

Compression:

Stored size: 1.39 KB

Contents

$:.unshift(File.dirname(__FILE__))

require 'yaml'
require 'fileutils'
require 'scrooge/core/string'
require 'scrooge/core/symbol'
require 'scrooge/core/thread'
require 'thread'

module Scrooge
  class Base
    
    GUARD = ::Mutex.new
    
    class << self
      
      # Active Profile reader
      #
      def profile
        @@profile ||= Scrooge::Profile.new
      end
      
      # Active Profile writer.
      #
      def profile=( profile )
        @@profile = profile
      end
      
      # Installs a YAML configuration template in the host framework's config
      # directory.
      #
      def setup!
        unless configuration_file_exists?
          FileUtils.cp( configuration_template(), profile.framework.configuration_file )
        end  
      end
      
      private
      
        def configuration_file_exists? #:nodoc:
          File.exist?( profile.framework.configuration_file )
        end
      
        def configuration_template #:nodoc:
          File.join( File.dirname(__FILE__), '..', 'assets', 'config', 'scrooge.yml.template' )
        end
      
    end
    
    def profile
      self.class.profile
    end
    
  end 

  module Middleware
    autoload :Tracker, 'scrooge/middleware/tracker'
  end 

end

require 'scrooge/profile'
require 'scrooge/storage/base'
require 'scrooge/orm/base'
require 'scrooge/framework/base'
require 'scrooge/tracker/base'
require 'scrooge/strategy/base'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
methodmissing-scrooge-1.0.4 lib/scrooge.rb