Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .env

This file was deleted.

11 changes: 9 additions & 2 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,22 @@ jobs:
name: reviewdog
runs-on: ubuntu-latest

strategy:
matrix:
ruby: ['3.0']

env:
RUBY_VERSION: ${{ matrix.ruby }}

steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
ruby-version: ${{ matrix.ruby }}
bundler-cache: true

- uses: reviewdog/action-setup@v1
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/specs_rails61.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ jobs:

strategy:
matrix:
ruby: ['3.2']
gemfile: ['rails61_activeadmin29', 'rails61_activeadmin']
ruby: ['3.0', '3.1']

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
RAILS_VERSION: 6.1.0

steps:
- name: Checkout repository
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/specs_rails70.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ jobs:

strategy:
matrix:
ruby: ['3.3']
gemfile: ['rails70_activeadmin']
ruby: ['3.1']

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
RAILS_VERSION: 7.0.0

steps:
- name: Checkout repository
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/specs_rails71.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ jobs:

strategy:
matrix:
ruby: ['3.2', '3.4']
gemfile: ['rails71_activeadmin']
ruby: ['3.2']

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
RAILS_VERSION: 7.1.0

steps:
- name: Checkout repository
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/specs_rails72.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ jobs:
strategy:
matrix:
ruby: ['3.2', '3.4']
gemfile: ['rails72_activeadmin']

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
RAILS_VERSION: 7.2.0

steps:
- name: Checkout repository
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/specs_rails80.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ jobs:

strategy:
matrix:
ruby: ['3.2', '3.4']
gemfile: ['rails80_activeadmin']
ruby: ['3.2', '3.3', '3.4']

env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
RAILS_VERSION: 8.0.0

steps:
- name: Checkout repository
Expand Down
4 changes: 1 addition & 3 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ inherit_from:

plugins:
- rubocop-capybara
- rubocop-packaging
- rubocop-performance
- rubocop-rails
- rubocop-rspec
- rubocop-rspec_rails

require:
- rubocop-packaging

AllCops:
Exclude:
- bin/*
Expand Down
1 change: 0 additions & 1 deletion .tool-versions

This file was deleted.

33 changes: 0 additions & 33 deletions Appraisals

This file was deleted.

35 changes: 20 additions & 15 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,32 @@
source 'https://rubygems.org'

if ENV['DEVEL'] == '1'
# for Docker dev
rails_ver = ENV.fetch('RAILS_VERSION')
gem 'rails', rails_ver

gem 'activeadmin', ENV.fetch('ACTIVEADMIN_VERSION')
gem 'activeadmin_quill_editor', path: './'
gem 'appraisal', '~> 2.4'

if rails_ver.start_with?('7.0')
gem 'concurrent-ruby', '1.3.4'
gem 'sqlite3', '~> 1.4'
else
gem 'sqlite3'
end
else
gemspec

gem 'sqlite3'
end

ruby_ver = ENV.fetch('RUBY_VERSION', '')
rails_ver = ENV.fetch('RAILS_VERSION', '')
activeadmin_ver = ENV.fetch('ACTIVEADMIN_VERSION', '')

rails = rails_ver.empty? ? ['rails'] : ['rails', "~> #{rails_ver}"]
gem(*rails)

activeadmin = activeadmin_ver.empty? ? ['activeadmin'] : ['activeadmin', "~> #{activeadmin_ver}"]
gem(*activeadmin)

ruby32 = Gem::Version.new(ruby_ver) >= Gem::Version.new('3.2')
rails72 = Gem::Version.new(rails_ver) >= Gem::Version.new('7.2')
sqlite3 = ruby32 || rails72 ? ['sqlite3'] : ['sqlite3', '~> 1.4']
gem(*sqlite3)

# NOTE: to avoid error: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger
gem 'concurrent-ruby', '1.3.4'

# Misc
gem 'bigdecimal'
gem 'csv'
gem 'mutex_m'
gem 'puma'
gem 'sassc'
Expand Down
50 changes: 24 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
include extra/.env

help:
@echo "Main targets: up / down / console / shell"
@echo "Main targets: build / specs / up / server / specs / shell"

# Docker commands
down:
docker compose down
# System commands

up:
docker compose up
build:
@rm -f Gemfile.lock spec/dummy/db/*.sqlite3
@docker compose -f extra/docker-compose.yml build

attach:
docker compose attach app
db_reset:
@docker compose -f extra/docker-compose.yml run --rm app bin/rails db:reset db:test:prepare

up_attach:
docker compose up -d && docker compose attach app
up: build db_reset
@docker compose -f extra/docker-compose.yml up

cleanup:
docker container rm -f activeadmin_quill_editor_app && docker image rm -f activeadmin_quill_editor-app
shell:
@docker compose -f extra/docker-compose.yml exec app bash

# Rails specific commands
console:
docker compose exec -e "PAGER=more" app bin/rails console
down:
@docker compose -f extra/docker-compose.yml down --volumes --rmi local --remove-orphans

routes:
docker compose exec app bin/rails routes
# App commands

specs:
docker compose exec app bin/rspec --fail-fast
console:
@docker compose -f extra/docker-compose.yml exec app bin/rails console

# Other commands
bundle:
docker compose exec app bundle
lint:
@docker compose -f extra/docker-compose.yml exec app bin/rubocop

shell:
docker compose exec -e "PAGER=more" app bash
server:
@docker compose -f extra/docker-compose.yml exec app bin/rails server -b 0.0.0.0 -p ${SERVER_PORT}

lint:
docker compose exec app bin/rubocop
specs:
@docker compose -f extra/docker-compose.yml exec app bin/rspec --fail-fast
45 changes: 1 addition & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,50 +117,7 @@ Some methods are provided for advanced use cases:

Project created by [Mattia Roccoberton](http://blocknot.es), thanks also to the good guys that opened issues and pull requests from time to time.

There 3 ways to interact with this project:

1) Using Docker:

```sh
# Run rails server on the dummy app (=> http://localhost:3000 to access to ActiveAdmin):
make up
# Enter in a Rails console (with the dummy app started):
make console
# Enter in a shell (with the dummy app started):
make shell
# Run the linter on the project (with the dummy app started):
make lint
# Run the test suite (with the dummy app started):
make specs
# Remove container and image:
make cleanup
# To try different versions of Ruby/Rails/ActiveAdmin edit docker-compose.yml
# For more commands please check the Makefile
```

2) Using Appraisal:

```sh
export RAILS_ENV=development
# Install dependencies
bin/appraisal
# Run server (or any command)
bin/appraisal rails s
# Or with specific versions
bin/appraisal rails71-activeadmin rails s
```

3) With a local setup:

```sh
# Dev setup (set the required envs)
source extra/dev_setup.sh
# Install dependencies
bundle
# Run server (or any command)
bin/rails s
# To try different versions of Rails/ActiveAdmin edit extra/dev_setup.sh
```
For development information please check [this document](extra/development.md).

## Do you like it? Star it!

Expand Down
11 changes: 11 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# frozen_string_literal: true

begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end

APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__)
load 'rails/tasks/engine.rake'

load 'rails/tasks/statistics.rake'

require 'bundler/gem_tasks'

begin
Expand Down
2 changes: 0 additions & 2 deletions activeadmin_quill_editor.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,4 @@ Gem::Specification.new do |spec|
spec.require_paths = ['lib']

spec.add_runtime_dependency 'activeadmin', '>= 2.9', '< 4' # rubocop:disable Gemspec/AddRuntimeDependency

spec.add_development_dependency 'appraisal', '~> 2.4' # rubocop:disable Gemspec/DevelopmentDependencies
end
29 changes: 0 additions & 29 deletions bin/appraisal

This file was deleted.

2 changes: 1 addition & 1 deletion bin/rails
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This command will automatically be run when you run "rails" with Rails gems
# installed from the root of your application.

ENV['RAILS_ENV'] ||= 'test'
ENV['RAILS_ENV'] ||= 'development'

ENGINE_ROOT = File.expand_path('..', __dir__)
ENGINE_PATH = File.expand_path('../lib/activeadmin/quill_editor/engine', __dir__)
Expand Down
25 changes: 0 additions & 25 deletions docker-compose.yml

This file was deleted.

Loading