tins 1.36.0 → 1.36.1

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: b3d0d3b142299555332881bdd390e8cb2fc4137cbbb92864e96c835790d1f943
4
- data.tar.gz: c287721ce6b44fb9a1cc4faed1eee2d6f0df250a92c389e811bc033b9c24a48a
3
+ metadata.gz: 74ccd9381ab74305d467c86810271be1033c7f68b777cdb4c561b3b5bfb5152a
4
+ data.tar.gz: 977fa807b40ee00176d7ecde2c363d871acc8c476988e34b682d3d8b19e7ef20
5
5
  SHA512:
6
- metadata.gz: 6a950643986122ff5e47e419657dbe5f76ffe1d1c80927ab9767297672a5296d08b84479b0ae03fcf7d5112c5297cdc3d8993425488c203321615dad441d7c6d
7
- data.tar.gz: abec6e88bb19153688f7e5c8069c3ac13fcff850aa9860f4924b360bdb53608d82deabbb8d0d35a234ff84e8149869861fe94b8963ba1187e7ae252d1bafe7af
6
+ metadata.gz: c689f798c3679f290db513c4203b4c19b92696606e76feee88b27d0959b0d4ec09d9f7aac80c1d502d3e44d205da82715678b5b629ba51f669264a75bb8c77ce
7
+ data.tar.gz: 5bf30172063f7b6406247b15ff340fd65e2421799fa93c9d52ab69de315ba71b12550ffdabff42d0d6dc801a69c1bcc5679afdcaec090558886890d05edd7bf2
data/CHANGES.md CHANGED
@@ -1,11 +1,15 @@
1
1
  # Changes
2
2
 
3
+ ## 2024-10-11 v1.36.1
4
+
5
+ * Fixed a typo in the code
6
+
3
7
  ## 2024-10-11 v1.36.0
4
8
 
5
9
  ### Significant Changes
6
10
 
7
11
  * Refactor bfs method in `hash_bfs.rb`:
8
- + Rename `include_nodes` variable to `visit_interal`
12
+ + Rename `include_nodes` variable to `visit_internal`
9
13
  + Update test cases in `hash_bfs_test.rb` to use new method signature
10
14
  + Update method signature and docstring to reflect new behavior
11
15
  * Update hash conversion logic:
data/lib/tins/hash_bfs.rb CHANGED
@@ -9,7 +9,7 @@ module Tins
9
9
  # The bfs method performs a breadth-first search on the object's structure,
10
10
  # visiting all elements and yielding their indices and values to the block.
11
11
  #
12
- # @param visit_interal [ true, false ] whether to visit internal hashes or arrays
12
+ # @param visit_internal [ true, false ] whether to visit internal hashes or arrays
13
13
  # @yield [ index, value ] yields each element's index and value to the block
14
14
  #
15
15
  # @raise [ ArgumentError ] if no &block argument was provided
@@ -17,7 +17,7 @@ module Tins
17
17
  # @example bfs { |index, value| … } # performs a breadth-first search on the object's structure
18
18
  #
19
19
  # @return [ self ] returns the receiver
20
- def bfs(visit_interal: false, &block)
20
+ def bfs(visit_internal: false, &block)
21
21
  block or raise ArgumentError, 'require &block argument'
22
22
  self.seen = {}
23
23
  queue = []
@@ -31,13 +31,13 @@ module Tins
31
31
  object.each do |k, v|
32
32
  queue.push([ k, convert_to_hash_or_ary(v) ])
33
33
  end
34
- visit_interal or next
34
+ visit_internal or next
35
35
  when Array === object
36
36
  seen[object.__id__] = true
37
37
  object.each_with_index do |v, i|
38
38
  queue.push([ i, convert_to_hash_or_ary(v) ])
39
39
  end
40
- visit_interal or next
40
+ visit_internal or next
41
41
  end
42
42
  block.(index, object)
43
43
  end
data/lib/tins/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Tins
2
2
  # Tins version
3
- VERSION = '1.36.0'
3
+ VERSION = '1.36.1'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -15,7 +15,7 @@ module Tins
15
15
 
16
16
  def test_with_nodes
17
17
  results = []
18
- @hash.bfs(visit_interal: true) { |*a| results.push(a) }
18
+ @hash.bfs(visit_internal: true) { |*a| results.push(a) }
19
19
  assert_equal(
20
20
  [[nil, {a:"foo", b:[{c:"baz"}, {d:"quux"}, ["blub"]]}], [:a, "foo"],
21
21
  [:b, [{c:"baz"}, {d:"quux"}, ["blub"]]], [0, {c:"baz"}], [1, {d:"quux"}],
@@ -27,7 +27,7 @@ module Tins
27
27
  def test_with_nodes_with_circle
28
28
  results = []
29
29
  @hash[:b].last << @hash
30
- @hash.bfs(visit_interal: true) { |*a| results.push(a) }
30
+ @hash.bfs(visit_internal: true) { |*a| results.push(a) }
31
31
  assert_equal 9, results.size
32
32
  end
33
33
  end
data/tins.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: tins 1.36.0 ruby lib
2
+ # stub: tins 1.36.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "tins".freeze
6
- s.version = "1.36.0".freeze
6
+ s.version = "1.36.1".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tins
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.36.0
4
+ version: 1.36.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank