base_editing_bootstrap 0.2.0 → 0.4.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: 0c34b968628eb0454335d3d95796e381ec478cb236a44941cbf267220377df6b
4
+ data.tar.gz: ac7a7f7106bf53615569782e55a19aafccd3c2d63aee77c0e71b27b6e7599de6
5
5
  SHA512:
6
- metadata.gz: f86e276eb409edff874465dfdea52e44f581d5db4ab47d0d44bd33f0b7b24c0a871125f4807371eb0f199b5bf8a56edd6768f1787d66f8fae314e4d77fc1b16b
7
- data.tar.gz: cbb77961f4f3df339a474472a6669039505ffbe2e31aa37abea4a7eae02481ea02e459f2f47fe0e802a6ef579d4bbcb81c3058c84ad9e12636462b3a28617f22
6
+ metadata.gz: 3dccc18a70b861a9d3ead369dbbd57d4c5504bd7316e16c07521ef75e4bdb0142d8978ff47787f0d80143af1511c44efc199bb04c85a7a3852a35d8ae7fea7ee
7
+ data.tar.gz: d0cefc4ba1f38b7ec45e3a93609b0cd498dfb6dcee6be9d7054a3b18e7cadaddb97855355595fb2b783baeb2d98f6d1410b6453832de3e32344cc170014c8c7f
data/CHANGELOG.md CHANGED
@@ -2,6 +2,42 @@
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.4.0 - 2024-04-29
6
+ #### Bug Fixes
7
+ - Add Translations for pagination - (14bbb6f) - Marino Bonetti
8
+ - Remove rubygems warnings - (5b0dc6e) - Marino Bonetti
9
+ #### Documentation
10
+ - Documentation - (a2f93cd) - Marino Bonetti
11
+ #### Features
12
+ - Prepare new installer - (9189b26) - Marino Bonetti
13
+ #### Miscellaneous Chores
14
+ - Start initializer as template - (7cc6756) - Marino Bonetti
15
+ - Fix versions in gemfile - (5280d4e) - Marino Bonetti
16
+ #### Tests
17
+ - Create spec for generators - (c7b3210) - Marino Bonetti
18
+ - Spec per generator - (bf79a97) - Marino Bonetti
19
+ - Add test to policy - (41d6bac) - Marino Bonetti
20
+ - Match gem version - (462e72f) - Marino Bonetti
21
+
22
+ - - -
23
+
24
+ ## 0.3.0 - 2024-04-27
25
+ #### Bug Fixes
26
+ - Remove files from gem - (660cb3d) - Marino Bonetti
27
+ #### Documentation
28
+ - Update documentation - (42472ff) - Marino Bonetti
29
+ - Add documentation for spec helper - (170dd5a) - Marino Bonetti
30
+ #### Features
31
+ - Add configurations to change redirect after edit/create - (f8f3048) - Marino Bonetti
32
+ #### Refactoring
33
+ - Gem dependency organization - (7fb8caf) - Marino Bonetti
34
+ - Gem dependency organization - (f997fd9) - Marino Bonetti
35
+ #### Tests
36
+ - Aggiunta test per controllo redirect post success o update - (4c28e38) - Marino Bonetti
37
+ - Add Seed for generating multiple post in dummy - (bcbe986) - Marino Bonetti
38
+
39
+ - - -
40
+
5
41
  ## 0.2.0 - 2024-04-23
6
42
  #### Documentation
7
43
  - Add documntation for installation - (b528daa) - Marino Bonetti
data/README.md CHANGED
@@ -20,8 +20,13 @@ Or install it yourself as:
20
20
  $ gem install base_editing_bootstrap
21
21
  ```
22
22
 
23
- ### TODO generators
24
- Then Install dependency (WIP TO TRANSLATE IN INSTALLATION TASK):
23
+ Then run installer:
24
+ ```bash
25
+ $ bundle exec rails g base_editing_bootstrap:install
26
+ ```
27
+
28
+ ### Generators
29
+ Then Install dependency (if you run base_editing_bootstrap:install you are good to go):
25
30
  ```bash
26
31
 
27
32
  bundle exec rails g pundit:install
@@ -36,7 +41,8 @@ La versione più semplice è attraverso: https://github.com/rails/cssbundling-ra
36
41
  Una volta installato basta lanciare bin/rails css:install:bootstrap come da
37
42
  documentazione e avrete la vostra versione di boostrap installata.
38
43
 
39
- Installare `gem "factory_bot_rails"` e configurarlo correttamente in application.rb
44
+ Installare `gem "factory_bot_rails"`,
45
+ Optional configurarlo correttamente in application.rb
40
46
  ```ruby
41
47
  config.generators do |g|
42
48
  g.test_framework :rspec
@@ -53,6 +59,19 @@ E' possibile configurare BaseEditingBootstrap con alcune impostazioni:
53
59
  # tutti i controller sottostanti
54
60
  # @default "ApplicationController"
55
61
  # config.inherited_controller = 'ApplicationController'
62
+
63
+ ##
64
+ # Configurazione per alterare lo standard di azione post aggiornamento record
65
+ # il default è andare nella pagina di editing del record
66
+ # possibili valori :edit , :index
67
+ # config_accessor :after_success_update_redirect, default: :edit
68
+
69
+ ##
70
+ # Configurazione per alterare lo standard di azione post creazione record
71
+ # il default è andare nella pagina di editing del record
72
+ # possibili valori :edit , :index
73
+ # config_accessor :after_success_create_redirect, default: :edit
74
+
56
75
  end
57
76
 
58
77
  ```
@@ -64,6 +83,13 @@ Utilizzo per modello base, in questo esempio prendiamo come modello Post come es
64
83
  ```ruby
65
84
  include BaseEditingBootstrap::BaseModel
66
85
  ```
86
+ - La factory nelle spec deve contenere il trait `with_invalid_attributes` per definire la situazione di dati per record
87
+ non valido. ES:
88
+ ```ruby
89
+ trait :with_invalid_attributes do
90
+ name {nil} # name dovrebbe essere obbligatorio nel modello
91
+ end
92
+ ```
67
93
  - Creare Controller:
68
94
  ```ruby
69
95
  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,36 @@ 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']
40
+ spec.add_dependency 'kaminari-i18n', '~> 0.5'
35
41
 
36
- spec.add_development_dependency "rspec-rails"
37
- spec.add_development_dependency "factory_bot_rails"
42
+ spec.add_development_dependency "rspec-rails", '~> 6.0'
43
+ spec.add_development_dependency "factory_bot_rails", '~> 6.4'
44
+ spec.add_development_dependency 'faker', '~> 3.3'
45
+ spec.add_development_dependency "puma", '~> 6.4'
46
+ spec.add_development_dependency "sqlite3", '~> 1.7'
47
+ spec.add_development_dependency "sprockets-rails", '~> 3.4'
48
+ spec.add_development_dependency 'rails-i18n', '~> 7.0' # For 7.0.0
49
+ spec.add_development_dependency "i18n-debug", '~> 1.2'
50
+ spec.add_development_dependency "cssbundling-rails", '~> 1.4'
51
+ spec.add_development_dependency "rspec-parameterized", ">= 1.0.0" # https://github.com/tomykaira/rspec-parameterized
52
+ spec.add_development_dependency 'rspec-html-matchers', '~> 0.10' # https://github.com/kucaahbe/rspec-html-matchers
53
+ spec.add_development_dependency 'rails-controller-testing', '~>1.0'
38
54
 
39
55
  end
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.4.0
@@ -1,5 +1,6 @@
1
1
  require "ransack"
2
2
  require "kaminari"
3
+ require "kaminari-i18n"
3
4
  require "pundit"
4
5
 
5
6
  if ENV['RAILS_ENV'] == 'test' and defined? RSpec
@@ -11,6 +12,7 @@ end
11
12
 
12
13
  require "zeitwerk"
13
14
  loader = Zeitwerk::Loader.for_gem
15
+ loader.ignore("#{__dir__}/generators")
14
16
  loader.setup
15
17
 
16
18
  module BaseEditingBootstrap
@@ -21,6 +23,18 @@ module BaseEditingBootstrap
21
23
  # tutti i controller sottostanti
22
24
  # @default "ApplicationController"
23
25
  config_accessor :inherited_controller, default: "ApplicationController"
26
+
27
+ ##
28
+ # Configurazione per alterare lo standard di azione post aggiornamento record
29
+ # il default è andare nella pagina di editing del record
30
+ # possibili valori :edit , :index
31
+ config_accessor :after_success_update_redirect, default: :edit
32
+
33
+ ##
34
+ # Configurazione per alterare lo standard di azione post creazione record
35
+ # il default è andare nella pagina di editing del record
36
+ # possibili valori :edit , :index
37
+ config_accessor :after_success_create_redirect, default: :edit
24
38
 
25
39
  def self.deprecator
26
40
  @deprecator ||= ActiveSupport::Deprecation.new("1.0", "BaseEditingBootstrap")
@@ -0,0 +1,2 @@
1
+ Description:
2
+ Generates initialization files for the gem
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BaseEditingBootstrap
4
+ module Generators
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+ source_root File.expand_path("templates", __dir__)
7
+
8
+ def create_initializer
9
+ initializer_file_name = "initializer.rb"
10
+ destination = File.join('config', 'initializers', "base_editing_bootstrap.rb")
11
+ template initializer_file_name, destination
12
+ end
13
+
14
+ def install_and_configure_pundit
15
+ generate "pundit:install"
16
+ inject_into_class "app/controllers/application_controller.rb", "ApplicationController", " include Pundit::Authorization\n"
17
+ end
18
+
19
+ def prepare_test_environment
20
+ gem "factory_bot_rails", group: :test, version: '~> 6.4', comment: "Necessary for spec"
21
+ inject_into_class "config/application.rb", "Application", <<~RUBY
22
+ config.generators do |g|
23
+ g.test_framework :rspec
24
+ g.fixture_replacement :factory_bot
25
+ g.factory_bot dir: 'spec/factories'
26
+ end
27
+ RUBY
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ BaseEditingBootstrap.configure do |config|
4
+ ##
5
+ # Controller da cui derivare poi il BaseEditingController da cui derivano
6
+ # tutti i controller sottostanti
7
+ # @default "ApplicationController"
8
+ # config_accessor :inherited_controller, default: "ApplicationController"
9
+
10
+ ##
11
+ # Configurazione per alterare lo standard di azione post aggiornamento record
12
+ # il default è andare nella pagina di editing del record
13
+ # possibili valori :edit , :index
14
+ # config_accessor :after_success_update_redirect, default: :edit
15
+
16
+ ##
17
+ # Configurazione per alterare lo standard di azione post creazione record
18
+ # il default è andare nella pagina di editing del record
19
+ # possibili valori :edit , :index
20
+ # config_accessor :after_success_create_redirect, default: :edit
21
+
22
+ end
@@ -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
@@ -12,3 +12,30 @@ RSpec::Matchers.define :permit_editable_attributes do |*expected_attributes|
12
12
  actual_attributes.empty?
13
13
  end
14
14
  end
15
+
16
+ shared_examples "a standard policy" do |factory|
17
+ let(:user) { create(:user) }
18
+ let(:instance) { described_class.new(user, build(factory)) }
19
+
20
+ describe "standard_methotds" do
21
+ where(:method, :response) do
22
+ [
23
+ [:show?, false],
24
+ [:destroy?, true],
25
+ [:update?, true],
26
+ [:create?, true],
27
+ [:index?, true],
28
+ ]
29
+ end
30
+
31
+ with_them do
32
+ it "should " do
33
+ expect(instance).to respond_to(method)
34
+ end
35
+ it "return value" do
36
+ expect(instance.send(method)).to be == response
37
+ end
38
+ end
39
+ end
40
+
41
+ end
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.4.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-29 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,37 +84,194 @@ 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
93
+ - !ruby/object:Gem::Dependency
94
+ name: kaminari-i18n
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '0.5'
100
+ type: :runtime
101
+ prerelease: false
102
+ version_requirements: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - "~>"
105
+ - !ruby/object:Gem::Version
106
+ version: '0.5'
69
107
  - !ruby/object:Gem::Dependency
70
108
  name: rspec-rails
71
109
  requirement: !ruby/object:Gem::Requirement
72
110
  requirements:
73
- - - ">="
111
+ - - "~>"
74
112
  - !ruby/object:Gem::Version
75
- version: '0'
113
+ version: '6.0'
76
114
  type: :development
77
115
  prerelease: false
78
116
  version_requirements: !ruby/object:Gem::Requirement
79
117
  requirements:
80
- - - ">="
118
+ - - "~>"
81
119
  - !ruby/object:Gem::Version
82
- version: '0'
120
+ version: '6.0'
83
121
  - !ruby/object:Gem::Dependency
84
122
  name: factory_bot_rails
123
+ requirement: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - "~>"
126
+ - !ruby/object:Gem::Version
127
+ version: '6.4'
128
+ type: :development
129
+ prerelease: false
130
+ version_requirements: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - "~>"
133
+ - !ruby/object:Gem::Version
134
+ version: '6.4'
135
+ - !ruby/object:Gem::Dependency
136
+ name: faker
137
+ requirement: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - "~>"
140
+ - !ruby/object:Gem::Version
141
+ version: '3.3'
142
+ type: :development
143
+ prerelease: false
144
+ version_requirements: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - "~>"
147
+ - !ruby/object:Gem::Version
148
+ version: '3.3'
149
+ - !ruby/object:Gem::Dependency
150
+ name: puma
151
+ requirement: !ruby/object:Gem::Requirement
152
+ requirements:
153
+ - - "~>"
154
+ - !ruby/object:Gem::Version
155
+ version: '6.4'
156
+ type: :development
157
+ prerelease: false
158
+ version_requirements: !ruby/object:Gem::Requirement
159
+ requirements:
160
+ - - "~>"
161
+ - !ruby/object:Gem::Version
162
+ version: '6.4'
163
+ - !ruby/object:Gem::Dependency
164
+ name: sqlite3
165
+ requirement: !ruby/object:Gem::Requirement
166
+ requirements:
167
+ - - "~>"
168
+ - !ruby/object:Gem::Version
169
+ version: '1.7'
170
+ type: :development
171
+ prerelease: false
172
+ version_requirements: !ruby/object:Gem::Requirement
173
+ requirements:
174
+ - - "~>"
175
+ - !ruby/object:Gem::Version
176
+ version: '1.7'
177
+ - !ruby/object:Gem::Dependency
178
+ name: sprockets-rails
179
+ requirement: !ruby/object:Gem::Requirement
180
+ requirements:
181
+ - - "~>"
182
+ - !ruby/object:Gem::Version
183
+ version: '3.4'
184
+ type: :development
185
+ prerelease: false
186
+ version_requirements: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - "~>"
189
+ - !ruby/object:Gem::Version
190
+ version: '3.4'
191
+ - !ruby/object:Gem::Dependency
192
+ name: rails-i18n
193
+ requirement: !ruby/object:Gem::Requirement
194
+ requirements:
195
+ - - "~>"
196
+ - !ruby/object:Gem::Version
197
+ version: '7.0'
198
+ type: :development
199
+ prerelease: false
200
+ version_requirements: !ruby/object:Gem::Requirement
201
+ requirements:
202
+ - - "~>"
203
+ - !ruby/object:Gem::Version
204
+ version: '7.0'
205
+ - !ruby/object:Gem::Dependency
206
+ name: i18n-debug
207
+ requirement: !ruby/object:Gem::Requirement
208
+ requirements:
209
+ - - "~>"
210
+ - !ruby/object:Gem::Version
211
+ version: '1.2'
212
+ type: :development
213
+ prerelease: false
214
+ version_requirements: !ruby/object:Gem::Requirement
215
+ requirements:
216
+ - - "~>"
217
+ - !ruby/object:Gem::Version
218
+ version: '1.2'
219
+ - !ruby/object:Gem::Dependency
220
+ name: cssbundling-rails
221
+ requirement: !ruby/object:Gem::Requirement
222
+ requirements:
223
+ - - "~>"
224
+ - !ruby/object:Gem::Version
225
+ version: '1.4'
226
+ type: :development
227
+ prerelease: false
228
+ version_requirements: !ruby/object:Gem::Requirement
229
+ requirements:
230
+ - - "~>"
231
+ - !ruby/object:Gem::Version
232
+ version: '1.4'
233
+ - !ruby/object:Gem::Dependency
234
+ name: rspec-parameterized
85
235
  requirement: !ruby/object:Gem::Requirement
86
236
  requirements:
87
237
  - - ">="
88
238
  - !ruby/object:Gem::Version
89
- version: '0'
239
+ version: 1.0.0
90
240
  type: :development
91
241
  prerelease: false
92
242
  version_requirements: !ruby/object:Gem::Requirement
93
243
  requirements:
94
244
  - - ">="
95
245
  - !ruby/object:Gem::Version
96
- version: '0'
246
+ version: 1.0.0
247
+ - !ruby/object:Gem::Dependency
248
+ name: rspec-html-matchers
249
+ requirement: !ruby/object:Gem::Requirement
250
+ requirements:
251
+ - - "~>"
252
+ - !ruby/object:Gem::Version
253
+ version: '0.10'
254
+ type: :development
255
+ prerelease: false
256
+ version_requirements: !ruby/object:Gem::Requirement
257
+ requirements:
258
+ - - "~>"
259
+ - !ruby/object:Gem::Version
260
+ version: '0.10'
261
+ - !ruby/object:Gem::Dependency
262
+ name: rails-controller-testing
263
+ requirement: !ruby/object:Gem::Requirement
264
+ requirements:
265
+ - - "~>"
266
+ - !ruby/object:Gem::Version
267
+ version: '1.0'
268
+ type: :development
269
+ prerelease: false
270
+ version_requirements: !ruby/object:Gem::Requirement
271
+ requirements:
272
+ - - "~>"
273
+ - !ruby/object:Gem::Version
274
+ version: '1.0'
97
275
  description: Raccolta di utility per semplificare costruzione cms in rails
98
276
  email:
99
277
  - marinobonetti@gmail.com
@@ -101,11 +279,8 @@ executables: []
101
279
  extensions: []
102
280
  extra_rdoc_files: []
103
281
  files:
104
- - ".rspec"
105
- - ".rubocop.yml"
106
282
  - CHANGELOG.md
107
283
  - CODE_OF_CONDUCT.md
108
- - Dockerfile
109
284
  - LICENSE.txt
110
285
  - MIT-LICENSE
111
286
  - README.md
@@ -167,11 +342,9 @@ files:
167
342
  - app/views/kaminari/_paginator.html.erb
168
343
  - app/views/kaminari/_prev_page.html.erb
169
344
  - base_editing_bootstrap.gemspec
170
- - cog.toml
171
345
  - config/initializers/base_field_error_proc.rb
172
346
  - config/locales/it.yml
173
347
  - config/routes.rb
174
- - docker-compose.yml
175
348
  - lib/base_editing_bootstrap.rb
176
349
  - lib/base_editing_bootstrap/VERSION
177
350
  - lib/base_editing_bootstrap/base_model.rb
@@ -181,6 +354,9 @@ files:
181
354
  - lib/base_editing_bootstrap/searches/base.rb
182
355
  - lib/base_editing_bootstrap/searches/field.rb
183
356
  - lib/base_editing_bootstrap/version.rb
357
+ - lib/generators/base_editing_bootstrap/install/USAGE
358
+ - lib/generators/base_editing_bootstrap/install/install_generator.rb
359
+ - lib/generators/base_editing_bootstrap/install/templates/initializer.rb
184
360
  - lib/tasks/base_editing_bootstrap_tasks.rake
185
361
  - spec/support/external_shared/base_editing_controller_helpers.rb
186
362
  - spec/support/external_shared/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: