distil 0.13.6 → 0.14.0.b
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -0
- data/VERSION +1 -1
- data/assets/distil.js +9 -7
- data/bin/distil +36 -60
- data/distil.gemspec +17 -32
- data/distil.tmproj +46 -15
- data/lib/distil/browser.rb +30 -26
- data/lib/distil/configurable.rb +64 -153
- data/lib/distil/error-reporter.rb +22 -20
- data/lib/distil/file-vendor.rb +29 -0
- data/lib/distil/hash-additions.rb +45 -0
- data/lib/distil/javascript-code.rb +12 -0
- data/lib/distil/{task/validate-js-task.rb → javascript-file-validator.rb} +19 -23
- data/lib/distil/library.rb +243 -0
- data/lib/distil/product/cache-manifest-product.rb +21 -0
- data/lib/distil/product/css-product.rb +41 -23
- data/lib/distil/product/html-product.rb +20 -0
- data/lib/distil/product/javascript-product.rb +122 -111
- data/lib/distil/product.rb +90 -76
- data/lib/distil/project.rb +370 -104
- data/lib/distil/recursive-http-fetcher.rb +72 -0
- data/lib/distil/server.rb +43 -0
- data/lib/distil/source-file/css-file.rb +56 -3
- data/lib/distil/source-file/html-file.rb +5 -6
- data/lib/distil/source-file/javascript-file.rb +96 -8
- data/lib/distil/source-file/json-file.rb +2 -4
- data/lib/distil/source-file/yui-minifiable-file.rb +19 -0
- data/lib/distil/source-file.rb +50 -92
- data/lib/distil/subclass-tracker.rb +13 -0
- data/lib/distil.rb +21 -37
- metadata +40 -39
- data/assets/mime.types +0 -1240
- data/lib/distil/configurable/file-set.rb +0 -85
- data/lib/distil/configurable/interpolated.rb +0 -36
- data/lib/distil/configurable/output-path.rb +0 -25
- data/lib/distil/configurable/project-path.rb +0 -25
- data/lib/distil/product/concatenated.rb +0 -83
- data/lib/distil/product/debug.rb +0 -32
- data/lib/distil/product/javascript-base-product.rb +0 -35
- data/lib/distil/product/javascript-doc-product.rb +0 -61
- data/lib/distil/product/minified.rb +0 -41
- data/lib/distil/product/page-product.rb +0 -27
- data/lib/distil/product/pdoc-product.rb +0 -42
- data/lib/distil/project/distil-project.rb +0 -157
- data/lib/distil/project/external-project.rb +0 -58
- data/lib/distil/project/remote-project.rb +0 -43
- data/lib/distil/target.rb +0 -251
- data/lib/distil/task/css-dependency-task.rb +0 -64
- data/lib/distil/task/jsl-dependency-task.rb +0 -50
- data/lib/distil/task/nib-task.rb +0 -72
- data/lib/distil/task.rb +0 -50
- data/lib/jsdoc.conf +0 -18
- data/lib/test/HtmlTestReporter.js +0 -127
- data/lib/test/Test.js +0 -248
- data/lib/test/TestReporter.js +0 -79
- data/lib/test/TestRunner.js +0 -132
- data/lib/test/browser.rb +0 -97
- data/lib/test/scriptwrapper.html +0 -10
- data/lib/test/unittest.html +0 -127
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.14.0.b
|
data/assets/distil.js
CHANGED
@@ -153,7 +153,7 @@
|
|
153
153
|
return {
|
154
154
|
type: type,
|
155
155
|
url: url,
|
156
|
-
callback:
|
156
|
+
callbacks: callback ? [callback]: [],
|
157
157
|
scope: scope,
|
158
158
|
userData: userData,
|
159
159
|
loadQueue: [],
|
@@ -217,8 +217,8 @@
|
|
217
217
|
}
|
218
218
|
|
219
219
|
resource.callbacksExecuted= true;
|
220
|
-
|
221
|
-
resource.
|
220
|
+
while (resource.callbacks.length)
|
221
|
+
(resource.callbacks.shift()).call(resource.scope, resource.userData);
|
222
222
|
|
223
223
|
resource= resource.parent;
|
224
224
|
}
|
@@ -332,7 +332,7 @@
|
|
332
332
|
if (rootResource.callbacksExecuted)
|
333
333
|
window.setTimeout(callback, 0);
|
334
334
|
else
|
335
|
-
rootResource.callback
|
335
|
+
rootResource.callbacks.push(callback);
|
336
336
|
}
|
337
337
|
|
338
338
|
distil.complete= function(name)
|
@@ -373,15 +373,17 @@
|
|
373
373
|
injectionComplete(currentResource);
|
374
374
|
}
|
375
375
|
|
376
|
-
distil.
|
376
|
+
distil.moduleDidLoad= function(moduleName)
|
377
377
|
{
|
378
378
|
if (rootResource===currentResource)
|
379
379
|
injectionComplete(currentResource);
|
380
380
|
}
|
381
381
|
|
382
|
+
distil.kick= distil.moduleDidLoad;
|
383
|
+
|
382
384
|
distil.urlForAssetWithNameInModule= function(asset, moduleName)
|
383
385
|
{
|
384
|
-
var module=
|
386
|
+
var module= name ? moduleIndex[moduleName] : distil.mainModule;
|
385
387
|
if (!module)
|
386
388
|
throw new Error(NO_MODULE_ERROR + moduleName);
|
387
389
|
if (!module.asset_map)
|
@@ -391,7 +393,7 @@
|
|
391
393
|
|
392
394
|
distil.dataForAssetWithNameInModule= function(asset, moduleName)
|
393
395
|
{
|
394
|
-
var module=
|
396
|
+
var module= name ? moduleIndex[moduleName] : distil.mainModule;
|
395
397
|
if (!module)
|
396
398
|
throw new Error(NO_MODULE_ERROR + moduleName);
|
397
399
|
if (!module.assets)
|
data/bin/distil
CHANGED
@@ -1,78 +1,54 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
|
2
3
|
module Distil
|
3
|
-
|
4
|
+
|
4
5
|
LIB_DIR= File.expand_path(File.join(File.dirname(__FILE__), "..", "lib"))
|
5
6
|
VENDOR_DIR= File.expand_path(File.join(File.dirname(__FILE__), "..", "vendor"))
|
6
7
|
ASSETS_DIR= File.expand_path(File.join(File.dirname(__FILE__), "..", "assets"))
|
7
8
|
APP_NAME= File.basename($0)
|
8
|
-
|
9
|
+
APP_SCRIPT= $0
|
10
|
+
|
9
11
|
$:.unshift(LIB_DIR)
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
require "distil"
|
13
|
+
require 'distil'
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
args= []
|
15
|
+
help = <<-HELP
|
16
|
+
Distil is a tool for building HTML applications from its component CSS & Javascript files.
|
18
17
|
|
19
|
-
|
20
|
-
if (!v[/^-/])
|
21
|
-
args << v
|
22
|
-
next
|
23
|
-
end
|
24
|
-
|
25
|
-
v= v.gsub(/^-+/, '')
|
26
|
-
|
27
|
-
key,value= v.split("=")
|
28
|
-
key.gsub!("-", "_")
|
29
|
-
|
30
|
-
value=true if !value
|
31
|
-
|
32
|
-
if ("f"==key || "file"==key || "buildfile"==key)
|
33
|
-
project_file= value
|
34
|
-
next
|
35
|
-
end
|
18
|
+
HELP
|
36
19
|
|
37
|
-
|
38
|
-
}
|
20
|
+
require 'optparse'
|
39
21
|
|
40
|
-
|
41
|
-
|
22
|
+
options = {}
|
23
|
+
opts = OptionParser.new do |opts|
|
24
|
+
opts.banner = help
|
42
25
|
|
43
|
-
|
44
|
-
|
45
|
-
|
26
|
+
opts.on("--server [PORT]", "Start web server (default port 8888)") do |port|
|
27
|
+
options['server'] = true
|
28
|
+
options['server_port'] = port unless port.nil?
|
29
|
+
end
|
30
|
+
|
31
|
+
opts.on("--base URL", "The base path for the server") do |url|
|
32
|
+
options['url']= url
|
33
|
+
end
|
46
34
|
end
|
35
|
+
opts.parse!
|
47
36
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
dir = File.dirname(dir)
|
37
|
+
project= Project.find(Dir.pwd)
|
38
|
+
unless project
|
39
|
+
puts "#{APP_NAME}: Could not find project to build"
|
40
|
+
exit 1
|
53
41
|
end
|
54
42
|
|
43
|
+
puts "\n#{project.name}:\n\n"
|
44
|
+
commands= ARGV.empty? ? ['build'] : ARGV
|
45
|
+
commands.each { |cmd|
|
46
|
+
project.send cmd
|
47
|
+
}
|
48
|
+
project.report
|
49
|
+
|
50
|
+
if true==options['server']
|
51
|
+
start_server(project, options)
|
52
|
+
end
|
53
|
+
|
55
54
|
end
|
56
|
-
|
57
|
-
|
58
|
-
# Change working directory to the folder containing the build YML file.
|
59
|
-
project_file||= find_project_file
|
60
|
-
|
61
|
-
if !project_file
|
62
|
-
puts "#{Distil::APP_NAME}: can't find project file"
|
63
|
-
exit
|
64
|
-
end
|
65
|
-
|
66
|
-
Dir.chdir(File.dirname(project_file))
|
67
|
-
|
68
|
-
project= Distil::DistilProject.new(project_file, arg_settings)
|
69
|
-
|
70
|
-
if 0==args.length
|
71
|
-
args << "build"
|
72
|
-
end
|
73
|
-
|
74
|
-
args.each { |cmd|
|
75
|
-
project.send cmd
|
76
|
-
exit 1 if project.total_error_count > 0
|
77
|
-
exit 1 if project.warnings_are_errors && project.total_warning_count > 0
|
78
|
-
}
|
data/distil.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{distil}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.14.0.b"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jeff Watkins"]
|
12
|
-
s.date = %q{2010-12-
|
12
|
+
s.date = %q{2010-12-21}
|
13
13
|
s.default_executable = %q{distil}
|
14
14
|
s.description = %q{A build tool for Javascript and CSS that takes advantage of best-of-breed helper applications Javascript Lint and JSDoc Toolkit}
|
15
15
|
s.executables = ["distil"]
|
@@ -19,7 +19,6 @@ Gem::Specification.new do |s|
|
|
19
19
|
"Rakefile",
|
20
20
|
"VERSION",
|
21
21
|
"assets/distil.js",
|
22
|
-
"assets/mime.types",
|
23
22
|
"bin/distil",
|
24
23
|
"bin/distil-old",
|
25
24
|
"distil.gemspec",
|
@@ -27,45 +26,28 @@ Gem::Specification.new do |s|
|
|
27
26
|
"lib/distil.rb",
|
28
27
|
"lib/distil/browser.rb",
|
29
28
|
"lib/distil/configurable.rb",
|
30
|
-
"lib/distil/configurable/file-set.rb",
|
31
|
-
"lib/distil/configurable/interpolated.rb",
|
32
|
-
"lib/distil/configurable/output-path.rb",
|
33
|
-
"lib/distil/configurable/project-path.rb",
|
34
29
|
"lib/distil/error-reporter.rb",
|
30
|
+
"lib/distil/file-vendor.rb",
|
31
|
+
"lib/distil/hash-additions.rb",
|
32
|
+
"lib/distil/javascript-code.rb",
|
33
|
+
"lib/distil/javascript-file-validator.rb",
|
34
|
+
"lib/distil/library.rb",
|
35
35
|
"lib/distil/product.rb",
|
36
|
-
"lib/distil/product/
|
36
|
+
"lib/distil/product/cache-manifest-product.rb",
|
37
37
|
"lib/distil/product/css-product.rb",
|
38
|
-
"lib/distil/product/
|
39
|
-
"lib/distil/product/javascript-base-product.rb",
|
40
|
-
"lib/distil/product/javascript-doc-product.rb",
|
38
|
+
"lib/distil/product/html-product.rb",
|
41
39
|
"lib/distil/product/javascript-product.rb",
|
42
|
-
"lib/distil/product/minified.rb",
|
43
|
-
"lib/distil/product/page-product.rb",
|
44
|
-
"lib/distil/product/pdoc-product.rb",
|
45
40
|
"lib/distil/project.rb",
|
46
|
-
"lib/distil/
|
47
|
-
"lib/distil/
|
48
|
-
"lib/distil/project/remote-project.rb",
|
41
|
+
"lib/distil/recursive-http-fetcher.rb",
|
42
|
+
"lib/distil/server.rb",
|
49
43
|
"lib/distil/source-file.rb",
|
50
44
|
"lib/distil/source-file/css-file.rb",
|
51
45
|
"lib/distil/source-file/html-file.rb",
|
52
46
|
"lib/distil/source-file/javascript-file.rb",
|
53
47
|
"lib/distil/source-file/json-file.rb",
|
54
|
-
"lib/distil/
|
55
|
-
"lib/distil/
|
56
|
-
"lib/distil/task/css-dependency-task.rb",
|
57
|
-
"lib/distil/task/jsl-dependency-task.rb",
|
58
|
-
"lib/distil/task/nib-task.rb",
|
59
|
-
"lib/distil/task/validate-js-task.rb",
|
60
|
-
"lib/jsdoc.conf",
|
48
|
+
"lib/distil/source-file/yui-minifiable-file.rb",
|
49
|
+
"lib/distil/subclass-tracker.rb",
|
61
50
|
"lib/jsl.conf",
|
62
|
-
"lib/test/HtmlTestReporter.js",
|
63
|
-
"lib/test/Test.js",
|
64
|
-
"lib/test/TestReporter.js",
|
65
|
-
"lib/test/TestRunner.js",
|
66
|
-
"lib/test/browser.rb",
|
67
|
-
"lib/test/scriptwrapper.html",
|
68
|
-
"lib/test/unittest.html",
|
69
51
|
"vendor/Makefile",
|
70
52
|
"vendor/extconf.rb",
|
71
53
|
"vendor/jsdoc-extras/plugins/distil-plugin.js",
|
@@ -778,15 +760,18 @@ Gem::Specification.new do |s|
|
|
778
760
|
s.add_runtime_dependency(%q<json>, [">= 1.4.3"])
|
779
761
|
s.add_runtime_dependency(%q<rubyzip>, [">= 0.9.4"])
|
780
762
|
s.add_runtime_dependency(%q<treetop>, [">= 1.4.8"])
|
763
|
+
s.add_runtime_dependency(%q<directory_watcher>, [">= 1.1.1"])
|
781
764
|
else
|
782
765
|
s.add_dependency(%q<json>, [">= 1.4.3"])
|
783
766
|
s.add_dependency(%q<rubyzip>, [">= 0.9.4"])
|
784
767
|
s.add_dependency(%q<treetop>, [">= 1.4.8"])
|
768
|
+
s.add_dependency(%q<directory_watcher>, [">= 1.1.1"])
|
785
769
|
end
|
786
770
|
else
|
787
771
|
s.add_dependency(%q<json>, [">= 1.4.3"])
|
788
772
|
s.add_dependency(%q<rubyzip>, [">= 0.9.4"])
|
789
773
|
s.add_dependency(%q<treetop>, [">= 1.4.8"])
|
774
|
+
s.add_dependency(%q<directory_watcher>, [">= 1.1.1"])
|
790
775
|
end
|
791
776
|
end
|
792
777
|
|
data/distil.tmproj
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<plist version="1.0">
|
4
4
|
<dict>
|
5
5
|
<key>currentDocument</key>
|
6
|
-
<string>
|
6
|
+
<string>lib/distil/source-file.rb</string>
|
7
7
|
<key>documents</key>
|
8
8
|
<array>
|
9
9
|
<dict>
|
@@ -21,58 +21,89 @@
|
|
21
21
|
<integer>270</integer>
|
22
22
|
<key>metaData</key>
|
23
23
|
<dict>
|
24
|
-
<key>
|
24
|
+
<key>lib/distil/product.rb</key>
|
25
25
|
<dict>
|
26
26
|
<key>caret</key>
|
27
27
|
<dict>
|
28
28
|
<key>column</key>
|
29
|
-
<integer>
|
29
|
+
<integer>0</integer>
|
30
30
|
<key>line</key>
|
31
|
-
<integer>
|
31
|
+
<integer>57</integer>
|
32
32
|
</dict>
|
33
33
|
<key>firstVisibleColumn</key>
|
34
34
|
<integer>0</integer>
|
35
35
|
<key>firstVisibleLine</key>
|
36
|
-
<integer>
|
36
|
+
<integer>42</integer>
|
37
37
|
</dict>
|
38
|
-
<key>lib/distil/product.rb</key>
|
38
|
+
<key>lib/distil/product/javascript-product.rb</key>
|
39
39
|
<dict>
|
40
40
|
<key>caret</key>
|
41
41
|
<dict>
|
42
42
|
<key>column</key>
|
43
|
-
<integer>
|
43
|
+
<integer>47</integer>
|
44
44
|
<key>line</key>
|
45
|
-
<integer>
|
45
|
+
<integer>40</integer>
|
46
46
|
</dict>
|
47
|
+
<key>columnSelection</key>
|
48
|
+
<false/>
|
47
49
|
<key>firstVisibleColumn</key>
|
48
50
|
<integer>0</integer>
|
49
51
|
<key>firstVisibleLine</key>
|
50
|
-
<integer>
|
52
|
+
<integer>20</integer>
|
53
|
+
<key>selectFrom</key>
|
54
|
+
<dict>
|
55
|
+
<key>column</key>
|
56
|
+
<integer>34</integer>
|
57
|
+
<key>line</key>
|
58
|
+
<integer>40</integer>
|
59
|
+
</dict>
|
60
|
+
<key>selectTo</key>
|
61
|
+
<dict>
|
62
|
+
<key>column</key>
|
63
|
+
<integer>58</integer>
|
64
|
+
<key>line</key>
|
65
|
+
<integer>40</integer>
|
66
|
+
</dict>
|
51
67
|
</dict>
|
52
|
-
<key>lib/distil/
|
68
|
+
<key>lib/distil/project.rb</key>
|
53
69
|
<dict>
|
54
70
|
<key>caret</key>
|
55
71
|
<dict>
|
56
72
|
<key>column</key>
|
57
|
-
<integer>
|
73
|
+
<integer>32</integer>
|
58
74
|
<key>line</key>
|
59
|
-
<integer>
|
75
|
+
<integer>220</integer>
|
60
76
|
</dict>
|
61
77
|
<key>firstVisibleColumn</key>
|
62
78
|
<integer>0</integer>
|
63
79
|
<key>firstVisibleLine</key>
|
80
|
+
<integer>195</integer>
|
81
|
+
</dict>
|
82
|
+
<key>lib/distil/source-file.rb</key>
|
83
|
+
<dict>
|
84
|
+
<key>caret</key>
|
85
|
+
<dict>
|
86
|
+
<key>column</key>
|
87
|
+
<integer>13</integer>
|
88
|
+
<key>line</key>
|
89
|
+
<integer>30</integer>
|
90
|
+
</dict>
|
91
|
+
<key>firstVisibleColumn</key>
|
64
92
|
<integer>0</integer>
|
93
|
+
<key>firstVisibleLine</key>
|
94
|
+
<integer>10</integer>
|
65
95
|
</dict>
|
66
96
|
</dict>
|
67
97
|
<key>openDocuments</key>
|
68
98
|
<array>
|
69
|
-
<string>
|
99
|
+
<string>lib/distil/project.rb</string>
|
100
|
+
<string>lib/distil/source-file.rb</string>
|
101
|
+
<string>lib/distil/product/javascript-product.rb</string>
|
70
102
|
<string>lib/distil/product.rb</string>
|
71
|
-
<string>lib/distil/product/pdoc-product.rb</string>
|
72
103
|
</array>
|
73
104
|
<key>showFileHierarchyDrawer</key>
|
74
105
|
<false/>
|
75
106
|
<key>windowFrame</key>
|
76
|
-
<string>{{
|
107
|
+
<string>{{833, 300}, {1087, 878}}</string>
|
77
108
|
</dict>
|
78
109
|
</plist>
|
data/lib/distil/browser.rb
CHANGED
@@ -1,34 +1,38 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
module Distil
|
2
|
+
|
3
|
+
class Browser
|
4
|
+
def supported?; true; end
|
5
|
+
def setup ; end
|
6
|
+
def open(url) ; end
|
7
|
+
def teardown ; end
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
9
|
+
def host
|
10
|
+
require 'rbconfig'
|
11
|
+
Config::CONFIG['host']
|
12
|
+
end
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
|
14
|
+
def macos?
|
15
|
+
host.include?('darwin')
|
16
|
+
end
|
15
17
|
|
16
|
-
|
17
|
-
|
18
|
-
|
18
|
+
def windows?
|
19
|
+
host.include?('mswin')
|
20
|
+
end
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
22
|
+
def linux?
|
23
|
+
host.include?('linux')
|
24
|
+
end
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
def open(url)
|
27
|
+
case
|
28
|
+
when macos?
|
29
|
+
`open #{url}`
|
30
|
+
when windows?
|
31
|
+
`start #{url}`
|
32
|
+
else
|
33
|
+
puts "I don't know how to open a browser for #{url} on your system"
|
34
|
+
end
|
32
35
|
end
|
33
36
|
end
|
37
|
+
|
34
38
|
end
|