vue_component_builder 0.1.0 → 0.1.1

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: c25e5c9c087b2a37d88edc55818f27740819ffa52f4c49943af3bab227539419
4
- data.tar.gz: 79fa4daf5feea6d09a772fb20639f0da92e1d79f62f91abb110bf947e976f320
3
+ metadata.gz: 6520cb101838c2379af8c3b3dfb958a443bbb3423719d48d3a5fdb2daaf065fc
4
+ data.tar.gz: f63d561a92cc892719da4348cbbc6820fe5f09432926c52107911e5d5a3c9051
5
5
  SHA512:
6
- metadata.gz: 6def592509fd62b21911bbff2ce47eace0e77ed57cf92e187ab71de594e9693287064bd4a2011bc05bca056c26599ecdcbf8d846f81f571e85e7aa616e9c2202
7
- data.tar.gz: 553a4b308adbad2e310a3fadd4f69384c8da9d6a1dcd91591a254565605be155e198c8e0c0eaf6f38f49feffc035944ab8f3c2cbe9581dc74746672c33184a04
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 vue_component:builder model=Fruit component=MyFruitComponent theme=element-plus exclude=id,created_at,updated_at
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
@@ -3,9 +3,9 @@
3
3
  <el-main>
4
4
  <el-row :gutter='24'>
5
5
  <el-col :span='4'>
6
- <Settingsmenu/>
6
+ ...
7
7
  </el-col>
8
- <el-col :span='13'>
8
+ <el-col :span='24'>
9
9
  <el-tabs v-model='this.activeTabName' type='border-card'>
10
10
  <el-tab-pane name='<%= @options[:model][:name] %>_tab'>
11
11
 
@@ -1,10 +1,7 @@
1
1
  import {api} from '../../api/index';
2
- import Settingsmenu from './Settingsmenu';
3
2
 
4
3
  export default {
5
- components: {
6
- Settingsmenu,
7
- },
4
+ components: {},
8
5
  <%= "#{@data_hook}," %>
9
6
  <%= "#{@mounted_hook}" %>
10
7
  <%= "#{@methods_hook}" %>
@@ -1,3 +1,3 @@
1
1
  module VueComponentBuilder
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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{Wrapper vue component}
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.0
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-06 00:00:00.000000000 Z
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: Wrapper vue component
55
+ description: Generate Vue component CRUD from Rails model mapping
56
56
  email:
57
57
  - yonathalmeida@gmail.com
58
58
  executables: []