dorian-yaml-all 0.0.2 → 1.0.0

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/yaml-all +16 -6
  3. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efe2d992800e58ce5cd14de419e13e513c48892ecdafd026d4c2271f80dbc157
4
- data.tar.gz: 7404ac9c4f9831935e9134d4ef5f360c08ff40e81c384d27fe1b61f55ee2992c
3
+ metadata.gz: a5e21a28f55951927176b216bb4a13057df3b4b90a6eb673251652ee70601c61
4
+ data.tar.gz: 6833d213eab9573a10f89dbf0134ca163151fc796463643947ef2df159920c39
5
5
  SHA512:
6
- metadata.gz: cb7136e2c38b90afda90e77fd144e50cddc32fc09fc1b486d538bd0db373475833296bc7508548a60c8d93be9e95e870c5b8d78b0a78449e4dc9d7f1e8902987
7
- data.tar.gz: ecc7e21b93b546830651534baf78b373c51c341f0b26e61795642ed6683cadbdd8ef9ccee0026e07a1715c7bbea750c85261d9f6bb2d50c7613be50071a2918f
6
+ metadata.gz: 1058bfd2b76baa2477bcc796343c7f0218c5fe55fe2296ec6f553bb437bdb8c8cf3693acc718c27ef0cc83da1700f7c03a893d70d7542e50b1860166d42368d8
7
+ data.tar.gz: 12b88d78069ae986c36e7b04ecaef6373e47848a4f4f85b6b0d45a9cc16839364f79897c5a93f89c1fbb8486a2deafd7abd242bf95019c87367ca45a8821b617
data/bin/yaml-all CHANGED
@@ -1,12 +1,22 @@
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: ... | each CODE"
6
- exit
4
+ require "dorian/arguments"
5
+ require "dorian/to_struct"
6
+ require "yaml"
7
+
8
+ parsed = Dorian::Arguments.parse(version: { alias: :v }, help: { alias: :h })
9
+
10
+ abort parsed.help if parsed.options.help
11
+
12
+ if parsed.options.version
13
+ abort File.read(File.expand_path("../../VERSION", __FILE__))
7
14
  end
8
15
 
9
- $stdin.each_line do |it|
10
- it.strip!
11
- eval(ARGV.first)
16
+ inputs = parsed.files.map { |file| File.read(file) }
17
+ inputs = [$stdin.each_line.to_a.join] if inputs.empty?
18
+
19
+ inputs.each do |input|
20
+ it = YAML.safe_load(input).to_deep_struct
21
+ eval(parsed.arguments.join(" "))
12
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dorian-yaml-all
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.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
11
+ date: 2024-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: yaml
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: dorian-arguments
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
41
55
  description: evalutes ruby code on all of yaml
42
56
  email: dorian@dorianmarie.com
43
57
  executables: