dorian-shuffle 0.5.3 → 1.0.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/shuffle +13 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0696f255c33210c1de2500cb6a49bf502390e72cf03b9d5c0e0917dca769356
4
- data.tar.gz: d5b528596ea0812725ca7e42d426d012fbcec2f348e17b92f79e9520bcd28973
3
+ metadata.gz: d889ea3c19078c5b27983ad8dc02e0b8963d0522401468d4935832fc1eb07004
4
+ data.tar.gz: 2656f9235d6f9fad03d6dd3aa1ef5db609d4f701950b177a9bb9191412c56122
5
5
  SHA512:
6
- metadata.gz: 8cdb258206b5c28ca6a4827fe3ff4d27bb8aa803137eef45d57e1d57cf14ffd555e4c31aeeebd71da564740669b475dc8a3e037c7b1a7b77788834760f7bb3a3
7
- data.tar.gz: 96de0602499fde16cc31014d1cd09bfe11e94b83002874354169656db5bca1d299165dea52609d50dd0038bc70b28202761057600c4c2ede6649f929ba6da844
6
+ metadata.gz: 133f77aefe8c3aef3375477d645e4a624af981637d9c03d151b2a5d1a111093a70716a755b53de0a00804fa6967039177bd30f539394609d76855fe91ca29ec6
7
+ data.tar.gz: 00ebfbb0cbb3afab5778d2e864718fe630ea72111c7b7dc56f78b37a874838fb78d014de777d630cf4de31b8536ccea0f541ee1fd4def21675bde78db536b0c4
data/bin/shuffle CHANGED
@@ -1,9 +1,18 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- if ARGV[0] == "--help" || ARGV[0] == "-h"
5
- puts "USAGE: ... | shuffle"
6
- exit
4
+ require "dorian/arguments"
5
+
6
+ parsed = Dorian::Arguments.parse(version: { alias: :v }, help: { alias: :h })
7
+
8
+ abort parsed.help if parsed.options.help
9
+
10
+ if parsed.options.version
11
+ abort File.read(File.expand_path("../../VERSION", __FILE__))
7
12
  end
8
13
 
9
- puts $stdin.each_line.to_a.shuffle
14
+ input = parsed.files.map { |file| File.read(file) }.join
15
+ input += parsed.arguments.join("\n")
16
+ input = $stdin.each_line.to_a.join("\n") if input.empty?
17
+
18
+ puts input.lines.map(&:strip).shuffle
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorian-shuffle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 1.0.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-08-22 00:00:00.000000000 Z
11
+ date: 2024-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dorian-arguments