view_component-form 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 72d1e925f6501a2af4458ca669c87bd9a947173fc4766ec4e72c466f794c649a
4
- data.tar.gz: 6c8be1d09936f2ba0de85be506419472bbe84d9901628cbcbb4ea3f90c21b21f
3
+ metadata.gz: 5a9199cdd2815e1711c5799426cf9e8ba25ecd6352c34616c973a269894f4a71
4
+ data.tar.gz: 21f504ee76b9eaf898ac3a125bab5234fef641df64e04554a3bdf5d748185858
5
5
  SHA512:
6
- metadata.gz: 524c3595df4a9891f036584ab79590a8bf2547c32cf74220fe6276ff3c3b6027e14b148ba558151513592a372e29c6ae0f9562c9ae23715500567a34e73c7b05
7
- data.tar.gz: 20c3af9cacc78f509a3d10371ab117c6ec6e766ffd1fa418efce9fc0ac4eb87b5a751b4ec0d24a6aab4a0f2f0bc741a97b5064956ee34bfa822ab219e3a46964
6
+ metadata.gz: 486ba4c74fd76b83e58c355234d0d65a2a06568634561d2a887b8623e115500c911ca810040f3fa5b41c66c37e3e80d58052065550281300bf7e355e635c3a76
7
+ data.tar.gz: 56d58c623a852b428d5b6440aeeb6a4f3c18c93ffd748a759588c0a5a4726b5e089517d48bdfebc2431447753c23a43b4612d639679f429d01f7208bcde9a87b
data/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
  ## [Unreleased]
8
8
  Nothing yet
9
9
 
10
+ ## [0.2.1] - 2022-03-17
11
+ ### Added
12
+ - Conditional ActionText in CI (#117)
13
+
14
+ ### Fixed
15
+ - Fix broken gem initialization due to missing ViewComponent::Form constant (#114)
16
+ - Initialize empty WeekdaySelectComponent if Rails < 7 to fix Zeitwerk error (#115)
17
+
10
18
  ## [0.2.0] - 2022-03-02
11
19
  ### Added
12
20
  - Test BuilderGenerator with generator\_spec (#64)
@@ -65,7 +73,8 @@ Nothing yet
65
73
  - Add CHANGELOG (#50)
66
74
  - Add CI (#2)
67
75
 
68
- [Unreleased]: https://github.com/pantographe/view_component-form/compare/v0.2.0...HEAD
76
+ [Unreleased]: https://github.com/pantographe/view_component-form/compare/v0.2.1...HEAD
77
+ [0.2.1]: https://github.com/pantographe/view_component-form/compare/v0.2.0...v0.2.1
69
78
  [0.2.0]: https://github.com/pantographe/view_component-form/compare/v0.1.3...v0.2.0
70
79
  [0.1.3]: https://github.com/pantographe/view_component-form/compare/v0.1.2...v0.1.3
71
80
  [0.1.2]: https://github.com/pantographe/view_component-form/compare/v0.1.1...v0.1.2
@@ -1,20 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- if Rails::VERSION::MAJOR >= 7
4
- module ViewComponent
5
- module Form
6
- class WeekdaySelectComponent < FieldComponent
7
- attr_reader :html_options
3
+ module ViewComponent
4
+ module Form
5
+ class WeekdaySelectComponent < FieldComponent
6
+ attr_reader :html_options
8
7
 
9
- def initialize(form, object_name, method_name, options = {}, html_options = {})
10
- @html_options = html_options
8
+ def initialize(form, object_name, method_name, options = {}, html_options = {})
9
+ @html_options = html_options
11
10
 
12
- super(form, object_name, method_name, options)
11
+ super(form, object_name, method_name, options)
13
12
 
14
- set_html_options!
15
- end
13
+ set_html_options!
14
+ end
16
15
 
17
- def call
16
+ def call # rubocop:disable Metrics/MethodLength
17
+ if Rails::VERSION::MAJOR >= 7 # rubocop:disable Style/GuardClause
18
18
  ActionView::Helpers::Tags::WeekdaySelect.new(
19
19
  object_name,
20
20
  method_name,
@@ -22,14 +22,16 @@ if Rails::VERSION::MAJOR >= 7
22
22
  options,
23
23
  html_options
24
24
  ).render
25
+ else
26
+ raise NotImplementedError, "#{self.class} is only available in Rails >= 7"
25
27
  end
28
+ end
26
29
 
27
- protected
30
+ protected
28
31
 
29
- def set_html_options!
30
- @html_options[:class] = class_names(html_options[:class], html_class)
31
- @html_options.delete(:class) if @html_options[:class].blank?
32
- end
32
+ def set_html_options!
33
+ @html_options[:class] = class_names(html_options[:class], html_class)
34
+ @html_options.delete(:class) if @html_options[:class].blank?
33
35
  end
34
36
  end
35
37
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ViewComponent
4
4
  module Form
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
@@ -3,6 +3,11 @@
3
3
  require "view_component"
4
4
  require "zeitwerk"
5
5
 
6
+ module ViewComponent
7
+ module Form
8
+ end
9
+ end
10
+
6
11
  loader = Zeitwerk::Loader.for_gem
7
12
  form = "#{__dir__}/form.rb"
8
13
  loader.ignore(form)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_component-form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pantographe
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-02 00:00:00.000000000 Z
11
+ date: 2022-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionview
@@ -147,7 +147,7 @@ metadata:
147
147
  source_code_uri: https://github.com/pantographe/view_component-form
148
148
  bug_tracker_uri: https://github.com/pantographe/view_component-form/issues
149
149
  rubygems_mfa_required: 'true'
150
- post_install_message:
150
+ post_install_message:
151
151
  rdoc_options: []
152
152
  require_paths:
153
153
  - lib
@@ -162,8 +162,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
164
  requirements: []
165
- rubygems_version: 3.3.4
166
- signing_key:
165
+ rubygems_version: 3.2.32
166
+ signing_key:
167
167
  specification_version: 4
168
168
  summary: Rails FormBuilder for ViewComponent
169
169
  test_files: []