Commit 256fa5b9 authored by hellekin's avatar hellekin

Use byebug & spring

- Add Byebug gem to help debugging during development
- Add Spring gem to speed up development and tests
parent daa072fe
......@@ -32,6 +32,7 @@ group :development, :test do
gem 'fabrication'
gem 'guard'
gem 'pry'
gem 'pry-byebug'
gem 'rb-inotify', '~> 0.9'
gem 'rspec'
gem 'rspec-rails', '~> 3.7'
......@@ -53,6 +54,7 @@ group :development do
gem 'rails-erd'
gem 'rubycritic', require: false
gem 'seed_dump'
gem 'spring'
end
group :test do
......
......@@ -198,6 +198,9 @@ GEM
pry (0.11.3)
coderay (~> 1.1.0)
method_source (~> 0.9.0)
pry-byebug (3.6.0)
byebug (~> 10.0)
pry (~> 0.10)
pry-rails (0.3.6)
pry (>= 0.10.4)
public_suffix (3.0.3)
......@@ -318,6 +321,8 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
spring (2.0.2)
activesupport (>= 4.2)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
......@@ -372,6 +377,7 @@ DEPENDENCIES
pg (>= 0.18, < 2.0)
phony_rails
pry
pry-byebug
pry-rails
puma (~> 3.11)
pundit
......@@ -389,6 +395,7 @@ DEPENDENCIES
shoulda
shoulda-matchers
simplecov
spring
uuid_parameter
RUBY VERSION
......
#!/usr/bin/env ruby
# This file loads spring without using Bundler, in order to be fast.
# It gets overwritten when you run the `spring binstub` command.
unless defined?(Spring)
require 'rubygems'
require 'bundler'
lockfile = Bundler::LockfileParser.new(Bundler.default_lockfile.read)
spring = lockfile.specs.detect { |spec| spec.name == "spring" }
if spring
Gem.use_paths Gem.dir, Bundler.bundle_path.to_s, *Gem.path
gem 'spring', spring.version
require 'spring/binstub'
end
end
if Rails.env.development?
require "byebug"
require "pry-byebug"
# Byebug.start_server 'localhost', ENV.fetch("BYEBUG_SERVER_PORT", 1048).to_i
end
......@@ -16,7 +16,12 @@ shared_dir = "#{app_dir}/tmp/"
bind "unix://#{shared_dir}/sockets/puma.sock";
# Logging
stdout_redirect "#{app_dir}/log/puma.stdout.log", "#{app_dir}/log/puma.stderr.log", true
if Rails.env.development?
# Do not redirect STDOUT so we can use byebug!
stdout_redirect nil, "#{app_dir}/log/puma.stderr.log", true
else
stdout_redirect "#{app_dir}/log/puma.stdout.log", "#{app_dir}/log/puma.stderr.log", true
end
# Set master PID and state locations
pidfile "#{shared_dir}/pids/puma.pid"
......
%w(
.ruby-version
tmp/restart.txt
tmp/caching-dev.txt
).each { |path| Spring.watch(path) }
......@@ -9,7 +9,9 @@ abort("The Rails environment is running in production mode!") if Rails.env.produ
require 'rspec/rails'
require 'bitfields/rspec'
require 'byebug'
require 'faker'
require 'pry-byebug'
require 'pundit/rspec'
require 'shoulda-matchers'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment