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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3eb70b1201cb5c9129f2e4f84b4e073ad81c9a42
4
- data.tar.gz: cf7f54d2e62a1239e0ff825fa54f42f97a1d254b
3
+ metadata.gz: 1f2e0e66e3839bf65292f80ba6d74ea111552b18
4
+ data.tar.gz: d6a0c453760bd6dc2a863b89bee3bbee825d6d4e
5
5
  SHA512:
6
- metadata.gz: 1991ab7214337b85e63d859909c03644df1c7ae8aaf36de54aca8d8bb92db4ce8dea832341d9b21c54f2b3d501b3681359d64b6073543326a6a5d3947f5afc28
7
- data.tar.gz: 21b02ed71baf12731b9c14de4fb3b3cadddc3d4cb9ddf7306dcf3fd0734b29bf059eb4d0908c12f766fa4efe0d9069bbcbd854d8f93a56657eef5de7e4eca96a
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 --file=.compath.yml
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
- With the following config, `compath` does not scan files of `bin/` directory.
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/**/*: # Modified!
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
  ...
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Compath
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compath
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - meganemura