compony 0.1.0 → 0.2.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: cb0673f11b76f52d4405874d3efc5d36c5711a7cd563cd5029df63893b8cbefb
4
- data.tar.gz: '0196fe47b074ce2854ba847ed2064fbcc94946c221ed1ea8521b727d733f6deb'
3
+ metadata.gz: f23cc54f00a7ceb09e6e5ce344ac957dfd22863ae54fbb8bfee47663aface5a9
4
+ data.tar.gz: 78ab3342c2ab352d18e841696324497b0c7891f06d74dda0ad28e8998c5e18ac
5
5
  SHA512:
6
- metadata.gz: 9f2f3c18aebe32eba38249171af0eb0d5a2a27b2bebeee71c8ced5555ec2755d1e65997d3e467a8f94563c64e2fdd7ad7aee5c80fde3e67c8e5e6a1c6333c6ca
7
- data.tar.gz: '080f57ca5947d0ae472b5cea6789aea66435064ebd356c63e797bdfbd69174c25baf9b6cf4c5895a6501a2231b34f952523d8c1d87d91c1a0d73b840f4782753'
6
+ metadata.gz: 6e2d696881f150e9f6b3c43522412670eecd87aae908a9bcd4be9184de74cc4e444df32c4b0965623c61065a38f483e4a9db5e4d26920cb54d8aaeaf393ad714
7
+ data.tar.gz: 79bdb5b40c32265f2c6ab6eb2ab421ad0ca48b13d1eb6dd5b64d8217e60e7b9fb9a424fe34c33896f8cc32ce6d1cd88d2ad0d532f40422370f40e0cd0440256f
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.1.3
1
+ 3.2.2
data/CHANGELOG.md CHANGED
@@ -1,3 +1,22 @@
1
+ # 0.2.0
2
+
3
+ - Cleanup old code
4
+ - Remove `check_config!` that was barely used
5
+
6
+ # 0.1.1
7
+
8
+ - Support and force Rails 7.1.2
9
+
10
+ ## Steps to perform
11
+
12
+ - in `config/application.rb`, replace `config.load_defaults 7.0` by `config.load_defaults 7.1` and add:
13
+ ```ruby
14
+ # Please, add to the `ignore` list any other `lib` subdirectories that do
15
+ # not contain `.rb` files, or that should not be reloaded or eager loaded.
16
+ # Common ones are `templates`, `generators`, or `middleware`, for example.
17
+ config.autoload_lib(ignore: %w(assets tasks))
18
+ ```
19
+
1
20
  # 0.1.0
2
21
 
3
22
  - Remove (hopefully) obsolete database safeguard in `resolve_association!` as we should no longer be accessing the DB.
@@ -12,6 +31,8 @@
12
31
 
13
32
  # 0.0.9
14
33
 
34
+ Do not use.
35
+
15
36
  - Support forms with references to tables with uuid type primary key
16
37
  - Support for `owned_by` in model:
17
38
  - Smart redirect
data/Gemfile.lock CHANGED
@@ -1,11 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- compony (0.0.9)
4
+ compony (0.1.2.edge)
5
5
  anchormodel (~> 0.1.2)
6
6
  cancancan (~> 3.4.0)
7
7
  dslblend (>= 0.0.3)
8
8
  dyny (>= 0.0.3)
9
+ rails (>= 7.1.2)
9
10
  request_store (>= 1.5)
10
11
  schemacop (>= 3.0.17)
11
12
  simple_form (>= 5.1.0)
@@ -13,79 +14,93 @@ PATH
13
14
  GEM
14
15
  remote: https://rubygems.org/
15
16
  specs:
16
- actioncable (7.0.4.3)
17
- actionpack (= 7.0.4.3)
18
- activesupport (= 7.0.4.3)
17
+ actioncable (7.1.2)
18
+ actionpack (= 7.1.2)
19
+ activesupport (= 7.1.2)
19
20
  nio4r (~> 2.0)
20
21
  websocket-driver (>= 0.6.1)
21
- actionmailbox (7.0.4.3)
22
- actionpack (= 7.0.4.3)
23
- activejob (= 7.0.4.3)
24
- activerecord (= 7.0.4.3)
25
- activestorage (= 7.0.4.3)
26
- activesupport (= 7.0.4.3)
22
+ zeitwerk (~> 2.6)
23
+ actionmailbox (7.1.2)
24
+ actionpack (= 7.1.2)
25
+ activejob (= 7.1.2)
26
+ activerecord (= 7.1.2)
27
+ activestorage (= 7.1.2)
28
+ activesupport (= 7.1.2)
27
29
  mail (>= 2.7.1)
28
30
  net-imap
29
31
  net-pop
30
32
  net-smtp
31
- actionmailer (7.0.4.3)
32
- actionpack (= 7.0.4.3)
33
- actionview (= 7.0.4.3)
34
- activejob (= 7.0.4.3)
35
- activesupport (= 7.0.4.3)
33
+ actionmailer (7.1.2)
34
+ actionpack (= 7.1.2)
35
+ actionview (= 7.1.2)
36
+ activejob (= 7.1.2)
37
+ activesupport (= 7.1.2)
36
38
  mail (~> 2.5, >= 2.5.4)
37
39
  net-imap
38
40
  net-pop
39
41
  net-smtp
40
- rails-dom-testing (~> 2.0)
41
- actionpack (7.0.4.3)
42
- actionview (= 7.0.4.3)
43
- activesupport (= 7.0.4.3)
44
- rack (~> 2.0, >= 2.2.0)
42
+ rails-dom-testing (~> 2.2)
43
+ actionpack (7.1.2)
44
+ actionview (= 7.1.2)
45
+ activesupport (= 7.1.2)
46
+ nokogiri (>= 1.8.5)
47
+ racc
48
+ rack (>= 2.2.4)
49
+ rack-session (>= 1.0.1)
45
50
  rack-test (>= 0.6.3)
46
- rails-dom-testing (~> 2.0)
47
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
48
- actiontext (7.0.4.3)
49
- actionpack (= 7.0.4.3)
50
- activerecord (= 7.0.4.3)
51
- activestorage (= 7.0.4.3)
52
- activesupport (= 7.0.4.3)
51
+ rails-dom-testing (~> 2.2)
52
+ rails-html-sanitizer (~> 1.6)
53
+ actiontext (7.1.2)
54
+ actionpack (= 7.1.2)
55
+ activerecord (= 7.1.2)
56
+ activestorage (= 7.1.2)
57
+ activesupport (= 7.1.2)
53
58
  globalid (>= 0.6.0)
54
59
  nokogiri (>= 1.8.5)
55
- actionview (7.0.4.3)
56
- activesupport (= 7.0.4.3)
60
+ actionview (7.1.2)
61
+ activesupport (= 7.1.2)
57
62
  builder (~> 3.1)
58
- erubi (~> 1.4)
59
- rails-dom-testing (~> 2.0)
60
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
61
- activejob (7.0.4.3)
62
- activesupport (= 7.0.4.3)
63
+ erubi (~> 1.11)
64
+ rails-dom-testing (~> 2.2)
65
+ rails-html-sanitizer (~> 1.6)
66
+ activejob (7.1.2)
67
+ activesupport (= 7.1.2)
63
68
  globalid (>= 0.3.6)
64
- activemodel (7.0.4.3)
65
- activesupport (= 7.0.4.3)
66
- activerecord (7.0.4.3)
67
- activemodel (= 7.0.4.3)
68
- activesupport (= 7.0.4.3)
69
- activestorage (7.0.4.3)
70
- actionpack (= 7.0.4.3)
71
- activejob (= 7.0.4.3)
72
- activerecord (= 7.0.4.3)
73
- activesupport (= 7.0.4.3)
69
+ activemodel (7.1.2)
70
+ activesupport (= 7.1.2)
71
+ activerecord (7.1.2)
72
+ activemodel (= 7.1.2)
73
+ activesupport (= 7.1.2)
74
+ timeout (>= 0.4.0)
75
+ activestorage (7.1.2)
76
+ actionpack (= 7.1.2)
77
+ activejob (= 7.1.2)
78
+ activerecord (= 7.1.2)
79
+ activesupport (= 7.1.2)
74
80
  marcel (~> 1.0)
75
- mini_mime (>= 1.1.0)
76
- activesupport (7.0.4.3)
81
+ activesupport (7.1.2)
82
+ base64
83
+ bigdecimal
77
84
  concurrent-ruby (~> 1.0, >= 1.0.2)
85
+ connection_pool (>= 2.2.5)
86
+ drb
78
87
  i18n (>= 1.6, < 2)
79
88
  minitest (>= 5.1)
89
+ mutex_m
80
90
  tzinfo (~> 2.0)
81
- anchormodel (0.1.2)
91
+ anchormodel (0.1.3)
82
92
  rails (~> 7.0)
83
93
  ast (2.4.2)
94
+ base64 (0.2.0)
95
+ bigdecimal (3.1.4)
84
96
  builder (3.2.4)
85
97
  cancancan (3.4.0)
86
98
  concurrent-ruby (1.2.2)
99
+ connection_pool (2.4.1)
87
100
  crass (1.0.6)
88
101
  date (3.3.3)
102
+ drb (2.2.0)
103
+ ruby2_keywords
89
104
  dslblend (0.0.3)
90
105
  dyny (0.0.3)
91
106
  rails
@@ -94,6 +109,10 @@ GEM
94
109
  activesupport (>= 5.0)
95
110
  i18n (1.13.0)
96
111
  concurrent-ruby (~> 1.0)
112
+ io-console (0.6.0)
113
+ irb (1.9.1)
114
+ rdoc
115
+ reline (>= 0.3.8)
97
116
  json (2.6.3)
98
117
  loofah (2.21.3)
99
118
  crass (~> 1.0.2)
@@ -104,9 +123,9 @@ GEM
104
123
  net-pop
105
124
  net-smtp
106
125
  marcel (1.0.2)
107
- method_source (1.0.0)
108
126
  mini_mime (1.1.2)
109
127
  minitest (5.18.0)
128
+ mutex_m (0.2.0)
110
129
  net-imap (0.3.4)
111
130
  date
112
131
  net-protocol
@@ -122,39 +141,53 @@ GEM
122
141
  parallel (1.23.0)
123
142
  parser (3.2.2.1)
124
143
  ast (~> 2.4.1)
144
+ psych (5.1.1.1)
145
+ stringio
125
146
  racc (1.6.2)
126
147
  rack (2.2.7)
148
+ rack-session (1.0.1)
149
+ rack (< 3)
127
150
  rack-test (2.1.0)
128
151
  rack (>= 1.3)
129
- rails (7.0.4.3)
130
- actioncable (= 7.0.4.3)
131
- actionmailbox (= 7.0.4.3)
132
- actionmailer (= 7.0.4.3)
133
- actionpack (= 7.0.4.3)
134
- actiontext (= 7.0.4.3)
135
- actionview (= 7.0.4.3)
136
- activejob (= 7.0.4.3)
137
- activemodel (= 7.0.4.3)
138
- activerecord (= 7.0.4.3)
139
- activestorage (= 7.0.4.3)
140
- activesupport (= 7.0.4.3)
152
+ rackup (1.0.0)
153
+ rack (< 3)
154
+ webrick
155
+ rails (7.1.2)
156
+ actioncable (= 7.1.2)
157
+ actionmailbox (= 7.1.2)
158
+ actionmailer (= 7.1.2)
159
+ actionpack (= 7.1.2)
160
+ actiontext (= 7.1.2)
161
+ actionview (= 7.1.2)
162
+ activejob (= 7.1.2)
163
+ activemodel (= 7.1.2)
164
+ activerecord (= 7.1.2)
165
+ activestorage (= 7.1.2)
166
+ activesupport (= 7.1.2)
141
167
  bundler (>= 1.15.0)
142
- railties (= 7.0.4.3)
143
- rails-dom-testing (2.0.3)
144
- activesupport (>= 4.2.0)
168
+ railties (= 7.1.2)
169
+ rails-dom-testing (2.2.0)
170
+ activesupport (>= 5.0.0)
171
+ minitest
145
172
  nokogiri (>= 1.6)
146
- rails-html-sanitizer (1.5.0)
147
- loofah (~> 2.19, >= 2.19.1)
148
- railties (7.0.4.3)
149
- actionpack (= 7.0.4.3)
150
- activesupport (= 7.0.4.3)
151
- method_source
173
+ rails-html-sanitizer (1.6.0)
174
+ loofah (~> 2.21)
175
+ nokogiri (~> 1.14)
176
+ railties (7.1.2)
177
+ actionpack (= 7.1.2)
178
+ activesupport (= 7.1.2)
179
+ irb
180
+ rackup (>= 1.0.0)
152
181
  rake (>= 12.2)
153
- thor (~> 1.0)
154
- zeitwerk (~> 2.5)
182
+ thor (~> 1.0, >= 1.2.2)
183
+ zeitwerk (~> 2.6)
155
184
  rainbow (3.1.1)
156
185
  rake (13.0.6)
186
+ rdoc (6.6.0)
187
+ psych (>= 4.0.0)
157
188
  regexp_parser (2.8.0)
189
+ reline (0.4.0)
190
+ io-console (~> 0.5)
158
191
  request_store (1.5.1)
159
192
  rack (>= 1.4)
160
193
  rexml (3.2.5)
@@ -182,11 +215,13 @@ GEM
182
215
  simple_form (5.2.0)
183
216
  actionpack (>= 5.2)
184
217
  activemodel (>= 5.2)
218
+ stringio (3.0.9)
185
219
  thor (1.2.2)
186
- timeout (0.3.2)
220
+ timeout (0.4.1)
187
221
  tzinfo (2.0.6)
188
222
  concurrent-ruby (~> 1.0)
189
223
  unicode-display_width (2.4.2)
224
+ webrick (1.8.1)
190
225
  websocket-driver (0.7.5)
191
226
  websocket-extensions (>= 0.1.0)
192
227
  websocket-extensions (0.1.5)
data/Rakefile CHANGED
@@ -17,6 +17,7 @@ task :gemspec do
17
17
  s.add_development_dependency 'rubocop', '>= 1.48'
18
18
  s.add_development_dependency 'rubocop-rails', '>= 2.18.0'
19
19
 
20
+ s.add_runtime_dependency 'rails', '>= 7.1.2'
20
21
  s.add_runtime_dependency 'request_store', '>= 1.5'
21
22
  s.add_runtime_dependency 'dyny', '>= 0.0.3'
22
23
  s.add_runtime_dependency 'schemacop', '>= 3.0.17'
data/compony.gemspec CHANGED
@@ -2,19 +2,19 @@
2
2
  # This file is auto-generated via: 'rake gemspec'.
3
3
 
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: compony 0.1.0 ruby lib
5
+ # stub: compony 0.2.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "compony".freeze
9
- s.version = "0.1.0".freeze
9
+ s.version = "0.2.0".freeze
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Sandro Kalbermatter".freeze, "contributors".freeze]
14
- s.date = "2023-11-06"
14
+ s.date = "2023-12-05"
15
15
  s.files = [".gitignore".freeze, ".ruby-version".freeze, ".yardopts".freeze, "CHANGELOG.md".freeze, "Gemfile".freeze, "Gemfile.lock".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "app/controllers/compony_controller.rb".freeze, "compony.gemspec".freeze, "config/locales/de.yml".freeze, "config/locales/en.yml".freeze, "config/routes.rb".freeze, "doc/resourceful_lifecycle.graphml".freeze, "doc/resourceful_lifecycle.pdf".freeze, "lib/compony.rb".freeze, "lib/compony/component.rb".freeze, "lib/compony/component_mixins/default/labelling.rb".freeze, "lib/compony/component_mixins/default/standalone.rb".freeze, "lib/compony/component_mixins/default/standalone/resourceful_verb_dsl.rb".freeze, "lib/compony/component_mixins/default/standalone/standalone_dsl.rb".freeze, "lib/compony/component_mixins/default/standalone/verb_dsl.rb".freeze, "lib/compony/component_mixins/resourceful.rb".freeze, "lib/compony/components/button.rb".freeze, "lib/compony/components/destroy.rb".freeze, "lib/compony/components/edit.rb".freeze, "lib/compony/components/form.rb".freeze, "lib/compony/components/new.rb".freeze, "lib/compony/components/with_form.rb".freeze, "lib/compony/controller_mixin.rb".freeze, "lib/compony/engine.rb".freeze, "lib/compony/method_accessible_hash.rb".freeze, "lib/compony/model_fields/anchormodel.rb".freeze, "lib/compony/model_fields/association.rb".freeze, "lib/compony/model_fields/attachment.rb".freeze, "lib/compony/model_fields/base.rb".freeze, "lib/compony/model_fields/boolean.rb".freeze, "lib/compony/model_fields/color.rb".freeze, "lib/compony/model_fields/currency.rb".freeze, "lib/compony/model_fields/date.rb".freeze, "lib/compony/model_fields/datetime.rb".freeze, "lib/compony/model_fields/decimal.rb".freeze, "lib/compony/model_fields/email.rb".freeze, "lib/compony/model_fields/float.rb".freeze, "lib/compony/model_fields/integer.rb".freeze, "lib/compony/model_fields/percentage.rb".freeze, "lib/compony/model_fields/phone.rb".freeze, "lib/compony/model_fields/rich_text.rb".freeze, "lib/compony/model_fields/string.rb".freeze, "lib/compony/model_fields/text.rb".freeze, "lib/compony/model_fields/time.rb".freeze, "lib/compony/model_fields/url.rb".freeze, "lib/compony/model_mixin.rb".freeze, "lib/compony/request_context.rb".freeze, "lib/compony/version.rb".freeze, "lib/compony/view_helpers.rb".freeze, "lib/generators/component/USAGE".freeze, "lib/generators/component/component_generator.rb".freeze, "lib/generators/component/templates/component.rb.erb".freeze, "lib/generators/component/templates/destroy.rb.erb".freeze, "lib/generators/component/templates/edit.rb.erb".freeze, "lib/generators/component/templates/form.rb.erb".freeze, "lib/generators/component/templates/new.rb.erb".freeze, "lib/generators/components/USAGE".freeze, "lib/generators/components/components_generator.rb".freeze]
16
16
  s.required_ruby_version = Gem::Requirement.new(">= 3.0.0".freeze)
17
- s.rubygems_version = "3.4.21".freeze
17
+ s.rubygems_version = "3.4.22".freeze
18
18
  s.summary = "Needs summary".freeze
19
19
 
20
20
  s.specification_version = 4
@@ -22,6 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency(%q<yard>.freeze, [">= 0.9.28".freeze])
23
23
  s.add_development_dependency(%q<rubocop>.freeze, [">= 1.48".freeze])
24
24
  s.add_development_dependency(%q<rubocop-rails>.freeze, [">= 2.18.0".freeze])
25
+ s.add_runtime_dependency(%q<rails>.freeze, [">= 7.1.2".freeze])
25
26
  s.add_runtime_dependency(%q<request_store>.freeze, [">= 1.5".freeze])
26
27
  s.add_runtime_dependency(%q<dyny>.freeze, [">= 0.0.3".freeze])
27
28
  s.add_runtime_dependency(%q<schemacop>.freeze, [">= 3.0.17".freeze])
@@ -37,7 +37,6 @@ module Compony
37
37
  setup_blocks.each do |setup_block|
38
38
  instance_exec(&setup_block)
39
39
  end
40
- check_config!
41
40
  end
42
41
 
43
42
  def inspect
@@ -228,9 +227,5 @@ module Compony
228
227
  def resourceful?
229
228
  return false
230
229
  end
231
-
232
- protected
233
-
234
- def check_config!; end
235
230
  end
236
231
  end
@@ -8,13 +8,11 @@ module Compony
8
8
  super
9
9
  end
10
10
 
11
- def check_config!
12
- super
13
- fail "#{inspect} requires config.form_fields do ..." if @form_fields.blank?
14
- end
15
-
16
11
  setup do
17
12
  before_render do
13
+ # Make sure the error message is going to be nice if form_fields were not implemented
14
+ fail "#{component.inspect} requires config.form_fields do ..." if @form_fields.nil?
15
+
18
16
  # Must render the buttons now as the rendering within simple form breaks the form
19
17
  @submit_button = Compony.button_component_class.new(
20
18
  label: @submit_label || I18n.t('compony.components.form.submit'), icon: 'arrow-right', type: :submit
@@ -1,13 +1,15 @@
1
+ module ::Components; end
2
+
1
3
  module Compony
2
4
  class Engine < Rails::Engine
3
5
  initializer 'compony.configure_eager_load_paths', before: :load_environment_hook, group: :all do
4
6
  # Allow app/components/foo/bar.rb to define constants Components::Foo::Bar and make sure components are eager loaded (needed for route generation etc.)
5
- Rails.application.config.eager_load_paths.delete(Rails.root.join('app', 'components').to_s)
6
- Rails.application.config.eager_load_paths.unshift(Rails.root.join('app').to_s)
7
-
8
- # Prevent *.rb files in assets and views directories to be loaded
9
- Rails.autoloaders.main.ignore(Rails.root.join('app', 'assets').to_s)
10
- Rails.autoloaders.main.ignore(Rails.root.join('app', 'views').to_s)
7
+ Rails.autoloaders.main.push_dir(Rails.root.join('app', 'components'), namespace: ::Components)
8
+ unless Rails.application.config.eager_load
9
+ Rails.application.config.to_prepare do
10
+ Rails.autoloaders.main.eager_load_dir(Rails.root.join('app', 'components'))
11
+ end
12
+ end
11
13
  end
12
14
 
13
15
  initializer 'compony.controller_mixin' do
@@ -1,7 +1,7 @@
1
1
  module Compony
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 1
4
+ MINOR = 2
5
5
  PATCH = 0
6
6
 
7
7
  EDGE = false
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compony
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Kalbermatter
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-11-06 00:00:00.000000000 Z
12
+ date: 2023-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yard
@@ -53,6 +53,20 @@ dependencies:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: 2.18.0
56
+ - !ruby/object:Gem::Dependency
57
+ name: rails
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: 7.1.2
63
+ type: :runtime
64
+ prerelease: false
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: 7.1.2
56
70
  - !ruby/object:Gem::Dependency
57
71
  name: request_store
58
72
  requirement: !ruby/object:Gem::Requirement