File tree Expand file tree Collapse file tree 20 files changed +149
-176
lines changed
Expand file tree Collapse file tree 20 files changed +149
-176
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -4,14 +4,12 @@ inherit_from:
44
55plugins :
66 - rubocop-capybara
7+ - rubocop-packaging
78 - rubocop-performance
89 - rubocop-rails
910 - rubocop-rspec
1011 - rubocop-rspec_rails
1112
12- require :
13- - rubocop-packaging
14-
1513AllCops :
1614 Exclude :
1715 - bin/*
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 33source 'https://rubygems.org'
44
55if ENV [ 'DEVEL' ] == '1'
6- # for Docker dev
7- rails_ver = ENV . fetch ( 'RAILS_VERSION' )
8- gem 'rails' , rails_ver
9-
10- gem 'activeadmin' , ENV . fetch ( 'ACTIVEADMIN_VERSION' )
116 gem 'activeadmin_quill_editor' , path : './'
12- gem 'appraisal' , '~> 2.4'
13-
14- if rails_ver . start_with? ( '7.0' )
15- gem 'concurrent-ruby' , '1.3.4'
16- gem 'sqlite3' , '~> 1.4'
17- else
18- gem 'sqlite3'
19- end
207else
218 gemspec
22-
23- gem 'sqlite3'
249end
2510
11+ ruby_ver = ENV . fetch ( 'RUBY_VERSION' , '' )
12+ rails_ver = ENV . fetch ( 'RAILS_VERSION' , '' )
13+ activeadmin_ver = ENV . fetch ( 'ACTIVEADMIN_VERSION' , '' )
14+
15+ rails = rails_ver . empty? ? [ 'rails' ] : [ 'rails' , "~> #{ rails_ver } " ]
16+ gem ( *rails )
17+
18+ activeadmin = activeadmin_ver . empty? ? [ 'activeadmin' ] : [ 'activeadmin' , "~> #{ activeadmin_ver } " ]
19+ gem ( *activeadmin )
20+
21+ ruby32 = Gem ::Version . new ( ruby_ver ) >= Gem ::Version . new ( '3.2' )
22+ rails72 = Gem ::Version . new ( rails_ver ) >= Gem ::Version . new ( '7.2' )
23+ sqlite3 = ruby32 || rails72 ? [ 'sqlite3' ] : [ 'sqlite3' , '~> 1.4' ]
24+ gem ( *sqlite3 )
25+
26+ # NOTE: to avoid error: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger
27+ gem 'concurrent-ruby' , '1.3.4'
28+
29+ # Misc
2630gem 'bigdecimal'
31+ gem 'csv'
2732gem 'mutex_m'
2833gem 'puma'
2934gem 'sassc'
Original file line number Diff line number Diff line change 1+ include extra/.env
2+
13help :
2- @echo " Main targets: up / down / console / shell"
4+ @echo " Main targets: build / specs / up / server / specs / shell"
35
46# Docker commands
5- down :
6- docker compose down
77
8- up :
9- docker compose up
8+ build :
9+ @rm -f Gemfile.lock spec/dummy/db/* .sqlite3
10+ @docker compose -f extra/docker-compose.yml build
1011
11- attach :
12- docker compose attach app
12+ db_reset :
13+ @ docker compose -f extra/docker-compose.yml run --rm app bin/rails db:reset db:test:prepare
1314
14- up_attach :
15- docker compose up -d && docker compose attach app
15+ up : build db_reset
16+ @ docker compose -f extra/ docker- compose.yml up
1617
1718cleanup :
18- docker container rm -f activeadmin_quill_editor_app && docker image rm -f activeadmin_quill_editor-app
19+ @ docker compose -f extra/ docker-compose.yml down --volumes --rmi local --remove-orphans
1920
20- # Rails specific commands
21- console :
22- docker compose exec -e " PAGER=more" app bin/rails console
21+ # App commands
2322
24- routes :
25- docker compose exec app bin/rails routes
23+ server :
24+ @docker compose -f extra/docker-compose.yml exec app bin/rails server -b 0.0.0.0 -p ${SERVER_PORT}
25+
26+ console :
27+ @docker compose -f extra/docker-compose.yml exec app bin/rails console
2628
2729specs :
28- docker compose exec app bin/rspec --fail-fast
30+ @ docker compose -f extra/docker-compose.yml exec app bin/rspec --fail-fast
2931
30- # Other commands
31- bundle :
32- docker compose exec app bundle
32+ lint :
33+ @docker compose -f extra/docker-compose.yml exec app bin/rubocop
3334
3435shell :
35- docker compose exec -e " PAGER=more" app bash
36-
37- lint :
38- docker compose exec app bin/rubocop
36+ @docker compose -f extra/docker-compose.yml exec app bash
Original file line number Diff line number Diff line change @@ -117,50 +117,7 @@ Some methods are provided for advanced use cases:
117117
118118Project created by [ Mattia Roccoberton] ( http://blocknot.es ) , thanks also to the good guys that opened issues and pull requests from time to time.
119119
120- There 3 ways to interact with this project:
121-
122- 1 ) Using Docker:
123-
124- ``` sh
125- # Run rails server on the dummy app (=> http://localhost:3000 to access to ActiveAdmin):
126- make up
127- # Enter in a Rails console (with the dummy app started):
128- make console
129- # Enter in a shell (with the dummy app started):
130- make shell
131- # Run the linter on the project (with the dummy app started):
132- make lint
133- # Run the test suite (with the dummy app started):
134- make specs
135- # Remove container and image:
136- make cleanup
137- # To try different versions of Ruby/Rails/ActiveAdmin edit docker-compose.yml
138- # For more commands please check the Makefile
139- ```
140-
141- 2 ) Using Appraisal:
142-
143- ``` sh
144- export RAILS_ENV=development
145- # Install dependencies
146- bin/appraisal
147- # Run server (or any command)
148- bin/appraisal rails s
149- # Or with specific versions
150- bin/appraisal rails71-activeadmin rails s
151- ```
152-
153- 3 ) With a local setup:
154-
155- ``` sh
156- # Dev setup (set the required envs)
157- source extra/dev_setup.sh
158- # Install dependencies
159- bundle
160- # Run server (or any command)
161- bin/rails s
162- # To try different versions of Rails/ActiveAdmin edit extra/dev_setup.sh
163- ```
120+ For development information please check [ this document] ( extra/development.md ) .
164121
165122## Do you like it? Star it!
166123
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3+ begin
4+ require 'bundler/setup'
5+ rescue LoadError
6+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7+ end
8+
9+ APP_RAKEFILE = File . expand_path ( "spec/dummy/Rakefile" , __dir__ )
10+ load 'rails/tasks/engine.rake'
11+
12+ load 'rails/tasks/statistics.rake'
13+
314require 'bundler/gem_tasks'
415
516begin
Original file line number Diff line number Diff line change 22# This command will automatically be run when you run "rails" with Rails gems
33# installed from the root of your application.
44
5- ENV [ 'RAILS_ENV' ] ||= 'test '
5+ ENV [ 'RAILS_ENV' ] ||= 'development '
66
77ENGINE_ROOT = File . expand_path ( '..' , __dir__ )
88ENGINE_PATH = File . expand_path ( '../lib/activeadmin/quill_editor/engine' , __dir__ )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ alias ls=' ls --color'
2+ alias ll=' ls -l'
3+ alias la=' ls -la'
You can’t perform that action at this time.
0 commit comments