Skip to content

Instantly share code, notes, and snippets.

@we4tech

we4tech/Gemfile

Last active Aug 29, 2015
Embed
What would you like to do?
Basic standalone rake/thor based project bootstrap
# Define root dirctory
ROOT_DIR = File.dirname(__FILE__)
# Set PROJ_ENV as environment variable
PROJ_ENV = ENV['PROJ_ENV'] || (ENV['PROJ_ENV'] = 'development')
# Load gems from the Gemfile
require 'bundler/setup'
Bundler.require(:default, PROJ_ENV.to_sym)
# Load required core libraries
# Include lib as common load path
$LOAD_PATH.unshift File.join(ROOT_DIR, 'lib')
source 'https://rubygems.org'
# Core libraries
gem 'rake'
gem 'activesupport'
gem 'bson_ext'
# Add gems related with content parsing
gem 'nokogiri'
# Add gems related with datababase
gem 'mongo_mapper', '~> 0.12.0'
# Add Sidekiq related gems
gem 'redis'
gem 'sidekiq'
gem 'sidekiq-unique-jobs'
gem 'slim'
gem 'sinatra', '~> 1.4.4'
group :development, :test do
gem 'bond'
gem 'pry'
gem 'pry-debugger'
gem 'factory_girl'
end
group :test do
gem 'database_cleaner'
gem 'rspec'
gem 'rspec-sidekiq'
gem 'vcr'
gem 'webmock'
end
ENV['PROJ_ENV'] = 'test'
require_relative '../boot'
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner[:mongo_mapper].clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner[:mongo_mapper].strategy = :truncation
end
config.after(:each) do
DatabaseCleaner[:mongo_mapper].clean
end
config.after(:all) do
DatabaseCleaner[:mongo_mapper].clean_with(:truncation)
end
config.order = 'random'
end
VCR.configure do |c|
c.cassette_library_dir = TweekDumper.root_path.join('spec', 'fixtures', 'vcr_cassettes')
c.hook_into :webmock
end
RSpec::Sidekiq.configure do |config|
# Clears all job queues before each example
config.clear_all_enqueued_jobs = true # default => true
# Whether to use terminal colours when outputting messages
config.enable_terminal_colours = true # default => true
# Warn when jobs are not enqueued to Redis but to a job array
config.warn_when_jobs_not_processed_by_sidekiq = true # default => true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.