public
Description: The latest and greatest wheel to be invented yet
Homepage:
Clone URL: git://github.com/spicycode/micronaut.git
micronaut / Rakefile
100644 66 lines (56 sloc) 1.994 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
require 'lib/micronaut/rake_task'
 
begin
  require 'jeweler'
  Jeweler::Tasks.new do |s|
    s.name = "micronaut"
    s.executables = "micronaut"
    s.summary = "An excellent replacement for the wheel..."
    s.email = "chad@spicycode.com"
    s.homepage = "http://github.com/spicycode/micronaut"
    s.description = "An excellent replacement for the wheel..."
    s.authors = ["Chad Humphries"]
    s.files = FileList["[A-Z]*", "{bin,lib,examples}/**/*"]
  end
  Jeweler::GemcutterTasks.new
rescue LoadError
  puts "Jeweler, or one of its dependencies, is not available. Install it with: gem install jeweler"
end
 
desc "List files that don't have examples"
task :untested do
  code = Dir["lib/**/*.rb"].map { |g| Dir.glob(g) }.flatten
  examples = Dir["examples/**/*_example.rb"].map { |g| Dir.glob(g) }.flatten
  examples.map! { |f| f =~ /examples\/(.*)_example/; "#{$1}.rb" }
  puts "\nThe following files seem to be missing their examples:"
  (code - examples).each do |missing|
    puts " #{missing}"
  end
end
 
puts "Running in Ruby #{RUBY_PLATFORM} #{RUBY_VERSION}"
desc "Run all micronaut examples"
Micronaut::RakeTask.new :examples do |t|
  t.pattern = "examples/**/*_example.rb"
end
 
namespace :examples do
  
  desc "Run all micronaut examples using rcov"
  Micronaut::RakeTask.new :coverage do |t|
    t.pattern = "examples/**/*_example.rb"
    t.rcov = true
    t.rcov_opts = %[--exclude "examples/*,gems/*,db/*,/Library/Ruby/*,config/*" --text-summary --sort coverage]
  end
 
end
 
task :default => [:check_dependencies, :examples]
 
begin
  %w{sdoc sdoc-helpers rdiscount}.each { |name| gem name }
  require 'sdoc_helpers'
rescue LoadError => ex
  puts "sdoc support not enabled:"
  puts ex.inspect
end
 
require 'rake/rdoctask'
Rake::RDocTask.new do |rdoc|
  version = File.exist?('VERSION') ? File.read('VERSION') : ''
  rdoc.rdoc_dir = 'rdoc'
  rdoc.title = "micronaut #{version}"
  rdoc.rdoc_files.include('README*')
  rdoc.rdoc_files.include('lib/**/*.rb')
end