vue_component_builder 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -2
- data/lib/builder/template/element-plus/main.vue.erb +2 -2
- data/lib/builder/template/element-plus/script.js.erb +1 -4
- data/lib/vue_component_builder/version.rb +1 -1
- data/lib/vue_component_builder.rb +14 -2
- data/vue_component_builder.gemspec +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6520cb101838c2379af8c3b3dfb958a443bbb3423719d48d3a5fdb2daaf065fc
|
4
|
+
data.tar.gz: f63d561a92cc892719da4348cbbc6820fe5f09432926c52107911e5d5a3c9051
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd13245bc12a763a8b259f7f547cd08f39dc23c5033258113be4b7f2c0d4ee512418870cc751f804d027f2348032f35d4902b474b96404541702cb437781d8f1
|
7
|
+
data.tar.gz: bdf646a8fbf56a40ff4a2cc86739b42a4bcbff1a488c9b52b36c21ab04730e7e6ad9918304e906f9a35c0c7fee0495221da31036709fa3fd6dfac668abfdb02e
|
data/README.md
CHANGED
@@ -35,7 +35,12 @@ exclude=id,created_at,updated_at [optional]
|
|
35
35
|
```
|
36
36
|
|
37
37
|
```shell
|
38
|
-
$ rails g
|
38
|
+
$ rails g vue_component_builder:new model=Fruit component=MyFruitComponent theme=element-plus exclude=id,created_at,updated_at
|
39
|
+
```
|
40
|
+
|
41
|
+
The new component will be generated inside in your Rails public folder
|
42
|
+
```shell
|
43
|
+
public/MyFruitComponent.vue
|
39
44
|
```
|
40
45
|
|
41
46
|
### TODO / coming soon
|
@@ -44,4 +49,5 @@ $ rails g vue_component:builder model=Fruit component=MyFruitComponent theme=el
|
|
44
49
|
- More theme options like Vuesax, BootstrapVue, Buefy or PrimeVue;
|
45
50
|
- Output directory option of generated component.
|
46
51
|
- Add search option in table;
|
47
|
-
- Add filter in table.
|
52
|
+
- Add filter in table.
|
53
|
+
- Use vuex
|
@@ -31,6 +31,20 @@ module VueComponentBuilder
|
|
31
31
|
|
32
32
|
input[:exclude] = input[:exclude].try(:split, ',')
|
33
33
|
|
34
|
+
if !input[:theme].present? || !input[:component].present? || !input[:model].present?
|
35
|
+
raise StandardError, <<-ERROR.strip_heredoc
|
36
|
+
|
37
|
+
Be sure to have informed the params needed:
|
38
|
+
e.g
|
39
|
+
model=Fruit
|
40
|
+
component=MyFruitComponent
|
41
|
+
theme=element-plus
|
42
|
+
exclude=id,created_at,updated_at [optional]
|
43
|
+
|
44
|
+
rails g vue_component_builder:new model=Fruit component=MyFruitComponent theme=element-plus exclude=id,created_at,updated_at
|
45
|
+
ERROR
|
46
|
+
end
|
47
|
+
|
34
48
|
@options = {
|
35
49
|
component: input[:component],
|
36
50
|
theme: input[:theme],
|
@@ -62,7 +76,6 @@ module VueComponentBuilder
|
|
62
76
|
protected
|
63
77
|
|
64
78
|
def build
|
65
|
-
# output_dir = "#{__dir__}/builder/output/#{@options[:component].to_s}.vue"
|
66
79
|
output_dir = "#{Rails.root}/public/#{@options[:component].to_s}.vue"
|
67
80
|
@form_attributes = generate_form_attribute
|
68
81
|
|
@@ -163,7 +176,6 @@ module VueComponentBuilder
|
|
163
176
|
end
|
164
177
|
|
165
178
|
def methods_hook
|
166
|
-
# content = "#{self.resetForm}"
|
167
179
|
@methods = ""
|
168
180
|
@options[:controller][:methods].each do |method|
|
169
181
|
method_name = method.to_s
|
@@ -10,13 +10,14 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["yonathalmeida@gmail.com"]
|
11
11
|
|
12
12
|
spec.summary = %q{Generate Vue component CRUD from Rails model mapping}
|
13
|
-
spec.description = %q{
|
13
|
+
spec.description = %q{Generate Vue component CRUD from Rails model mapping}
|
14
14
|
spec.homepage = "https://github.com/Yonatha/vue_component_builder"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
18
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
19
|
if spec.respond_to?(:metadata)
|
20
|
+
|
20
21
|
spec.metadata["homepage_uri"] = spec.homepage
|
21
22
|
spec.metadata["source_code_uri"] = "https://github.com/Yonatha/vue_component_builder"
|
22
23
|
spec.metadata["changelog_uri"] = "https://github.com/Yonatha/vue_component_builder"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vue_component_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yonatha Almeida
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '5.0'
|
55
|
-
description:
|
55
|
+
description: Generate Vue component CRUD from Rails model mapping
|
56
56
|
email:
|
57
57
|
- yonathalmeida@gmail.com
|
58
58
|
executables: []
|