How can I programatically call the ruby debugger from within a ruby program in Ruby 1.9?



I am writing a web based debugger for Ruby, but in order to do this I need to be able to call the Ruby debugger from within a Ruby program on the server side. Has this ever been done? Is this even possible?


The end product being built will allow Ruby code to be edited, executed and stepped through using just a web browser. The ruby code that is to be debugged will be "eval"ed on the server side.


I have since been pointed in the right direction by one of the stackoverflow users who has suggested using popen or expect. I have tried both of these now but have encountered the following problems:


popen: When waiting for the console yo


Related to : How can I programatically call the ruby debugger from within a ruby program in Ruby 1.9?
hubris fails to install with: Missing C libraries: ruby, ruby, ruby
Development Tools & Services

I am desperately trying to install Hubris but the installation fails whenever I run "cabal install".


Link to Hurbis:
https://github.com/mwotton/Hubris/tree/master/Haskell


Link to the Cabal file:
https://github.com/mwotton/Hubris/blob/master/Haskell/hubris.cabal


The cabal command that fails is:


cabal install --extra-include-dirs=/usr/include/ruby-1.9.1/x86_64-linux --extra-include-dirs=/usr/include/ruby-1.9.1 --extra-lib-dirs=/usr/lib --user --enable-shared --with-ghc=/usr/local/bin/ghc

The error message is:


Resolving dependencies..
How can I programatically call the ruby debugger from within a ruby program in Ruby 1.9?
Development Tools & Services

I am writing a web based debugger for Ruby, but in order to do this I need to be able to call the Ruby debugger from within a Ruby program on the server side. Has this ever been done? Is this even possible?


The end product being built will allow Ruby code to be edited, executed and stepped through using just a web browser. The ruby code that is to be debugged will be "eval"ed on the server side.


I have since been pointed in the right direction by one of the stackoverflow users who has suggested using popen or expect. I have tried both of these now but have encountered the following problems:


popen: When waiting for the console yo

Ruby: Generate/modify Ruby source files from within Ruby
Development Tools & Services

What is the most reliable way to generate and/or parse and modify a Ruby source file from within ruby?


That is, I want to e.g. create a new ruby source file or change a few lines of code in a class in a source file to e.g. add or remove methods or calls or whatever.


Is there a library for this perhaps?


Ruby Iconv works with irb and ruby debugger but not in a unit test
Development Tools & Services

I'm running Ruby 1.8.7 with Rails 2.3.5 on Ubuntu 10.04 64-bit. I've written a method that should take a string like this, "École À la Découverte" and output a file-system name like this "ecole_a_la_decouverte":


(Iconv.new('US-ASCII//TRANSLIT', 'utf-8').iconv "École À la Découverte").downcase.split.join('_')


When I test this line in my code, the test always fails saying that "cole_la_dcouverte" is unequal to "ecole_a_la_decouverte". The odd thing is that if I insert a debugger line and use the debugger console the test passes. As well, running this line manually in irb and ./script/console seems to work.


Does anyone know what'

“which in ruby”: Checking if program exists in $PATH from ruby
Development Tools & Services

Hiya,
my scripts rely heavily on external programs and scripts.
I need to be sure that a program I need to call exists.
Manually, I'd check this using 'which' in the commandline.


Is there an equivalent to File.exists? for things in $PATH?


(yes I guess I could parse %x[which scriptINeedToRun] but that's not super elegant.


Thanks!
yannick


UPDATE: Here's the solution I retained:


def command?(command)
system("which #{ command} > /dev/null 2>&1")
end

Ruby 1.9.3-p140 - Maximum number of threads in a Ruby program?
Development Tools & Services
I'm playing with Thread and I discovered that I cannot run 10000 threads.It gives me the following error: threading.rb:23:in `initialize': can't create Thread (35) (ThreadError) from threading.rb:23:in `new' from threading.rb:23:in `block in <main>' from threading.rb:22:in `times' from threading.rb:22:in `<main>'Then I tried to see what's the maximum number and when I make up to 2046 threads, Ruby will run the code.Why 2046? It appears

HD Wallpapers
3D
3D Abstract
City
Celebrities
Indian Celebrities
Cars
Travel
Girls
Animals Birds
Movies
Sports
Black White
Nature
Planes
Anime
Food Drink
Dreamy Fantasy
Architecture
Games
Space
Holidays
Flowers
Love
Artistic
Baby
Beach
Bikes Motorcycles
Macro
Computers
Vector
Funny
Army
Textures
Brands
Misc
Music
Other
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .