vuejs 1.1.0.beta2 → 1.1.0.beta3

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: ccdc51477ca262d861c03be1932f7d9d5c83cc99b10c6ab4618b441d9c5ca5ea
4
- data.tar.gz: c97ea07ed73b4e640de884fcef67cc3d42ad3076605996730dcd91005f38896d
3
+ metadata.gz: f07a96eab9a53f20b80be71ef9672976e39834c236da04dd301b0799948ff0c3
4
+ data.tar.gz: 48e4f7f78174ceb061fa12740328ffb593a5bc883e5225b826a454047b8516c9
5
5
  SHA512:
6
- metadata.gz: 85b9c74a8f439cfa75abe054f9aeebbd9299720e176e994eb46bd309bafa49b1a2ebc719becd1ad490cb50d27edd5138c456b1298901174efddbff7fdf801864
7
- data.tar.gz: 5e02a2dd5bb1efbf5e92ee7b8dcc1cba8911ce926501dc2f3ee19acf8bc3c9c6323cee8d82f3f277292662cd3f5e0cc6867449ddab38508cafa60ece82f627e9
6
+ metadata.gz: '083aaa02c9684dfff34398a87c4ce5d8e1d75df8bf1068de6bfe48477d61a25b79a3dd210da0ff728739a334a25dc366f6a67d823a2e29c9587d5fb3d52d9ba0'
7
+ data.tar.gz: b68683e49d0760853c1a3bd97c7d9ee1a95f87c18807f83c081c4ec9ee7687874cede8029ce87be37d2f244870e1239b1a5275e219065d5c01a781b17a209fbc
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Vuejs Gem
1
+ # Welcome to Vuejs Gem
2
2
 
3
3
  > Vue for your favourite Ruby on Rails projects
4
4
 
@@ -26,9 +26,18 @@ And then execute:
26
26
 
27
27
  $ bundle
28
28
 
29
- # Webpacker
29
+ ## Get started
30
30
 
31
- ## Vue component generator
31
+ To generate an empty Vue on Rails project with all its dependencies, run Rails with its application template
32
+
33
+ ```
34
+ rails new app -m http://vueonrails.com/vue
35
+ ```
36
+
37
+ To browse the application template, it's here http://vueonrails.com/vue
38
+
39
+
40
+ ## Generate a new Vue component
32
41
 
33
42
  ```
34
43
  rails generate vue something
@@ -36,17 +45,18 @@ rails generate vue something
36
45
 
37
46
  Note: `vuejs` gem creates vue components as single-file component by default.
38
47
 
39
- To generate a component with seperation of concern, please use the `--seperate`
48
+ To generate a component with seperation of concern, please use the option `--seperate`,
49
+ like `rails g vue something --seperate`
40
50
 
41
51
  > rails g vue something --seperate
42
52
 
43
- ## Vue component destroyer
53
+ ## Destroy a Vue component
44
54
 
45
55
  ```
46
56
  rails destroy vue something
47
57
  ```
48
58
 
49
- ## Vue component viewer
59
+ ## View a standalone Vue component
50
60
 
51
61
  Vue-component viewer allows you to browse your individual & independent Vue component easily without its surrounding element outside the scope of the component. Simply visit http://localhost:3000/vue/<name>
52
62
 
@@ -55,26 +65,25 @@ To mount the endpoint `/vue/<name>`, go to routes.rb and paste this:
55
65
  ```
56
66
  mount Vuejs::engine, to: 'vue'
57
67
  ```
58
- ## Turbolinks support
68
+
69
+ ## Generate a Vue component with Turbolinks support
59
70
  ```
60
71
  rails generate vue something --turbolinks
61
72
  ```
62
73
 
63
- ## Vuex support - coming soon
74
+ ## Generate a Vue component with Vuex support
64
75
 
65
76
  ```
66
77
  rails generate vue something --vuex
67
78
  ```
68
79
 
69
- This will add vuex using yarn. And generate a vue component with vuex support
70
-
71
- ## Enable Specific page vue
80
+ ## Generate a Vue component with Specific Page Vue support
72
81
 
73
82
  ```
74
83
  rails generate vue something --spv
75
84
  ```
76
85
 
77
- ### Generate unit tests for component - coming soon
86
+ ## Generate a Vue component with unit tests
78
87
 
79
88
  ```
80
89
  rails generate vue something --test
@@ -15,6 +15,15 @@ module SyntaxHelper
15
15
  "<p>#{Vuejs::VERSION}</p>".html_safe
16
16
  end
17
17
 
18
+ def vue_component(identifier, variable)
19
+ concat("<div id=\"#{identifier}\" refs=\"#{identifier}\">".html_safe)
20
+ concat("</div>".html_safe)
21
+ variable.each {|key, value|
22
+ concat("<div id=\"vueonrails-#{key}\" data-#{key}=\"#{value}\">".html_safe)
23
+ concat("</div>".html_safe)
24
+ }; nil
25
+ end
26
+
18
27
  def vue(identifier)
19
28
  concat("<div id=\"#{identifier}\" refs=\"#{identifier}\">".html_safe)
20
29
  yield
@@ -13,7 +13,8 @@ export default {
13
13
  }
14
14
  },
15
15
  methods: {
16
- click: function(response){
16
+ onClick: function(response){
17
+ alert("clicked")
17
18
  console.log("clicked")
18
19
  }
19
20
  },
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div id="app">
3
3
  <p>{{ message }}</p>
4
- <button @click="click">toggle</button>
4
+ <button @click="onClick">click this</button>
5
5
  </div>
6
6
  </template>
7
7
 
@@ -3,7 +3,7 @@
3
3
  <template>
4
4
  <div id="app">
5
5
  <p>{{ message }}</p>
6
- <button @click="click">toggle</button>
6
+ <button @click="onClick">click this</button>
7
7
  </div>
8
8
  </template>
9
9
 
@@ -20,7 +20,8 @@ export default {
20
20
  }
21
21
  },
22
22
  methods: {
23
- click: function(response){
23
+ onClick: function(response){
24
+ alert("clicked")
24
25
  console.log("clicked")
25
26
  }
26
27
  },
@@ -63,7 +63,7 @@ class VueGenerator < Rails::Generators::NamedBase
63
63
  end
64
64
 
65
65
  def create_component_with_seperate_concern_using name
66
- say "Generating a Vue component with seperation of concern"
66
+ say "Generated a Vue component with seperation of concern"
67
67
  @code = "<%= vue \"#{name}\" %>"
68
68
  template "packs/pack.js.erb", "#{PACKS_PATH}/#{name}.js"
69
69
  template "packs/index.vue", "#{PARTS_PATH}/#{name}/#{name}.vue"
@@ -72,7 +72,7 @@ class VueGenerator < Rails::Generators::NamedBase
72
72
  end
73
73
 
74
74
  def create_single_file_component_using name
75
- say "Generating a Single File Component"
75
+ say "Generated a Single File Component"
76
76
  @code = "<%= vue \"#{name}\" %>"
77
77
  template "packs/pack.js.erb", "#{PACKS_PATH}/#{name}.js"
78
78
  template "sfc/single-file-component.vue", "#{PARTS_PATH}/#{name}.vue"
data/lib/vuejs/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Vuejs
2
- VERSION = "1.1.0.beta2"
2
+ VERSION = "1.1.0.beta3"
3
3
  end
@@ -1,3 +1,7 @@
1
+ function erb(variable){
2
+ return document.getElementById("vueonrails-" + variable).getAttribute("data-" + variable)
3
+ }
4
+
1
5
  function isView(pageClassString){
2
6
  if(pageClassString == "###") return
3
7
  if(pageClassString != "") pageClassString = pageClassString.replace(/#/g , " ");
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vuejs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.beta2
4
+ version: 1.1.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Lim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-04 00:00:00.000000000 Z
11
+ date: 2018-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler