public
Description: IronRuby sugar for WPF, Silverlight and Windows Forms.
Homepage:
Clone URL: git://github.com/thbar/magic.git
Click here to lend your support to: magic and make a donation at www.pledgie.com !
magic / Rakefile
100644 82 lines (73 sloc) 2.535 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
74
75
76
77
78
79
80
81
82
require 'rake'
 
desc "Home-baked spec task"
task :spec do
  # this obviously need some cleaning - it's currently getting the job done though
  if RUBY_PLATFORM == 'i386-mswin32'
    ENV["RUBY_EXE"] = 'C:\git\ironruby\Merlin\Main\Bin\debug\ir.exe'
    system("ir spec/mspec/bin/mspec-run --format spec spec/*_spec.rb")
  else
    unless ENV["RUBY_EXE"]
      # MSpec needs RUBY_EXE env var now - guess it from env
      ruby_exe = `which ir`.strip
      puts "Setting RUBY_EXE to '#{ruby_exe}'"
      ENV["RUBY_EXE"] = ruby_exe
    end
    # system("ir spec/mspec/bin/mspec-run --format spec spec/*_spec.rb")
    # for some reason the latest build of ir (in the path) throws an error - works if I use older build
    system("mono /Users/thbar/Work/git/ironruby-labs/Release/ir.exe spec/mspec/bin/mspec-run --format spec spec/*_spec.rb")
  end
end
 
desc "Compress all magic files into a single lib for use in Silverlight"
task :compress do
  File.open(File.dirname(__FILE__) + "/../magic-compressed.rb","w") do |output|
    output << "# compressed version of magic - do not modify\n"
    Dir["lib/**/*.rb"].each do |file|
      output << "\n\n# content for #{file}\n\n"
      output << IO.read(file).gsub(/^require/,"# disabled: require")
    end
  end
end
 
begin
  require 'jeweler'
  Jeweler::Tasks.new do |s|
    s.name = "magic"
    s.summary = %Q{TODO}
    s.email = "thibaut.barrere@gmail.com"
    s.homepage = "http://github.com/thbar/magic"
    s.description = "TODO"
    s.authors = ["Thibaut Barrè€re"]
  end
rescue LoadError
  puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end
 
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
  rdoc.rdoc_dir = 'rdoc'
  rdoc.title = 'magic'
  rdoc.options << '--line-numbers' << '--inline-source'
  rdoc.rdoc_files.include('README*')
  rdoc.rdoc_files.include('lib/**/*.rb')
end
 
require 'rake/testtask'
Rake::TestTask.new(:test) do |t|
  t.libs << 'lib' << 'test'
  t.pattern = 'test/**/*_test.rb'
  t.verbose = false
end
 
begin
  require 'rcov/rcovtask'
  Rcov::RcovTask.new do |t|
    t.libs << 'test'
    t.test_files = FileList['test/**/*_test.rb']
    t.verbose = true
  end
rescue LoadError
  puts "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
end
 
begin
  require 'cucumber/rake/task'
  Cucumber::Rake::Task.new(:features)
rescue LoadError
  puts "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
end
 
task :default => :test