marfa 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/marfa-build-js +18 -6
- data/lib/marfa/version.rb +1 -1
- data/marfa.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a423c48b5405907fa9a6e7e782f8695dad2c3c36
|
4
|
+
data.tar.gz: 9a4ab9f1754e2bdab22f437a5928ef00f94b8fa3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 138fe6e3b19da6060c509eaebd92b7c7a13c6a0f39ca8a435958e9cc9faa5c6c714c9be89c28d4815e45b7ccbf0dc1939a5d97691a7f42f9d0ddc0e1c82352ff
|
7
|
+
data.tar.gz: 400b292c45fdfa2bf8218147282bc1a15dee62f1c9ea1456c229dd9f8e2e5dfcb4c0d8ae7e8ab6961d4be14dff45b10a472356c4996fb386fa878671cbd8411c
|
data/bin/marfa-build-js
CHANGED
@@ -8,21 +8,31 @@ include FileUtils
|
|
8
8
|
|
9
9
|
options = {
|
10
10
|
home_path: FileUtils.pwd,
|
11
|
-
search_dir: '',
|
12
|
-
output_dir: '/static/js'
|
11
|
+
search_dir: '/app',
|
12
|
+
output_dir: '/static/js',
|
13
|
+
hierarchy: false,
|
14
|
+
minify: false
|
13
15
|
}
|
14
16
|
|
15
17
|
parser = OptionParser.new do |opts|
|
16
18
|
opts.banner = 'Usage: marfa-build-js [options]'
|
17
19
|
|
18
|
-
opts.on('-s', '--
|
20
|
+
opts.on('-s', '--search-dir SEARCH_DIR', 'Search dir') do |search_dir|
|
19
21
|
options[:search_dir] = search_dir
|
20
22
|
end
|
21
23
|
|
22
|
-
opts.on('-o', '--
|
24
|
+
opts.on('-o', '--output-dir OUTPUT_DIR', 'Output dir') do |output_dir|
|
23
25
|
options[:output_dir] = output_dir
|
24
26
|
end
|
25
27
|
|
28
|
+
opts.on('-u', '--use_hierarchy', 'Use current dir hierarchy') do
|
29
|
+
options[:hierarchy] = true
|
30
|
+
end
|
31
|
+
|
32
|
+
opts.on('-m', '--minify', 'Minify js') do
|
33
|
+
options[:minify] = true
|
34
|
+
end
|
35
|
+
|
26
36
|
opts.on('-h', '--help', 'Displays help') do
|
27
37
|
puts opts
|
28
38
|
exit
|
@@ -46,12 +56,14 @@ Dir[search_dir + '/**/*.js'].each do |path|
|
|
46
56
|
)
|
47
57
|
|
48
58
|
result = Babel::Transpiler.transform(File.read(path))
|
49
|
-
code = closure.compile(result['code'])
|
59
|
+
code = (options[:minify]) ? closure.compile(result['code']) : result['code']
|
60
|
+
file_name = path.split('/').last
|
50
61
|
output_path = options[:home_path] + options[:output_dir]
|
62
|
+
output_path += path.sub(search_dir, '').sub(file_name, '') if options[:hierarchy]
|
51
63
|
|
52
64
|
mkdir_p(output_path) unless Dir.exist?(output_path)
|
53
65
|
|
54
|
-
File.open(output_path + '/' +
|
66
|
+
File.open(output_path + '/' + file_name, 'w') do |f|
|
55
67
|
f.puts code
|
56
68
|
end
|
57
69
|
end
|
data/lib/marfa/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Version constant
|
2
2
|
module Marfa
|
3
3
|
# The version constant for the current version of Marfa
|
4
|
-
VERSION = '0.1.
|
4
|
+
VERSION = '0.1.5' unless defined?(Marfa::VERSION)
|
5
5
|
|
6
6
|
# The current Marfa version.
|
7
7
|
# @return [String] The version number
|
data/marfa.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marfa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Krechetov
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-02-
|
13
|
+
date: 2017-02-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: haml
|