Skip to content

Commit

Permalink
setup for ruby 1.9+ and jruby 1.7+
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Feb 22, 2019
1 parent 7948394 commit fc608e9
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 20 deletions.
65 changes: 56 additions & 9 deletions .travis.yml
@@ -1,14 +1,61 @@
---
language: ruby
cache: bundler
rvm:
- 2.3
- 2.4
- 2.5
script: bundle exec rake $TASK
env:
- TASK=test
gemfile: gemfiles/ruby-others
script: bundle exec rake default

matrix:
include:
- env: TASK=rubocop
rvm: 2.3

# ruby
- rvm: 1.9
gemfile: gemfiles/ruby-1.9
env:
- SKIP_RUBOCOP=true
- SKIP_SINGLECOV=true

- rvm: 2.0
gemfile: gemfiles/ruby-2.0
env: SKIP_RUBOCOP=true

- rvm: 2.1
env: SKIP_RUBOCOP=true

- rvm: 2.2
env: SKIP_RUBOCOP=true

- rvm: 2.3
env: SKIP_RUBOCOP=true

- rvm: 2.4
env: SKIP_RUBOCOP=true

- rvm: 2.5 # with rubocop

- rvm: 2.6
env: SKIP_RUBOCOP=true


# jruby
- rvm: jruby-1.7
gemfile: gemfiles/ruby-1.9
env:
- SKIP_RUBOCOP=true
- SKIP_SINGLECOV=true

- rvm: jruby-9.0
gemfile: gemfiles/ruby-2.0
env:
- SKIP_RUBOCOP=true
- SKIP_SINGLECOV=true

- rvm: jruby-9.1
env:
- SKIP_RUBOCOP=true
- SKIP_SINGLECOV=true

- rvm: jruby-9.2
env:
- SKIP_RUBOCOP=true
- SKIP_SINGLECOV=true

13 changes: 8 additions & 5 deletions Rakefile
Expand Up @@ -4,7 +4,7 @@
require "bundler/setup"
require "bundler/gem_tasks"
require "rake/testtask"
require "rubocop/rake_task"
require "rubocop/rake_task" unless ENV['SKIP_RUBOCOP']

# The extras that override the built-in methods need to be tested in isolation in order
# to prevent them to change also the behavior and the result of the built-in tests.
Expand Down Expand Up @@ -42,8 +42,11 @@ end

task :test => [:test_common, :test_extra_items, :test_extra_i18n, :test_extra_overflow, :test_extra_trim ]

RuboCop::RakeTask.new(:rubocop) do |t|
t.options = `git ls-files -z`.split("\x0") # limit rubocop to the files in the repo
if ENV['SKIP_RUBOCOP']
task :default => [:test]
else
RuboCop::RakeTask.new(:rubocop) do |t|
t.options = `git ls-files -z`.split("\x0") # limit rubocop to the files in the repo
end
task :default => [:test, :rubocop]
end

task :default => [:test, :rubocop]
2 changes: 1 addition & 1 deletion docs/how-to.md
Expand Up @@ -64,7 +64,7 @@ You can copy the comprehensive and annotated [pagy.rb](https://github.com/ddnexu

## Environment Assumptions

- ruby >= 2.3
- ruby 1.9+ or jruby 1.7+

### Out of the box assumptions

Expand Down
9 changes: 9 additions & 0 deletions gemfiles/ruby-1.9
@@ -0,0 +1,9 @@
source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

# test
gem 'rake', '~> 10.0'
gem 'minitest', '~> 5.0'
gem 'rack', '<= 1.14'
gem 'i18n', '0.8.5'
11 changes: 11 additions & 0 deletions gemfiles/ruby-2.0
@@ -0,0 +1,11 @@
source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

# test
gem 'rake', '~> 10.0'
gem 'minitest', '~> 5.0'
gem 'rack', '1.6.11'
gem 'i18n', '1.1.0'
gem 'single_cov', '~> 1.3.0' unless ENV['SKIP_SINGLECOV']

12 changes: 12 additions & 0 deletions gemfiles/ruby-others
@@ -0,0 +1,12 @@
source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }

# test
gem 'rake', '~> 10.0'
gem 'minitest', '~> 5.0'
gem 'rack'
gem 'i18n'
gem 'single_cov', '~> 1.3.0' unless ENV['SKIP_SINGLECOV']
gem 'rubocop', '~> 0.63.1' unless ENV['SKIP_RUBOCOP']

7 changes: 2 additions & 5 deletions pagy.gemspec
Expand Up @@ -8,12 +8,9 @@ Gem::Specification.new do |s|
s.authors = ['Domizio Demichelis']
s.email = ['dd.nexus@gmail.com']
s.summary = 'The Ultimate Pagination Ruby Gem'
s.description = 'Agnostic pagination in plain ruby: it works with any framework, ORM and DB type, with all kinds of collections, even pre-paginated, scopes, Arrays, JSON data... and just whatever you can count. Easy to use and customize, very fast and very light.'
s.description = 'Agnostic pagination in plain ruby: it works with any framework, ORM and DB type, with all kinds of collections, even pre-paginated, scopes, Arrays, JSON data... Easy, powerful, fast and light.'
s.homepage = 'https://github.com/ddnexus/pagy'
s.license = 'MIT'
s.files = `git ls-files -z`.split("\x0").select{|f| f.start_with?('lib', 'pagy.gemspec', 'LICENSE') }
s.required_ruby_version = '>= 2.3.0'

# remove after 1.0
s.post_install_message = "Pagy CHANGELOG: https://github.com/ddnexus/pagy/blob/master/CHANGELOG.md"
s.required_ruby_version = '>= 1.9' # rubocop:disable Gemspec/RequiredRubyVersion
end

0 comments on commit fc608e9

Please sign in to comment.