hyperactiveform 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 +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +10 -0
- data/lib/generators/form/form_generator.rb +9 -0
- data/lib/generators/form/templates/form.rb +2 -0
- data/lib/{hyper_active_form/generators.rb → generators/hyper_active_form/install/install_generator.rb} +0 -2
- data/lib/generators/rspec/form_generator.rb +11 -0
- data/lib/generators/rspec/templates/form_spec.rb +5 -0
- data/lib/generators/test_unit/form_generator.rb +11 -0
- data/lib/generators/test_unit/templates/form_test.rb +7 -0
- data/lib/hyper_active_form/version.rb +1 -1
- data/lib/hyper_active_form.rb +0 -1
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c05e1cc748050b5a735f9f2fc3944427e5a3618b8083fa8ab9e3667a8d9f5f9a
|
4
|
+
data.tar.gz: e990037c9b3fcbcb5f2e68790c486f1a11bc541bb2680d2a312fa9a8336ca5e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56384a8814889a64eb844f60c9eb5eb22335d0143d83a2e2f9dcf662090ce44d9d794bdc632a4a2d672ed07c510718d63bed04e597ec657ca40ac1ec5be66fa4
|
7
|
+
data.tar.gz: 9cf4cb7e27b70e97687f19f5f860df6529e925d741c7f42d87c0c28b05a953bffcfeddbc2c72ef172b25af3ab79bc43d641d01d9718bfbbd1bba79a1b902a0b6
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.3.0] - 2024-12-22
|
4
|
+
- Add generators (`rails generate form foo`) ([#2](https://github.com/Intrepidd/hyperactiveform/pull/2) by [@tchiadeu](https://github.com/tchiadeu))
|
5
|
+
|
3
6
|
## [0.2.0] - 2024-12-14
|
4
7
|
- Add callbacks for `assign_form_attributes` and `submit`
|
5
8
|
- Change behavior of `assign_form_attributes`/`submit` to use the default value or nil if no value is provided, rather than keeping the value from `setup`
|
data/README.md
CHANGED
@@ -26,6 +26,16 @@ Run the install generator:
|
|
26
26
|
|
27
27
|
this will create an `ApplicationForm` class in your app/forms directory. You can use it as a base class for your form objects.
|
28
28
|
|
29
|
+
## Generators
|
30
|
+
|
31
|
+
You can [generate](https://guides.rubyonrails.org/configuring.html#configuring-generators) a form and its tests with the following command:
|
32
|
+
|
33
|
+
```
|
34
|
+
$ rails generate form FooBar
|
35
|
+
```
|
36
|
+
|
37
|
+
This will create the `FooBarForm`
|
38
|
+
|
29
39
|
## Usage
|
30
40
|
|
31
41
|
Here is an example of an `HyperActiveForm` form object:
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Rspec
|
2
|
+
module Generators
|
3
|
+
class FormGenerator < ::Rails::Generators::NamedBase
|
4
|
+
source_root File.expand_path("templates", __dir__)
|
5
|
+
|
6
|
+
def create_form_spec
|
7
|
+
template "form_spec.rb", File.join("spec/forms", class_path, "#{file_name}_form_spec.rb")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module TestUnit
|
2
|
+
module Generators
|
3
|
+
class FormGenerator < ::Rails::Generators::NamedBase
|
4
|
+
source_root File.expand_path("templates", __dir__)
|
5
|
+
|
6
|
+
def create_form_test
|
7
|
+
template "form_test.rb", File.join("test/forms", class_path, "#{file_name}_form_test.rb")
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/hyper_active_form.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyperactiveform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrien Siami
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -88,9 +88,15 @@ files:
|
|
88
88
|
- gemfiles/Gemfile.rails-7.1.x
|
89
89
|
- gemfiles/Gemfile.rails-7.2.x
|
90
90
|
- gemfiles/Gemfile.rails-8.x
|
91
|
+
- lib/generators/form/form_generator.rb
|
92
|
+
- lib/generators/form/templates/form.rb
|
93
|
+
- lib/generators/hyper_active_form/install/install_generator.rb
|
94
|
+
- lib/generators/rspec/form_generator.rb
|
95
|
+
- lib/generators/rspec/templates/form_spec.rb
|
96
|
+
- lib/generators/test_unit/form_generator.rb
|
97
|
+
- lib/generators/test_unit/templates/form_test.rb
|
91
98
|
- lib/hyper_active_form.rb
|
92
99
|
- lib/hyper_active_form/base.rb
|
93
|
-
- lib/hyper_active_form/generators.rb
|
94
100
|
- lib/hyper_active_form/version.rb
|
95
101
|
- lib/hyperactiveform.rb
|
96
102
|
- sig/hyperactiveform.rbs
|