dorian-all 0.7.0 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/all +14 -5
  3. metadata +19 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2eefb2f0d5df53fba2273ab0eb0b3e98a98cc8ce3db5ccf94048054a13342fdf
4
- data.tar.gz: 34468ff1d965e02f944e5ed4c62e22b42ba6d57cde77af771de7336c2fbabaed
3
+ metadata.gz: c70b4f9da4519e867c7b3d9849957f267b32dd55cae8d7b3b99faf66857a5087
4
+ data.tar.gz: ed8db36ae2dff133b4a1f8931d37b9e9569eea0e3e88d47b492697872d4aa9a8
5
5
  SHA512:
6
- metadata.gz: d37db73eb4874db8e633436eea0f100b62856e54507c0a02d3f7e2152d4ef16d19ed741e87ed020be3a6881a482e84446820b92f3c94d48442e82514d6ec1eb7
7
- data.tar.gz: 11accb9966a0071d7c9504d1718f0c0995682888341e163223afe3e822d83657877717bf4dbbccb0a738e4baa21268f970638d1c742fefa81baedfd00e8c77fd
6
+ metadata.gz: 2cc13c788e75deca955fa2690141b85a534259bb6d90f2ed48e13474a3558e2bde76d25b88412f112ea82adf1231c93b221379cde511a74ada301ac2230f7967
7
+ data.tar.gz: 4e4f40b503d429db72a3052a1981afbec29f652bcfecb07a87baa075dfc4f22c01c33d73abe6d454467044acd84d7326f6633ed5f8bb040e81a822d969504796
data/bin/all CHANGED
@@ -1,10 +1,19 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- if ARGV.size != 1 || ARGV.first == "--help" || ARGV.first == "-h"
5
- puts "USAGE: ... | all CODE"
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
+ if parsed.options.version
10
+ abort File.read(File.expand_path("../../VERSION", __FILE__))
11
+ end
12
+
13
+ if parsed.files.any?
14
+ it = parsed.files.map { |file| File.read(file) }.join
15
+ else
16
+ it = $stdin.each_line.to_a.map(&:strip)
7
17
  end
8
18
 
9
- it = $stdin.each_line.to_a.map(&:strip)
10
- eval(ARGV.first)
19
+ eval(parsed.arguments.join(" "))
metadata CHANGED
@@ -1,19 +1,30 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorian-all
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.3
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-07-05 00:00:00.000000000 Z
12
- dependencies: []
13
- description: |-
14
- Evaluates some code on all lines of the input
15
-
16
- e.g. `ls -l | each "puts l.split[4]" | all "puts lines.map(&:to_i).sum"`
11
+ date: 2024-08-22 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'
27
+ description: evaluates ruby code on all lines of the input
17
28
  email: dorian@dorianmarie.com
18
29
  executables:
19
30
  - all
@@ -44,5 +55,5 @@ requirements: []
44
55
  rubygems_version: 3.5.11
45
56
  signing_key:
46
57
  specification_version: 4
47
- summary: Evaluates some code on all lines of the input
58
+ summary: evaluates ruby code on all lines of the input
48
59
  test_files: []