ruby-debug-passenger 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YzBmODA1ZjJhYzhiMDhlYThiYTk4YjEzODVjZTljYjM5OTU1NWMyYw==
5
+ data.tar.gz: !binary |-
6
+ NGQxMjdmNWY3MzA4NTFjNzVmOWY1OGI1ZmVjOTMyZDJhOTI2YzczZg==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ ODk3MDcwMThkZDU4ZDI3ZDYwMWVkNDcwZWMwZWM0OTM4ZjVhZTI1NmI4MTc3
10
+ Y2E5YjYzMzQxMWZhNDJjZGU5MGE3NzBiMWY3NDFjNzYyNDcyMDk5ZTBkOWRl
11
+ ODc4Mjc4MjhiZDNjNTBiMGFlMjQ3OGU4ZTI3YTFhY2IzMTI3NGI=
12
+ data.tar.gz: !binary |-
13
+ OTllMWI5MjIzNzMyNzM3OTI5MDZkOWYxMGIxNTZkNGVlYzRmNmVjYTdhYjQx
14
+ OTFkNjM5NmQwNGU4YjQxYjJhMzBiNTYzY2U5ODRmODY0NDVkNDc3YjZhZGJi
15
+ ZDIzNTU5Y2U4YzhmMjU0NDk2NzVkNWIyMjYzODJiYjQ0M2EzMmQ=
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in ruby-debug-passenger.gemspec
4
4
  gemspec
5
+
6
+ gem 'rake'
data/README.md CHANGED
@@ -23,26 +23,33 @@ and
23
23
  * Debugger gem 1.1.4
24
24
  * Phusion Passenger 3.0.12 and 3.0.13
25
25
 
26
+ and
27
+
28
+ * Rails 3.2.14
29
+ * Ruby (MRI) 2.0.0-p247
30
+ * Byebug 1.8.0
31
+ * Passenger 4.0.10
32
+
26
33
  It will probably work on other versions, but not on Rails 2.
27
34
 
28
35
  It may or may not work on Ruby 1.8.
29
36
 
30
37
  ## Installation
31
- Add this to your `Gemfile` (assuming you are on Ruby 1.9):
38
+ Add this to your `Gemfile` if you are on Ruby 2.0
32
39
 
33
40
  ```ruby
34
- gem "debugger"
41
+ gem "byebug"
35
42
  gem "ruby-debug-passenger"
36
43
  ```
37
44
 
38
- or use the old ruby-debug gem:
45
+ or this if you are on Ruby 1.9
39
46
 
40
47
  ```ruby
41
- gem "ruby-debug19", require: "ruby-debug"
48
+ gem "debugger"
42
49
  gem "ruby-debug-passenger"
43
50
  ```
44
51
 
45
- Or if you're using Ruby 1.8 you can try the following, but it hasn't been tested!
52
+ or this if you are on Ruby 1.8, but it hasn't been tested!
46
53
 
47
54
  ```ruby
48
55
  gem "ruby-debug"
@@ -52,29 +59,25 @@ gem "ruby-debug-passenger"
52
59
  Then run `bundle install` to install it.
53
60
 
54
61
  ## Usage
55
- Add `debugger` anywhere in your Ruby code that you want to invoke the debugger.
56
- (Or in an ERB template add `<% debugger %>`.)
62
+ Add `debugger` (for rubies under 2.0) or `byebug` (for rubies from 2.0) anywhere
63
+ in your Ruby code that you want to invoke the debugger. Or in an ERB template,
64
+ add `<% debugger %>` or `<% byebug %>` instead.
57
65
 
58
66
  Run `rake debug` to restart Phusion Passenger and connect to the debugger. (You
59
67
  will be prompted to reload the app in your browser.)
60
68
 
61
- ## Suggested configuration
62
- I recommend putting this in your `~/.rdebugrc`:
63
-
64
- ```ruby
65
- set autolist
66
- set autoeval
67
- set autoreload
68
- ```
69
-
70
69
  ## Recommended reading
71
70
  * [ruby-debug documentation](http://bashdb.sourceforge.net/ruby-debug.html)
72
- * [RailsCast #54](http://railscasts.com/episodes/54-debugging-with-ruby-debug)
73
- (the setup steps are out of date, but it shows why ruby-debug can be useful)
71
+ * [RailsCast #54](http://railscasts.com/episodes/54-debugging-with-ruby-debug),
72
+ or the [revised version](http://railscasts.com/episodes/54-debugging-ruby-revised)
73
+ if you're a Pro subscriber.
74
74
 
75
75
  ## Changelog
76
+ ### 0.2.0
77
+ * Support for `byebug` gem (David Rodríguez)
78
+
76
79
  ### 0.1.0
77
- * Support for `debugger` gem (Kai Middleton) #1
80
+ * Support for `debugger` gem (Kai Middleton) [#1](https://github.com/davejamesmiller/ruby-debug-passenger/pull/1)
78
81
 
79
82
  ### 0.0.1
80
83
  * Initial release
@@ -11,18 +11,33 @@ module RubyDebugPassenger
11
11
  # ever run in the development environment (for safety more than anything
12
12
  # else).
13
13
  if Rails.env.development? && File.exists?(File.join(Rails.root, 'tmp', 'debug.txt'))
14
+ begin
15
+ require 'byebug'
16
+ rescue LoadError
17
+ raise "'byebug' gem must be present when using 'ruby-debug-passenger'"
18
+ end if RUBY_VERSION.start_with?('2.0')
19
+
14
20
  begin
15
21
  require 'debugger'
16
22
  rescue LoadError
17
- begin
18
- require 'ruby-debug'
19
- rescue LoadError
20
- raise "One of the gems 'debugger' or 'ruby-debug' must be present when using the gem 'ruby-debug-passenger'"
21
- end
22
- end
23
+ raise "'debugger' gem must be present when using 'ruby-debug-passenger'"
24
+ end if RUBY_VERSION.start_with?('1.9')
25
+
26
+ begin
27
+ require 'ruby-debug'
28
+ rescue LoadError
29
+ raise "'ruby-debug' gem must be present when using 'ruby-debug-passenger'"
30
+ end if RUBY_VERSION.start_with?('1.8')
31
+
23
32
  File.delete(File.join(Rails.root, 'tmp', 'debug.txt'))
24
- Debugger.wait_connection = true
25
- Debugger.start_remote
33
+
34
+ if RUBY_VERSION < '2.0'
35
+ Debugger.wait_connection = true
36
+ Debugger.start_remote
37
+ else
38
+ Byebug.wait_connection = true
39
+ Byebug.start_server
40
+ end
26
41
  end
27
42
  end
28
43
 
@@ -1,3 +1,3 @@
1
1
  module RubyDebugPassenger
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -1,19 +1,28 @@
1
1
  desc "Restart the app with debugging enabled, then launch the debugger"
2
2
  task :debug do
3
3
 
4
+ begin
5
+ require 'byebug'
6
+ rescue LoadError
7
+ puts "'byebug' gem must be present for this task to work"
8
+ exit 1
9
+ end if RUBY_VERSION.start_with?('2.0')
10
+
4
11
  begin
5
12
  require 'debugger'
6
13
  rescue LoadError
7
- begin
8
- require 'ruby-debug'
9
- rescue LoadError
10
- puts "One of the gems 'debugger' or 'ruby-debug' must be present for this task to work"
11
- exit 1
12
- end
13
- end
14
+ puts "'debugger' gem must be present for this task to work"
15
+ exit 1
16
+ end if RUBY_VERSION.start_with?('1.9')
17
+
18
+ begin
19
+ require 'ruby-debug'
20
+ rescue LoadError
21
+ puts "'ruby-debug' gem must be present for this task to work"
22
+ exit 1
23
+ end if RUBY_VERSION.start_with?('1.8')
14
24
 
15
25
  # This instructs the app to wait for the debugger to connect after loading
16
- # See config/environments/development.rb
17
26
  FileUtils.touch(File.join(Rails.root, 'tmp', 'debug.txt'))
18
27
 
19
28
  # Instruct Phusion Passenger to restart the app
@@ -32,9 +41,18 @@ task :debug do
32
41
  exit 1
33
42
  end
34
43
 
35
- puts "Loading debugger..."
44
+ if RUBY_VERSION < '2.0'
45
+ puts "Loading debugger..."
46
+ else
47
+ puts "Loading byebug..."
48
+ end
49
+
36
50
  begin
37
- Debugger.start_client
51
+ if RUBY_VERSION < '2.0'
52
+ Debugger.start_client
53
+ else
54
+ Byebug.start_client
55
+ end
38
56
  rescue Interrupt
39
57
  # Clear the "^C" that is displayed when you press Ctrl-C
40
58
  puts "\r\e[0KDisconnected."
@@ -10,22 +10,15 @@ Gem::Specification.new do |s|
10
10
  s.homepage = "https://github.com/davejamesmiller/ruby-debug-passenger"
11
11
  s.summary = %q{Adds a 'rake debug' task to Rails to restart Phusion Passenger with a debugger connected}
12
12
  s.description = <<-EOF
13
- Adds an initializer that loads 'ruby-debug' or 'debugger' and starts the
14
- debugger, and a 'rake debug' task that tells Phusion Passenger to restart
15
- with debugging enabled. This makes it possible to do interactive debugging
16
- when using the Phusion Passenger Apache module - it does not require the
17
- standalone server.
13
+ Adds an initializer that loads and starts the debugger, and a 'rake debug'
14
+ task that tells Phusion Passenger to restart with debugging enabled. This
15
+ makes it possible to do interactive debugging when using the Phusion
16
+ Passenger Apache module - it does not require the standalone server.
18
17
  EOF
19
18
  s.license = 'MIT'
20
19
 
21
- s.rubyforge_project = "ruby-debug-passenger"
22
-
23
20
  s.files = `git ls-files`.split("\n")
24
21
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
25
22
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
26
23
  s.require_paths = ["lib"]
27
-
28
- # specify any dependencies here; for example:
29
- # s.add_development_dependency "rspec"
30
- # s.add_runtime_dependency "rest-client"
31
24
  end
metadata CHANGED
@@ -1,21 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-debug-passenger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Dave James Miller
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-07-01 00:00:00.000000000Z
11
+ date: 2013-08-13 00:00:00.000000000 Z
13
12
  dependencies: []
14
- description: ! " Adds an initializer that loads 'ruby-debug' or 'debugger' and
15
- starts the\n debugger, and a 'rake debug' task that tells Phusion Passenger to
16
- restart\n with debugging enabled. This makes it possible to do interactive debugging\n
17
- \ when using the Phusion Passenger Apache module - it does not require the\n standalone
18
- server.\n"
13
+ description: ! " Adds an initializer that loads and starts the debugger, and a
14
+ 'rake debug'\n task that tells Phusion Passenger to restart with debugging enabled.
15
+ This\n makes it possible to do interactive debugging when using the Phusion\n
16
+ \ Passenger Apache module - it does not require the standalone server.\n"
19
17
  email:
20
18
  - dave@davejamesmiller.com
21
19
  executables: []
@@ -34,27 +32,26 @@ files:
34
32
  homepage: https://github.com/davejamesmiller/ruby-debug-passenger
35
33
  licenses:
36
34
  - MIT
35
+ metadata: {}
37
36
  post_install_message:
38
37
  rdoc_options: []
39
38
  require_paths:
40
39
  - lib
41
40
  required_ruby_version: !ruby/object:Gem::Requirement
42
- none: false
43
41
  requirements:
44
42
  - - ! '>='
45
43
  - !ruby/object:Gem::Version
46
44
  version: '0'
47
45
  required_rubygems_version: !ruby/object:Gem::Requirement
48
- none: false
49
46
  requirements:
50
47
  - - ! '>='
51
48
  - !ruby/object:Gem::Version
52
49
  version: '0'
53
50
  requirements: []
54
- rubyforge_project: ruby-debug-passenger
55
- rubygems_version: 1.8.10
51
+ rubyforge_project:
52
+ rubygems_version: 2.0.6
56
53
  signing_key:
57
- specification_version: 3
54
+ specification_version: 4
58
55
  summary: Adds a 'rake debug' task to Rails to restart Phusion Passenger with a debugger
59
56
  connected
60
57
  test_files: []