Byebug fully supports Windows or not?
Yes, byebug
support Windows.
Rails 5 adds platform: :mri option to byebug gem. (see here)
Windows platforms were probably overlooked when that patch was added.
And this document says mri does not include Windows.
That's right.
I heard some people said that some commands (e.g.restart) did not work in their Windows PC.
Those people should report those issues to the project.
CI tests are passing against Windows environment.(see here)
Thtat's right, the best indicator of support ;)
And I cannot find any limitation on Windows environment in Byebug's README.
Another good indicator :)
How do I show more surrounding code in byebug?
You are looking for set listsize
.
P.S. never used byebug, just a quick sight on the gem's Readme.
similar to gem byebug for coffescript
Use debugger
as you would byebug
and make sure you have the browser's developer console open. Execution will pause and you can step through the debugger and peek at the local scope.
See the documentation on debugger for more
Debugging in JRuby 9000
As you can see in https://rubygems.org/gems/pry/versions, there are many java versions of pry that work very well with jruby since jruby 1.6.
Pry is not MRI dependent. You can also use pry-remote in case your application is a web server or a rails app.
I've tried using byebug and gave up since it was not supported on jruby.
What is the correct way to detect if ruby is running on Windows?
Preferred Option (Updated based on @John's recommendations):
require 'rbconfig'
is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
This could also work, but is less reliable (it won't work with much older versions, and the environment variable can be modified)
is_windows = (ENV['OS'] == 'Windows_NT')
(I can't easily test either on all of the rubies listed, or anything but Windows 7, but I know that both will work for 1.9.x, IronRuby, and JRuby).
Related Topics
Why Rails Can Use 'If' as Hash Key But Not in Ruby
Convert String to Datetime Ruby on Rails
Ruby on Rails: Fully Functional Tableless Model
Ruby#Index Method VS Binary Search
What Is the Ruby Equivalent of Preg_Quote()
Iterate Through Array of Hashes in Ruby
Assign to an Array and Replace Emerged Nil Values
Why Doesn't Puts() Print in a Single Line
Reading Parameters on Sinatra Post
How to Pass Value from One Resource to Another Resource in Chef Recipe
Jekyll Liquid - Accessing _Config.Yml Dynamically
How to Set the Mechanize Page Encoding
Why Do I Get a Encoding::Compatibilityerror with #Inspect
Openuri Causing 401 Unauthorized Error with Https Url
Filter Activeadmin with Hstore