mudguard 0.2.2 → 0.2.3

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: 9eb5bc544f7c9cfd9d472be7531d3dcf0c9f66ef53b30333ffa60fdd09092e6a
4
- data.tar.gz: 4e3a47b2512035f09678e8b1b3670a90c1f150f995ca57b9b13ce569cadc6eda
3
+ metadata.gz: 44d7f2ff1e9b179d3d64e1263ab13cb217497fce8dd174f5b0ee5ef4cdf1c67f
4
+ data.tar.gz: 6597fed3f89fa210951650bec390b8c6a5196db0806b3e5b2daaba9406693d21
5
5
  SHA512:
6
- metadata.gz: 3e0818bd960ef30419b87e98169e7dbfe791ae1c5a9be458100c21a4a2dcc9cb5d615a9449d929ac1d0b45bc23059d4e218950df0fbdc737064f9a8198d0ddd6
7
- data.tar.gz: d099a3fe5e9f98a7c6cc02882d73177d142dc77bbc39d28d48d550ff1967082f60c0b4afbcdf021c574fa506c581bf28f6b465b74e3d9262411eeedd513f4e57
6
+ metadata.gz: 0eecb391426607e7650a7da55c2f470acf06b44da2327c7853c1215dc2a46fcdb592cedf3a7f383d57772b16017eb5f2b0c9edb0b87c4dc1d9d3821749a7a1a1
7
+ data.tar.gz: d69e2ec7b320c04a6e01475f7973992204f08653d84316865f903363b72e51928c15f98601c1b0e2a9009f712612556e0fc33811bf271c707d6cbcc92def2eba
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mudguard (0.2.2)
4
+ mudguard (0.2.3)
5
5
  parser (~> 2.7)
6
6
  rake (~> 13.0)
7
7
 
@@ -7,9 +7,8 @@ module Mudguard
7
7
  # Knows all constants of the project
8
8
  class Consts
9
9
  def initialize(sources:)
10
- @consts = sources
11
- .flat_map(&:find_consts)
12
- .each_with_object(Hash.new { |h, k| h[k] = {} }) do |c, a|
10
+ @consts = sources.flat_map(&:find_consts)
11
+ .each_with_object(create_hash_of_hash) do |c, a|
13
12
  path = split_hierarchy(c)
14
13
  const_name = path.last
15
14
  module_names = path.take(path.count - 1)
@@ -37,8 +36,12 @@ module Mudguard
37
36
 
38
37
  SEPARATOR = "::"
39
38
 
39
+ def create_hash_of_hash
40
+ Hash.new { |h, k| h[k] = create_hash_of_hash }
41
+ end
42
+
40
43
  def find_const_deeper(current_module, remaining_modules, consts, const_path)
41
- return if consts.nil?
44
+ return if consts.nil? || consts.empty?
42
45
 
43
46
  if remaining_modules.any?
44
47
  # Move deeper toward target module
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mudguard
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mudguard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jorg Jenni