reinforce 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -99,9 +99,6 @@ module Reinforce
99
99
 
100
100
  def parse_ability_bag(data, path)
101
101
  locstring = data.dig('ability_bag', 'ui_info', 'screen_name', 'locstring', 'value')
102
-
103
- return if locstring.nil? || locstring == '0'
104
-
105
102
  icon_name = data.dig('ability_bag', 'ui_info', 'icon_name')
106
103
  builds = data.dig('ability_bag', 'cursor_ghost_ebp', 'instance_reference')
107
104
 
@@ -76,8 +76,10 @@ module Reinforce
76
76
  end
77
77
  end
78
78
 
79
+ # rubocop:disable Metrcs/AbcSize
80
+ # rubocop:disable Metrics/CyclomaticComplexity
79
81
  def get_by_pbgid(pbgid, build: LATEST_BUILD)
80
- return nil if build.nil?
82
+ return nil if build.nil? || pbgid.nil?
81
83
 
82
84
  build = last_build if build == LATEST_BUILD
83
85
 
@@ -103,7 +105,7 @@ module Reinforce
103
105
  end
104
106
 
105
107
  def get_by_path(path, build: LATEST_BUILD)
106
- return nil if build.nil?
108
+ return nil if build.nil? || path.nil?
107
109
 
108
110
  build = last_build if build == LATEST_BUILD
109
111
 
@@ -127,6 +129,8 @@ module Reinforce
127
129
 
128
130
  nil
129
131
  end
132
+ # rubocop:enable Metrics/CyclomaticComplexity
133
+ # rubocop:enable Metrcs/AbcSize
130
134
 
131
135
  def populate(build, data, rehash: true)
132
136
  populate_pbgid_hash(build, data)
@@ -32,11 +32,7 @@ module Reinforce
32
32
  end
33
33
 
34
34
  def parse_extensions(data, path)
35
- locstring = parse_locstring(data)
36
-
37
- return if locstring.nil? || locstring == '0'
38
-
39
- new(locstring:,
35
+ new(locstring: parse_locstring(data),
40
36
  icon_name: parse_icon_name(data),
41
37
  path:,
42
38
  spawns: parse_spawns(data),
@@ -51,7 +47,7 @@ module Reinforce
51
47
 
52
48
  def parse_icon_name(data)
53
49
  ext_data = data['extensions'].find { |ext| ext['exts'].key?('screen_name') }
54
- ext_data.dig('exts', 'icon_name')
50
+ ext_data&.dig('exts', 'icon_name')
55
51
  end
56
52
 
57
53
  def parse_spawns(data)
@@ -26,10 +26,7 @@ module Reinforce
26
26
  def parse_extensions(data, path)
27
27
  squad_data = squad_data_from(data)
28
28
  locstring = squad_data&.dig('race_data', 'info', 'screen_name', 'locstring', 'value')
29
-
30
- return if locstring.nil? || locstring == '0'
31
-
32
- icon_name = squad_data.dig('race_data', 'info', 'icon_name')
29
+ icon_name = squad_data&.dig('race_data', 'info', 'icon_name')
33
30
 
34
31
  new(locstring:,
35
32
  icon_name:,
@@ -25,9 +25,6 @@ module Reinforce
25
25
 
26
26
  def parse_upgrade_bag(data, path)
27
27
  locstring = data.dig('upgrade_bag', 'ui_info', 'screen_name', 'locstring', 'value')
28
-
29
- return if locstring.nil? || locstring == '0'
30
-
31
28
  icon_name = data.dig('upgrade_bag', 'ui_info', 'icon_name')
32
29
 
33
30
  new(locstring:,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Reinforce
4
- VERSION = '0.2.2'
4
+ VERSION = '0.2.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reinforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ryantaylor
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-09-12 00:00:00.000000000 Z
11
+ date: 2024-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vault_coh