Sha256: 69cbfa91df103d7982f2421f8cad54303115575a9e351323b87be4836d891119

Contents?: true

Size: 618 Bytes

Versions: 3

Compression:

Stored size: 618 Bytes

Contents

module Barista
  module Integration
    
    autoload :Rails2,  'barista/integration/rails2'
    autoload :Rails3,  'barista/integration/rails3'
    autoload :Sinatra, 'barista/integration/sinatra'
    
    def self.setup
      setup_rails   if defined?(Rails)
      setup_sinatra if defined?(::Sinatra)
    end
    
    def self.setup_rails
      case Rails::VERSION::MAJOR
      when 3
        Rails3
      when 2
        # We need to manually call the initialiser stuff in Rails 2.
        Rails2.setup
      end
    end
    
    def self.setup_sinatra
      ::Sinatra::Base.register(Sinatra)
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
barista-1.0.0 lib/barista/integration.rb
barista-0.7.0.pre3 lib/barista/integration.rb
barista-0.7.0.pre2 lib/barista/integration.rb