compath 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -8
- data/lib/compath/guide.rb +5 -1
- data/lib/compath/version.rb +1 -1
- 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: 1f2e0e66e3839bf65292f80ba6d74ea111552b18
|
4
|
+
data.tar.gz: d6a0c453760bd6dc2a863b89bee3bbee825d6d4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 044a25838f0f30322e55ea522f7adcbca0e2fe22fb22dfdc63d48237d46eac248f490024d7f80c0ead9c6ae886a837ca5a8618c21ec46fa710055ad4ce6d3839
|
7
|
+
data.tar.gz: 6b6678b4980161c8fc44812b45fb99085b66ecfec38db67f863ca5b26ca0c84629750544658e0d8387be9f06622f9462ce7a7f8358a5b7706f938527b044b85d
|
data/README.md
CHANGED
@@ -8,7 +8,7 @@ Compath generates a guide of directory structure in the project.
|
|
8
8
|
|
9
9
|
## Usage
|
10
10
|
|
11
|
-
$ compath
|
11
|
+
$ compath
|
12
12
|
|
13
13
|
It creates or updates `.compath.yml`.
|
14
14
|
|
@@ -16,8 +16,7 @@ It creates or updates `.compath.yml`.
|
|
16
16
|
---
|
17
17
|
bin/:
|
18
18
|
exe/:
|
19
|
-
lib
|
20
|
-
lib/compath/:
|
19
|
+
lib/**/*:
|
21
20
|
spec/:
|
22
21
|
|
23
22
|
...
|
@@ -26,26 +25,27 @@ spec/:
|
|
26
25
|
The top level object of yaml is mapping. Each key of objects means path, and each value of objects means description.
|
27
26
|
Additional convention of configuration is that the path (key) which is end with `**/*` or `*` tells Compath to stop scanning of children of the directory.
|
28
27
|
|
29
|
-
|
28
|
+
Initial generated config has keys of only top level paths.
|
29
|
+
With the following changes of `.compath.yml`, `compath` will also scan files of `lib/` directory.
|
30
30
|
|
31
31
|
```yaml
|
32
32
|
---
|
33
33
|
bin/:
|
34
34
|
exe/:
|
35
|
-
lib
|
36
|
-
lib/compath/:
|
35
|
+
lib/: # Removed `**/*`
|
37
36
|
spec/:
|
38
37
|
|
39
38
|
...
|
40
39
|
```
|
41
40
|
|
42
|
-
will be updated to the following content by compath.
|
41
|
+
It will be updated to the following content by compath.
|
43
42
|
|
44
43
|
```yaml
|
45
44
|
---
|
46
45
|
bin/:
|
47
46
|
exe/:
|
48
|
-
lib
|
47
|
+
lib/:
|
48
|
+
lib/compath/:
|
49
49
|
spec/:
|
50
50
|
|
51
51
|
...
|
data/lib/compath/guide.rb
CHANGED
@@ -35,7 +35,7 @@ module Compath
|
|
35
35
|
|
36
36
|
def object_key
|
37
37
|
if directory?
|
38
|
-
if @scan_children
|
38
|
+
if !has_directory_child? || @scan_children
|
39
39
|
pathname.to_s + '/'
|
40
40
|
else
|
41
41
|
pathname.to_s + '/**/*'
|
@@ -48,5 +48,9 @@ module Compath
|
|
48
48
|
def object_value
|
49
49
|
@description
|
50
50
|
end
|
51
|
+
|
52
|
+
def has_directory_child?
|
53
|
+
pathname.children.any?(&:directory?)
|
54
|
+
end
|
51
55
|
end
|
52
56
|
end
|
data/lib/compath/version.rb
CHANGED