dorian-times 0.5.3 → 1.1.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 +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9311517b930b354ee314ba5b3880182937a406a269393a411ccc5627f0c55a33
4
- data.tar.gz: a87dfa31561e42a2572390f0c9cfce0823e7bfa4f7d40b52b28afce5982608f3
3
+ metadata.gz: 63b20ad73010031ac1b3527b5533b5fa5ae66c7233135542539ca6e359331870
4
+ data.tar.gz: 1e1f7fc69a9a46debf9d6d9060865ad6d41867ce9733dba2cbdc7b9993d4ee6a
5
5
  SHA512:
6
- metadata.gz: c1ce801c3cb19ac8f1df73731222fbc47185e33aa1fb56738a0f747de6a0eb2bc79aee9737170ff9b551756f4f51f5af02192c7dec6d5d1f8e422913f1c1f14d
7
- data.tar.gz: '04154269b5cbe0188279157c59020050a0769d5f3d413cb222d341303638e05716d3dc563ebc4680d6f798e825bca8c627448f35cee10fc74dd0b5beabd324b0'
6
+ metadata.gz: 39b1f7968a2affde70d69c3e51a52d0be6286d727d3a1b3fdcd4ef45e94af78f0bcaa50c7d562a89c358e940db7e540d353c16f8e555336fd5f14343b7e736f6
7
+ data.tar.gz: 4d815614b8bbeef397e06fcf289c5b6481f858f616fd020b9955df3bdcfd1df71d51c4a970900dec6850bdad015282ac37711b52eec9b2759542a4118f5727a6
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", __dir__))
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.1.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-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dorian-arguments
@@ -43,9 +43,9 @@ require_paths:
43
43
  - lib
44
44
  required_ruby_version: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ">="
46
+ - - '='
47
47
  - !ruby/object:Gem::Version
48
- version: '0'
48
+ version: 3.3.4
49
49
  required_rubygems_version: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="