hotwire_crud 0.1.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/hotwire_crud.gemspec +7 -3
- data/lib/generators/hotwire_crud/USAGE +1 -1
- data/lib/generators/hotwire_crud/hotwire_crud_generator.rb +25 -7
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e28611e36f142b7cbc686342aa46add0584de857664561cb12da7c3ac9e9b7f
|
4
|
+
data.tar.gz: 7ce6fa2c4d1245df5231a4f70ad177049681e1aa9df714ef4da2f5b36a5e6492
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e37b02588f1d5cfd9d974efa90858711c481451e59922648deba621e2cbf6d36c265bd81c59b7712cb6e66769f55e08dc2283aefad1ba965d507e4e6074f36a
|
7
|
+
data.tar.gz: dfd4ebb3f66e9d70de6f01923653f010484ebf2566b8ecad942fa250d43466703c059293f531deb62dfcb5ba8ae6e2982a997ad7e4de389a23ff433a2fe4ec56
|
data/hotwire_crud.gemspec
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
Gem::Specification.new do |spec|
|
2
4
|
spec.name = 'hotwire_crud'
|
3
|
-
spec.version = '0.
|
5
|
+
spec.version = '1.0.0'
|
4
6
|
spec.summary = 'crud generator with hotwire approach and static routes'
|
5
7
|
spec.description = 'Crud generator with static routes which lazy loads content using content routes'
|
6
8
|
spec.authors = ['Umair Azam']
|
@@ -10,10 +12,12 @@ Gem::Specification.new do |spec|
|
|
10
12
|
|
11
13
|
spec.files = Dir['lib/**/*', 'templates/**/*', '*.gemspec']
|
12
14
|
spec.require_paths = ['lib']
|
13
|
-
|
15
|
+
spec.required_ruby_version = '3.1.2'
|
14
16
|
spec.add_runtime_dependency 'rails', '>= 6.0'
|
15
17
|
# Add other dependencies if needed
|
16
18
|
|
17
19
|
# Specify the custom generator file(s)
|
18
20
|
spec.add_development_dependency 'railties'
|
19
|
-
|
21
|
+
spec.add_development_dependency 'rubocop', '~> 1.0'
|
22
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
23
|
+
end
|
@@ -1,30 +1,48 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# A Rails generator that creates a CRUD (Create, Read, Update, Delete) controller
|
4
|
+
# with Hotwire support.
|
5
|
+
#
|
6
|
+
# This generator creates a controller file, view files, and sets up the
|
7
|
+
# routes for the CRUD operations. It is designed to be used with Hotwire
|
8
|
+
# for a more interactive and dynamic user interface.
|
9
|
+
#
|
10
|
+
# Usage:
|
11
|
+
# rails generate hotwire_crud resource_controller_name
|
12
|
+
#
|
13
|
+
# Example:
|
14
|
+
# rails generate hotwire_crud products
|
15
|
+
#
|
16
|
+
# This will generate a Products controller with actions for index, show, new, edit,
|
17
|
+
# create, update, and destroy, along with corresponding view templates.
|
18
|
+
#
|
19
|
+
|
20
|
+
# lib/generators/hotwire_crud_generator.rb
|
3
21
|
class HotwireCrudGenerator < Rails::Generators::NamedBase
|
4
|
-
source_root File.expand_path(
|
22
|
+
source_root File.expand_path('templates', __dir__)
|
5
23
|
|
6
24
|
argument :actions, type: :array, default: %w[index edit new show]
|
7
25
|
|
8
26
|
def create_static_controller_file
|
9
|
-
template
|
27
|
+
template 'static_controller.erb', File.join('app/controllers/static', "#{file_name}_controller.rb")
|
10
28
|
end
|
11
29
|
|
12
30
|
def create_static_controller_test
|
13
|
-
template
|
31
|
+
template 'static_controller_spec.erb', File.join('spec/controllers/static', "#{file_name}_controller_spec.rb")
|
14
32
|
end
|
15
33
|
|
16
34
|
def create_controller_file
|
17
|
-
template
|
35
|
+
template 'controller.erb', File.join('app/controllers', "#{file_name}_controller.rb")
|
18
36
|
end
|
19
37
|
|
20
38
|
def create_controller_test
|
21
|
-
template
|
39
|
+
template 'controller_spec.erb', File.join('spec/controllers', "#{file_name}_controller_spec.rb")
|
22
40
|
end
|
23
41
|
|
24
42
|
def create_views
|
25
43
|
actions.each do |action|
|
26
|
-
template "views/static_#{action}.html.erb", File.join(
|
27
|
-
template "views/#{action}.html.erb", File.join(
|
44
|
+
template "views/static_#{action}.html.erb", File.join('app/views/static', file_name, "#{action}.html.haml")
|
45
|
+
template "views/#{action}.html.erb", File.join('app/views', file_name, "#{action}.html.haml")
|
28
46
|
end
|
29
47
|
end
|
30
48
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hotwire_crud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Umair Azam
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rubocop
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.0'
|
41
55
|
description: Crud generator with static routes which lazy loads content using content
|
42
56
|
routes
|
43
57
|
email:
|
@@ -64,23 +78,24 @@ files:
|
|
64
78
|
homepage: https://github.com/omairrazam/hotwire_crud.git
|
65
79
|
licenses:
|
66
80
|
- MIT
|
67
|
-
metadata:
|
81
|
+
metadata:
|
82
|
+
rubygems_mfa_required: 'true'
|
68
83
|
post_install_message:
|
69
84
|
rdoc_options: []
|
70
85
|
require_paths:
|
71
86
|
- lib
|
72
87
|
required_ruby_version: !ruby/object:Gem::Requirement
|
73
88
|
requirements:
|
74
|
-
- -
|
89
|
+
- - '='
|
75
90
|
- !ruby/object:Gem::Version
|
76
|
-
version:
|
91
|
+
version: 3.1.2
|
77
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
93
|
requirements:
|
79
94
|
- - ">="
|
80
95
|
- !ruby/object:Gem::Version
|
81
96
|
version: '0'
|
82
97
|
requirements: []
|
83
|
-
rubygems_version: 3.3.
|
98
|
+
rubygems_version: 3.3.7
|
84
99
|
signing_key:
|
85
100
|
specification_version: 4
|
86
101
|
summary: crud generator with hotwire approach and static routes
|