readymade 0.1.3 → 0.1.4

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: 5518ad54b22a02728462c0d0ca01e71ebe9567c3ecd54a361ca8632cf4cc57b9
4
- data.tar.gz: 63060f391776097416c481b295e9a558e3eea37e78ecaae5486d924d870c4367
3
+ metadata.gz: a730db0a4c2ccfefcb7c48a607ba75e691b8133ac8f6f7cdc6a67554bed180c3
4
+ data.tar.gz: 84567afe201fd84977f5a56a46b68093c4bc7d814f4395d2cbb87325f268fa17
5
5
  SHA512:
6
- metadata.gz: 7c3b2f4f55272272223414fbd43f2a917368d0d8780dab5ffa83c575a630a39e8276fbbff63e20f125c88b994e8907592266a09c457e29e1cd823a85cf00de20
7
- data.tar.gz: 9658eacbac92c969f2171ce1ab2a210f965416b265222ce5505c1e26802d86473391fbb494b6410fa42c6810c4da87a56e02db7530b0f7f517107b36ab800aba
6
+ metadata.gz: 53c0991bce0adcfc2c9e2cbe8498936c90bcd01b197d3483027e04b594bb2ea9fbaf4b69cf7306312b4b2cb3784613f5facbde0d6ee46a6fba6b07fcab7b1814
7
+ data.tar.gz: 6d280789685dc5bead01c40191668c58e56124108d9c2d5c81a9537b0ee147e4d2718d03460b2e4b512ee4b43ca98947781eff1f006746fb1108bac352294fb0
data/CHANGELOG.md CHANGED
@@ -1,8 +1,18 @@
1
1
  Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- [0.1.3] - 2021-11.20
4
+ ## [0.1.4] - 2021-11-22
5
5
 
6
- Improvements
6
+ ### Features
7
+
8
+ * Add `Readymade::InstantForm`
9
+
10
+ ### Improvements
11
+
12
+ * Call `build_form` inside `form_valid?` if `@form` is not defined
13
+
14
+ ## [0.1.3] - 2021-11-20
15
+
16
+ ### Improvements
7
17
 
8
18
  * Fix error when required param for instant form is not defined
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- readymade (0.1.3)
4
+ readymade (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -23,9 +23,35 @@ Or install it yourself as:
23
23
  Inherit your components from:
24
24
  * `Readymade::Response`
25
25
  * `Readymade::Form`
26
+ * `Readymade::InstantForm`
26
27
  * `Readymade::Action`
27
28
  * `Readymade::Operation`
28
29
 
30
+ ### Readymade::Response
31
+
32
+ ```TODO: add```
33
+
34
+ ### Readymade::Form
35
+
36
+ ```TODO: add```
37
+
38
+ ### Readymade::InstantForm
39
+
40
+ Permit params and validates presence inline
41
+
42
+ ```ruby
43
+ Readymade::InstantForm.new(my_params, permitted: %i[name phone], required: %i[email]) # permits: name, phone, email; validates on presence: email
44
+ ```
45
+
46
+ ### Readymade::Action
47
+
48
+ ```TODO: add```
49
+
50
+ ### Readymade::Operation
51
+
52
+ ```TODO: add```
53
+
54
+
29
55
  ## Development
30
56
 
31
57
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -20,8 +20,6 @@ module Readymade
20
20
  @args.each do |name, value|
21
21
  instance_variable_set("@#{name}", value)
22
22
  end
23
-
24
- # yield if block_given?
25
23
  end
26
24
 
27
25
  def call; end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Readymade
4
+ class InstantForm < Form
5
+
6
+ end
7
+ end
@@ -14,6 +14,8 @@ module Readymade
14
14
  end
15
15
 
16
16
  def form_valid?
17
+ build_form if @form.nil? && defined?(:build_form)
18
+
17
19
  form.validate
18
20
  end
19
21
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Readymade
4
- VERSION = '0.1.3'
4
+ VERSION = '0.1.4'
5
5
  end
data/lib/readymade.rb CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require 'readymade/action'
4
4
  require 'readymade/form'
5
+ require 'readymade/instant_form'
5
6
  require 'readymade/operation'
6
7
  require 'readymade/response'
7
8
  require 'readymade/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: readymade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - OrestF
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-11-20 00:00:00.000000000 Z
11
+ date: 2021-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -74,6 +74,7 @@ files:
74
74
  - lib/readymade.rb
75
75
  - lib/readymade/action.rb
76
76
  - lib/readymade/form.rb
77
+ - lib/readymade/instant_form.rb
77
78
  - lib/readymade/operation.rb
78
79
  - lib/readymade/response.rb
79
80
  - lib/readymade/version.rb