-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
41 lines (32 loc) · 836 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
38
39
40
41
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
require "bundler/gem_tasks"
# http://blog.zachallett.com/pry-reload/
#
# I should gemify this later.
task :console do
require 'pry'
require 'tak'
# http://stackoverflow.com/questions/9236264/how-to-disable-warning-for-redefining-a-constant-when-loading-a-file
def silence_warnings(&block)
warn_level, $VERBOSE = $VERBOSE, nil
result = block.call
$VERBOSE = warn_level
result
end
# Modified a bit to silence some constant reload warnings
# and to return a true or the error.
def reload!
!!silence_warnings do
$LOADED_FEATURES
.select { |feat| feat =~ /\/tak\// }
.each { |file| load file }
end
rescue => e
e
end
ARGV.clear
Pry.start
end