public
Description: a Scheme written in Ruby, but implemented on the bus!
Homepage: http://bus-scheme.rubyforge.org
Clone URL: git://github.com/technomancy/bus-scheme.git
technomancy (author)
Mon Jun 02 10:47:22 -0700 2008
commit  d009ab438c8f8128bc0da344c807fa5dbed6e28e
tree    164505a6cb978bea02143b09d8307ab95056e0d2
parent  ee954a3f167510190e9c67c7ce4a21beb80a5203
bus-scheme / Rakefile
100644 73 lines (61 sloc) 1.828 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# -*- ruby -*-
 
require 'rubygems'
require 'hoe'
require './lib/bus_scheme.rb'
 
Hoe.new('bus-scheme', BusScheme::VERSION) do |p|
  p.rubyforge_name = 'bus-scheme'
  p.author = 'Phil Hagelberg'
  p.email = 'technomancy@gmail.com'
  p.summary = 'Bus Scheme is a Scheme in Ruby, imlemented on the bus.'
  p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
  p.url = 'http://bus-scheme.rubyforge.org'
  p.remote_rdoc_dir = ''
end
 
desc "Code statistics"
task :stats do
  require 'code_statistics'
  CodeStatistics.new(['lib'], ['Unit tests', 'test']).to_s
end
 
desc "Complexity statistics"
task :flog do
  system "flog lib/**/*rb"
end
 
desc "Show todo items"
task :todo do
  puts File.read('README.txt').match(/== Todo(.*)== Requirements/m)[1].split("\n").grep(/^(\*|===)/).join("\n")
  puts "Within the code:"
  system "grep -r TODO lib"
end
 
desc "Show tests that have been commented out"
task :commented_tests do
  Dir.glob('test/test_*.rb').each do |file|
    puts File.read(file).grep(/^\s*#+\s*def (test_[^ ]*)/)
  end
 
  Dir.glob('test/test_*.scm').each do |file|
    puts File.read(file).grep(/^\s*;+\s*\(assert/)
  end
end
 
# TODO: use multiruby, duh
desc "Run ruby tests in Rubinius"
task :rbx_test do
  BIN = ENV['bin'] || "~/src/rubinius/shotgun/rubinius"
  if ENV['test']
    system "#{BIN} test/test_#{ENV['test']}.rb"
  else
    system "#{BIN} -w -Ilib:test -e '#{Dir.glob('test/test_*.rb').map{ |f| "require \"" + f + "\" "}.join('; ')}'"
  end
end
 
desc 'Run tests written in Scheme'
task :scheme_test do
  Dir.glob('test/test_*.scm').each do |file|
    begin
      BusScheme.load(file)
    rescue => e
      puts "Error: #{e.message} in #{file}"
    end
  end
end
 
# can never keep these straight
task :test_scheme => :scheme_test
task :scheme => :scheme_test
 
task :default => [:test, :scheme_test]