modulorails 0.2.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +14 -0
  3. data/.gitignore +3 -0
  4. data/.rubocop.yml +45 -0
  5. data/.travis.yml +23 -4
  6. data/Appraisals +18 -0
  7. data/CHANGELOG.md +41 -0
  8. data/Dockerfile.ruby25 +34 -0
  9. data/Dockerfile.ruby26 +28 -0
  10. data/Dockerfile.ruby27 +25 -0
  11. data/Dockerfile.ruby30 +25 -0
  12. data/Dockerfile.ruby31 +25 -0
  13. data/Gemfile.lock +60 -53
  14. data/README.md +16 -4
  15. data/Rakefile +1 -1
  16. data/app/assets/stylesheets/modulorails.css +21 -0
  17. data/app/helpers/modulorails/application_helper.rb +8 -0
  18. data/config/locales/en.yml +3 -0
  19. data/docker-compose.debug.yml +47 -0
  20. data/docker-compose.yml +37 -0
  21. data/entrypoints/appraisal_test.sh +7 -0
  22. data/gemfiles/rails_52.gemfile +9 -0
  23. data/gemfiles/rails_60.gemfile +9 -0
  24. data/gemfiles/rails_61.gemfile +9 -0
  25. data/gemfiles/rails_70.gemfile +9 -0
  26. data/lib/generators/modulorails/docker/docker_generator.rb +19 -0
  27. data/lib/generators/modulorails/docker/templates/Dockerfile.prod.tt +57 -0
  28. data/lib/generators/modulorails/docker/templates/Dockerfile.tt +26 -0
  29. data/lib/generators/modulorails/docker/templates/config/database.yml.tt +32 -0
  30. data/lib/generators/modulorails/docker/templates/docker-compose.prod.yml.tt +50 -0
  31. data/lib/generators/modulorails/docker/templates/docker-compose.yml.tt +71 -0
  32. data/lib/generators/modulorails/docker/templates/entrypoints/docker-entrypoint.sh.tt +20 -0
  33. data/lib/generators/modulorails/docker/templates/entrypoints/webpack-entrypoint.sh.tt +7 -0
  34. data/lib/generators/modulorails/gitlabci/gitlabci_generator.rb +34 -0
  35. data/lib/generators/modulorails/gitlabci/templates/.gitlab-ci.yml.tt +118 -0
  36. data/lib/generators/modulorails/gitlabci/templates/.modulorails-gitlab-ci +6 -0
  37. data/lib/generators/modulorails/gitlabci/templates/config/database-ci.yml.tt +8 -0
  38. data/lib/generators/modulorails/healthcheck/health_check_generator.rb +41 -0
  39. data/lib/generators/modulorails/healthcheck/templates/.modulorails-health_check +6 -0
  40. data/lib/generators/modulorails/healthcheck/templates/config/initializers/health_check.rb.tt +100 -0
  41. data/lib/generators/modulorails/rubocop/rubocop_generator.rb +24 -0
  42. data/lib/generators/modulorails/rubocop/templates/rubocop.yml.tt +18 -0
  43. data/lib/generators/modulorails/self_update/self_update_generator.rb +32 -0
  44. data/lib/generators/modulorails/service/service_generator.rb +13 -0
  45. data/lib/generators/modulorails/service/templates/service.rb.tt +28 -0
  46. data/lib/modulorails/configuration.rb +8 -2
  47. data/lib/modulorails/data.rb +21 -2
  48. data/lib/modulorails/error_data.rb +21 -0
  49. data/lib/modulorails/errors/base_error.rb +4 -0
  50. data/lib/modulorails/errors/errors.rb +3 -0
  51. data/lib/modulorails/errors/invalid_format_error.rb +14 -0
  52. data/lib/modulorails/errors/invalid_value_error.rb +14 -0
  53. data/lib/modulorails/railtie.rb +35 -3
  54. data/lib/modulorails/services/base_service.rb +203 -0
  55. data/lib/modulorails/services/logs_for_method_service.rb +42 -0
  56. data/lib/modulorails/services/services.rb +2 -0
  57. data/lib/modulorails/success_data.rb +17 -0
  58. data/lib/modulorails/validators/database_configuration.rb +9 -3
  59. data/lib/modulorails/version.rb +4 -1
  60. data/lib/modulorails.rb +46 -21
  61. data/modulorails.gemspec +4 -0
  62. metadata +114 -17
  63. data/lib/generators/gitlabci_generator.rb +0 -134
  64. data/lib/generators/templates/.gitlab-ci.yml +0 -72
  65. data/lib/generators/templates/.modulorails-gitlab-ci +0 -3
  66. data/lib/generators/templates/config/database-ci.yml +0 -7
  67. data/lib/modulorails/updater.rb +0 -42
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 265c1a8a801aa9cd51479b23756c2b2631e9ac0d6fbd7634ce2fa572e0489ac9
4
- data.tar.gz: 251ec334d918a84982b3573e0ad610dc28eca31b77250ea2305caa46c5792951
3
+ metadata.gz: 945b70ac74dba5edd9a3e6df1aae0f0244d4a4704487a070c82d0b46580a2285
4
+ data.tar.gz: 850fcbbf27e12f2b777f0c72deb15a249d84a46fa9dc993fca359dbe79481efe
5
5
  SHA512:
6
- metadata.gz: 3dc837963f657c14c3ee2541fc7778de4ead2d2cb8216feb8908897b3c26400331ea07020c348ee88d11167f02c52ef8334bf6a4e9934cdcf3f22951a51f31d3
7
- data.tar.gz: 724b94a6b281027be0e5c36a9d93b66e1c8207e24e31d165f10ca04bf828461f019f689c29c983f377145d589a5dc90069ad9dda8bc1633f51e1ad25a1e13653
6
+ metadata.gz: 43ef84405a627ebc3460428add66c7769b626a476c15b4e1e21234dc8ec3e4a03bade4d42bfea506965d1ee9192cfa12aa6b8271989005d0075c292faa951b25
7
+ data.tar.gz: b76c6a8fd2b32a745cac58298a751c4f120e7165ac3b5c13221dd11602475f4e3bf5aaa398106ef4f6a10e1c93c98e917373aea3c041114cf480820e91cae342
data/.dockerignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+ *.gem
13
+ gemfiles/*.lock
14
+ Gemfile.lock
data/.gitignore CHANGED
@@ -9,3 +9,6 @@
9
9
 
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
+ *.gem
13
+ gemfiles/*.lock
14
+ /config/database.yml
data/.rubocop.yml ADDED
@@ -0,0 +1,45 @@
1
+ # The behavior of RuboCop can be controlled via the .rubocop.yml
2
+ # configuration file. It makes it possible to enable/disable
3
+ # certain cops (checks) and to alter their behavior if they accept
4
+ # any parameters. The file can be placed either in your home
5
+ # directory or in some project directory.
6
+ #
7
+ # RuboCop will start looking for the configuration file in the directory
8
+ # where the inspected file is and continue its way up to the root directory.
9
+ #
10
+ # See https://docs.rubocop.org/rubocop/configuration
11
+
12
+ # Enabling Rails-specific cops.
13
+ require: rubocop-rails
14
+
15
+ AllCops:
16
+ # Disable all cops by default to ease the migration. This will probably be removed one day.
17
+ DisabledByDefault: true
18
+ # No suggestions since the gem is the sole truth for rubocop configuration.
19
+ SuggestExtensions: false
20
+
21
+ # Excluding most directories with generated files and directories with configuration files.
22
+ Exclude:
23
+ - 'vendor/**/*'
24
+ - 'db/**/*'
25
+ - 'tmp/**/*'
26
+ - 'bin/**/*'
27
+ - 'builds/**/*'
28
+ - 'Gemfile'
29
+ - 'config/environments/*'
30
+ - 'config/puma.rb'
31
+ - 'config/spring.rb'
32
+ - 'test/application_system_test_case.rb'
33
+ - 'test/test_helper.rb'
34
+ - 'config/initializers/*.rb'
35
+ - 'spec/spec_helper.rb'
36
+ - 'node_modules/**/*'
37
+ - 'spec/**/*'
38
+
39
+ # Instructing rubocop about all standard Modulotech environments.
40
+ Rails/UnknownEnv:
41
+ Environments:
42
+ - production
43
+ - development
44
+ - test
45
+ - staging
data/.travis.yml CHANGED
@@ -1,9 +1,28 @@
1
1
  ---
2
2
  language: ruby
3
3
  cache: bundler
4
- rvm:
5
- - 2.5
6
- - 2.6
7
- - 2.7
4
+
5
+ ruby:
6
+ - '2.5'
7
+ - '2.6'
8
+ - '2.7'
9
+ - '3.0'
10
+ - '3.1'
11
+
8
12
  before_install:
9
13
  - gem install bundler -v 2.1.4
14
+
15
+ gemfile:
16
+ - gemfiles/rails_52.gemfile
17
+ - gemfiles/rails_60.gemfile
18
+ - gemfiles/rails_61.gemfile
19
+ - gemfiles/rails_70.gemfile
20
+
21
+ matrix:
22
+ exclude:
23
+ - gemfile: gemfiles/rails_70.gemfile
24
+ ruby: 2.5
25
+ - gemfile: gemfiles/rails_70.gemfile
26
+ ruby: 2.6
27
+
28
+ script: bundle exec rake spec
data/Appraisals ADDED
@@ -0,0 +1,18 @@
1
+ appraise "rails-52" do
2
+ gem 'rails', '~> 5.2', '>= 5.2.6'
3
+ end
4
+
5
+ appraise "rails-60" do
6
+ gem 'rails', '~> 6.0', '>= 6.0.4.4'
7
+ end
8
+
9
+ appraise "rails-61" do
10
+ gem 'rails', '~> 6.1', '>= 6.1.4.4'
11
+ end
12
+
13
+ # Rails 7 requires at least Ruby 2.7
14
+ if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7')
15
+ appraise "rails-70" do
16
+ gem 'rails', '~> 7.0'
17
+ end
18
+ end
data/CHANGELOG.md CHANGED
@@ -2,6 +2,47 @@
2
2
 
3
3
  This file is used to list changes made in each version of the gem.
4
4
 
5
+ # 1.0.0
6
+
7
+ The Rubocop release.
8
+
9
+ - Add Modulorails helper `powered_by`.
10
+ - Add `Modulorails::BaseService`, `Modulorails::LogsForMethodService`,
11
+ `Modulorails::SuccessData` and `Modulorails::ErrorData`.
12
+ - Add Rubocop dependency with empty configuration.
13
+ - Ensure the compatibility of the gem with Ruby 3.0 and Ruby 3.1.
14
+
15
+ # 0.4.0
16
+
17
+ Fixes, updates and health_check release.
18
+
19
+ - Update generators for Docker and Gitlab CI.
20
+ - Move all generators under the `modulorails` namespace.
21
+ - Add dependency to `health_check` gem.
22
+ - Fix error on database configuration validator when no database.yml exists.
23
+ - Rescue if httparty can't post to configuration.endpoint.
24
+ - Add dockerfiles to test on many Ruby versions.
25
+ - Add appraisal to test on many Rails versions.
26
+
27
+ # 0.3.0
28
+
29
+ Docker release.
30
+
31
+ - Add generator for Docker.
32
+ - Use templates for Gitlabci generator.
33
+
34
+ # 0.2.3
35
+
36
+ Gitlab-ci generator.
37
+
38
+ - Fixes the Ruby version put in the generated `.gitlab-ci.yml`.
39
+
40
+ # 0.2.2
41
+
42
+ Auto-update fixes.
43
+
44
+ - Run `bundle install` to update the `Gemfile.lock` on auto-update.
45
+
5
46
  # 0.2.1
6
47
 
7
48
  Minor fixes.
data/Dockerfile.ruby25 ADDED
@@ -0,0 +1,34 @@
1
+ #
2
+ # BUILD IMAGE
3
+ #
4
+ FROM ruby:2.5-alpine
5
+
6
+ WORKDIR /app
7
+
8
+ RUN apk add --update --no-cache \
9
+ alpine-sdk \
10
+ tzdata
11
+
12
+ RUN gem install bundler
13
+
14
+ # Your RubyGems version (3.0.3)) has a bug that prevents `required_ruby_version` from working for
15
+ # Bundler. Any scripts that use `gem install bundler` will break as soon as Bundler drops support
16
+ # for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning
17
+ # by running `gem update --system 3.2.3`
18
+ RUN gem update --system 3.2.3
19
+
20
+ COPY . .
21
+
22
+ RUN bundle config set specific_platform true
23
+
24
+ # Ensure the use of a Gemfile working with Ruby 2.5
25
+ RUN sed -e 's/"..\/"/".\/"/' gemfiles/rails_52.gemfile > Gemfile
26
+
27
+ # Install the basic dependencies
28
+ RUN bundle install
29
+
30
+ # Install dependencies for all supported Rails versions
31
+ RUN bundle exec appraisal install
32
+
33
+ # Run the tests
34
+ CMD ['./entrypoints/appraisal_test.sh']
data/Dockerfile.ruby26 ADDED
@@ -0,0 +1,28 @@
1
+ #
2
+ # BUILD IMAGE
3
+ #
4
+ FROM ruby:2.6-alpine
5
+
6
+ WORKDIR /app
7
+
8
+ RUN apk add --update --no-cache \
9
+ alpine-sdk \
10
+ tzdata
11
+
12
+ RUN gem install bundler
13
+
14
+ COPY . .
15
+
16
+ RUN bundle config set specific_platform true
17
+
18
+ # Ensure the use of a Gemfile working with Ruby 2.6
19
+ RUN sed -e 's/"..\/"/".\/"/' gemfiles/rails_52.gemfile > Gemfile
20
+
21
+ # Install the basic dependencies
22
+ RUN bundle install
23
+
24
+ # Install dependencies for all supported Rails versions
25
+ RUN bundle exec appraisal install
26
+
27
+ # Run the tests
28
+ CMD ['./entrypoints/appraisal_test.sh']
data/Dockerfile.ruby27 ADDED
@@ -0,0 +1,25 @@
1
+ #
2
+ # BUILD IMAGE
3
+ #
4
+ FROM ruby:2.7-alpine
5
+
6
+ WORKDIR /app
7
+
8
+ RUN apk add --update --no-cache \
9
+ alpine-sdk \
10
+ tzdata
11
+
12
+ RUN gem install bundler
13
+
14
+ COPY . .
15
+
16
+ RUN bundle config set specific_platform true
17
+
18
+ # Install the basic dependencies
19
+ RUN bundle install
20
+
21
+ # Install dependencies for all supported Rails versions
22
+ RUN bundle exec appraisal install
23
+
24
+ # Run the tests
25
+ CMD ['./entrypoints/appraisal_test.sh']
data/Dockerfile.ruby30 ADDED
@@ -0,0 +1,25 @@
1
+ #
2
+ # BUILD IMAGE
3
+ #
4
+ FROM ruby:3.0-alpine
5
+
6
+ WORKDIR /app
7
+
8
+ RUN apk add --update --no-cache \
9
+ alpine-sdk \
10
+ tzdata
11
+
12
+ RUN gem install bundler
13
+
14
+ COPY . .
15
+
16
+ RUN bundle config set specific_platform true
17
+
18
+ # Install the basic dependencies
19
+ RUN bundle install
20
+
21
+ # Install dependencies for all supported Rails versions
22
+ RUN bundle exec appraisal install
23
+
24
+ # Run the tests
25
+ CMD ['./entrypoints/appraisal_test.sh']
data/Dockerfile.ruby31 ADDED
@@ -0,0 +1,25 @@
1
+ #
2
+ # BUILD IMAGE
3
+ #
4
+ FROM ruby:3.1-alpine
5
+
6
+ WORKDIR /app
7
+
8
+ RUN apk add --update --no-cache \
9
+ alpine-sdk \
10
+ tzdata
11
+
12
+ RUN gem install bundler
13
+
14
+ COPY . .
15
+
16
+ RUN bundle config set specific_platform true
17
+
18
+ # Install the basic dependencies
19
+ RUN bundle install
20
+
21
+ # Install dependencies for all supported Rails versions
22
+ RUN bundle exec appraisal install
23
+
24
+ # Run the tests
25
+ CMD ['./entrypoints/appraisal_test.sh']
data/Gemfile.lock CHANGED
@@ -1,8 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- modulorails (0.2.1)
4
+ modulorails (0.4.0)
5
5
  git (~> 1.7, >= 1.7.0)
6
+ health_check (~> 3.1)
6
7
  httparty
7
8
  i18n
8
9
  railties (>= 4.2.0)
@@ -10,97 +11,103 @@ PATH
10
11
  GEM
11
12
  remote: https://rubygems.org/
12
13
  specs:
13
- actionpack (6.0.3.2)
14
- actionview (= 6.0.3.2)
15
- activesupport (= 6.0.3.2)
16
- rack (~> 2.0, >= 2.0.8)
14
+ actionpack (7.0.0)
15
+ actionview (= 7.0.0)
16
+ activesupport (= 7.0.0)
17
+ rack (~> 2.0, >= 2.2.0)
17
18
  rack-test (>= 0.6.3)
18
19
  rails-dom-testing (~> 2.0)
19
20
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
20
- actionview (6.0.3.2)
21
- activesupport (= 6.0.3.2)
21
+ actionview (7.0.0)
22
+ activesupport (= 7.0.0)
22
23
  builder (~> 3.1)
23
24
  erubi (~> 1.4)
24
25
  rails-dom-testing (~> 2.0)
25
26
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
26
- activemodel (6.0.3.2)
27
- activesupport (= 6.0.3.2)
28
- activerecord (6.0.3.2)
29
- activemodel (= 6.0.3.2)
30
- activesupport (= 6.0.3.2)
31
- activesupport (6.0.3.2)
27
+ activemodel (7.0.0)
28
+ activesupport (= 7.0.0)
29
+ activerecord (7.0.0)
30
+ activemodel (= 7.0.0)
31
+ activesupport (= 7.0.0)
32
+ activesupport (7.0.0)
32
33
  concurrent-ruby (~> 1.0, >= 1.0.2)
33
- i18n (>= 0.7, < 2)
34
- minitest (~> 5.1)
35
- tzinfo (~> 1.1)
36
- zeitwerk (~> 2.2, >= 2.2.2)
34
+ i18n (>= 1.6, < 2)
35
+ minitest (>= 5.1)
36
+ tzinfo (~> 2.0)
37
+ appraisal (2.4.1)
38
+ bundler
39
+ rake
40
+ thor (>= 0.14.0)
37
41
  builder (3.2.4)
38
- concurrent-ruby (1.1.7)
42
+ concurrent-ruby (1.1.9)
39
43
  crass (1.0.6)
40
- diff-lcs (1.4.4)
44
+ diff-lcs (1.5.0)
41
45
  erubi (1.10.0)
42
- git (1.8.1)
46
+ git (1.10.2)
43
47
  rchardet (~> 1.8)
44
- httparty (0.18.1)
48
+ health_check (3.1.0)
49
+ railties (>= 5.0)
50
+ httparty (0.20.0)
45
51
  mime-types (~> 3.0)
46
52
  multi_xml (>= 0.5.2)
47
- i18n (1.8.5)
53
+ i18n (1.8.11)
48
54
  concurrent-ruby (~> 1.0)
49
- loofah (2.8.0)
55
+ loofah (2.13.0)
50
56
  crass (~> 1.0.2)
51
57
  nokogiri (>= 1.5.9)
52
58
  method_source (1.0.0)
53
- mime-types (3.3.1)
59
+ mime-types (3.4.1)
54
60
  mime-types-data (~> 3.2015)
55
- mime-types-data (3.2020.1104)
56
- mini_portile2 (2.4.0)
57
- minitest (5.14.1)
61
+ mime-types-data (3.2022.0105)
62
+ minitest (5.15.0)
58
63
  multi_xml (0.6.0)
59
- nokogiri (1.10.10)
60
- mini_portile2 (~> 2.4.0)
64
+ nokogiri (1.13.1-aarch64-linux)
65
+ racc (~> 1.4)
66
+ racc (1.6.0)
61
67
  rack (2.2.3)
62
68
  rack-test (1.1.0)
63
69
  rack (>= 1.0, < 3)
64
70
  rails-dom-testing (2.0.3)
65
71
  activesupport (>= 4.2.0)
66
72
  nokogiri (>= 1.6)
67
- rails-html-sanitizer (1.3.0)
73
+ rails-html-sanitizer (1.4.2)
68
74
  loofah (~> 2.3)
69
- railties (6.0.3.2)
70
- actionpack (= 6.0.3.2)
71
- activesupport (= 6.0.3.2)
75
+ railties (7.0.0)
76
+ actionpack (= 7.0.0)
77
+ activesupport (= 7.0.0)
72
78
  method_source
73
- rake (>= 0.8.7)
74
- thor (>= 0.20.3, < 2.0)
79
+ rake (>= 12.2)
80
+ thor (~> 1.0)
81
+ zeitwerk (~> 2.5)
75
82
  rake (12.3.3)
76
83
  rchardet (1.8.0)
77
- rspec (3.9.0)
78
- rspec-core (~> 3.9.0)
79
- rspec-expectations (~> 3.9.0)
80
- rspec-mocks (~> 3.9.0)
81
- rspec-core (3.9.2)
82
- rspec-support (~> 3.9.3)
83
- rspec-expectations (3.9.2)
84
+ rspec (3.10.0)
85
+ rspec-core (~> 3.10.0)
86
+ rspec-expectations (~> 3.10.0)
87
+ rspec-mocks (~> 3.10.0)
88
+ rspec-core (3.10.1)
89
+ rspec-support (~> 3.10.0)
90
+ rspec-expectations (3.10.1)
84
91
  diff-lcs (>= 1.2.0, < 2.0)
85
- rspec-support (~> 3.9.0)
86
- rspec-mocks (3.9.1)
92
+ rspec-support (~> 3.10.0)
93
+ rspec-mocks (3.10.2)
87
94
  diff-lcs (>= 1.2.0, < 2.0)
88
- rspec-support (~> 3.9.0)
89
- rspec-support (3.9.3)
90
- thor (1.0.1)
91
- thread_safe (0.3.6)
92
- tzinfo (1.2.7)
93
- thread_safe (~> 0.1)
94
- zeitwerk (2.4.0)
95
+ rspec-support (~> 3.10.0)
96
+ rspec-support (3.10.3)
97
+ thor (1.2.1)
98
+ tzinfo (2.0.4)
99
+ concurrent-ruby (~> 1.0)
100
+ zeitwerk (2.5.3)
95
101
 
96
102
  PLATFORMS
97
- ruby
103
+ aarch64-linux
98
104
 
99
105
  DEPENDENCIES
100
106
  activerecord (>= 4.2.0)
107
+ appraisal
101
108
  modulorails!
102
109
  rake (~> 12.0)
103
110
  rspec (~> 3.0)
104
111
 
105
112
  BUNDLED WITH
106
- 2.1.4
113
+ 2.3.3
data/README.md CHANGED
@@ -10,7 +10,7 @@ provides templates for the common configurations and defines common dependencies
10
10
  Add this line to your application's Gemfile:
11
11
 
12
12
  ```ruby
13
- gem 'modulorails', git: 'git://github.com/moduloTech/modulorails.git'
13
+ gem 'modulorails'
14
14
  ```
15
15
 
16
16
  And then execute:
@@ -33,9 +33,21 @@ end
33
33
 
34
34
  ## Development
35
35
 
36
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
37
-
38
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
36
+ There are tests in `spec`. To run tests:
37
+ - Build Docker images using `docker compose build`.
38
+ - You can run tests on all supported Ruby versions using `docker compose up`.
39
+ - Or you can run test on a specific Ruby version using one of the following commands:
40
+ - Ruby 2.5: `docker compose run ruby25`
41
+ - Ruby 2.6: `docker compose run ruby26`
42
+ - Ruby 2.7: `docker compose run ruby27`
43
+ - Ruby 3.0: `docker compose run ruby30`
44
+ - Ruby 3.1: `docker compose run ruby31`
45
+
46
+ [Appraisal](https://github.com/thoughtbot/appraisal) is used to test the gem against many supported Rails versions:
47
+ - Rails 5.2, 6.0 and 6.1 on Ruby 2.5 and 2.6.
48
+ - Rails 5.2, 6.0, 6.1 and 7.0 on Ruby 2.7, 3.0 and 3.1.
49
+
50
+ Travis CI is configured to automatically run tests in all supported Ruby versions and dependency sets after each push.
39
51
 
40
52
  ## Contributing
41
53
 
data/Rakefile CHANGED
@@ -3,4 +3,4 @@ require "rspec/core/rake_task"
3
3
 
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
- task :default => :spec
6
+ task default: :spec
@@ -0,0 +1,21 @@
1
+ /**
2
+ ** Modulorails style
3
+ **/
4
+ .modulolink {
5
+ text-decoration: none;
6
+ font-weight: 500;
7
+ color: #202D4C;
8
+ }
9
+
10
+ .modulolink span {
11
+ color: #FFCE19;
12
+ }
13
+
14
+ .modulolink:hover {
15
+ color: #374D82;
16
+ text-decoration: none;
17
+ }
18
+
19
+ .modulolink:hover span {
20
+ color: #FFCB0C;
21
+ }
@@ -0,0 +1,8 @@
1
+ # @author Matthieu CIAPPARA <ciappa_m@modulotech.fr>
2
+ module Modulorails::ApplicationHelper
3
+ def powered_by
4
+ link_to('https://www.modulotech.fr/', target: '_blank', class: 'modulolink') do
5
+ raw("Powered by modulo<span>Tech</span>")
6
+ end
7
+ end
8
+ end
@@ -14,3 +14,6 @@ en:
14
14
  configurable_password: Password is not configurable for test environment
15
15
  configurable_database: Database name is not configurable for test environment
16
16
  configurable_port: Port is not configurable for test environment
17
+ errors:
18
+ invalid_format: Invalid format for field %{field}
19
+ invalid_value: Invalid value for field %{field}
@@ -0,0 +1,47 @@
1
+ version: '3.7'
2
+
3
+ services:
4
+ ruby25:
5
+ image: modulotechgroup/modulorails:testruby25
6
+ volumes:
7
+ - .:/app
8
+ build:
9
+ context: .
10
+ dockerfile: Dockerfile.ruby25
11
+ command: ./entrypoints/appraisal_test.sh
12
+
13
+ ruby26:
14
+ image: modulotechgroup/modulorails:testruby26
15
+ volumes:
16
+ - .:/app
17
+ build:
18
+ context: .
19
+ dockerfile: Dockerfile.ruby26
20
+ command: ./entrypoints/appraisal_test.sh
21
+
22
+ ruby27:
23
+ image: modulotechgroup/modulorails:testruby27
24
+ volumes:
25
+ - .:/app
26
+ build:
27
+ context: .
28
+ dockerfile: Dockerfile.ruby27
29
+ command: ./entrypoints/appraisal_test.sh
30
+
31
+ ruby30:
32
+ image: modulotechgroup/modulorails:testruby30
33
+ volumes:
34
+ - .:/app
35
+ build:
36
+ context: .
37
+ dockerfile: Dockerfile.ruby30
38
+ command: ./entrypoints/appraisal_test.sh
39
+
40
+ ruby31:
41
+ image: modulotechgroup/modulorails:testruby31
42
+ volumes:
43
+ - .:/app
44
+ build:
45
+ context: .
46
+ dockerfile: Dockerfile.ruby31
47
+ command: ./entrypoints/appraisal_test.sh
@@ -0,0 +1,37 @@
1
+ version: '3.7'
2
+
3
+ services:
4
+ ruby25:
5
+ image: modulotechgroup/modulorails:testruby25
6
+ build:
7
+ context: .
8
+ dockerfile: Dockerfile.ruby25
9
+ command: ./entrypoints/appraisal_test.sh
10
+
11
+ ruby26:
12
+ image: modulotechgroup/modulorails:testruby26
13
+ build:
14
+ context: .
15
+ dockerfile: Dockerfile.ruby26
16
+ command: ./entrypoints/appraisal_test.sh
17
+
18
+ ruby27:
19
+ image: modulotechgroup/modulorails:testruby27
20
+ build:
21
+ context: .
22
+ dockerfile: Dockerfile.ruby27
23
+ command: ./entrypoints/appraisal_test.sh
24
+
25
+ ruby30:
26
+ image: modulotechgroup/modulorails:testruby30
27
+ build:
28
+ context: .
29
+ dockerfile: Dockerfile.ruby30
30
+ command: ./entrypoints/appraisal_test.sh
31
+
32
+ ruby31:
33
+ image: modulotechgroup/modulorails:testruby31
34
+ build:
35
+ context: .
36
+ dockerfile: Dockerfile.ruby31
37
+ command: ./entrypoints/appraisal_test.sh
@@ -0,0 +1,7 @@
1
+ #!/bin/sh
2
+
3
+ # Exit immediately if a command exits with a non-zero status
4
+ set -e
5
+
6
+ # Launch the tests
7
+ bundle exec appraisal rake spec
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "rake", "~> 12.0"
6
+ gem "rspec", "~> 3.0"
7
+ gem "rails", "~> 5.2", ">= 5.2.6"
8
+
9
+ gemspec path: "../"