ember-es6_template 0.2.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e81a2a7d5be7ab1ab89c2392048c1a18026bd4cc
|
4
|
+
data.tar.gz: 23c18b034d49023b6af7785f883aabedd70336e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2bec6777d1e9073d0136ab84a55b49f56cc3365029fd35828208211a978899c0d4b3a0647076c481a8c1d32ddff15c504b809adf486f4ba7a20edc38c60bf332
|
7
|
+
data.tar.gz: c6c9ab9a669d8a08406b7df1a43e46142fcde8c18503fdc35b79e5805c1659c337d62eb4ff789907497aa4cf340ba76fa282a20a4900faf9b25e9ee3637e2711
|
@@ -2,10 +2,35 @@ module Ember
|
|
2
2
|
module ES6Template
|
3
3
|
class Config
|
4
4
|
attr_accessor :module_prefix
|
5
|
+
attr_reader :prefix_dirs, :prefix_files
|
6
|
+
|
7
|
+
def prefix_dirs=(dirs)
|
8
|
+
@prefix_pattern = nil
|
9
|
+
|
10
|
+
@prefix_dirs = dirs
|
11
|
+
end
|
12
|
+
|
13
|
+
def prefix_files=(files)
|
14
|
+
@prefix_pattern = nil
|
15
|
+
|
16
|
+
@prefix_files = files
|
17
|
+
end
|
18
|
+
|
19
|
+
def prefix_pattern
|
20
|
+
@prefix_pattern ||= begin
|
21
|
+
patterns = []
|
22
|
+
patterns += Array(prefix_dirs).map {|dir| Regexp.new("^#{dir}/") }
|
23
|
+
patterns += Array(prefix_files).map {|file| Regexp.new("^#{file}$") }
|
24
|
+
|
25
|
+
patterns.empty? ? // : Regexp.union(patterns)
|
26
|
+
end
|
27
|
+
end
|
5
28
|
|
6
29
|
def to_hash
|
7
30
|
{
|
8
|
-
module_prefix: module_prefix
|
31
|
+
module_prefix: module_prefix,
|
32
|
+
prefix_files: prefix_files,
|
33
|
+
prefix_dirs: prefix_dirs
|
9
34
|
}
|
10
35
|
end
|
11
36
|
end
|
@@ -24,7 +24,15 @@ module Ember
|
|
24
24
|
private
|
25
25
|
|
26
26
|
def module_name(path)
|
27
|
-
[
|
27
|
+
paths = []
|
28
|
+
paths << config.module_prefix if config.prefix_pattern =~ path
|
29
|
+
paths << path
|
30
|
+
|
31
|
+
paths.compact.join('/')
|
32
|
+
end
|
33
|
+
|
34
|
+
def config
|
35
|
+
Ember::ES6Template.config
|
28
36
|
end
|
29
37
|
end
|
30
38
|
end
|
@@ -62,7 +62,11 @@ module Ember
|
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
65
|
-
[
|
65
|
+
paths = []
|
66
|
+
paths << @config.module_prefix if @config.prefix_pattern =~ module_name
|
67
|
+
paths << module_name
|
68
|
+
|
69
|
+
paths.compact.join('/')
|
66
70
|
end
|
67
71
|
end
|
68
72
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember-es6_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryunosuke SATO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: babel-transpiler
|