Sha256: cba10719ad07beed3f80e36c660fc8c0096f4e4ca2a023f3cd8a92008697d1ec

Contents?: true

Size: 1.26 KB

Versions: 2

Compression:

Stored size: 1.26 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 File.exist?( profile.framework.configuration_file )
          FileUtils.cp( configuration_template(), profile.framework.configuration_file )
        end  
      end
      
      private
      
        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'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
methodmissing-scrooge-1.0.0 lib/scrooge.rb
methodmissing-scrooge-1.0.1 lib/scrooge.rb