distil 0.14.0.c → 0.14.0.d

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.14.0.c
1
+ 0.14.0.d
data/assets/distil.js CHANGED
@@ -263,6 +263,8 @@
263
263
  }
264
264
  };
265
265
 
266
+ distil.moduleCount= 0;
267
+
266
268
  distil.module= function(name, def)
267
269
  {
268
270
  if (name in moduleIndex)
@@ -275,14 +277,16 @@
275
277
  return;
276
278
  }
277
279
 
280
+ distil.moduleCount++;
281
+
278
282
  if (distil.sync)
279
283
  {
280
284
  var url= getRunningScriptSource();
281
285
  var lastSlash= url.lastIndexOf('/');
282
- def.path= url.substring(0,lastSlash+1) + def.folder;
286
+ def.path= url.substring(0,lastSlash+1);
283
287
  }
284
288
  else
285
- def.path= currentResource.path + def.folder;
289
+ def.path= currentResource.path;
286
290
 
287
291
  if ('/'!==def.path.slice(-1))
288
292
  def.path+='/';
@@ -375,7 +379,8 @@
375
379
 
376
380
  distil.moduleDidLoad= function(moduleName)
377
381
  {
378
- if (rootResource===currentResource)
382
+ distil.moduleCount--;
383
+ if (!distil.moduleCount && rootResource===currentResource)
379
384
  injectionComplete(currentResource);
380
385
  }
381
386
 
data/bin/distil CHANGED
@@ -12,10 +12,10 @@ module Distil
12
12
 
13
13
  require 'distil'
14
14
 
15
- help = <<-HELP
16
- Distil is a tool for building HTML applications from its component CSS & Javascript files.
17
-
18
- HELP
15
+ help = %{
16
+ Distil is a tool for building HTML applications from its component CSS &
17
+ Javascript files.
18
+ }.remove_indent
19
19
 
20
20
  require 'optparse'
21
21
 
data/distil.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{distil}
8
- s.version = "0.14.0.c"
8
+ s.version = "0.14.0.d"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jeff Watkins"]
data/distil.tmproj CHANGED
@@ -3,7 +3,7 @@
3
3
  <plist version="1.0">
4
4
  <dict>
5
5
  <key>currentDocument</key>
6
- <string>lib/distil/source-file.rb</string>
6
+ <string>lib/distil/product/javascript-product.rb</string>
7
7
  <key>documents</key>
8
8
  <array>
9
9
  <dict>
@@ -21,85 +21,98 @@
21
21
  <integer>270</integer>
22
22
  <key>metaData</key>
23
23
  <dict>
24
- <key>lib/distil/product.rb</key>
24
+ <key>bin/distil</key>
25
25
  <dict>
26
26
  <key>caret</key>
27
27
  <dict>
28
28
  <key>column</key>
29
29
  <integer>0</integer>
30
30
  <key>line</key>
31
- <integer>57</integer>
31
+ <integer>38</integer>
32
32
  </dict>
33
33
  <key>firstVisibleColumn</key>
34
34
  <integer>0</integer>
35
35
  <key>firstVisibleLine</key>
36
- <integer>42</integer>
36
+ <integer>0</integer>
37
37
  </dict>
38
- <key>lib/distil/product/javascript-product.rb</key>
38
+ <key>lib/distil/configurable.rb</key>
39
39
  <dict>
40
40
  <key>caret</key>
41
41
  <dict>
42
42
  <key>column</key>
43
- <integer>47</integer>
43
+ <integer>0</integer>
44
44
  <key>line</key>
45
- <integer>40</integer>
45
+ <integer>0</integer>
46
46
  </dict>
47
- <key>columnSelection</key>
48
- <false/>
49
47
  <key>firstVisibleColumn</key>
50
48
  <integer>0</integer>
51
49
  <key>firstVisibleLine</key>
52
- <integer>20</integer>
53
- <key>selectFrom</key>
50
+ <integer>31</integer>
51
+ </dict>
52
+ <key>lib/distil/error-reporter.rb</key>
53
+ <dict>
54
+ <key>caret</key>
54
55
  <dict>
55
56
  <key>column</key>
56
- <integer>34</integer>
57
+ <integer>0</integer>
57
58
  <key>line</key>
58
- <integer>40</integer>
59
+ <integer>0</integer>
59
60
  </dict>
60
- <key>selectTo</key>
61
+ <key>firstVisibleColumn</key>
62
+ <integer>0</integer>
63
+ <key>firstVisibleLine</key>
64
+ <integer>18</integer>
65
+ </dict>
66
+ <key>lib/distil/library.rb</key>
67
+ <dict>
68
+ <key>caret</key>
61
69
  <dict>
62
70
  <key>column</key>
63
- <integer>58</integer>
71
+ <integer>0</integer>
64
72
  <key>line</key>
65
- <integer>40</integer>
73
+ <integer>205</integer>
66
74
  </dict>
75
+ <key>firstVisibleColumn</key>
76
+ <integer>0</integer>
77
+ <key>firstVisibleLine</key>
78
+ <integer>183</integer>
67
79
  </dict>
68
- <key>lib/distil/project.rb</key>
80
+ <key>lib/distil/product/javascript-product.rb</key>
69
81
  <dict>
70
82
  <key>caret</key>
71
83
  <dict>
72
84
  <key>column</key>
73
- <integer>32</integer>
85
+ <integer>33</integer>
74
86
  <key>line</key>
75
- <integer>220</integer>
87
+ <integer>116</integer>
76
88
  </dict>
77
89
  <key>firstVisibleColumn</key>
78
90
  <integer>0</integer>
79
91
  <key>firstVisibleLine</key>
80
- <integer>195</integer>
92
+ <integer>93</integer>
81
93
  </dict>
82
- <key>lib/distil/source-file.rb</key>
94
+ <key>lib/distil/server.rb</key>
83
95
  <dict>
84
96
  <key>caret</key>
85
97
  <dict>
86
98
  <key>column</key>
87
- <integer>13</integer>
99
+ <integer>84</integer>
88
100
  <key>line</key>
89
- <integer>30</integer>
101
+ <integer>13</integer>
90
102
  </dict>
91
103
  <key>firstVisibleColumn</key>
92
104
  <integer>0</integer>
93
105
  <key>firstVisibleLine</key>
94
- <integer>10</integer>
106
+ <integer>0</integer>
95
107
  </dict>
96
108
  </dict>
97
109
  <key>openDocuments</key>
98
110
  <array>
99
- <string>lib/distil/project.rb</string>
100
- <string>lib/distil/source-file.rb</string>
111
+ <string>lib/distil/library.rb</string>
112
+ <string>bin/distil</string>
101
113
  <string>lib/distil/product/javascript-product.rb</string>
102
- <string>lib/distil/product.rb</string>
114
+ <string>lib/distil/server.rb</string>
115
+ <string>lib/distil/configurable.rb</string>
103
116
  </array>
104
117
  <key>showFileHierarchyDrawer</key>
105
118
  <false/>
@@ -75,6 +75,8 @@ module Distil
75
75
  output.puts FILE_SEPARATOR
76
76
  end
77
77
 
78
+ output.puts module_definition
79
+
78
80
  # emit remote assets first
79
81
  libraries.each { |l|
80
82
  f= project.file_from_path(l.file_for(content_type, language, variant))
@@ -87,8 +89,6 @@ module Distil
87
89
  output.puts FILE_SEPARATOR
88
90
  }
89
91
 
90
- output.puts module_definition
91
-
92
92
  if project.global_export
93
93
  exports= [project.global_export, *project.additional_globals].join(", ")
94
94
  output.puts "(function(#{exports}){"
data/lib/distil.rb CHANGED
@@ -50,6 +50,15 @@ class String
50
50
  prefix = prefix.to_s
51
51
  self[0, prefix.length] == prefix
52
52
  end
53
+ def remove_indent
54
+ str= sub(/^\n*/, "")
55
+ match= str.match(/(^\s+)/)
56
+ return str unless match
57
+ str.gsub(/^#{match[1]}/, '').strip
58
+ end
59
+ def indent(str)
60
+ self.gsub(/^/, str)
61
+ end
53
62
  end
54
63
 
55
64
  require 'distil/hash-additions'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: distil
3
3
  version: !ruby/object:Gem::Version
4
- hash: 88
4
+ hash: 89
5
5
  prerelease: true
6
6
  segments:
7
7
  - 0
8
8
  - 14
9
9
  - 0
10
- - c
11
- version: 0.14.0.c
10
+ - d
11
+ version: 0.14.0.d
12
12
  platform: ruby
13
13
  authors:
14
14
  - Jeff Watkins