lite-form 1.0.2 → 1.0.3

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: 71ac196f9262cabced3c3e7bc7e588e7bce698a4abbd7aa5a956787335993179
4
- data.tar.gz: 33a648e006ccd5af8431f0a5d079db55cf10aad688eedb4fe16f65fdba380c34
3
+ metadata.gz: ea2f3c1a9fa5400e41478b65b200c21c3308f1d1e0d15cd0817d51439ca35f9d
4
+ data.tar.gz: abde0d2692e46fe859b5bf5e632ef777ea891acc988e02d8bd95dfe56f71a6fe
5
5
  SHA512:
6
- metadata.gz: d1bd7cf4427423d2d3f6958e3c39d02de7ccdca6b06918c671e3ef3102e9deedc77dad59cef12f5897040e36a6848d2af0d06eee27783128eef08a4c3c323a51
7
- data.tar.gz: 629f2dc0ae0728b002434fb890caa5d9d3f5589800938e9358e114319a358559fe73dac299481ebbbf663b38a64f25d509e83a3751a0098fab87081f3c0fa4ef
6
+ metadata.gz: 352537783f3c6edd12db09afe98a3b5125e92e99b21edd4891495b9cc06ef445539ece33c41577cdbe0c848349265e515a6ba4e5cd98286334a1c9e14392e5eb
7
+ data.tar.gz: 8abd3defb7ae22d462fe5816b0bcca03e4c882111c7d0f7450125c1b1a8f7c0dbfc9df8f3192175fa9d3d9d8c4a2f03124200d95471ddb070a538a8b6d975461
data/.rubocop.yml CHANGED
@@ -5,8 +5,6 @@ AllCops:
5
5
  TargetRubyVersion: 2.6
6
6
  DisplayCopNames: true
7
7
  DisplayStyleGuide: true
8
- LineLength:
9
- Max: 100
10
8
  Layout/EmptyLinesAroundBlockBody:
11
9
  Exclude:
12
10
  - 'spec/**/**/*'
@@ -14,6 +12,8 @@ Layout/EmptyLinesAroundClassBody:
14
12
  EnforcedStyle: empty_lines_except_namespace
15
13
  Layout/EmptyLinesAroundModuleBody:
16
14
  EnforcedStyle: empty_lines_except_namespace
15
+ Layout/LineLength:
16
+ Max: 100
17
17
  Metrics/BlockLength:
18
18
  Exclude:
19
19
  - 'spec/**/**/*'
data/CHANGELOG.md CHANGED
@@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.0.2] - 2019-09-16
10
+ ### Removed
11
+ - Removed lite-form generator
12
+ - Removed spec from rails generator
13
+
9
14
  ## [1.0.2] - 2019-09-16
10
15
  ### Changed
11
16
  - Changed create propagation to check errors instead of persistence
data/Gemfile.lock CHANGED
@@ -1,115 +1,115 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-form (1.0.2)
4
+ lite-form (1.0.3)
5
5
  activemodel
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- actionpack (6.0.0)
11
- actionview (= 6.0.0)
12
- activesupport (= 6.0.0)
13
- rack (~> 2.0)
10
+ actionpack (6.0.2.1)
11
+ actionview (= 6.0.2.1)
12
+ activesupport (= 6.0.2.1)
13
+ rack (~> 2.0, >= 2.0.8)
14
14
  rack-test (>= 0.6.3)
15
15
  rails-dom-testing (~> 2.0)
16
16
  rails-html-sanitizer (~> 1.0, >= 1.2.0)
17
- actionview (6.0.0)
18
- activesupport (= 6.0.0)
17
+ actionview (6.0.2.1)
18
+ activesupport (= 6.0.2.1)
19
19
  builder (~> 3.1)
20
20
  erubi (~> 1.4)
21
21
  rails-dom-testing (~> 2.0)
22
22
  rails-html-sanitizer (~> 1.1, >= 1.2.0)
23
- activemodel (6.0.0)
24
- activesupport (= 6.0.0)
25
- activerecord (6.0.0)
26
- activemodel (= 6.0.0)
27
- activesupport (= 6.0.0)
28
- activesupport (6.0.0)
23
+ activemodel (6.0.2.1)
24
+ activesupport (= 6.0.2.1)
25
+ activerecord (6.0.2.1)
26
+ activemodel (= 6.0.2.1)
27
+ activesupport (= 6.0.2.1)
28
+ activesupport (6.0.2.1)
29
29
  concurrent-ruby (~> 1.0, >= 1.0.2)
30
30
  i18n (>= 0.7, < 2)
31
31
  minitest (~> 5.1)
32
32
  tzinfo (~> 1.1)
33
- zeitwerk (~> 2.1, >= 2.1.8)
33
+ zeitwerk (~> 2.2)
34
34
  ast (2.4.0)
35
- builder (3.2.3)
35
+ builder (3.2.4)
36
36
  colorize (0.8.1)
37
37
  concurrent-ruby (1.1.5)
38
- crass (1.0.4)
38
+ crass (1.0.5)
39
39
  database_cleaner (1.7.0)
40
40
  diff-lcs (1.3)
41
- erubi (1.8.0)
42
- fasterer (0.6.0)
41
+ erubi (1.9.0)
42
+ fasterer (0.8.1)
43
43
  colorize (~> 0.7)
44
- ruby_parser (>= 3.13.0)
44
+ ruby_parser (>= 3.14.1)
45
45
  generator_spec (0.9.4)
46
46
  activesupport (>= 3.0.0)
47
47
  railties (>= 3.0.0)
48
- i18n (1.6.0)
48
+ i18n (1.7.0)
49
49
  concurrent-ruby (~> 1.0)
50
- jaro_winkler (1.5.3)
51
- loofah (2.2.3)
50
+ jaro_winkler (1.5.4)
51
+ loofah (2.4.0)
52
52
  crass (~> 1.0.2)
53
53
  nokogiri (>= 1.5.9)
54
54
  method_source (0.9.2)
55
55
  mini_portile2 (2.4.0)
56
- minitest (5.11.3)
57
- nokogiri (1.10.4)
56
+ minitest (5.13.0)
57
+ nokogiri (1.10.7)
58
58
  mini_portile2 (~> 2.4.0)
59
- parallel (1.17.0)
60
- parser (2.6.4.1)
59
+ parallel (1.19.1)
60
+ parser (2.6.5.0)
61
61
  ast (~> 2.4.0)
62
- rack (2.0.7)
62
+ rack (2.0.8)
63
63
  rack-test (1.1.0)
64
64
  rack (>= 1.0, < 3)
65
65
  rails-dom-testing (2.0.3)
66
66
  activesupport (>= 4.2.0)
67
67
  nokogiri (>= 1.6)
68
- rails-html-sanitizer (1.2.0)
69
- loofah (~> 2.2, >= 2.2.2)
70
- railties (6.0.0)
71
- actionpack (= 6.0.0)
72
- activesupport (= 6.0.0)
68
+ rails-html-sanitizer (1.3.0)
69
+ loofah (~> 2.3)
70
+ railties (6.0.2.1)
71
+ actionpack (= 6.0.2.1)
72
+ activesupport (= 6.0.2.1)
73
73
  method_source
74
74
  rake (>= 0.8.7)
75
75
  thor (>= 0.20.3, < 2.0)
76
76
  rainbow (3.0.0)
77
- rake (12.3.3)
78
- rspec (3.8.0)
79
- rspec-core (~> 3.8.0)
80
- rspec-expectations (~> 3.8.0)
81
- rspec-mocks (~> 3.8.0)
82
- rspec-core (3.8.2)
83
- rspec-support (~> 3.8.0)
84
- rspec-expectations (3.8.4)
77
+ rake (13.0.1)
78
+ rspec (3.9.0)
79
+ rspec-core (~> 3.9.0)
80
+ rspec-expectations (~> 3.9.0)
81
+ rspec-mocks (~> 3.9.0)
82
+ rspec-core (3.9.0)
83
+ rspec-support (~> 3.9.0)
84
+ rspec-expectations (3.9.0)
85
85
  diff-lcs (>= 1.2.0, < 2.0)
86
- rspec-support (~> 3.8.0)
87
- rspec-mocks (3.8.1)
86
+ rspec-support (~> 3.9.0)
87
+ rspec-mocks (3.9.0)
88
88
  diff-lcs (>= 1.2.0, < 2.0)
89
- rspec-support (~> 3.8.0)
90
- rspec-support (3.8.2)
91
- rubocop (0.74.0)
89
+ rspec-support (~> 3.9.0)
90
+ rspec-support (3.9.0)
91
+ rubocop (0.78.0)
92
92
  jaro_winkler (~> 1.5.1)
93
93
  parallel (~> 1.10)
94
94
  parser (>= 2.6)
95
95
  rainbow (>= 2.2.2, < 4.0)
96
96
  ruby-progressbar (~> 1.7)
97
97
  unicode-display_width (>= 1.4.0, < 1.7)
98
- rubocop-performance (1.4.1)
98
+ rubocop-performance (1.5.1)
99
99
  rubocop (>= 0.71.0)
100
- rubocop-rspec (1.35.0)
101
- rubocop (>= 0.60.0)
100
+ rubocop-rspec (1.37.1)
101
+ rubocop (>= 0.68.1)
102
102
  ruby-progressbar (1.10.1)
103
- ruby_parser (3.13.1)
103
+ ruby_parser (3.14.1)
104
104
  sexp_processor (~> 4.9)
105
- sexp_processor (4.12.1)
106
- sqlite3 (1.4.1)
107
- thor (0.20.3)
105
+ sexp_processor (4.13.0)
106
+ sqlite3 (1.4.2)
107
+ thor (1.0.1)
108
108
  thread_safe (0.3.6)
109
109
  tzinfo (1.2.5)
110
110
  thread_safe (~> 0.1)
111
111
  unicode-display_width (1.6.0)
112
- zeitwerk (2.1.10)
112
+ zeitwerk (2.2.2)
113
113
 
114
114
  PLATFORMS
115
115
  ruby
@@ -129,4 +129,4 @@ DEPENDENCIES
129
129
  sqlite3
130
130
 
131
131
  BUNDLED WITH
132
- 2.0.1
132
+ 2.0.2
data/README.md CHANGED
@@ -30,18 +30,21 @@ Or install it yourself as:
30
30
 
31
31
  ## Setup
32
32
 
33
- `rails g lite:form:install` will generate the following file:
34
- `../app/forms/application_form.rb`
33
+ ### Generators
35
34
 
36
- ```ruby
37
- class ApplicationForm < Lite::Form::Base
38
- end
35
+ Use `rails g form NAME` will generate the following files:
36
+
37
+ ```erb
38
+ app/forms/[name]_form.rb
39
39
  ```
40
40
 
41
- Use `rails g form NAME` will generate the following file:
42
- `../app/forms/[name]_form.rb`
41
+ If a `ApplicationForm` file in the `app/forms` directory is available, the
42
+ generator will create file that inherit from `ApplicationForm` if not it will
43
+ fallback to `Lite::Form::Base`.
44
+
45
+ ### Forms
43
46
 
44
- You will then need to fill this class with the methods and actions you want to perform:
47
+ You will need to fill this class with the methods and actions you want to perform:
45
48
 
46
49
  ```ruby
47
50
  class UserForm < ApplicationForm
@@ -6,4 +6,3 @@ Example:
6
6
 
7
7
  This will create:
8
8
  - app/forms/[name]_form.rb
9
- - spec/forms/[name]_form_spec.rb
@@ -14,12 +14,6 @@ module Rails
14
14
  template('form.rb.tt', path)
15
15
  end
16
16
 
17
- def copy_specs
18
- path = File.join('spec', 'forms', class_path, "#{file_name}_form_spec.rb")
19
- empty_directory('spec/forms')
20
- template('spec.rb.tt', path)
21
- end
22
-
23
17
  private
24
18
 
25
19
  def file_name
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  <% module_namespacing do -%>
4
- class <%= class_name %>Form < ApplicationForm
4
+ class <%= class_name %>Form < <%= ApplicationForm.to_s rescue 'Lite::Form::Base' %>
5
5
  end
6
6
  <% end -%>
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Form
5
5
 
6
- VERSION ||= '1.0.2'
6
+ VERSION ||= '1.0.3'
7
7
 
8
8
  end
9
9
  end
data/lib/lite/form.rb CHANGED
@@ -11,5 +11,4 @@ end
11
11
  require "lite/form/#{name}"
12
12
  end
13
13
 
14
- require 'generators/lite/form/install_generator'
15
14
  require 'generators/rails/form_generator'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lite-form
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-17 00:00:00.000000000 Z
11
+ date: 2019-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -200,12 +200,9 @@ files:
200
200
  - _config.yml
201
201
  - bin/console
202
202
  - bin/setup
203
- - lib/generators/lite/form/install_generator.rb
204
- - lib/generators/lite/form/templates/install.rb
205
203
  - lib/generators/rails/USAGE
206
204
  - lib/generators/rails/form_generator.rb
207
205
  - lib/generators/rails/templates/form.rb.tt
208
- - lib/generators/rails/templates/spec.rb.tt
209
206
  - lib/lite/form.rb
210
207
  - lib/lite/form/base.rb
211
208
  - lib/lite/form/exceptions.rb
@@ -234,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
234
231
  - !ruby/object:Gem::Version
235
232
  version: '0'
236
233
  requirements: []
237
- rubygems_version: 3.0.4
234
+ rubygems_version: 3.1.1
238
235
  signing_key:
239
236
  specification_version: 4
240
237
  summary: Ruby Form based framework (aka form objects)
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rails/generators'
4
-
5
- module Lite
6
- module Form
7
- class InstallGenerator < Rails::Generators::Base
8
-
9
- source_root File.expand_path('../templates', __FILE__)
10
-
11
- def copy_application_query_file
12
- copy_file('install.rb', 'app/forms/application_form.rb')
13
- end
14
-
15
- end
16
- end
17
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ApplicationForm < Lite::Form::Base
4
- end
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rails_helper'
4
-
5
- RSpec.describe <%= class_name %>Form, type: :form do
6
- pending "add some examples to (or delete) #{__FILE__}"
7
- end