jsus 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +6 -0
- data/VERSION +1 -1
- data/bin/jsus +11 -5
- data/features/command-line/basic_dependency_resolution.feature +2 -2
- data/features/command-line/extensions.feature +1 -1
- data/features/command-line/external_dependency_resolution.feature +2 -2
- data/features/command-line/json_package.feature +1 -1
- data/features/command-line/structure_json.feature +1 -1
- data/jsus.gemspec +2 -2
- metadata +4 -4
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/bin/jsus
CHANGED
@@ -31,8 +31,9 @@ cli = OptionParser.new do |opts|
|
|
31
31
|
options[:deps_dir] = dir
|
32
32
|
end
|
33
33
|
|
34
|
-
opts.on('-g', '--generate-includes', 'generates includes.js file that you may use for ad-hoc requiring of dependencies') do
|
34
|
+
opts.on('-g', '--generate-includes [ROOT]', 'generates includes.js file that you may use for ad-hoc requiring of dependencies, defaults to output directory') do |dir|
|
35
35
|
options[:generate_includes] = true
|
36
|
+
options[:includes_root] = dir
|
36
37
|
end
|
37
38
|
|
38
39
|
opts.on('--generate-docs [*CLASSES]', Array, "generate docs for some of the sources. When given empty array, defaults to /**/*") do |docs|
|
@@ -117,14 +118,19 @@ validators_map = {"mooforge" => Jsus::Validator::Mooforge}
|
|
117
118
|
end
|
118
119
|
end
|
119
120
|
|
120
|
-
# Hack, hack, hack
|
121
|
+
# Hack, hack, hack >:E
|
121
122
|
if options[:generate_includes]
|
123
|
+
includes_root = options[:includes_root] || output_dir
|
122
124
|
File.open(File.join(output_dir, "includes.js"), "w") do |f|
|
123
125
|
c = Jsus::Container.new(*(package.source_files.to_a + package.linked_external_dependencies.to_a))
|
124
|
-
script = %{
|
126
|
+
script = %{
|
127
|
+
(function(prefix, loader) {
|
125
128
|
var sources = %sources%;
|
126
|
-
|
127
|
-
|
129
|
+
if (!loader) loader = function(path) {
|
130
|
+
document.write('<scr' + 'ipt src="' + (prefix || '') + path + '"></script>');
|
131
|
+
}
|
132
|
+
for (var i = 0, j = sources.length; i < j; i++) loader(sources[i]);
|
133
|
+
})(window.prefix, window.loader);}.sub("%sources%", JSON.pretty_generate(c.required_files(includes_root)))
|
128
134
|
f.puts script
|
129
135
|
end
|
130
136
|
end
|
@@ -3,7 +3,7 @@ Feature: resolve dependencies
|
|
3
3
|
dependency list.
|
4
4
|
|
5
5
|
Scenario: internal dependencies in correct order
|
6
|
-
When I run "jsus
|
6
|
+
When I run "jsus Basic tmp"
|
7
7
|
Then the following files should exist:
|
8
8
|
| tmp/package.js |
|
9
9
|
And file "tmp/package.js" should contain
|
@@ -52,7 +52,7 @@ Feature: resolve dependencies
|
|
52
52
|
|
53
53
|
|
54
54
|
Scenario: internal dependencies in wrong order
|
55
|
-
When I run "jsus
|
55
|
+
When I run "jsus BasicWrongOrder tmp"
|
56
56
|
Then the following files should exist:
|
57
57
|
| tmp/package.js |
|
58
58
|
And file "tmp/package.js" should contain
|
@@ -3,7 +3,7 @@ Feature: extensions
|
|
3
3
|
extensions.
|
4
4
|
|
5
5
|
Scenario: monkeypatch for external dependency
|
6
|
-
When I run "jsus
|
6
|
+
When I run "jsus Extensions tmp -d Extensions/Mootools"
|
7
7
|
Then the following files should exist:
|
8
8
|
| tmp/package.js |
|
9
9
|
And file "tmp/package.js" should contain
|
@@ -3,7 +3,7 @@ Feature: external dependencies
|
|
3
3
|
pool.
|
4
4
|
|
5
5
|
Scenario: basic external dependency
|
6
|
-
When I run "jsus
|
6
|
+
When I run "jsus ExternalDependency tmp -d ExternalDependency/Mootools"
|
7
7
|
Then the following files should exist:
|
8
8
|
| tmp/package.js |
|
9
9
|
And file "tmp/package.js" should contain
|
@@ -50,7 +50,7 @@ Feature: external dependencies
|
|
50
50
|
And file "tmp/package.js" should have "script: Core.js" before "script: Color.js"
|
51
51
|
|
52
52
|
Scenario: external dependency with external dependency
|
53
|
-
When I run "jsus
|
53
|
+
When I run "jsus ExternalDependencyWithExternalDependency tmp -d ExternalDependencyWithExternalDependency"
|
54
54
|
Then the following files should exist:
|
55
55
|
| tmp/package.js |
|
56
56
|
And file "tmp/package.js" should contain
|
@@ -3,7 +3,7 @@ Feature: json package files
|
|
3
3
|
package.json
|
4
4
|
|
5
5
|
Scenario: package with package.json file
|
6
|
-
When I run "jsus
|
6
|
+
When I run "jsus JsonPackage tmp"
|
7
7
|
Then the following files should exist:
|
8
8
|
| tmp/package.js |
|
9
9
|
And file "tmp/package.js" should contain
|
@@ -3,7 +3,7 @@ Feature: structure json files
|
|
3
3
|
generate some extra files.
|
4
4
|
|
5
5
|
Scenario: auto-generation of tree.json and scripts.json
|
6
|
-
When I run "jsus
|
6
|
+
When I run "jsus Basic tmp"
|
7
7
|
Then the following files should exist:
|
8
8
|
| tmp/tree.json |
|
9
9
|
| tmp/scripts.json |
|
data/jsus.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{jsus}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mark Abramov"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-02-11}
|
13
13
|
s.default_executable = %q{jsus}
|
14
14
|
s.description = %q{Javascript packager and dependency resolver}
|
15
15
|
s.email = %q{markizko@gmail.com}
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 3
|
9
|
+
version: 0.2.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Mark Abramov
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-
|
17
|
+
date: 2011-02-11 00:00:00 +03:00
|
18
18
|
default_executable: jsus
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -285,7 +285,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
285
285
|
requirements:
|
286
286
|
- - ">="
|
287
287
|
- !ruby/object:Gem::Version
|
288
|
-
hash: -
|
288
|
+
hash: -1946463697476242454
|
289
289
|
segments:
|
290
290
|
- 0
|
291
291
|
version: "0"
|