mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-15 07:23:19 -04:00
Removed support for Ruby 1.8.6.
This commit is contained in:
16
Rakefile
16
Rakefile
@@ -2,7 +2,11 @@
|
|||||||
# -*- ruby -*-
|
# -*- ruby -*-
|
||||||
|
|
||||||
require 'rake/clean'
|
require 'rake/clean'
|
||||||
require 'rdoc/task'
|
begin
|
||||||
|
require 'rdoc/task'
|
||||||
|
rescue LoadError => ex
|
||||||
|
# No rdoc task availble.
|
||||||
|
end
|
||||||
|
|
||||||
SRC_DIR = 'src'
|
SRC_DIR = 'src'
|
||||||
PROB_DIR = 'koans'
|
PROB_DIR = 'koans'
|
||||||
@@ -63,7 +67,7 @@ end
|
|||||||
module RubyImpls
|
module RubyImpls
|
||||||
# Calculate the list of relevant Ruby implementations.
|
# Calculate the list of relevant Ruby implementations.
|
||||||
def self.find_ruby_impls
|
def self.find_ruby_impls
|
||||||
rubys = `rvm list`.gsub(/=>/,'').split(/\n/).sort
|
rubys = `rvm list`.gsub(/=>/,'').split(/\n/).map { |x| x.strip }.reject { |x| x.empty? || x =~ /^rvm/ }.sort
|
||||||
expected.map { |impl|
|
expected.map { |impl|
|
||||||
last = rubys.grep(Regexp.new(Regexp.quote(impl))).last
|
last = rubys.grep(Regexp.new(Regexp.quote(impl))).last
|
||||||
last ? last.split.first : nil
|
last ? last.split.first : nil
|
||||||
@@ -77,7 +81,7 @@ module RubyImpls
|
|||||||
|
|
||||||
# List of expected ruby implementations.
|
# List of expected ruby implementations.
|
||||||
def self.expected
|
def self.expected
|
||||||
%w(ruby-1.8.6 ruby-1.8.7 ruby-1.9.2 jruby ree)
|
%w(ruby-1.8.7 ruby-1.9.2 jruby ree)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -88,9 +92,11 @@ task :walk_the_path do
|
|||||||
ruby 'path_to_enlightenment.rb'
|
ruby 'path_to_enlightenment.rb'
|
||||||
end
|
end
|
||||||
|
|
||||||
Rake::RDocTask.new do |rd|
|
if defined?(Rake::RDocTask)
|
||||||
|
Rake::RDocTask.new do |rd|
|
||||||
rd.main = "README.rdoc"
|
rd.main = "README.rdoc"
|
||||||
rd.rdoc_files.include("README.rdoc", "koans/*.rb")
|
rd.rdoc_files.include("README.rdoc", "koans/*.rb")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
directory DIST_DIR
|
directory DIST_DIR
|
||||||
@@ -150,7 +156,7 @@ task :run_all do
|
|||||||
RubyImpls.list.each do |impl|
|
RubyImpls.list.each do |impl|
|
||||||
puts "=" * 40
|
puts "=" * 40
|
||||||
puts "On Ruby #{impl}"
|
puts "On Ruby #{impl}"
|
||||||
sh "rvm #{impl} rake run"
|
sh ". rvm #{impl}; rake run"
|
||||||
results << [impl, "RAN"]
|
results << [impl, "RAN"]
|
||||||
puts
|
puts
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user