source 'http://rubygems.org'

gem 'rails', '~> 3.2.8'
gem 'json'
gem 'json_pure'
gem 'parseconfig', '~> 1.0.2'
gem 'xml-simple'
gem 'rack'
gem 'regin'
gem 'open4'
gem 'systemu'
gem 'mongoid'
gem 'bson'
gem 'bson_ext'
gem 'pry', :require => 'pry' if ENV['PRY']
# Fedora 19 splits psych out into its own gem.
if Gem::Specification.respond_to?(:find_all_by_name) and not Gem::Specification::find_all_by_name('psych').empty?
  gem 'psych'
end

# For performance reasons, the following scripts will not be
# refactored to use mongoid exclusively:
#  * broker-util/oo-admin-chk
#  * broker-util/oo-admin-fix-sshkeys
#  * broker-util/oo-stats
# These scripts use the OpenShift::DataStore API, and thus depend on
# the mongo rubygem:
gem 'mongo'

if ENV['BROKER_SOURCE'] || ENV['BROKER_PLUGINS_FILE']
  gem 'openshift-origin-common', :path => '../common'
  gem 'openshift-origin-controller', :path => '../controller'
  gem 'netrc' # rest-client has an undeclared prereq on netrc

  # Load broker plugins according to local file, but keep paths relative to ./
  eval IO.read(File.expand_path(ENV['BROKER_PLUGINS_FILE'] || '~/.openshift/broker_plugins.rb'))
else
  gem 'openshift-origin-controller'

  # Load broker plugin gems specified by .conf files in plugins.d/
  # Load if either .conf or -dev.conf is present;
  # Plugins use -dev.conf only in development mode.
  plugins = Dir[(ENV['OPENSHIFT_CONF_DIR'] || "/etc/openshift") + '/plugins.d/*.conf'].
              map {|file| File.basename(file, ".conf") }
  # in development, load if there is a -dev.conf file, even if no prod.conf
  group :development do
    plugins.map! {|name| name.sub(/-dev$/, '')}
  end
  # otherwise, ignore presence of -dev.conf files
  group :test, :production do
    plugins.reject! {|name| name.match /-dev$/}
  end
  plugins.sort.uniq.each {|name| gem name}
end

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19', :require => 'ruby-debug'

# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'

