forked from deivid-rodriguez/byebug
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRakefile
86 lines (72 loc) · 1.69 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
require 'rake/testtask'
require 'rake/extensiontask'
require 'bundler/gem_tasks'
Rake::ExtensionTask.new('byebug')
SO_NAME = "byebug.so"
desc "Run MiniTest suite"
task :test do
Rake::TestTask.new(:test) do |t|
t.test_files = FileList["test/*_test.rb"]
t.warning = true
t.verbose = true
end
end
base_spec = eval(File.read('byebug.gemspec'), binding, 'byebug.gemspec')
task :default => :test
desc 'Run a test in looped mode so that you can look for memory leaks'
task 'test_loop' do
code = %Q[loop{ require '#{$*[1]}' }]
cmd = %Q[ruby -Itest -e "#{ code }"]
system cmd
end
desc 'Watch memory use of a looping test'
task 'test_loop_mem' do
system "watch \"ps aux | grep -v 'sh -c r' | grep [I]test\""
end
namespace :demo do
desc 'Launch a simple fib demo in the debugger'
task 'fib' do
system "ruby demo/fib.rb"
end
desc 'Launch a simple fib demo in the debugger'
task 'fib_mm' do
system "./bin/byebug --post-mortem -Ilib demo/fib_mm.rb"
end
desc 'Launch a simple fib demo in the debugger'
task 'socket' do
system "ruby ws.rb&"
system "open ./ui/debugger.html"
end
task 'remote_server' do
require 'byebug'
p Byebug::VERSION
Byebug.start_websocket_server
# system "open ./ui/debugger.html"
# Byebug.post_mortem do
# p "foo"
# raise
# p "bar"
# end
p "foo"
byebug
p "bar"
p "foo2"
p "bar2"
end
task "server" do
require 'byebug'
Byebug.wait_connection = true
Byebug.start
Byebug.start_server
Byebug.post_mortem do
p "foo"
raise
p "bar"
end
# Byebug.current_context.step_into
end
task "client" do
require 'byebug'
Byebug.start_client
end
end