dorian-dir 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/dir +11 -3
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7a4194072e1df69d17af0545f3d0b22828af476f35580bcad03b757126ba802
4
- data.tar.gz: b2a7fc7be6a50285fc722135cbe7ba688b65d98dca7853d9147617e0823fbc5f
3
+ metadata.gz: 5e1523a968b4f4ead263e5a085587c49e12c2e39ad8fa9d546d6843ad84be2f0
4
+ data.tar.gz: 31b089b9f96e36e447fdb5f7f26e84fd0d5b2bd24fc10caa1d140b51e85d6273
5
5
  SHA512:
6
- metadata.gz: 1df5fd606c3a862629524941873bb0d1d0305538ac4e1bf9de58db8faec9d6b567d4de7fec855f7807b3100ed616ff15fb852ffd2b0e95f8a9ea3b223ee9013e
7
- data.tar.gz: ce037c024e276e97c9be6712b653fc242a8076def36c3b34a93efab3cb1c4744bb1ea055432bd4c6f216b445e7a3fd8b22ca81304d7d8c85bad25e937b912f44
6
+ metadata.gz: 270b02d1e7d72f27333de43ef26bc06ccaf9754529e555c68c4008eda4bb1e64220055c6ecfe62d5af505e1f80bcf9e2f26576334c592bcf537e3ecb4c574f2d
7
+ data.tar.gz: 96cf503446c99f6bf673c6be4eeb1c6331614137acd26f4f2cd6d9e17ea3ab62cf9447c61fd62991b73b734b1fc025406d90532ba6e0df9cad0132ebc3e3f206
data/bin/dir CHANGED
@@ -1,9 +1,17 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- if ARGV.any?
5
- puts "USAGE: dir"
4
+ if ARGV.first == "-h" || ARGV.first == "--help"
5
+ puts "USAGE: dir [PATHS...]"
6
6
  exit
7
7
  end
8
8
 
9
- puts Dir.glob('*').select { |path| Dir.exist?(path) }
9
+ PATHS = ARGV.any? ? ARGV : ["."]
10
+
11
+ PATHS.each do |path|
12
+ puts(
13
+ Dir.glob("#{path}/*").select { |path| Dir.exist?(path) }.map do |path|
14
+ File.basename(path)
15
+ end
16
+ )
17
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorian-dir
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dorian Marié
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-05 00:00:00.000000000 Z
11
+ date: 2024-04-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |-
14
14
  List directories