source 'https://rubygems.org'

# to not use insecure git protocol
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# on servers we don't have proper LANG
Encoding.default_external = Encoding::UTF_8


gem 'dotenv-rails', '~> 2.0'
gem 'rails', '4.2.7.1'
gem 'activesupport',  '4.2.7.1' # somehow paperclip needs to explicitly lock the version to not use 5.0

gem 'protected_attributes', '~> 1.1.3'
gem 'rails-observers'

group :assets do
  gem 'coffee-rails', '~> 4.1'
  gem 'sprockets-rails', '~> 2.3.2'
  gem 'non-stupid-digest-assets', '~> 1.0'
end

gem 'sass-rails', '~> 5.0'

gem 'open_id_authentication'
gem 'oauth2', '1.0.0'
gem 'bcrypt', '~> 3.1.7'

gem 'i18n'

# This is in Rails 5:
# http://blog.bigbinary.com/2016/03/09/rails-5-makes-partial-redering-from-cache-substantially-faster.html
gem 'multi_fetch_fragments', github: 'mikz/multi_fetch_fragments'

source 'https://geminabox.3sca.net' do
  gem '3scale_time_range', '0.0.6'
  gem '3scale_core', '1.22.0'

  # 3scale fork that allows OPTIONS passthrough
  gem 'font_assets', '0.1.11.pre.3scale', groups: [:production, :preview]
end

gem 'config_for', '~> 0.3.0'

gem 'resque', '~> 1.25.2', require: %w(resque resque/server)
gem 'resque-scheduler', '~> 4.0.0'
gem 'resque-retry'
gem 'resque-workers-lock'
gem 'statsd-ruby', require: false

gem 'sinatra', require: false # for sidekiq and resque web

# Sidekiq
gem 'sidekiq', '< 5', require: %w(sidekiq sidekiq/web)

gem 'activemerchant', github: '3scale/active_merchant', branch: 'adyen'
gem 'money', '6.7.1' # Lock to this version we use in production
gem 'stripe' # we need the stripe gem because activemerchant can not generate Stripe's "customers"
gem 'audited-activerecord'

# Rails 4.1: this should not be needed, maybe replace it with enum -- http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html
gem 'symbolize', '~> 4.5'
gem 'acts_as_list', '~> 0.7.6'
gem 'braintree', '~>2.10.0'
gem 'cancancan', '~> 1.7.1'
gem 'formtastic', '~> 1.2.4'
gem 'rmagick', '~> 2.15.3', require: false
gem 'gruff', '~>0.3', require: false
gem 'bugsnag', '~> 5.0'
gem 'htmlentities', '~>4.3', '>= 4.3.4'
gem 'inherited_resources', '1.6.0'
gem 'json', '~> 1.8.1'

case ENV.fetch('DATABASE', 'mysql')
when 'postgresql'
  gem 'pg'
when 'mysql'
  gem 'mysql2', '~>0.3.11'
end

gem 'nokogiri', '>= 1.6.8'
gem 'dalli', '~> 2.7'
gem 'secure_headers', '~> 2.2'
gem 'faraday_middleware'

gem 'rails_event_store', '~> 0.9.0'
gem 'paperclip', '~> 5.0'
gem 'zip-zip', require: false
gem 'rubyzip', '~>1.1.7', require: false
gem 'swagger-ui_rails2', git: 'https://github.com/3scale/swagger-ui_rails.git', branch: 'dev-2.1.3'
gem 'swagger-ui_rails', git: 'https://github.com/3scale/swagger-ui_rails.git', branch: 'dev'
gem 'json-schema'
gem 'RedCloth', '~>4.3', require: false
gem 'redcarpet', '~>3.4.0', require: false
gem 'baby_squeel', '~> 1.0.1'
gem 'recaptcha', '0.3.4', require: 'recaptcha/rails'
gem 'hiredis', '~>0.6.0'
gem 'redis', '~> 3.2.1', require: ['redis', 'redis/connection/hiredis']
gem 'redis-namespace', '~> 1.5.2'
gem 'rest-client', '~>1.6'
gem 'httpclient'
gem 'thinking-sphinx', '~> 3.2.0'
gem 'ts-datetime-delta', require: 'thinking_sphinx/deltas/datetime_delta'
gem 'diff-lcs', '~> 1.2'
gem 'acts-as-taggable-on', '~> 4.0'
gem 'whenever', '~> 0.9.4', require: false
gem 'will_paginate', '~> 3.1.0'

gem 'rack-x_served_by', '~> 0.1.1'
gem 'deadlock_retry'
gem 'addressable', require: false
gem 'roar-rails'
gem 'mixpanel-ruby', require: false
gem 'analytics-ruby', require: false
gem 'acts_as_tree'
gem 'hashie', require: false

gem 'reform', '~> 2.0.3', require: false

# sanitize params passed to rack
gem 'rack-utf8_sanitizer'

gem 'google-api-client', require: false
gem 'jwt', '~> 1.5.2', require: false

group :assets do
  gem 'uglifier'
  gem 'font-awesome-rails', '~> 4.3.0.0'
  gem 'codemirror-rails', '~> 5.6'
  gem 'jquery-rails', '~> 3.1'

  gem 'active-docs', path: 'vendor/active-docs'
end

gem 'compass-rails', '~> 2.0.4'

gem 'state_machines', '0.4.0'
gem 'state_machines-activerecord', '0.4.0'
gem 'after_commit_queue', '~> 1.1.0'

# for liquid docs on-fly generation
gem 'html-pipeline', github: 'ceritium/html-pipeline', branch: 'master'
gem 'github-markdown'

# templating
gem 'slim-rails', '~> 3.0'
gem 'ruby-openid'

gem 'draper', '~> 2.0'

group :development do
  gem 'spring', '2.0.0', require: false
  gem 'spring-commands-rubocop'
  gem 'spring-commands-cucumber'
  gem 'spring-commands-rspec'
  gem 'spring-commands-m' # To be removed in Rails 5
  gem 'spring-commands-testunit' # this is what RubyMine does

  gem 'colorize'
  gem 'bullet', '~> 4.2'

  # to generate the swagger JSONs
  gem 'sour', github: 'HakubJozak/sour', require: false
  # for `rake doc:liquid:generate` and similar
  gem 'source2swagger', '~> 0.1', source: 'https://geminabox.3sca.net'
  gem 'letter_opener', require: false if ENV.fetch('LETTER_OPENER', '1') == '0'

  # Rails 4.2 have it built in
  gem 'quiet_assets'

  gem 'yard', require: false

  # Install rubocop only when using RubyMine (for the rubocop plugin)
  gem 'rubocop', install_if: ENV['TEAMCITY_RAKE_RUNNER_MODE'], require: false
end

gem 'message_bus', '>= 2.0.0.beta.7', '<= 2.1', require: false
gem 'mail_view', '~> 2.0.4'

# legacy from rails 2.3 -
gem 'dynamic_form'

group :test do
  gem 'codeclimate_rails', path: 'vendor/codeclimate_rails'
  gem 'rack-no_animations', '~> 1.0.3'
  gem 'simplecov', '~> 0.10.0'

  gem 'capybara', '~> 2.7.0', source: 'https://rubygems.org'
  gem 'capybara-webkit', '~> 1.10.1', source: 'https://rubygems.org'

  gem 'headless', '~> 2.3.1'
  gem 'selenium-webdriver', '~> 3.0', require: false
  gem 'chronic'
  gem 'cucumber', '~>1.3.20'
  gem 'cucumber-rails', require: false
  gem 'email_spec', require: false
  gem 'factory_girl', '~>2.6.4' # versions 3.0 and up are for ruby 1.9 only
  gem 'factory_girl_rails'
  gem 'fakefs', '~>0.4.2', require: 'fakefs/safe'
  gem 'fakeweb', '1.3.0.3scale.pre.2', require: false, source: 'https://geminabox.3sca.net'
  gem 'webmock', '~> 1.21', require: false
  gem 'launchy'
  gem 'mechanize'
  gem 'parallel_tests', '~> 2.3'

  gem 'childprocess'

  gem 'equivalent-xml', require: false

  # use our version until https://github.com/justinweiss/resque_unit/pull/42 is released
  gem 'resque_unit', '0.4.9.3scale', require: false, source: 'https://geminabox.3sca.net'

  gem 'rspec-rails', require: false # version 3 and up require capybara >= 2.2

  # Reason to use the fork: https://github.com/kucaahbe/rspec-html-matchers/pull/21
  gem 'rspec-html-matchers', github: '3scale/rspec-html-matchers', require: false
  gem 'rspec_api_documentation'

  gem 'shoulda', '~> 3.5.0', require: false
  gem 'shoulda-matchers', '~> 2.8.0'
  gem 'shoulda-context', '~> 1.2.1'
  gem 'timecop', '~> 0.8'

  gem 'minitest'
  gem 'minitest-reporters', require: false
  gem 'minitest-stub-const'
  gem 'ci_reporter_rspec', '~> 1.0', require: false
  gem 'ci_reporter_shell', github: '3scale/ci_reporter_shell', require: false

  # IMPORTANT: Load 'mocha' after 'shoulda'.
  gem 'mocha', '~> 1.1.0', require: 'mocha/setup'

  # proxy tests
  gem 'thin', require: false
  gem 'database_cleaner', '~> 1.4', require: false

  # performance tests
  gem 'ruby-prof'

  gem 'percy-capybara', '~> 2.1.0', require: false
  gem 'm', '~> 1.5.0' # To be removed in rails 5.0


end

group :development, :test do
  gem 'unicorn-rails'

  gem 'pry-rails'
  gem 'pry-doc', '>= 0.8', require: false

  gem 'rack-jspm', '~> 0.1.1'

  gem 'license_finder', '~> 2.1.2'

end

gem 'unicorn', require: false, group: [:production, :preview]
gem 'developer_portal', path: 'lib/developer_portal'
