dorian-to_struct 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/bin/to_struct +1 -1
- data/lib/dorian/to_struct.rb +4 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbf302700b3ccd2685cab62a5c042e17f176f8091dbb68d3f19c8d3fe1f1ed18
|
4
|
+
data.tar.gz: cef30d957d1ab98f95a6cf26fb30ce61867b6ea9060e4773d9fc155529ad63e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 667d8183f007bdce95d9bf615098155b2bacc3e42960a38c4fe133d8d072973f686ff8495c102aff38692a3478e208ed047932cc9c4d7729c68e88460f7dfa8b
|
7
|
+
data.tar.gz: ef25313323ca1e1c8e6811a9b713d64610671c4e89b19416a7ec3051443d304d72284979298ec700a5645847849e032041815841c65da7fb0ff67f856b31aed4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.0.0
|
data/bin/to_struct
CHANGED
@@ -6,7 +6,7 @@ require "dorian/arguments"
|
|
6
6
|
parsed = Dorian::Arguments.parse(version: { alias: :v }, help: { alias: :h })
|
7
7
|
|
8
8
|
if parsed.options.version
|
9
|
-
abort File.read(File.expand_path("
|
9
|
+
abort File.read(File.expand_path("../VERSION", __dir__))
|
10
10
|
else
|
11
11
|
abort parsed.help
|
12
12
|
end
|
data/lib/dorian/to_struct.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Array
|
2
4
|
def to_struct
|
3
5
|
map(&:to_struct)
|
@@ -18,11 +20,11 @@ end
|
|
18
20
|
|
19
21
|
class Struct
|
20
22
|
def from_struct
|
21
|
-
to_h
|
23
|
+
to_h.transform_keys(&:to_s)
|
22
24
|
end
|
23
25
|
|
24
26
|
def from_deep_struct
|
25
|
-
to_h
|
27
|
+
to_h.transform_keys(&:to_s).transform_values(&:from_deep_struct)
|
26
28
|
end
|
27
29
|
end
|
28
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dorian-to_struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.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-
|
11
|
+
date: 2024-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: makes structs
|
14
14
|
email: dorian@dorianmarie.com
|
@@ -32,9 +32,9 @@ require_paths:
|
|
32
32
|
- lib
|
33
33
|
required_ruby_version: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
|
-
- -
|
35
|
+
- - '='
|
36
36
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
37
|
+
version: 3.3.4
|
38
38
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
39
|
requirements:
|
40
40
|
- - ">="
|