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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d4f5ac19e990aa8f6bf562b7d81cdc16883fe2125f3ca3c49ed5c263fe9ea093
4
- data.tar.gz: cca57932c680abb611f8607b04cc7c91c95afdb47ed32a13e3758336b6bebf31
3
+ metadata.gz: dbf302700b3ccd2685cab62a5c042e17f176f8091dbb68d3f19c8d3fe1f1ed18
4
+ data.tar.gz: cef30d957d1ab98f95a6cf26fb30ce61867b6ea9060e4773d9fc155529ad63e2
5
5
  SHA512:
6
- metadata.gz: 26b356e92e535b244016df40bb9dc40063797799d0f915bbaaa0e1411d647552dc1ed8ab3081479fbb0ab5e95c138a4a59dd5ef586096ab18630aa05ed0ad782
7
- data.tar.gz: 87d48e7153fa3343038347bce0a17420d3ab95cf60f9b9ec77f12527cac1322da106b986a640f2c0129336132ae82bfdd31ef435f2b365c681c0084ff8e5a42d
6
+ metadata.gz: 667d8183f007bdce95d9bf615098155b2bacc3e42960a38c4fe133d8d072973f686ff8495c102aff38692a3478e208ed047932cc9c4d7729c68e88460f7dfa8b
7
+ data.tar.gz: ef25313323ca1e1c8e6811a9b713d64610671c4e89b19416a7ec3051443d304d72284979298ec700a5645847849e032041815841c65da7fb0ff67f856b31aed4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
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("../../VERSION", __FILE__))
9
+ abort File.read(File.expand_path("../VERSION", __dir__))
10
10
  else
11
11
  abort parsed.help
12
12
  end
@@ -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 { |key, value| [key, value.from_deep_struct] }
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: 1.1.0
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-08-24 00:00:00.000000000 Z
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: '0'
37
+ version: 3.3.4
38
38
  required_rubygems_version: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - ">="