reinforce 0.2.1 → 0.2.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14e8dc56b32be98cfaba3626de5ea12a9b348d87f0abfb497b461cda4fcd7335
4
- data.tar.gz: 6725510284291c233f75151d6aaf595d256963d1fed51d92bbad2321fcb4fb77
3
+ metadata.gz: 64a63c4e823f91eade22d487959592495d0a64f5f09bb164678e50f006c54771
4
+ data.tar.gz: 02f9f8501669f5134cc990e9f662a1b5a6d9c6410cd32d89940f3d4bfd1d9936
5
5
  SHA512:
6
- metadata.gz: 4190ab50bd5a4a5eb8a510a1c684e6b4b2042cf540fce2a56d062860e4fbfea22ca11fb03e613b057c451541c28c495808ff975b549fb383dd002616e0875826
7
- data.tar.gz: 4b1e69ee08871043131251f845e860ea0669e3a46ca06a6649a2b15a183c1ed007390ee45957709469271ad28be3ba640569fbbe3bdba448ef225710921f7801
6
+ metadata.gz: c06aa47d001e62ce5354ce63fe8b0e7716873b9e93d35e00ccc9c14829072933326216fdcd58eae7b87e9e0ebff92cc8a37551074882ed9c138cf6ced5d16490
7
+ data.tar.gz: e9844b80806934f2e4d73dd457ae712ec02cb21a99d6662e6a0af39b3ae6530f50fed9040c0937a4a781df240eefd2ca1aa47adec48357edd5744d39b890f2ca
@@ -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)
@@ -94,6 +94,8 @@ module Reinforce
94
94
  end
95
95
 
96
96
  # rubocop:disable Metrics/AbcSize
97
+ # rubocop:disable Metrics/CyclomaticComplexity
98
+ # rubocop:disable Metrics/PerceivedComplexity
97
99
  def rectify_suspects(commands)
98
100
  commands.each_with_index do |command, idx|
99
101
  next unless command.suspect?
@@ -103,12 +105,14 @@ module Reinforce
103
105
  relevant = remaining.take_while { |c| c.pbgid != command.pbgid }
104
106
 
105
107
  used = relevant.any? do |c|
106
- building_details&.produces?(c.details.path)
108
+ building_details&.produces?(c.details&.path)
107
109
  end
108
110
 
109
111
  command.mark_legit if used
110
112
  end
111
113
  end
114
+ # rubocop:enable Metrics/PerceivedComplexity
115
+ # rubocop:enable Metrics/CyclomaticComplexity
112
116
  # rubocop:enable Metrics/AbcSize
113
117
  end
114
118
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Reinforce
4
- VERSION = '0.2.1'
4
+ VERSION = '0.2.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reinforce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ryantaylor