raganwald / andand

The Maybe Monad in idiomatic Ruby

andand / config / requirements.rb
100755 20 lines (17 sloc) 0.45 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require 'fileutils'
include FileUtils
 
require 'rubygems'
%w[rake hoe newgem rubigen].each do |req_gem|
  begin
    require req_gem
  rescue LoadError => e
    if r = e.to_s.match(/Could not find RubyGem (.*?) \(/)
      req_gem = r[1]
    end
    puts "This Rakefile requires the '#{req_gem}' RubyGem."
    puts "Installation: gem install #{req_gem} -y"
    exit
  end
end
 
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
 
require 'andand'