Sha256: a133df448c75d3a919c6781aadcd4da39b10c2f4d7d05ce22e4e9f1a123929ce

Contents?: true

Size: 818 Bytes

Versions: 1

Compression:

Stored size: 818 Bytes

Contents

#!/usr/bin/ruby

# Tryout - Fix namespace conflicts between Drydock, Rudy, and Caesars
#

$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')

require 'drydock'
require 'tryouts'
include Tryouts

Drydock.run = false

tryout("include within module") do
  module SomeModule
    include Drydock
    before do
    end
    puts "Works!"  # Doesn't run
  end
end

tryout("extend within module") do
  module SomeModule
    extend Drydock
    before do
    end
    puts "Works!"  # Runs
  end
end

tryout("use before in main without include or extend") do
  before do
  end
  puts "Works!"   # Runs
end

tryout("include within main, use before in SomeModule") do
  include Drydock
  before do
  end
  module SomeModule
    before do
    end
    puts "just ran SomeModule.before"  # Run
  end
  puts "Works!"  # Runs
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solutious-rudy-0.9.0 tryouts/misc/drydock_tryout.rb