dorian-times 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/times +24 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9311517b930b354ee314ba5b3880182937a406a269393a411ccc5627f0c55a33
4
- data.tar.gz: a87dfa31561e42a2572390f0c9cfce0823e7bfa4f7d40b52b28afce5982608f3
3
+ metadata.gz: 6ba8e94393dcfbbca2d14797eef4872e25dd30a5c7d38da8ee78fab7e779186a
4
+ data.tar.gz: d7765302beec04a05b6cb2fe7a8b0954a4c8e5c9e2e1a4060b88e9e5762ae74e
5
5
  SHA512:
6
- metadata.gz: c1ce801c3cb19ac8f1df73731222fbc47185e33aa1fb56738a0f747de6a0eb2bc79aee9737170ff9b551756f4f51f5af02192c7dec6d5d1f8e422913f1c1f14d
7
- data.tar.gz: '04154269b5cbe0188279157c59020050a0769d5f3d413cb222d341303638e05716d3dc563ebc4680d6f798e825bca8c627448f35cee10fc74dd0b5beabd324b0'
6
+ metadata.gz: e71d22bb11c1944dc88eb9a21f722df85c82a1ae96fde3e4be4e0fbbbfcaee3e6ed48397530fba5ea3a9f1aaf1836ab4dc83e409bbc67d3fb45f7ab7b294ca12
7
+ data.tar.gz: 96a509315e7ca4c8a8803080dc32d2d375d7bef91d747c882f73ecbb9a45bc0830898b870c688e1b52780e9c07791f00098dfda446752b9da614f0742577e31a
data/bin/times CHANGED
@@ -1,9 +1,29 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- if ARGV.size != 1 || ARGV[0] == "--help" || ARGV[0] == "-h"
5
- puts "USAGE: times N"
6
- exit
4
+ require "dorian/arguments"
5
+
6
+ parsed =
7
+ Dorian::Arguments.parse(
8
+ start: {
9
+ type: :integer,
10
+ alias: :s,
11
+ default: 1
12
+ },
13
+ version: {
14
+ alias: :v
15
+ },
16
+ help: {
17
+ alias: :h
18
+ }
19
+ )
20
+
21
+ abort parsed.help if parsed.options.help
22
+
23
+ if parsed.options.version
24
+ abort File.read(File.expand_path("../../VERSION", __FILE__))
7
25
  end
8
26
 
9
- ARGV.first.to_i.times { |i| puts i + 1 }
27
+ parsed.arguments.each do |argument|
28
+ argument.to_i.times { |i| puts parsed.options.start + i }
29
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorian-times
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