to_dots 0.2.0 → 0.2.2

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
- SHA1:
3
- metadata.gz: 5a8988e3d224fac93c0498c0b32d3024fd431e90
4
- data.tar.gz: 2883d756770d337e2b6a2396907e066a0fd1494b
2
+ SHA256:
3
+ metadata.gz: ed6c85e7adc7219b143c21f03779747ea25391e450aff15c63b4dacdeb09e574
4
+ data.tar.gz: a4aa785461ea26e642fdabb6ba5ae28762ba39b4cedd78ea77ebe434d45712a7
5
5
  SHA512:
6
- metadata.gz: 9695194cc507d4986acd6a0f5798b1541b812698b8468c435abb861335f1a3e0653a7ed880d4b9ddc88f97c6f164edfdf8e5301ff119a3b26ebc80b021bd1359
7
- data.tar.gz: 29b47fc10b965317962dc4ddb93cc8e2d43b47923629bb5135ad245d907557e500e95468f0afefd790e3ebe418167dc6bdcfe11d697af0a8bc806ec7428476ec
6
+ metadata.gz: b9a7e1c2d8f1da1ce08e0ed56fccfcf728e756e35a3d264fdf5d5a3765580e56844962b639c6823435a3eb6caf1f5190d8eb6a47de2d626f430d044d20dbf19b
7
+ data.tar.gz: 76c4942055c1b28f3389ab2646beda8eb09485c81521dbad41268d2d93639be63ac36f704105b4ebd8807e84eaad12e932dab218306b39bc78f1692d598dc1e7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- to_dots (0.1.0)
4
+ to_dots (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  module ToDots
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.2"
3
3
  end
data/lib/to_dots.rb CHANGED
@@ -1,17 +1,16 @@
1
1
  require "to_dots/version"
2
- require 'hash'
3
- require 'array'
2
+ require_relative './hash'
3
+ require_relative './array'
4
4
 
5
5
  module ToDots
6
6
  def self.to_dots(object, result = [], prefix = '')
7
- case object
8
- when ::Hash
7
+ if object.respond_to?(:to_hash)
9
8
  object.each do |key, value|
10
9
  to_dots(value, result, "#{prefix}#{'.' unless prefix.empty?}#{key}")
11
10
  end
12
- when ::Array
13
- object.each_with_index do |value, index|
14
- to_dots(value, result, "#{prefix}")
11
+ elsif object.is_a?(Array)
12
+ object.each do |value|
13
+ to_dots(value, result, prefix.to_s)
15
14
  end
16
15
  else
17
16
  result << "#{prefix}.#{object}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: to_dots
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Fowler
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-14 00:00:00.000000000 Z
11
+ date: 2023-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -79,7 +79,7 @@ homepage: http://github.com/fzf/to_dots
79
79
  licenses:
80
80
  - MIT
81
81
  metadata: {}
82
- post_install_message:
82
+ post_install_message:
83
83
  rdoc_options: []
84
84
  require_paths:
85
85
  - lib
@@ -94,9 +94,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubyforge_project:
98
- rubygems_version: 2.5.2
99
- signing_key:
97
+ rubygems_version: 3.1.2
98
+ signing_key:
100
99
  specification_version: 4
101
100
  summary: Converts a Hash or Array into dot strings
102
101
  test_files: []