base_editing_bootstrap 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f935f929fda6d975ddd3d969fe03d639e0c523a19824733227bec64865e982e
4
- data.tar.gz: 12448bdc9765b31fe9660d9116092cd5ff3e61bd160b8d0cfc0d699b56a85212
3
+ metadata.gz: 7468c063d06ad4be7aea4786ffe79b06e7aea328286d1f3db23a9c8155e16112
4
+ data.tar.gz: 495f2835ef4de6c905cf39b8ed886d1187231dd566d3e005437c951f8fb6723c
5
5
  SHA512:
6
- metadata.gz: f86e276eb409edff874465dfdea52e44f581d5db4ab47d0d44bd33f0b7b24c0a871125f4807371eb0f199b5bf8a56edd6768f1787d66f8fae314e4d77fc1b16b
7
- data.tar.gz: cbb77961f4f3df339a474472a6669039505ffbe2e31aa37abea4a7eae02481ea02e459f2f47fe0e802a6ef579d4bbcb81c3058c84ad9e12636462b3a28617f22
6
+ metadata.gz: 31e7c1be7578adc8f78cd3f10f2b09a0f66f359eb6a62719857f76bddbcf53e77d321835b0a060ed161df0d1182f87d279b2e19bcafe5cb25d4b7b612e92a771
7
+ data.tar.gz: 1fdd1a212e2be5888561827980fc74d2c3916b7ef6210fc7cc541d5ee2d436c6f6bf320eb4ea570043869a084ec8d43bd2a4341c2f5ddd47523971ff235df7fd
data/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
  All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
3
3
 
4
4
  - - -
5
+ ## 0.3.0 - 2024-04-27
6
+ #### Bug Fixes
7
+ - Remove files from gem - (660cb3d) - Marino Bonetti
8
+ #### Documentation
9
+ - Update documentation - (42472ff) - Marino Bonetti
10
+ - Add documentation for spec helper - (170dd5a) - Marino Bonetti
11
+ #### Features
12
+ - Add configurations to change redirect after edit/create - (f8f3048) - Marino Bonetti
13
+ #### Refactoring
14
+ - Gem dependency organization - (7fb8caf) - Marino Bonetti
15
+ - Gem dependency organization - (f997fd9) - Marino Bonetti
16
+ #### Tests
17
+ - Aggiunta test per controllo redirect post success o update - (4c28e38) - Marino Bonetti
18
+ - Add Seed for generating multiple post in dummy - (bcbe986) - Marino Bonetti
19
+
20
+ - - -
21
+
5
22
  ## 0.2.0 - 2024-04-23
6
23
  #### Documentation
7
24
  - Add documntation for installation - (b528daa) - Marino Bonetti
data/README.md CHANGED
@@ -53,6 +53,19 @@ E' possibile configurare BaseEditingBootstrap con alcune impostazioni:
53
53
  # tutti i controller sottostanti
54
54
  # @default "ApplicationController"
55
55
  # config.inherited_controller = 'ApplicationController'
56
+
57
+ ##
58
+ # Configurazione per alterare lo standard di azione post aggiornamento record
59
+ # il default è andare nella pagina di editing del record
60
+ # possibili valori :edit , :index
61
+ # config_accessor :after_success_update_redirect, default: :edit
62
+
63
+ ##
64
+ # Configurazione per alterare lo standard di azione post creazione record
65
+ # il default è andare nella pagina di editing del record
66
+ # possibili valori :edit , :index
67
+ # config_accessor :after_success_create_redirect, default: :edit
68
+
56
69
  end
57
70
 
58
71
  ```
@@ -64,6 +77,13 @@ Utilizzo per modello base, in questo esempio prendiamo come modello Post come es
64
77
  ```ruby
65
78
  include BaseEditingBootstrap::BaseModel
66
79
  ```
80
+ - La factory nelle spec deve contenere il trait `with_invalid_attributes` per definire la situazione di dati per record
81
+ non valido. ES:
82
+ ```ruby
83
+ trait :with_invalid_attributes do
84
+ name {nil} # name dovrebbe essere obbligatorio nel modello
85
+ end
86
+ ```
67
87
  - Creare Controller:
68
88
  ```ruby
69
89
  class PostsController < BaseEditingController
@@ -186,7 +186,13 @@ class BaseEditingController < RestrictedAreaController
186
186
 
187
187
  def _successful_create(format)
188
188
  format.all do
189
- redirect_to edit_custom_polymorphic_path(@object),
189
+ path = case BaseEditingBootstrap.after_success_create_redirect
190
+ when :index
191
+ index_custom_polymorphic_path(@object.class)
192
+ else
193
+ edit_custom_polymorphic_path(@object)
194
+ end
195
+ redirect_to path,
190
196
  status: :see_other,
191
197
  notice: t('activerecord.successful.messages.created', model: base_class.model_name.human)
192
198
  end
@@ -201,7 +207,13 @@ class BaseEditingController < RestrictedAreaController
201
207
 
202
208
  def _successful_update(format)
203
209
  format.all do
204
- redirect_to edit_custom_polymorphic_path(@object),
210
+ path = case BaseEditingBootstrap.after_success_update_redirect
211
+ when :index
212
+ index_custom_polymorphic_path(@object.class)
213
+ else
214
+ edit_custom_polymorphic_path(@object)
215
+ end
216
+ redirect_to path,
205
217
  status: :see_other,
206
218
  notice: t('activerecord.successful.messages.updated', model: base_class.model_name.human)
207
219
  end
@@ -20,20 +20,35 @@ Gem::Specification.new do |spec|
20
20
  spec.files = Dir.chdir(__dir__) do
21
21
  `git ls-files -z`.split("\x0").reject do |f|
22
22
  (File.expand_path(f) == __FILE__) ||
23
- f.start_with?(*%w[bin/ test/ spec/ features/ .git .gitlab-ci.yml appveyor Gemfile])
23
+ f.start_with?(*[
24
+ "bin/", "test/", "spec/", "features/",
25
+ ".git", ".gitlab-ci.yml", "appveyor", "Gemfile",
26
+ "cog.toml", "docker-compose.yml", "Dockerfile",
27
+ ".rspec", ".rubocop.yml"
28
+ ])
24
29
  end
25
30
  end
26
31
  spec.files += Dir['spec/support/external_shared/*.rb']
27
32
 
28
- spec.add_dependency "rails", ">= 7.0"
29
- spec.add_dependency "pundit", ">= 2.3.1"
30
-
33
+ spec.add_dependency "rails", [">= 7.0", "< 8.0"]
34
+ # Policy
35
+ spec.add_dependency "pundit", ["~> 2.3", ">= 2.3.1"]
31
36
  # Search
32
- spec.add_dependency 'ransack', '>= 4.0.0'
37
+ spec.add_dependency 'ransack', ['~> 4.0', '>= 4.0.0']
33
38
  # Pagination
34
- spec.add_dependency 'kaminari', '>= 1.2.2'
39
+ spec.add_dependency 'kaminari', ['~> 1.2', '>= 1.2.2']
35
40
 
36
- spec.add_development_dependency "rspec-rails"
37
- spec.add_development_dependency "factory_bot_rails"
41
+ spec.add_development_dependency "rspec-rails", '~> 6.0'
42
+ spec.add_development_dependency "factory_bot_rails", '~> 6.4'
43
+ spec.add_development_dependency 'faker'
44
+ spec.add_development_dependency "puma"
45
+ spec.add_development_dependency "sqlite3"
46
+ spec.add_development_dependency "sprockets-rails"
47
+ spec.add_development_dependency 'rails-i18n', '~> 7.0.0' # For 7.0.0
48
+ spec.add_development_dependency "i18n-debug"
49
+ spec.add_development_dependency "cssbundling-rails"
50
+ spec.add_development_dependency "rspec-parameterized", ">= 1.0.0" # https://github.com/tomykaira/rspec-parameterized
51
+ spec.add_development_dependency 'rspec-html-matchers' # https://github.com/kucaahbe/rspec-html-matchers
52
+ spec.add_development_dependency 'rails-controller-testing'
38
53
 
39
54
  end
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.3.0
@@ -21,6 +21,18 @@ module BaseEditingBootstrap
21
21
  # tutti i controller sottostanti
22
22
  # @default "ApplicationController"
23
23
  config_accessor :inherited_controller, default: "ApplicationController"
24
+
25
+ ##
26
+ # Configurazione per alterare lo standard di azione post aggiornamento record
27
+ # il default è andare nella pagina di editing del record
28
+ # possibili valori :edit , :index
29
+ config_accessor :after_success_update_redirect, default: :edit
30
+
31
+ ##
32
+ # Configurazione per alterare lo standard di azione post creazione record
33
+ # il default è andare nella pagina di editing del record
34
+ # possibili valori :edit , :index
35
+ config_accessor :after_success_create_redirect, default: :edit
24
36
 
25
37
  def self.deprecator
26
38
  @deprecator ||= ActiveSupport::Deprecation.new("1.0", "BaseEditingBootstrap")
@@ -10,6 +10,32 @@ end
10
10
  ##
11
11
  # Helper per testare controller derivanti da base editing
12
12
  # only e except servono per filtrare o escludere determinate actions
13
+ # @!attribute factory [Symbol] -> nome della factory da usare per il modello
14
+ # @!attribute only [Array[Symbol]] -> nome delle sole action da controllare
15
+ # - delete
16
+ # - create
17
+ # - update
18
+ # - edit
19
+ # - new
20
+ # - index
21
+ # @!attribute expect [Array[Symbol]] -> nome delle action da non controllare
22
+ # @!attribute skip_invalid_checks [Boolean] -> se serve saltare il check delle azioni con dati non validi
23
+ #
24
+ # Sono poi disponibili diversi let per poter fare l'override arbitrario degli url,
25
+ # tutti abbastanza auto-descrittivi
26
+ #
27
+ # :url_for_new
28
+ # :url_for_index
29
+ # :url_for_create
30
+ # :url_for_succ_delete
31
+ # :url_for_fail_delete
32
+ # :url_for_edit -> Rispetto agli altri questo risulta essere pià complicato in quanto
33
+ # deve ritornare una proc a cui passiamo il valore dell'istanza persistente
34
+ # che nei casi del after create non abbiamo a priori.
35
+ # :url_for_unauthorized
36
+ # :url_for_update
37
+ #
38
+ #
13
39
  RSpec.shared_examples "base editing controller" do |factory: nil, only: [], except: [], skip_invalid_checks: false|
14
40
  if factory
15
41
  let(:inside_factory) { factory }
@@ -28,7 +54,9 @@ RSpec.shared_examples "base editing controller" do |factory: nil, only: [], exce
28
54
  let(:url_for_create) { url_for(model.new) }
29
55
  let(:url_for_succ_delete) { url_for(model) }
30
56
  let(:url_for_fail_delete) { url_for_succ_delete }
31
- let(:url_for_edit) { url_for([persisted_instance, action: :edit]) }
57
+ let(:url_for_edit) { ->(p = persisted_instance) {
58
+ url_for([p, action: :edit])
59
+ } }
32
60
  let(:url_for_update) { url_for(persisted_instance) }
33
61
  ## non sempre abbiamo l'index nelle action disponibili, dobbiamo quindi avere modo di eseguire un override
34
62
  let(:url_for_unauthorized) { url_for_index }
@@ -79,7 +107,7 @@ RSpec.shared_examples "base editing controller" do |factory: nil, only: [], exce
79
107
  if check_if_should_execute(only, except, :edit)
80
108
  describe "edit" do
81
109
  it "response" do
82
- get url_for_edit
110
+ get url_for_edit.call
83
111
  expect(response).to have_http_status(:ok)
84
112
  expect(assigns[:object]).to be_an_instance_of(model)
85
113
  end
@@ -92,6 +120,13 @@ RSpec.shared_examples "base editing controller" do |factory: nil, only: [], exce
92
120
  put url_for_update, params: {param_key => valid_attributes}
93
121
  expect(assigns[:object]).to be_an_instance_of(model)
94
122
  expect(response).to have_http_status(:see_other)
123
+ case BaseEditingBootstrap.after_success_update_redirect
124
+ when :index
125
+ expect(response).to redirect_to(url_for_index)
126
+ else
127
+ # edit
128
+ expect(response).to redirect_to(url_for_edit.call(assigns[:object]))
129
+ end
95
130
  end
96
131
 
97
132
  unless skip_invalid_checks
@@ -109,6 +144,13 @@ RSpec.shared_examples "base editing controller" do |factory: nil, only: [], exce
109
144
  post url_for_create, params: {param_key => valid_attributes}
110
145
  expect(assigns[:object]).to be_an_instance_of(model)
111
146
  expect(response).to have_http_status(:see_other)
147
+ case BaseEditingBootstrap.after_success_create_redirect
148
+ when :index
149
+ expect(response).to redirect_to(url_for_index)
150
+ else
151
+ # edit
152
+ expect(response).to redirect_to(url_for_edit.call(assigns[:object]))
153
+ end
112
154
  end
113
155
 
114
156
  unless skip_invalid_checks
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: base_editing_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marino Bonetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-23 00:00:00.000000000 Z
11
+ date: 2024-04-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '7.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '8.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,10 +27,16 @@ dependencies:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '7.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '8.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: pundit
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.3'
31
40
  - - ">="
32
41
  - !ruby/object:Gem::Version
33
42
  version: 2.3.1
@@ -35,6 +44,9 @@ dependencies:
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '2.3'
38
50
  - - ">="
39
51
  - !ruby/object:Gem::Version
40
52
  version: 2.3.1
@@ -42,6 +54,9 @@ dependencies:
42
54
  name: ransack
43
55
  requirement: !ruby/object:Gem::Requirement
44
56
  requirements:
57
+ - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '4.0'
45
60
  - - ">="
46
61
  - !ruby/object:Gem::Version
47
62
  version: 4.0.0
@@ -49,6 +64,9 @@ dependencies:
49
64
  prerelease: false
50
65
  version_requirements: !ruby/object:Gem::Requirement
51
66
  requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '4.0'
52
70
  - - ">="
53
71
  - !ruby/object:Gem::Version
54
72
  version: 4.0.0
@@ -56,6 +74,9 @@ dependencies:
56
74
  name: kaminari
57
75
  requirement: !ruby/object:Gem::Requirement
58
76
  requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: '1.2'
59
80
  - - ">="
60
81
  - !ruby/object:Gem::Version
61
82
  version: 1.2.2
@@ -63,11 +84,42 @@ dependencies:
63
84
  prerelease: false
64
85
  version_requirements: !ruby/object:Gem::Requirement
65
86
  requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '1.2'
66
90
  - - ">="
67
91
  - !ruby/object:Gem::Version
68
92
  version: 1.2.2
69
93
  - !ruby/object:Gem::Dependency
70
94
  name: rspec-rails
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '6.0'
100
+ type: :development
101
+ prerelease: false
102
+ version_requirements: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - "~>"
105
+ - !ruby/object:Gem::Version
106
+ version: '6.0'
107
+ - !ruby/object:Gem::Dependency
108
+ name: factory_bot_rails
109
+ requirement: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - "~>"
112
+ - !ruby/object:Gem::Version
113
+ version: '6.4'
114
+ type: :development
115
+ prerelease: false
116
+ version_requirements: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - "~>"
119
+ - !ruby/object:Gem::Version
120
+ version: '6.4'
121
+ - !ruby/object:Gem::Dependency
122
+ name: faker
71
123
  requirement: !ruby/object:Gem::Requirement
72
124
  requirements:
73
125
  - - ">="
@@ -81,7 +133,119 @@ dependencies:
81
133
  - !ruby/object:Gem::Version
82
134
  version: '0'
83
135
  - !ruby/object:Gem::Dependency
84
- name: factory_bot_rails
136
+ name: puma
137
+ requirement: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ type: :development
143
+ prerelease: false
144
+ version_requirements: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ version: '0'
149
+ - !ruby/object:Gem::Dependency
150
+ name: sqlite3
151
+ requirement: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - ">="
154
+ - !ruby/object:Gem::Version
155
+ version: '0'
156
+ type: :development
157
+ prerelease: false
158
+ version_requirements: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: '0'
163
+ - !ruby/object:Gem::Dependency
164
+ name: sprockets-rails
165
+ requirement: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - ">="
168
+ - !ruby/object:Gem::Version
169
+ version: '0'
170
+ type: :development
171
+ prerelease: false
172
+ version_requirements: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - ">="
175
+ - !ruby/object:Gem::Version
176
+ version: '0'
177
+ - !ruby/object:Gem::Dependency
178
+ name: rails-i18n
179
+ requirement: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - "~>"
182
+ - !ruby/object:Gem::Version
183
+ version: 7.0.0
184
+ type: :development
185
+ prerelease: false
186
+ version_requirements: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - "~>"
189
+ - !ruby/object:Gem::Version
190
+ version: 7.0.0
191
+ - !ruby/object:Gem::Dependency
192
+ name: i18n-debug
193
+ requirement: !ruby/object:Gem::Requirement
194
+ requirements:
195
+ - - ">="
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
198
+ type: :development
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ requirements:
202
+ - - ">="
203
+ - !ruby/object:Gem::Version
204
+ version: '0'
205
+ - !ruby/object:Gem::Dependency
206
+ name: cssbundling-rails
207
+ requirement: !ruby/object:Gem::Requirement
208
+ requirements:
209
+ - - ">="
210
+ - !ruby/object:Gem::Version
211
+ version: '0'
212
+ type: :development
213
+ prerelease: false
214
+ version_requirements: !ruby/object:Gem::Requirement
215
+ requirements:
216
+ - - ">="
217
+ - !ruby/object:Gem::Version
218
+ version: '0'
219
+ - !ruby/object:Gem::Dependency
220
+ name: rspec-parameterized
221
+ requirement: !ruby/object:Gem::Requirement
222
+ requirements:
223
+ - - ">="
224
+ - !ruby/object:Gem::Version
225
+ version: 1.0.0
226
+ type: :development
227
+ prerelease: false
228
+ version_requirements: !ruby/object:Gem::Requirement
229
+ requirements:
230
+ - - ">="
231
+ - !ruby/object:Gem::Version
232
+ version: 1.0.0
233
+ - !ruby/object:Gem::Dependency
234
+ name: rspec-html-matchers
235
+ requirement: !ruby/object:Gem::Requirement
236
+ requirements:
237
+ - - ">="
238
+ - !ruby/object:Gem::Version
239
+ version: '0'
240
+ type: :development
241
+ prerelease: false
242
+ version_requirements: !ruby/object:Gem::Requirement
243
+ requirements:
244
+ - - ">="
245
+ - !ruby/object:Gem::Version
246
+ version: '0'
247
+ - !ruby/object:Gem::Dependency
248
+ name: rails-controller-testing
85
249
  requirement: !ruby/object:Gem::Requirement
86
250
  requirements:
87
251
  - - ">="
@@ -101,11 +265,8 @@ executables: []
101
265
  extensions: []
102
266
  extra_rdoc_files: []
103
267
  files:
104
- - ".rspec"
105
- - ".rubocop.yml"
106
268
  - CHANGELOG.md
107
269
  - CODE_OF_CONDUCT.md
108
- - Dockerfile
109
270
  - LICENSE.txt
110
271
  - MIT-LICENSE
111
272
  - README.md
@@ -167,11 +328,9 @@ files:
167
328
  - app/views/kaminari/_paginator.html.erb
168
329
  - app/views/kaminari/_prev_page.html.erb
169
330
  - base_editing_bootstrap.gemspec
170
- - cog.toml
171
331
  - config/initializers/base_field_error_proc.rb
172
332
  - config/locales/it.yml
173
333
  - config/routes.rb
174
- - docker-compose.yml
175
334
  - lib/base_editing_bootstrap.rb
176
335
  - lib/base_editing_bootstrap/VERSION
177
336
  - lib/base_editing_bootstrap/base_model.rb
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require rails_helper
data/.rubocop.yml DELETED
@@ -1,13 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 3.0
3
-
4
- Style/StringLiterals:
5
- Enabled: true
6
- EnforcedStyle: double_quotes
7
-
8
- Style/StringLiteralsInInterpolation:
9
- Enabled: true
10
- EnforcedStyle: double_quotes
11
-
12
- Layout/LineLength:
13
- Max: 120
data/Dockerfile DELETED
@@ -1,57 +0,0 @@
1
- # syntax = docker/dockerfile:1
2
-
3
- # Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
4
- ARG RUBY_VERSION=3.3.0
5
- FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
6
-
7
- # Rails app lives here
8
- WORKDIR /app
9
-
10
- # Set production environment
11
- ENV RAILS_ENV="production"
12
-
13
-
14
- # Throw-away build stage to reduce size of final image
15
- FROM base as build_dev_image
16
-
17
- # Install packages needed to build gems and node modules
18
- RUN apt-get update -qq && \
19
- apt-get install --no-install-recommends -y build-essential curl git libvips node-gyp pkg-config python-is-python3
20
-
21
- # Install JavaScript dependencies
22
- ARG NODE_VERSION=20.11.1
23
- ARG YARN_VERSION=1.22.22
24
- ENV PATH=/usr/local/node/bin:$PATH
25
- RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \
26
- /tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \
27
- npm install -g yarn@$YARN_VERSION && \
28
- rm -rf /tmp/node-build-master
29
-
30
- #------------------------------------------------------------
31
- # IMMAGINE DI SVILUPPO
32
- FROM build_dev_image as development_image
33
-
34
- ARG default_editor
35
- RUN apt-get install -y nano gpg gpg-agent git-lfs git ssh
36
- #questo serve per editare le credentials
37
- ENV EDITOR='nano' \
38
- BUNDLE_PATH="/bundle"
39
- # helper per webpacker
40
- RUN touch /.yarnrc && chmod 777 /.yarnrc
41
- RUN mkdir /.cache && chmod 777 /.cache
42
- RUN adduser --system -D --uid 1000 -h /home/nobody --shell /bin/bash rails rails
43
-
44
-
45
- RUN mkdir /bundle && chmod -R ugo+rwt /bundle
46
- VOLUME /bundle
47
-
48
- RUN gem install foreman
49
- ##
50
- # Installiamo:
51
- # bundle-audit : gemma per controllo di sicurezza https://github.com/rubysec/bundler-audit
52
- # bummr : gemma per upgrade automatizzato delle gemme con singoli commit per gemma
53
- RUN gem install bundle-audit bummr
54
-
55
- RUN mkdir -p /home/nobody && chmod 777 /home/nobody
56
- ENV HOME="/home/nobody"
57
-
data/cog.toml DELETED
@@ -1,32 +0,0 @@
1
- from_latest_tag = false
2
- ignore_merge_commits = false
3
- disable_changelog = false
4
- generate_mono_repository_global_tag = true
5
- branch_whitelist = []
6
- skip_ci = "[skip ci]"
7
- skip_untracked = false
8
- pre_bump_hooks = [
9
- "echo '{{version}}' > lib/base_editing_bootstrap/VERSION",
10
- "docker compose run app bundle"
11
- ]
12
- post_bump_hooks = [
13
- "git push",
14
- "git push origin {{version}}",
15
- "docker compose run app gem build base_editing_bootstrap.gemspec",
16
- "docker compose run app gem push base_editing_bootstrap-{{version}}.gem",
17
- "rm -fr base_editing_bootstrap-{{version}}.gem"
18
- ]
19
- pre_package_bump_hooks = []
20
- post_package_bump_hooks = []
21
-
22
- [git_hooks]
23
-
24
- [commit_types]
25
-
26
- [changelog]
27
- path = "CHANGELOG.md"
28
- authors = []
29
-
30
- [bump_profiles]
31
-
32
- [packages]
data/docker-compose.yml DELETED
@@ -1,20 +0,0 @@
1
- services:
2
- app:
3
- command: /app/spec/dummy/bin/dev
4
- build:
5
- context: .
6
- user: ${CMPS_UID_GID}
7
- volumes:
8
- - '.:/app'
9
- - 'bundle:/bundle'
10
- - '~/.gitconfig:/home/nobody/.gitconfig'
11
- - '~/.gnupg:/home/nobody/.gnupg'
12
- - '~/.gem:/home/nobody/.gem'
13
- - '~/.ssh:/home/nobody/.ssh'
14
- environment:
15
- RAILS_ENV: development
16
- ports:
17
- - 3000:3000
18
-
19
- volumes:
20
- bundle: