dassets 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dassets/source.rb +2 -2
- data/lib/dassets/version.rb +1 -1
- data/test/support/empty/.gitkeep +0 -0
- data/test/unit/source_tests.rb +29 -0
- metadata +6 -4
data/lib/dassets/source.rb
CHANGED
@@ -22,13 +22,13 @@ class Dassets::Source
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def files
|
25
|
-
apply_filter(glob_files).sort
|
25
|
+
apply_filter(glob_files || []).sort
|
26
26
|
end
|
27
27
|
|
28
28
|
private
|
29
29
|
|
30
30
|
def glob_files
|
31
|
-
Dir.glob(File.join(@path, "**/*"
|
31
|
+
Dir.glob(File.join(@path, "**/*")).reject!{ |p| !File.file?(p) }
|
32
32
|
end
|
33
33
|
|
34
34
|
def apply_filter(files)
|
data/lib/dassets/version.rb
CHANGED
File without changes
|
data/test/unit/source_tests.rb
CHANGED
@@ -49,6 +49,35 @@ class Dassets::Source
|
|
49
49
|
|
50
50
|
end
|
51
51
|
|
52
|
+
class EmptySourceTests < Assert::Context
|
53
|
+
desc "with no source files"
|
54
|
+
setup do
|
55
|
+
@empty_source_path = TEST_SUPPORT_PATH.join("empty")
|
56
|
+
@empty_source = Dassets::Source.new(@empty_source_path)
|
57
|
+
|
58
|
+
@no_exist_source_path = TEST_SUPPORT_PATH.join("does-not-exist")
|
59
|
+
@no_exist_source = Dassets::Source.new(@no_exist_source_path)
|
60
|
+
end
|
61
|
+
|
62
|
+
should "have no files" do
|
63
|
+
assert_empty @empty_source.files
|
64
|
+
assert_empty @no_exist_source.files
|
65
|
+
end
|
66
|
+
|
67
|
+
should "hand filters an empty path list" do
|
68
|
+
@empty_source.filter do |paths|
|
69
|
+
paths.reject{ |path| File.basename(path) =~ /^_/ }
|
70
|
+
end
|
71
|
+
@no_exist_source.filter do |paths|
|
72
|
+
paths.reject{ |path| File.basename(path) =~ /^_/ }
|
73
|
+
end
|
74
|
+
|
75
|
+
assert_empty @empty_source.files
|
76
|
+
assert_empty @no_exist_source.files
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
|
52
81
|
class EngineRegistrationTests < BaseTests
|
53
82
|
desc "when registering an engine"
|
54
83
|
setup do
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dassets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 2
|
10
|
+
version: 0.6.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2013-
|
19
|
+
date: 2013-06-12 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: assert
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- test/support/app/assets/nested/a-thing.txt.useless.dumb
|
136
136
|
- test/support/app/assets/nested/file3.txt
|
137
137
|
- test/support/config/assets.rb
|
138
|
+
- test/support/empty/.gitkeep
|
138
139
|
- test/support/public/file1-daa05c683a4913b268653f7a7e36a5b4.txt
|
139
140
|
- test/support/public/file2-9bbe1047cffbb590f59e0e5aeff46ae4.txt
|
140
141
|
- test/support/public/grumpy_cat-b0d1f399a916f7a25c4c0f693c619013.jpg
|
@@ -203,6 +204,7 @@ test_files:
|
|
203
204
|
- test/support/app/assets/nested/a-thing.txt.useless.dumb
|
204
205
|
- test/support/app/assets/nested/file3.txt
|
205
206
|
- test/support/config/assets.rb
|
207
|
+
- test/support/empty/.gitkeep
|
206
208
|
- test/support/public/file1-daa05c683a4913b268653f7a7e36a5b4.txt
|
207
209
|
- test/support/public/file2-9bbe1047cffbb590f59e0e5aeff46ae4.txt
|
208
210
|
- test/support/public/grumpy_cat-b0d1f399a916f7a25c4c0f693c619013.jpg
|