Rakefile

Path: Rakefile
Last Update: Tue Mar 30 10:17:50 -0600 2010

Required files

fileutils   activesupport   setup  

Methods

Constants

TEMPLATE = ENV['RDOC_TEMPLATE'] || 'html'
APIOUT = "doc/rdoc"

Public Instance methods

[Source]

# File Rakefile, line 106
def add_loadpath(*paths)
  live = ENV['live']

  unless live
    # $LOAD_PATH.unshift(File.expand_path('lib/core'))
    # $LOAD_PATH.unshift(File.expand_path('lib/lore'))
    # $LOAD_PATH.unshift(File.expand_path('lib/more'))
    paths.each do |path|
      $LOAD_PATH.unshift(File.expand_path(path))
    end
  end

  puts "RUBY VERSION: #{RUBY_VERSION}"
  puts "LOAD PATH:\n" + $LOAD_PATH.join("\n")
end

[Source]

# File Rakefile, line 122
def get_tests(which="{c,l,m}ore")
  if find = ARGV[1..-1].select{|e| e !~ /(^[-]|[=])/ }[0]
    unless FileTest.file?(find)
      #find = File.join(find, '**', 'test_*.rb')
      find = ['test/test_*.rb']
      find << File.join(find, which, '**', 'test_*.rb')
    end
  else
    #find = 'test/**/test_*.rb'
    find = ['test/test_*.rb']
    find << "test/#{which}/**/test_*.rb"
  end

  Dir.glob(find)
end

[Source]

# File Rakefile, line 150
def prepare_tests_all
  add_loadpath('lib/core','lib/lore','lib/more')
  files = get_tests
  run_tests(files)
end

[Source]

# File Rakefile, line 156
def prepare_tests_core
  add_loadpath('lib/core')
  files = get_tests('core')
  run_tests(files)
end

[Source]

# File Rakefile, line 162
def prepare_tests_lore
  add_loadpath('lib/lore')
  files = get_tests('lore')
  run_tests(files)
end

[Source]

# File Rakefile, line 168
def prepare_tests_more
  add_loadpath('lib/more')
  files = get_tests('more')
  run_tests(files)
end

[Source]

# File Rakefile, line 138
def run_tests(files)
  files.each do |file|
    next if File.directory?(file)
    begin
      puts "Loading: #{file}" if $DEBUG
      load(file)
    rescue LoadError
      puts "Error loading: #{file}"
    end
  end
end

[Validate]