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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +19 -1
- data/lib/dev_suite/directory_tree/builder/base.rb +9 -5
- data/lib/dev_suite/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eca02b15867ef75a77fed4586931ab72a98c33202dd3792daf44cc208c0f9e72
|
4
|
+
data.tar.gz: b6bc4187d4e93978fab552d47178792efb7862c9055f868469b138ee37e755e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70e87b35875abc89df1823e80fd6fda525eb019e992b8e454cdf22043b98b0b731cdc6b111af15ca23bb8818857de387ae996adbeb1d0920413dbe807804119e
|
7
|
+
data.tar.gz: 9c4396647818118bde2c5c82a3b9f0d5ce2775d3c53812070071b4b3d37ebc931786214a3a8a8b6c3c151eb64904bebcf61298ba915dbd99baf64c1e54d13737
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -96,8 +96,26 @@ DevSuite::SomeUtility.do_something
|
|
96
96
|
DevSuite::DirectoryTree.visualize(base_path)
|
97
97
|
```
|
98
98
|
|
99
|
-
**
|
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
|
-
|
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
|
-
|
22
|
-
|
23
|
-
|
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)
|
data/lib/dev_suite/version.rb
CHANGED