compressor 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/compressor.rb +14 -2
- 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: 4fd93ca50a31e9390c82251c5b529ff035c49297
|
4
|
+
data.tar.gz: 264aaa3bd1d9ee32c6b4d9630ceea1706805798b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 508bbad057650654676ef4d8f3b60eeb4f9c7733629cab734b2f70ed10045256e75c0b1312dedde0838e44c403ef1bb7d87d15023bec781a4890ef7be76233bf
|
7
|
+
data.tar.gz: 097301dbec4c10c98bfca9f476d421e7d23d3da95fe05876d1b3aef97792a0695fbfc315016e34aa1a3dc1197f40c5edb8bb39a5248dc70d2bf3dc1d3026727b
|
data/lib/compressor.rb
CHANGED
@@ -8,7 +8,9 @@ end
|
|
8
8
|
module Motion::Project
|
9
9
|
class Config
|
10
10
|
def concat_files(opts={})
|
11
|
-
|
11
|
+
opts[:exclude] ||= [ "/app/" ]
|
12
|
+
opts[:parallel] ||= 4
|
13
|
+
concatenate_files!(extract_concatenated_files(Array(opts[:exclude])), opts[:parallel])
|
12
14
|
end
|
13
15
|
|
14
16
|
private
|
@@ -16,9 +18,18 @@ module Motion::Project
|
|
16
18
|
def extract_concatenated_files(excluded=[])
|
17
19
|
@files.flatten!
|
18
20
|
concatenated_files = @files.select { |f| excluded.none? { |excluded_match| !!f.match(excluded_match) } }
|
19
|
-
old_dependencies = @dependencies
|
20
21
|
@files = @files - concatenated_files
|
21
22
|
@dependencies = Dependency.new(@files - @exclude_from_detect_dependencies, @dependencies).run
|
23
|
+
|
24
|
+
# TODO: Remove all concatenated files from the dependency hash
|
25
|
+
# @dependencies.each do |target, dependencies|
|
26
|
+
# if @files.include?(target)
|
27
|
+
# @dependencies[target] = dependencies - concatenated_files
|
28
|
+
# else
|
29
|
+
# @dependencies.delete(target)
|
30
|
+
# end
|
31
|
+
# end
|
32
|
+
|
22
33
|
order_concatenated_files(concatenated_files)
|
23
34
|
end
|
24
35
|
|
@@ -37,6 +48,7 @@ module Motion::Project
|
|
37
48
|
|
38
49
|
# Prep the concat path for writing
|
39
50
|
Dir.mkdir(File.dirname(concat_path)) unless File.exist?(File.dirname(concat_path))
|
51
|
+
File.new(concat_path, 'w') unless File.exist?(concat_path)
|
40
52
|
|
41
53
|
# Concatenate this group of files
|
42
54
|
File.open(temp_concat_path, 'a') do |concat|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compressor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamon Holmgren
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|