forked from jwoertink/bootcamp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
37 lines (30 loc) · 815 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# encoding: utf-8
require 'bundler/gem_tasks'
require 'rake'
require 'rspec/core/rake_task'
namespace :spec do
RSpec::Core::RakeTask.new(:normal) do |t|
t.pattern ='spec/**/*_spec.rb'
t.rcov = false
end
end
desc "Start IRB with all runtime dependencies loaded"
task :console, [:script] do |t,args|
dirs = ['lib'].select { |dir| File.directory?(dir) }
original_load_path = $LOAD_PATH
if File.exist?('Gemfile')
require 'bundler'
Bundler.setup(:default)
end
$LOAD_PATH.unshift(*dirs)
ARGV.clear
require 'irb'
puts "Booting console"
IRB.conf[:SCRIPT] = args.script
IRB.start
# return the $LOAD_PATH to it's original state
$LOAD_PATH.reject! { |path| !(original_load_path.include?(path)) }
end
desc "RSpec tests"
task "spec" => "spec:normal"
task "default" => "spec"