formalism-model_forms 0.7.2 → 0.9.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: '082c6bb37c880171e718d59e44a932587ef6cdeb14b4e4bd089e74ac93bfea7f'
4
- data.tar.gz: 48fa334241bea2219ca7ef170ba4e1f013c06aa9ce197e2b2593e6aae4cce118
3
+ metadata.gz: 47900b69f1be9c8bef86688c9e681826a65728c91c9845738783642743244b09
4
+ data.tar.gz: 4375669db4ec1759d39dc3997fae6093d1ae17b0b28e292f90fd564a3d24302d
5
5
  SHA512:
6
- metadata.gz: da4c7f403b76dff4ed7f918a4e715d74468d11cc7b819278d81975836c5411d9267dbb39c35046c598ec5d589d91b74d881cc571e8602ec7afe4ea093c7aa002
7
- data.tar.gz: 03fc4d464b2758279405bee6a8b6a69a5175c863ed792d8e373927103345f6a9a7cc2f5d72f9bc56ec6d0c5daf845887cd78ec4269d5fd66943d9083aabe37f2
6
+ metadata.gz: ae16ac72bd4a0e9a2c7634fd714a8db54cebc7b4c4cdd271627a57ac82047d739947f1800b1eaa997c28473818ef86f3270be8f58415f2fe75b08f8a2237b12a
7
+ data.tar.gz: ceb502c64be7bde904b88824d76c2b78de639fa1cd7f818fddc128aedc699bf4c8828a799a3ddc01230bfd5c8fb5f956b323c9e67688f2c22d2b5c1bd0ab67b8
data/CHANGELOG.md CHANGED
@@ -1,6 +1,19 @@
1
1
  # Changelog
2
2
 
3
- ## master (unreleased)
3
+ ## Unreleased
4
+
5
+ ## 0.9.0 (2022-09-21)
6
+
7
+ * Make `#instance=` public method.
8
+ * Drop Ruby 2.5 support.
9
+ * Add Ruby 3.1 for CI.
10
+ * Update development dependencies.
11
+ * Resolve RuboCop offenses.
12
+
13
+ ## 0.8.0 (2021-02-11)
14
+
15
+ * Support Ruby 3.
16
+ * Update development dependencies.
4
17
 
5
18
  ## 0.7.2 (2020-11-11)
6
19
 
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Formalism Model Forms
2
2
 
3
3
  [![Cirrus CI - Base Branch Build Status](https://img.shields.io/cirrus/github/AlexWayfer/formalism-model_forms?style=flat-square)](https://cirrus-ci.com/github/AlexWayfer/formalism-model_forms)
4
- [![Codecov branch](https://img.shields.io/codecov/c/github/AlexWayfer/formalism-model_forms/master.svg?style=flat-square)](https://codecov.io/gh/AlexWayfer/formalism-model_forms)
4
+ [![Codecov branch](https://img.shields.io/codecov/c/github/AlexWayfer/formalism-model_forms/main.svg?style=flat-square)](https://codecov.io/gh/AlexWayfer/formalism-model_forms)
5
5
  [![Code Climate](https://img.shields.io/codeclimate/maintainability/AlexWayfer/formalism-model_forms.svg?style=flat-square)](https://codeclimate.com/github/AlexWayfer/formalism-model_forms)
6
6
  [![Depfu](https://img.shields.io/depfu/AlexWayfer/benchmark_toys?style=flat-square)](https://depfu.com/repos/github/AlexWayfer/formalism-model_forms)
7
- [![Inline docs](https://inch-ci.org/github/AlexWayfer/formalism-model_forms.svg?branch=master)](https://inch-ci.org/github/AlexWayfer/formalism-model_forms)
7
+ [![Inline docs](https://inch-ci.org/github/AlexWayfer/formalism-model_forms.svg?branch=main)](https://inch-ci.org/github/AlexWayfer/formalism-model_forms)
8
8
  [![License](https://img.shields.io/github/license/AlexWayfer/formalism-model_forms.svg?style=flat-square)](LICENSE.txt)
9
9
  [![Gem](https://img.shields.io/gem/v/formalism-model_forms.svg?style=flat-square)](https://rubygems.org/gems/formalism-model_forms)
10
10
 
@@ -65,7 +65,7 @@ module Formalism
65
65
  end
66
66
 
67
67
  memoize def model_name
68
- deconstantize.split('::')[2..-1].reverse
68
+ deconstantize.split('::')[2..].reverse
69
69
  .find { |part| self::MODELS_NAMESPACE&.const_defined?(part, false) || part == 'Model' }
70
70
  end
71
71
 
@@ -82,6 +82,8 @@ module Formalism
82
82
  end
83
83
  end
84
84
 
85
+ attr_writer :instance
86
+
85
87
  def initialize(*)
86
88
  @cached =
87
89
  Sequel::Plugins.const_defined?(:StaticCache) &&
@@ -108,13 +110,11 @@ module Formalism
108
110
 
109
111
  def execute
110
112
  # TODO: Check
111
- Actions::Application::Restart.run if @cached && ENV['RACK_ENV'] != 'test'
113
+ Actions::Application::Restart.run if @cached && ENV.fetch('RACK_ENV') != 'test'
112
114
 
113
115
  instance
114
116
  end
115
117
 
116
- attr_writer :instance
117
-
118
118
  def find_instance
119
119
  model
120
120
  .first(primary_field_name => public_send(primary_field_name))
@@ -63,10 +63,7 @@ module Formalism
63
63
  def execute
64
64
  self.instance =
65
65
  if dataset
66
- if @cached
67
- then cached_dataset_for_execute
68
- else non_cached_dataset_for_execute.all
69
- end
66
+ @cached ? cached_dataset_for_execute : non_cached_dataset_for_execute.all
70
67
  else
71
68
  []
72
69
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Formalism
4
4
  module ModelForms
5
- VERSION = '0.7.2'
5
+ VERSION = '0.9.0'
6
6
  end
7
7
  end
@@ -41,8 +41,6 @@ module Formalism
41
41
 
42
42
  def define_other_model_forms(forms_namespace)
43
43
  FORM_CLASSES.each do |form_name, parent_name|
44
- ## https://github.com/rubocop-hq/rubocop/issues/9026
45
- # rubocop:disable Style/DocumentDynamicEvalDefinition
46
44
  forms_namespace::Model.class_eval(
47
45
  <<~CODE,
48
46
  # class Update < FB::Forms::Model::Base
@@ -54,7 +52,6 @@ module Formalism
54
52
  CODE
55
53
  __FILE__, __LINE__ - 7
56
54
  )
57
- # rubocop:enable Style/DocumentDynamicEvalDefinition
58
55
  end
59
56
  end
60
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formalism-model_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Popov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-11-11 00:00:00.000000000 Z
12
+ date: 2022-09-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: alt_memery
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 0.3.0
48
+ version: 0.4.0
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: 0.3.0
55
+ version: 0.4.0
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: gorilla_patch
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -129,42 +129,42 @@ dependencies:
129
129
  requirements:
130
130
  - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: 0.4.0
132
+ version: 0.12.1
133
133
  type: :development
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: 0.4.0
139
+ version: 0.12.1
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: toys
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: 0.11.0
146
+ version: 0.13.0
147
147
  type: :development
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
- version: 0.11.0
153
+ version: 0.13.0
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: codecov
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - "~>"
159
159
  - !ruby/object:Gem::Version
160
- version: 0.2.0
160
+ version: 0.6.0
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
165
  - - "~>"
166
166
  - !ruby/object:Gem::Version
167
- version: 0.2.0
167
+ version: 0.6.0
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: rspec
170
170
  requirement: !ruby/object:Gem::Requirement
@@ -185,28 +185,42 @@ dependencies:
185
185
  requirements:
186
186
  - - "~>"
187
187
  - !ruby/object:Gem::Version
188
- version: 0.19.0
188
+ version: 0.21.0
189
+ type: :development
190
+ prerelease: false
191
+ version_requirements: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - "~>"
194
+ - !ruby/object:Gem::Version
195
+ version: 0.21.0
196
+ - !ruby/object:Gem::Dependency
197
+ name: simplecov-cobertura
198
+ requirement: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - "~>"
201
+ - !ruby/object:Gem::Version
202
+ version: '2.1'
189
203
  type: :development
190
204
  prerelease: false
191
205
  version_requirements: !ruby/object:Gem::Requirement
192
206
  requirements:
193
207
  - - "~>"
194
208
  - !ruby/object:Gem::Version
195
- version: 0.19.0
209
+ version: '2.1'
196
210
  - !ruby/object:Gem::Dependency
197
211
  name: rubocop
198
212
  requirement: !ruby/object:Gem::Requirement
199
213
  requirements:
200
214
  - - "~>"
201
215
  - !ruby/object:Gem::Version
202
- version: '1.2'
216
+ version: 1.36.0
203
217
  type: :development
204
218
  prerelease: false
205
219
  version_requirements: !ruby/object:Gem::Requirement
206
220
  requirements:
207
221
  - - "~>"
208
222
  - !ruby/object:Gem::Version
209
- version: '1.2'
223
+ version: 1.36.0
210
224
  - !ruby/object:Gem::Dependency
211
225
  name: rubocop-performance
212
226
  requirement: !ruby/object:Gem::Requirement
@@ -265,7 +279,8 @@ licenses:
265
279
  metadata:
266
280
  source_code_uri: https://github.com/AlexWayfer/formalism-model_forms
267
281
  homepage_uri: https://github.com/AlexWayfer/formalism-model_forms
268
- changelog_uri: https://github.com/AlexWayfer/formalism-model_forms/blob/master/CHANGELOG.md
282
+ changelog_uri: https://github.com/AlexWayfer/formalism-model_forms/blob/main/CHANGELOG.md
283
+ rubygems_mfa_required: 'true'
269
284
  post_install_message:
270
285
  rdoc_options: []
271
286
  require_paths:
@@ -274,14 +289,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
274
289
  requirements:
275
290
  - - ">="
276
291
  - !ruby/object:Gem::Version
277
- version: 2.5.0
292
+ version: '2.6'
293
+ - - "<"
294
+ - !ruby/object:Gem::Version
295
+ version: '4'
278
296
  required_rubygems_version: !ruby/object:Gem::Requirement
279
297
  requirements:
280
298
  - - ">="
281
299
  - !ruby/object:Gem::Version
282
300
  version: '0'
283
301
  requirements: []
284
- rubygems_version: 3.1.4
302
+ rubygems_version: 3.3.7
285
303
  signing_key:
286
304
  specification_version: 4
287
305
  summary: Standard Formalism forms for Sequel Models