Skip to content

Commit

Permalink
Fix tests, remove old rails (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
artofhuman committed Jul 10, 2020
1 parent 7ff8dc8 commit 8914b0d
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 56 deletions.
6 changes: 2 additions & 4 deletions .travis.yml
Expand Up @@ -2,16 +2,14 @@ language: ruby
cache: bundler

gemfile:
- gemfiles/rails4.2.gemfile
- gemfiles/rails5.0.gemfile
- gemfiles/rails5.1.gemfile

before_script:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- bundle exec rake setup

script:
- bundle exec rake

rvm:
- 2.2.6
- 2.3.4
- 2.6.6
12 changes: 1 addition & 11 deletions Appraisals
@@ -1,17 +1,7 @@
# frozen_string_literal: true

appraise 'rails4.2' do
gem 'rails', '~> 4.2.0'
end

appraise 'rails5.0' do
gem 'rails', '~> 5.0.1'
gem 'inherited_resources', git: 'https://github.com/activeadmin/inherited_resources.git'
gem 'listen'
end

appraise 'rails5.1' do
gem 'rails', '~> 5.1.0'
gem 'inherited_resources', git: 'https://github.com/activeadmin/inherited_resources.git'
gem 'inherited_resources'
gem 'listen'
end
5 changes: 4 additions & 1 deletion Dockerfile
@@ -1,10 +1,11 @@
FROM ruby:2.3-slim
FROM ruby:2.7-slim

ENV PHANTOMJS_VERSION 1.9.8

RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
make \
curl \
gcc \
g++ \
libsqlite3-dev \
Expand All @@ -23,4 +24,6 @@ RUN \
mv /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/ /srv/var/phantomjs && \
ln -s /srv/var/phantomjs/bin/phantomjs /usr/bin/phantomjs

RUN curl -o- -L https://yarnpkg.com/install.sh | bash

WORKDIR /app
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -6,6 +6,7 @@ group :test do
gem 'pry-byebug'
gem 'puma'
gem 'therubyracer'
gem 'sassc'
end

gemspec
17 changes: 11 additions & 6 deletions Makefile
@@ -1,23 +1,28 @@
RUN := run --rm
RUN := run --rm --service-ports
DOCKER_COMPOSE_RUN := docker-compose $(RUN)

default: test

compose-bash:
bash:
${DOCKER_COMPOSE_RUN} app bash

rake:
bundle exec rake ${T}

test: appraisals
bundle exec appraisal rspec ${T}

appraisals: setup
bundle exec appraisal install

appraisals-generate:
bundle exec appraisal generate


setup:
gem install bundler --no-ri --no-rdoc
gem install bundler
bundle check || bundle install -j 2
bundle exec appraisal rake setup

down:
docker-compose down

clean:
rm -f Gemfile.lock
Expand Down
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -119,3 +119,10 @@ Available options see [here](https://github.com/justinfrench/formtastic#the-avai
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

## How run local example

make bash
make setup
cd spec/rails/rails-5.1.7/
BUNDLE_GEMFILE=/app/gemfiles/rails5.1.gemfile bundle exec rails s -b 0.0.0.0
2 changes: 1 addition & 1 deletion activeadmin_settings_cached.gemspec
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |s|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
s.require_paths = ['lib']

s.add_dependency 'activeadmin'
s.add_dependency 'activeadmin', '~> 1.0', '< 1.2.0'
s.add_dependency 'rails-settings-cached', '>= 0.5.3', '< 0.6.7'

s.add_development_dependency 'appraisal'
Expand Down
9 changes: 7 additions & 2 deletions docker-compose.yml
Expand Up @@ -5,8 +5,13 @@ services:
build: '.'
command: 'make test'
volumes:
- '.:/app'
- bundler-data:/usr/local/bundle/:cached
- .:/app:cached
- bundler-data:/usr/local/bundle/
- bin-data:/usr/local/bin/
ports:
- "3000:3000"


volumes:
bundler-data:
bin-data:
13 changes: 0 additions & 13 deletions gemfiles/rails4.2.gemfile

This file was deleted.

15 changes: 0 additions & 15 deletions gemfiles/rails5.0.gemfile

This file was deleted.

3 changes: 2 additions & 1 deletion gemfiles/rails5.1.gemfile
Expand Up @@ -3,13 +3,14 @@
source "https://rubygems.org"

gem "rails", "~> 5.1.0"
gem "inherited_resources", git: "https://github.com/activeadmin/inherited_resources.git"
gem "inherited_resources"
gem "listen"

group :test do
gem "pry-byebug"
gem "puma"
gem "therubyracer"
gem "sassc"
end

gemspec path: "../"
1 change: 1 addition & 0 deletions lib/activeadmin_settings_cached/model.rb
Expand Up @@ -127,6 +127,7 @@ def settings_model
attributes[:model_name]
end

# TODO: remove 4.1
def meth
if Rails.version >= '4.1.0'
:get_all
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Expand Up @@ -43,7 +43,7 @@

Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, {
js_errors: true,
js_errors: false,
timeout: 80,
debug: true,
:phantomjs_options => ['--debug=no', '--load-images=no']
Expand Down
1 change: 0 additions & 1 deletion tasks/test.rake
Expand Up @@ -13,7 +13,6 @@ task :setup do
--skip-gemfile
--skip-bundle
--skip-git
--skip-keeps
--skip-turbolinks
--skip-test-unit
--skip-spring
Expand Down

0 comments on commit 8914b0d

Please sign in to comment.