Sha256: a1b455d9e0a1867ba16ae507914d5e31c2d5791e9f8dfa3a56e799b46e7c18b0

Contents?: true

Size: 703 Bytes

Versions: 18

Compression:

Stored size: 703 Bytes

Contents

# This program is *NOT* supposed to be executable, but called
# via ruby (in order to test that restart provides a funky $:).
# This program is used to test that 'restart' works when we didn't call
# the debugger initially.

TOP_SRC_DIR = File.join(File.expand_path(File.dirname(__FILE__), '..')) unless 
  defined?(TOP_SRC_DIR)

$:.unshift File.join(TOP_SRC_DIR, 'ext')
$:.unshift File.join(TOP_SRC_DIR, 'lib')
$:.unshift File.join(TOP_SRC_DIR, 'cli')
require 'ruby-debug'
Debugger.init

# GCD. We assume positive numbers
def gcd(a, b)
  # Make: a <= b
  debugger
  if a > b
    a, b = [b, a]
  end

  return nil if a <= 0

  if a == 1 or b-a == 0
    return a
  end
  return gcd(b-a, a)
end

gcd(3,5)

Version data entries

18 entries across 18 versions & 5 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/1.8/gems/ruby-debug-0.10.4/test/gcd-dbg-nox.rb
debugger-1.0.1 test/gcd-dbg-nox.rb
debugger-1.0.0 test/gcd-dbg-nox.rb
debugger-1.0.0.rc2 test/gcd-dbg-nox.rb
debugger-1.0.0.rc1 test/gcd-dbg-nox.rb
ruby-debug-0.10.5.rc1 test/gcd-dbg-nox.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/gcd-dbg-nox.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/gcd-dbg-nox.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/gcd-dbg-nox.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/gcd-dbg-nox.rb
vim-jar-0.0.3 bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/gcd-dbg-nox.rb
vim-jar-0.0.2 bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/gcd-dbg-nox.rb
vim-jar-0.0.1 bundler/ruby/1.8/gems/ruby-debug-0.10.4/test/gcd-dbg-nox.rb
ruby-debug-0.10.4 test/gcd-dbg-nox.rb
rackjour-0.1.8 vendor/gems/gems/ruby-debug-0.10.3/test/gcd-dbg-nox.rb
ruby-debug-0.10.3 test/gcd-dbg-nox.rb
ruby-debug-0.10.1 test/gcd-dbg-nox.rb
ruby-debug-0.10.2 test/gcd-dbg-nox.rb