fwi 1.2.1 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fwi.gemspec +1 -1
- data/lib/fwi/compilers/js/compiler.rb +16 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcc0b0bc4fcf2f752fc1b44da4ee762dca07ec41
|
4
|
+
data.tar.gz: 317ee1310f3f44c71fede6fdaac16d174cc2c887
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4c80d1d4bd5708be3dc2679f29d9e5aa5b5089341df273b5c944ca8129ae9b2fd37b593d8cc07a0928a94bf51bb56e758584f22d2519685626823d5c2488088
|
7
|
+
data.tar.gz: fe62cea14f6f761ca31bb143e7cdcbed6509be6041b31bf4cff546503d2fb69b5455e5b83c2dadead5411dbe14a57346a60fcc53d42d09d2c790ab5ce3eb41ba
|
data/fwi.gemspec
CHANGED
@@ -5,6 +5,8 @@ class JSCompiler
|
|
5
5
|
GEN = FWI::Generator::JS.new
|
6
6
|
|
7
7
|
def populate_options o
|
8
|
+
@options = {}
|
9
|
+
o.on("--bundle [NAME]", "Create a JavaScript bundle file with the given name") { |name| @options[:bundle] = name }
|
8
10
|
end
|
9
11
|
|
10
12
|
def after_parse; end
|
@@ -14,8 +16,20 @@ class JSCompiler
|
|
14
16
|
base = File.basename(file, File.extname(file))
|
15
17
|
|
16
18
|
files = GEN.gen bitmap
|
17
|
-
|
18
|
-
|
19
|
+
if @options[:bundle].nil?
|
20
|
+
files.each do |fn, contents|
|
21
|
+
f = File.join(options[:output], fn)
|
22
|
+
FileUtils.mkdir_p File.expand_path("..", f)
|
23
|
+
File.write(f, contents)
|
24
|
+
end
|
25
|
+
else
|
26
|
+
contents = ""
|
27
|
+
files.each do |fn, fcontents|
|
28
|
+
contents << "// File: #{fn}\n"
|
29
|
+
contents << fcontents
|
30
|
+
contents << "\n"
|
31
|
+
end
|
32
|
+
f = File.join(options[:output], @options[:bundle])
|
19
33
|
FileUtils.mkdir_p File.expand_path("..", f)
|
20
34
|
File.write(f, contents)
|
21
35
|
end
|