vueck 1.0.3 → 1.0.4
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 +4 -4
- data/lib/config.rb +30 -0
- data/lib/exceptions.rb +6 -0
- data/lib/filemanager.rb +5 -3
- data/lib/vueck.rb +2 -34
- data/vueck.gemspec +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 899e92a45ae907d91d027bfbc3e94a7204076f01
|
4
|
+
data.tar.gz: 2d0c08fdd8234e445e1a7520660c5f3b71fb52c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27faac06565988e958fd44296b90e2b512e92e82ef447501c380d1578f4b165475f5bf7cbd40d54b773e1105797c0f11bd6aeef5367da1255e955bdd9c9ef6eb
|
7
|
+
data.tar.gz: be98118103b7fc62880d3a8011c63b55bcfd339e34a0162f16605659e92ec46cafc1317da766a860728088fc7a8f9f749e16dbcdbbd072d2bfedf9fb9e903c06
|
data/lib/config.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
module VueCK
|
2
|
+
FILES = {
|
3
|
+
javascript: "vue.js",
|
4
|
+
style: "vue.css"
|
5
|
+
}
|
6
|
+
DIRS = {
|
7
|
+
cache: ".vueck_cache/",
|
8
|
+
components: "vue/"
|
9
|
+
}
|
10
|
+
ELEMENTS = {
|
11
|
+
component: "component",
|
12
|
+
template: "template",
|
13
|
+
script: "script",
|
14
|
+
style: "style"
|
15
|
+
}
|
16
|
+
ATTRIBUTES = {
|
17
|
+
name: "name",
|
18
|
+
lang: "lang"
|
19
|
+
}
|
20
|
+
LANG_DEFALTS = {
|
21
|
+
script: "javascript",
|
22
|
+
style: "css",
|
23
|
+
template: "html"
|
24
|
+
}
|
25
|
+
REQUIRED = {
|
26
|
+
script: true,
|
27
|
+
style: false,
|
28
|
+
template: true
|
29
|
+
}
|
30
|
+
end
|
data/lib/exceptions.rb
ADDED
data/lib/filemanager.rb
CHANGED
@@ -7,14 +7,16 @@ module VueCK
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def serve
|
10
|
-
return render unless
|
11
|
-
return render unless cachefiles_exist?
|
12
|
-
return render unless cachefiles_fresh?
|
10
|
+
return render unless cache_valid?
|
13
11
|
read_file
|
14
12
|
end
|
15
13
|
|
16
14
|
private
|
17
15
|
|
16
|
+
def cache_valid?
|
17
|
+
cachedir_exists? and cachefiles_exist? and cachefiles_fresh?
|
18
|
+
end
|
19
|
+
|
18
20
|
def render
|
19
21
|
renders = BatchRenderer.new.render
|
20
22
|
File.write(@js_cache, renders[:components])
|
data/lib/vueck.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'exceptions'
|
2
|
+
require 'config'
|
1
3
|
require 'batchrenderer'
|
2
4
|
require 'element'
|
3
5
|
require 'filemanager'
|
@@ -8,40 +10,6 @@ require 'cssminify'
|
|
8
10
|
require 'plugin'
|
9
11
|
|
10
12
|
module VueCK
|
11
|
-
FILES = {
|
12
|
-
javascript: "vue.js",
|
13
|
-
style: "vue.css"
|
14
|
-
}
|
15
|
-
DIRS = {
|
16
|
-
cache: ".vueck_cache/",
|
17
|
-
components: "vue/"
|
18
|
-
}
|
19
|
-
ELEMENTS = {
|
20
|
-
component: "component",
|
21
|
-
template: "template",
|
22
|
-
script: "script",
|
23
|
-
style: "style"
|
24
|
-
}
|
25
|
-
ATTRIBUTES = {
|
26
|
-
name: "name",
|
27
|
-
lang: "lang"
|
28
|
-
}
|
29
|
-
LANG_DEFALTS = {
|
30
|
-
script: "javascript",
|
31
|
-
style: "css",
|
32
|
-
template: "html"
|
33
|
-
}
|
34
|
-
REQUIRED = {
|
35
|
-
script: true,
|
36
|
-
style: false,
|
37
|
-
template: true
|
38
|
-
}
|
39
|
-
|
40
|
-
class InvalidTemplateEngine < StandardError
|
41
|
-
end
|
42
|
-
class ComonentRenderError < StandardError
|
43
|
-
end
|
44
|
-
|
45
13
|
class VueCK
|
46
14
|
def initialize(filename)
|
47
15
|
@filename = filename
|
data/vueck.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'vueck'
|
3
3
|
s.homepage = 'https://github.com/adamrdrew/vueck'
|
4
|
-
s.version = '1.0.
|
4
|
+
s.version = '1.0.4'
|
5
5
|
s.date = '2018-01-30'
|
6
6
|
s.summary = "VueCK"
|
7
7
|
s.description = "Rack middleware for compiling and serving VueJS single file components"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vueck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Drew
|
@@ -123,7 +123,9 @@ files:
|
|
123
123
|
- README.md
|
124
124
|
- Rakefile
|
125
125
|
- lib/batchrenderer.rb
|
126
|
+
- lib/config.rb
|
126
127
|
- lib/element.rb
|
128
|
+
- lib/exceptions.rb
|
127
129
|
- lib/filemanager.rb
|
128
130
|
- lib/plugin.rb
|
129
131
|
- lib/sfc.rb
|