add spring

This commit is contained in:
Benjamin Neff 2015-06-23 01:02:46 +02:00
parent 38b31ea464
commit 47b30ed763
10 changed files with 66 additions and 4 deletions

10
Gemfile
View file

@ -24,7 +24,7 @@ group :development do
end
group :test do
# rspec
# unit tests
gem "rspec-instafail", "0.2.6", require: false
gem "fuubar", "2.0.0"
gem "nyan-cat-formatter", require: false
@ -40,12 +40,16 @@ group :test do
end
group :development, :test do
# rspec
# unit tests
gem "rspec-rails", "3.3.1"
# guard
# automatic test runs
gem "guard-rspec", require: false
# preloading environment
gem "spring"
gem "spring-commands-rspec"
# GUID generation
gem "uuid", "2.3.8"

View file

@ -204,6 +204,9 @@ GEM
simplecov-rcov (0.2.3)
simplecov (>= 0.4.1)
slop (3.6.0)
spring (1.3.6)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (3.2.0)
rack (~> 1.0)
sprockets-rails (2.3.1)
@ -242,6 +245,8 @@ DEPENDENCIES
rubocop (= 0.32.0)
simplecov (= 0.10.0)
simplecov-rcov (= 0.2.3)
spring
spring-commands-rspec
sqlite3
uuid (= 2.3.8)
yard

View file

@ -1,6 +1,11 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
ENGINE_ROOT = File.expand_path('../..', __FILE__)
ENGINE_PATH = File.expand_path('../../lib/diaspora_federation/engine', __FILE__)

View file

@ -6,6 +6,11 @@
# this file is here to facilitate running it.
#
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

View file

@ -6,11 +6,15 @@
# this file is here to facilitate running it.
#
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)
require 'rubygems'
require 'bundler/setup'
load Gem.bin_path('rspec-core', 'rspec')

15
bin/spring Executable file
View file

@ -0,0 +1,15 @@
#!/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"
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq }
gem "spring", match[1]
require "spring/binstub"
end
end

1
config/spring.rb Normal file
View file

@ -0,0 +1 @@
Spring.application_root = "./test/dummy"

View file

@ -1,4 +1,8 @@
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'

View file

@ -1,4 +1,8 @@
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
require_relative '../config/boot'
require 'rake'
Rake.application.run

15
test/dummy/bin/spring Executable file
View file

@ -0,0 +1,15 @@
#!/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"
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq }
gem "spring", match[1]
require "spring/binstub"
end
end