File: Rakefile

# Rakefile

Path: | Rakefile
Last Update: | Tue Aug 10 17:25:06 -0600 2010

### Required files

fileutils activesupport setup

### Methods

add_loadpath get_tests prepare_tests_all prepare_tests_core prepare_tests_lore prepare_tests_more run_tests

### Constants

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

### Public Instance methods

add_loadpath(*paths)

[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

get_tests(which="{c,l,m}ore")

[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

prepare_tests_all()

[Source]

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

prepare_tests_core()

[Source]

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

prepare_tests_lore()

[Source]

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

prepare_tests_more()

[Source]

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

run_tests(files)

[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]