Skip to content

Commit 28627ca

Browse files
committed
Better rake tasks for AppVeyor.
1 parent 4cfd9c7 commit 28627ca

File tree

3 files changed

+25
-5
lines changed

3 files changed

+25
-5
lines changed

Rakefile

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ Dir.glob('tasks/**/*.rake').each do |rakefile|
4242
end
4343

4444
def has_docker?
45-
system("docker version > /dev/null 2>&1")
46-
0 == $?.exitstatus
45+
system("docker version > /dev/null 2>&1 || boot2docker version > /dev/null 2>&1")
4746
end
4847

4948
if Concurrent.on_jruby?
@@ -181,7 +180,20 @@ begin
181180
'--tag ~notravis'
182181
end
183182

184-
task :ci => [:clean, :compile, :travis]
183+
RSpec::Core::RakeTask.new(:appveyor) do |t|
184+
t.rspec_opts = '--backtrace ' \
185+
'--tag ~unfinished ' \
186+
'--seed 1 ' \
187+
'--format documentation ' \
188+
'--tag ~notravis'
189+
end
190+
191+
if Concurrent.on_windows?
192+
task :ci => [:clean, :compile, :appveyor]
193+
else
194+
task :ci => [:clean, :compile, :travis]
195+
end
196+
185197
task :default => [:clean, :compile, :spec]
186198
rescue LoadError
187199
puts 'Error loading Rspec rake tasks, probably building the gem...'

lib/concurrent/utility/engine.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ def on_rbx?
1919
ruby_engine == 'rbx'
2020
end
2121

22+
def on_windows?
23+
!(RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/).nil?
24+
end
25+
2226
def ruby_engine
2327
defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'
2428
end

spec/spec_helper.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@
88
require 'simplecov'
99
require 'coveralls'
1010

11-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
11+
if ENV['TRAVIS']
12+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
1213
SimpleCov::Formatter::HTMLFormatter,
1314
Coveralls::SimpleCov::Formatter
14-
]
15+
]
16+
else
17+
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
18+
end
1519

1620
SimpleCov.start do
1721
project_name 'concurrent-ruby'

0 commit comments

Comments
 (0)