rill 0.1.1 → 0.1.2
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.
- data/lib/rill.rb +5 -5
- metadata +1 -1
data/lib/rill.rb
CHANGED
|
@@ -33,7 +33,7 @@ class Rill
|
|
|
33
33
|
def resolve_module(mod)
|
|
34
34
|
return if @preloads.include?(mod) || @modules.include?(mod)
|
|
35
35
|
|
|
36
|
-
mod =
|
|
36
|
+
mod = parse_module(mod)
|
|
37
37
|
path = File.join(@base, "#{mod}.js")
|
|
38
38
|
code = File.open(path).read
|
|
39
39
|
|
|
@@ -68,7 +68,7 @@ class Rill
|
|
|
68
68
|
# mark the module id
|
|
69
69
|
# parse and set the module dependencies if not present
|
|
70
70
|
def polish(mod, code = nil)
|
|
71
|
-
mod =
|
|
71
|
+
mod = parse_module(mod)
|
|
72
72
|
|
|
73
73
|
return polish_code(mod, code) unless code.nil? || code == ''
|
|
74
74
|
|
|
@@ -86,7 +86,7 @@ class Rill
|
|
|
86
86
|
end
|
|
87
87
|
|
|
88
88
|
def polish_code(mod, code)
|
|
89
|
-
mod =
|
|
89
|
+
mod = parse_module(mod)
|
|
90
90
|
|
|
91
91
|
if code =~ /^define\(function/
|
|
92
92
|
deps = parse_deps(code)
|
|
@@ -101,8 +101,8 @@ class Rill
|
|
|
101
101
|
code
|
|
102
102
|
end
|
|
103
103
|
|
|
104
|
-
def
|
|
105
|
-
mod.sub(/^#{@base}
|
|
104
|
+
def parse_module(mod)
|
|
105
|
+
mod.sub(/^#{@base}\/?/, '').sub(/\.js$/, '')
|
|
106
106
|
end
|
|
107
107
|
|
|
108
108
|
def expand_path(dep, mod)
|