dorian-times 0.5.2 → 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 +17 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7e23ebce87d6bd899ffee292c0a3a475ce94afc4ff7282c7a2ef6a9e4f87352
4
- data.tar.gz: e345c8deda849b2583832c087ae2ef78ece569648ec29c089117c12ce55fbef7
3
+ metadata.gz: 6ba8e94393dcfbbca2d14797eef4872e25dd30a5c7d38da8ee78fab7e779186a
4
+ data.tar.gz: d7765302beec04a05b6cb2fe7a8b0954a4c8e5c9e2e1a4060b88e9e5762ae74e
5
5
  SHA512:
6
- metadata.gz: 4ebe82d73b268840ee314ae7205b8b7d7f95ddfff93859704bf36973cc4e047165969ad5230b470272bf422da6b1530638e7fbdfb15e1e60e8ea14e8e6f7be2b
7
- data.tar.gz: 8975d5c6b76ef7be92a0aed4a9f3b2b0182f5e31366cc5210a63c01265a22bb6a069c2523f563a80654663d95280a8e2cd8dd856e74d4c2e6bff3ce51781a7d3
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,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorian-times
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
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-18 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2024-08-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dorian-arguments
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: prints numbers from 1 to n
14
28
  email: dorian@dorianmarie.com
15
29
  executables: