rubion 0.3.13 → 0.3.14

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: 7e44746a0b8ff53ccdc236e43a182d060ace64e38790450f10c04fb4d09550ed
4
- data.tar.gz: 9c05871fdf57aef1e1e2ff82bc2c58015eb18865c999afc3ae13b46ccb0c2341
3
+ metadata.gz: f69e93b8534eeaf2045d43f775aec23a72ccf97335ebca9fd8bcb323375dfdca
4
+ data.tar.gz: 4d96785c60788e1933a566e8483a79c7ae98f93d301f94b97923ec4c80026af1
5
5
  SHA512:
6
- metadata.gz: 3bee4acf0c1d91670bd811eb2c01c1e4d2192616ba3ce49a7b27f1e1577b8daed57fb35bb0c9a7f77dce0afe6f0698cadcc64ce2145e1ca38bc583afbadfa5ba
7
- data.tar.gz: f9092694ecd11f85b03fecd7e3021ae6d0e3904022c7384d0c161f35aaf703887b4162a35162fd39c2af45f912221e981c1c0d91538d979b7cceaf08543794cc
6
+ metadata.gz: b64a88b924fe46d2979c06a520aa8458661ad8d06d374c9fe9fa945730b05d1f93e26073a5ef69779ae87e88c840d617ea016be52df356a4ba7753f2c4d1f5a5
7
+ data.tar.gz: cccf29d1fe83443774d4b83421edbb086d1f22e1b557f9b413918c90464da4501a95f4f866374d9861cb78fc1e2b4a869ee92f70ddd4666587a0df352dde7f0f
data/README.md CHANGED
@@ -187,6 +187,9 @@ Package Versions:
187
187
  | typescript | 4.7.0 | 5/24/2022 | 5.1.0 | 5/25/2023 | 1 year | 12 |
188
188
  +------------------+---------+--------------------------+---------+--------------------------+------------------+-------------------+
189
189
  ```
190
+ ![aaaScreenshot 2025-11-15 at 2 54 24 pm](https://github.com/user-attachments/assets/9ce27e07-9c95-44ea-a96c-ec9537234d06)
191
+ <img width="1333" height="741" alt="Screenshot 2025-11-15 at 2 54 34 pm" src="https://github.com/user-attachments/assets/22759b64-776f-4c9d-9bbb-3b70adead02e" />
192
+
190
193
 
191
194
  ### Direct Dependencies Only (with --exclude-dependencies)
192
195
 
@@ -105,18 +105,38 @@ module Rubion
105
105
  # Exit code 1 is expected when vulnerabilities exist, so we still parse the output
106
106
  # Exit code 0 means no vulnerabilities found
107
107
  # Any other exit code or error means the command failed
108
- if status.exitstatus == 1 || status.success?
108
+ if status.exitstatus.nil? || status.exitstatus == 127 || stderr.include?('command not found') || stdout.include?('command not found')
109
+ # Command not found - try to install bundler-audit automatically
110
+ install_bundler_audit_and_retry
111
+ elsif status.exitstatus == 1 || status.success? || (!stdout.empty? && (stdout.include?('vulnerabilities found') || stdout.include?('Name:')))
109
112
  # Exit code 1 (vulnerabilities found) or 0 (no vulnerabilities) - parse output
113
+ # Also try to parse if output looks valid even if exit code is unexpected
110
114
  parse_bundler_audit_output(stdout)
111
- elsif !stdout.empty? && (stdout.include?('vulnerabilities found') || stdout.include?('Name:'))
112
- # Try to parse if output looks valid even if exit code is unexpected
113
- parse_bundler_audit_output(stdout)
114
- elsif status.exitstatus.nil?
115
- # Command not found or failed to execute
116
- raise "bundle-audit command failed or is not installed. Error: #{stderr}"
117
115
  else
118
116
  # Unexpected exit code
119
- raise "bundle-audit failed with exit code #{status.exitstatus}. Output: #{stdout}#{stderr.empty? ? '' : "\nError: #{stderr}"}"
117
+ raise "bundle-audit failed with exit code #{status.exitstatus}. Output: #{stdout}#{unless stderr.empty?
118
+ "\nError: #{stderr}"
119
+ end}"
120
+ end
121
+ end
122
+
123
+ def install_bundler_audit_and_retry
124
+ puts "\n ⚠️ bundle-audit is not installed."
125
+ print ' Attempting to install bundler-audit... '
126
+ $stdout.flush
127
+
128
+ _install_stdout, install_stderr, install_status = Open3.capture3('gem install bundler-audit 2>&1')
129
+
130
+ if install_status.success?
131
+ puts "✓ Successfully installed bundler-audit\n"
132
+ puts " Retrying gem vulnerability check...\n\n"
133
+ # Retry the check after installation
134
+ check_gem_vulnerabilities
135
+ else
136
+ puts '✗ Failed to install bundler-audit'
137
+ raise "bundle-audit is not installed and automatic installation failed.\n" \
138
+ "Please install it manually by running: gem install bundler-audit\n" \
139
+ "Installation error: #{install_stderr}"
120
140
  end
121
141
  end
122
142
 
@@ -131,7 +151,9 @@ module Rubion
131
151
  raise "bundle outdated command failed or is not available. Error: #{stderr}"
132
152
  else
133
153
  # Command failed with non-zero exit code
134
- raise "bundle outdated failed with exit code #{status.exitstatus}. Output: #{stdout}#{stderr.empty? ? '' : "\nError: #{stderr}"}"
154
+ raise "bundle outdated failed with exit code #{status.exitstatus}. Output: #{stdout}#{unless stderr.empty?
155
+ "\nError: #{stderr}"
156
+ end}"
135
157
  end
136
158
  end
137
159
 
@@ -146,7 +168,9 @@ module Rubion
146
168
  raise "#{@package_manager} audit command failed or is not available. Error: #{stderr}"
147
169
  elsif !status.success? && status.exitstatus != 1
148
170
  # Exit code 1 is expected when vulnerabilities are found, other non-zero codes are errors
149
- raise "#{@package_manager} audit failed with exit code #{status.exitstatus}. Output: #{stdout}#{stderr.empty? ? '' : "\nError: #{stderr}"}"
171
+ raise "#{@package_manager} audit failed with exit code #{status.exitstatus}. Output: #{stdout}#{unless stderr.empty?
172
+ "\nError: #{stderr}"
173
+ end}"
150
174
  end
151
175
 
152
176
  begin
@@ -177,7 +201,9 @@ module Rubion
177
201
  raise "npm outdated command failed or is not available. Error: #{stderr}"
178
202
  elsif !status.success? && status.exitstatus != 1
179
203
  # Exit code 1 is expected when packages are outdated, other non-zero codes are errors
180
- raise "npm outdated failed with exit code #{status.exitstatus}. Output: #{stdout}#{stderr.empty? ? '' : "\nError: #{stderr}"}"
204
+ raise "npm outdated failed with exit code #{status.exitstatus}. Output: #{stdout}#{unless stderr.empty?
205
+ "\nError: #{stderr}"
206
+ end}"
181
207
  end
182
208
 
183
209
  begin
@@ -198,7 +224,9 @@ module Rubion
198
224
  raise "yarn outdated command failed or is not available. Error: #{stderr}"
199
225
  elsif !status.success? && status.exitstatus != 1
200
226
  # Exit code 1 is expected when packages are outdated, other non-zero codes are errors
201
- raise "yarn outdated failed with exit code #{status.exitstatus}. Output: #{stdout}#{stderr.empty? ? '' : "\nError: #{stderr}"}"
227
+ raise "yarn outdated failed with exit code #{status.exitstatus}. Output: #{stdout}#{unless stderr.empty?
228
+ "\nError: #{stderr}"
229
+ end}"
202
230
  end
203
231
 
204
232
  begin
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rubion
4
- VERSION = "0.3.13"
4
+ VERSION = "0.3.14"
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.13
4
+ version: 0.3.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - bipashant