Skip to content

Commit

Permalink
Fix older Rubies and reenable coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
halostatue committed Jan 11, 2017
1 parent f993e14 commit a11b750
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 24 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ rvm:
- 2.2.6
- 2.1.9
- 2.0.0
- jruby-head
- 1.9.3
- 1.8.7
- ree
Expand Down
10 changes: 10 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@
# be accepted.

source "https://rubygems.org/"

if RUBY_VERSION < '1.9'
gem 'rdoc', '< 4.0'
elsif RUBY_VERSION >= '2.0'
if RUBY_ENGINE == 'ruby'
gem 'simplecov', '~> 0.7'
gem 'coveralls', '~> 0.7'
end
end

gemspec

# vim: syntax=ruby
36 changes: 13 additions & 23 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,29 @@ Hoe.plugin :travis
spec = Hoe.spec 'diff-lcs' do
developer('Austin Ziegler', 'halostatue@gmail.com')

self.need_tar = true
require_ruby_version '>= 1.8'

self.history_file = 'History.rdoc'
self.readme_file = 'README.rdoc'
self.extra_rdoc_files = FileList["*.rdoc"].to_a

%w(MIT Perl\ Artistic\ v2 GNU\ GPL\ v2).each { |l| self.license l }

self.extra_dev_deps << ['hoe-bundler', '~> 1.2']
self.extra_dev_deps << ['hoe-doofus', '~> 1.0']
self.extra_dev_deps << ['hoe-gemspec2', '~> 1.1']
self.extra_dev_deps << ['hoe-git', '~> 1.5']
self.extra_dev_deps << ['hoe-rubygems', '~> 1.0']
self.extra_dev_deps << ['hoe-travis', '~> 1.2']
self.extra_dev_deps << ['rake', '~> 10.0']
self.extra_dev_deps << ['rspec', '>= 2.0', '< 4.0']

if RUBY_VERSION >= '1.9' and (ENV['CI'] or ENV['TRAVIS'])
self.extra_dev_deps << ['simplecov', '~> 0.8']
self.extra_dev_deps << ['coveralls', '~> 0.7']
end
self.licenses = [ 'MIT', 'Perl Artistic v2', 'GNU GPL v2' ]

extra_dev_deps << ['hoe-doofus', '~> 1.0']
extra_dev_deps << ['hoe-gemspec2', '~> 1.1']
extra_dev_deps << ['hoe-git', '~> 1.6']
extra_dev_deps << ['hoe-rubygems', '~> 1.0']
extra_dev_deps << ['hoe-travis', '~> 1.2']
extra_dev_deps << ['rspec', '>= 2.0', '< 4']
extra_dev_deps << ['rake', '>= 10.0', '< 12']
extra_dev_deps << ['rdoc', '>= 0']
end

unless Rake::Task.task_defined? :test
task :test => :spec
Rake::Task['travis'].prerequisites.replace(%w(spec))
end

if RUBY_VERSION >= '1.9'
if RUBY_VERSION >= '2.0' && RUBY_ENGINE == 'ruby'
namespace :spec do
desc "Submit test coverage to Coveralls"
task :coveralls do
if ENV['CI'] or ENV['TRAVIS']
ENV['COVERALLS'] = 'yes'
Expand All @@ -54,7 +46,7 @@ if RUBY_VERSION >= '1.9'
end
end

desc "Runs test coverage. Only works Ruby 1.9+ and assumes 'simplecov' is installed."
desc "Runs test coverage. Only works Ruby 2.0+ and assumes 'simplecov' is installed."
task :coverage do
ENV['COVERAGE'] = 'yes'
Rake::Task['spec'].execute
Expand All @@ -63,5 +55,3 @@ if RUBY_VERSION >= '1.9'

# Rake::Task['travis'].prerequisites.replace(%w(spec:coveralls))
end

# vim: syntax=ruby

0 comments on commit a11b750

Please sign in to comment.