dev_suite 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61551856599e246df8b5d7e66bf7ada17cf7ed03147c9c846fcd1f4ed2fcaf5d
4
- data.tar.gz: f36513a7e8afa78bd04c9a9d9cd893e9a75b79006ff2ba41f8aa0245f06cc0fa
3
+ metadata.gz: eca02b15867ef75a77fed4586931ab72a98c33202dd3792daf44cc208c0f9e72
4
+ data.tar.gz: b6bc4187d4e93978fab552d47178792efb7862c9055f868469b138ee37e755e0
5
5
  SHA512:
6
- metadata.gz: 533af36d8beb9efbe20c5f8135d6c7255265c6e8ff7b0b2fc35f57da5572803cead32a69bcda9e672f4de5373b0a6f41e678241042c0ce16c0a06cbe681ead4d
7
- data.tar.gz: 66729b4045f43b20029c6ad81365e51505489c3a6f99f241cfbb7acd9e31bd5951004e3faf2f0715878ac386a2c1d8108701142fdb87ebed72b63b1d7263b423
6
+ metadata.gz: 70e87b35875abc89df1823e80fd6fda525eb019e992b8e454cdf22043b98b0b731cdc6b111af15ca23bb8818857de387ae996adbeb1d0920413dbe807804119e
7
+ data.tar.gz: 9c4396647818118bde2c5c82a3b9f0d5ce2775d3c53812070071b4b3d37ebc931786214a3a8a8b6c3c151eb64904bebcf61298ba915dbd99baf64c1e54d13737
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dev_suite (0.2.1)
4
+ dev_suite (0.2.2)
5
5
  benchmark (~> 0.1)
6
6
  get_process_mem (~> 0.2)
7
7
 
data/README.md CHANGED
@@ -96,8 +96,26 @@ DevSuite::SomeUtility.do_something
96
96
  DevSuite::DirectoryTree.visualize(base_path)
97
97
  ```
98
98
 
99
- **Example output**
99
+ **Configuring the Visualization:**
100
+
101
+ ```ruby
102
+ DevSuite::DirectoryTree::Config.configure do |config|
103
+ config.settings.set(:skip_hidden, true)
104
+ # ...
105
+ end
100
106
  ```
107
+
108
+ **Available Configuration Options:**
109
+
110
+ | Setting | Description | Example Values |
111
+ | -------------- | ------------------------------------------------ | ------------------------ |
112
+ | `:skip_hidden` | Skip hidden files and directories. | `true`, `false` |
113
+ | `:max_depth` | Limit the depth of the directory tree displayed. | `1`, `2`, `3`, ... |
114
+ | `:skip_types` | Exclude files of specific types. | `['.log', '.tmp']`, `[]` |
115
+
116
+ **Example output**
117
+
118
+ ```bash
101
119
  /path/to/your/directory/
102
120
  ├── project/
103
121
  │ ├── src/
@@ -10,19 +10,23 @@ module DevSuite
10
10
  def build(path)
11
11
  return build_permission_denied_node(path) unless path.readable?
12
12
 
13
- path.directory? ? construct_directory_node(path) : build_file_node(path)
13
+ build_node(path)
14
14
  rescue Errno::EACCES
15
15
  build_permission_denied_node(path)
16
16
  end
17
17
 
18
18
  protected
19
19
 
20
+ def build_node(path)
21
+ path.directory? ? construct_directory_node(path) : build_file_node(path)
22
+ end
23
+
20
24
  def construct_directory_node(path)
21
- directory = Node::Directory.new(path.basename.to_s)
22
- path.children.each do |child|
23
- directory.add_child(build(child))
25
+ Node::Directory.new(path.basename.to_s).tap do |directory|
26
+ path.children.each do |child|
27
+ directory.add_child(build(child)) if child.readable?
28
+ end
24
29
  end
25
- directory
26
30
  end
27
31
 
28
32
  def build_file_node(path)
@@ -1,3 +1,3 @@
1
1
  module DevSuite
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dev_suite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Huy Nguyen