Sha256: ae3b2aff53a694b84691469865463e1cb65b6ac919e7e51bff5c16c96e1012cf

Contents?: true

Size: 1.2 KB

Versions: 4

Compression:

Stored size: 1.2 KB

Contents

require 'rspec/core/rake_task'
require 'bundler/gem_tasks'

lib_folder = File.expand_path("../lib", __FILE__)

RUBIES = ['ruby-2.0.0-p643', 'ruby-2.1.5', 'ruby-2.2.1', 'ruby-2.3.0']

def spec_run_all
  RUBIES.each do |ruby_v|
    puts "\n  Using #{ruby_v}\n\n"
    command = "$rvm_path/wrappers/#{ruby_v}/rake summary"
    run command
  end
end

task :spec do
  case ARGV[1]
  when 'setup'
    spec_setup
  when 'run'
    spec_run_all if ARGV[2] == 'all'
  when nil
    run 'rspec spec'
  end
end

# Stubs
task :setup
task :run
task :all

def spec_setup
  RUBIES.each do |ruby_v|
    puts "Installing #{ruby_v}..."
    run "rvm install #{ruby_v}"
    path = "$rvm_path/wrappers/#{ruby_v}"
    run "#{path}/gem install bundler"
    run "#{path}/bundle install"
  end
end

#task all: [:cop, :run_all]

task :summary do
  run 'rspec spec/ -r ./.rspec_formatter.rb -f SimpleFormatter' rescue nil
end

#RSpec::Core::RakeTask.new(:spec)

task :default => :spec

task :console do |task|
  cmd = [ 'irb', "-r '#{lib_folder}/daru_lite.rb'" ]
  run *cmd
end

task :cop do |task|
  run 'rubocop' rescue nil
end

task :pry do |task|
  cmd = [ 'pry', "-r '#{lib_folder}/daru_lite.rb'" ]
  run *cmd
end

def run *cmd
  sh(cmd.join(" "))
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
daru_lite-0.1.3 Rakefile
daru_lite-0.1.2 Rakefile
daru_lite-0.1.1 Rakefile
daru_lite-0.1 Rakefile