rdp / backtracer Goto Github PK
View Code? Open in Web Editor NEWQuality output when an exception is thrown and not caught in Ruby
Quality output when an exception is thrown and not caught in Ruby
irb(main):003:0> Object.constants.grep /SCRIPT/i
=> [:ScriptError, :RUBY_DESCRIPTION]
irb(main):004:0> require 'backtracer'
=> true
irb(main):005:0> Object.constants.grep /SCRIPT/i
=> [:ScriptError, :RUBY_DESCRIPTION, :SCRIPT_LINES__]
I like what you're doing here. Always thought the backtrace could be made more useful. It occurs to me that it can be hard to decide what exactly one should show in a backtrace, you never know what the developer wants to see, and providing everything can be an overload. That led to to think it would be cool if the backtrace did provide everything, but in YAML, and then we could pipe that to a filter command to see it in different ways, even write our own filters. We might have somthing like:
ruby -rbacktracer myscript.rb 2>&1 | backtracer -i locals
/home/rdp/prod/allgems_prod_copy/lib/allgems/App.rb in load_gem_spec
haml :load, :layout => false
end
private
def load_gem_spec(gem, version=nil)
version ||= get_latest(gem)
raise 'failed gem' unless version
Specer.get_spec(gem, version)
end
# gem:: name of the gem
# Returns the latest version of the given gem or nil
def get_latest(gem)
AllGems.db[:versions].join(:gems, :id => :gem_id
E:/installs/ruby191p376/lib/ruby/gems/1.9.1/gems/backtracer-0.7.2/lib/backtracer.rb:32: warning: global variable `$no_code_line_numbers' not initialized
C:/installs/ruby19_mingw/lib/ruby/gems/1.9.1/gems/backtracer-0.6.1/lib/backtracer.rb:32:in `block in ': undefined method`set_backtrace' for nil:NilClass (NoMethodError) C:/installs/ruby19_mingw/lib/ruby/site_ruby/1.9.1/rubygems.rb:827:in `report_activate_error': Could not find RubyGem whichr (>= 0) (Gem::LoadError) from C:/installs/ruby19_mingw/lib/ruby/site_ruby/1.9.1/rubygems.rb:261:in`activate' from C:/installs/ruby19_mingw/lib/ruby/site_ruby/1.9.1/rubygems.rb:68:in `gem' from :273:in`push_gem_version_on_load_path' from internal:gem_prelude:14:in `gem' from c:/cygwin/bin/whichr:18:in`'
yup
guess not yet...
and other permutations, if anybody cares +1 this
yes indeed it is
I doubt it
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.