rubosquad 0.2.0 → 0.2.1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rubosquad.rb +15 -15
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc5a605727814b79d31d6d01ace3cb53ea6889e1c47e29ce27d612a31a6aea85
4
- data.tar.gz: f6fc4368c48f1dc19d8081161dc10beafe3caeb7f6d7511c2cb26c13d891a12c
3
+ metadata.gz: ea0148cd8d05e66b5990557a84a80ff89fa053929e4bbec510aafbc12007e9ff
4
+ data.tar.gz: fd638cb0a18a6a1b0dc77495b38c9b55dadee1045fbba4f79a6ea74b4c59bb62
5
5
  SHA512:
6
- metadata.gz: 6d4adf406923dc9b9613bd0c90b68f6dd51023f4c03f07d05b406de2c98dd0b632cee46105c96432e0c8019ee7baa3eeed0fbea5a80d0746bb4141ceca777f04
7
- data.tar.gz: af009b59c62ce252ad5cd99b97fedd079c4d52d7dd4dd2a7401eaf9d476016676717c4a570559902cdd6c9ce4c3db8bdc10c64fcaa11a8fd5cd187c6cdf7e93e
6
+ metadata.gz: e7878218fff87254f16cd8e6c54613301ca65c5ccf39cffd0b420cb0bb6eb7411a3bdf0991436acb634b353e3f2aa86726f9e1176ffc537b97b02e946b5dc7b2
7
+ data.tar.gz: d89bd634df027b5ce0cc35d9e91e3349d5ef936d15cb9883eb500ba8fda11faeee33f0de7c7e4504bb8f0d7bd21ad37de58078ce94c5b4a76fcfbb48033ad6a0
data/lib/rubosquad.rb CHANGED
@@ -20,7 +20,7 @@ module Rubosquad
20
20
  base_branch = detect_base_branch
21
21
 
22
22
  unless base_branch
23
- Rails.logger.debug 'Error: Could not find main or master branch.'
23
+ puts 'Error: Could not find main or master branch.'
24
24
  exit 1
25
25
  end
26
26
 
@@ -28,7 +28,7 @@ module Rubosquad
28
28
  current_branch = `git rev-parse --abbrev-ref HEAD`.strip
29
29
 
30
30
  if current_branch == base_branch
31
- Rails.logger.debug "Warning: You are on the #{base_branch} branch. Comparing working directory changes."
31
+ puts "Warning: You are on the #{base_branch} branch. Comparing working directory changes."
32
32
  # Compare working directory + staged changes against HEAD
33
33
  changed_files = `git diff --name-only HEAD`.split("\n")
34
34
  changed_files += `git diff --name-only --cached`.split("\n")
@@ -42,7 +42,7 @@ module Rubosquad
42
42
  changed_files = changed_files.select { |file| File.exist?(file) }
43
43
 
44
44
  if changed_files.empty?
45
- Rails.logger.debug 'No Ruby files have changed.'
45
+ puts 'No Ruby files have changed.'
46
46
  exit 0
47
47
  end
48
48
 
@@ -52,9 +52,9 @@ module Rubosquad
52
52
  "#{current_branch} vs #{base_branch}"
53
53
  end
54
54
 
55
- Rails.logger.debug "\nRunning Rubocop on changed files (#{comparison_info}):"
55
+ puts "\nRunning Rubocop on changed files (#{comparison_info}):"
56
56
  changed_files.each { |file| puts " - #{file}" }
57
- Rails.logger.debug
57
+ puts
58
58
 
59
59
  # Check for available RuboCop extensions that can actually be loaded
60
60
  extensions = %w[rubocop-factory_bot rubocop-rails rubocop-rspec rubocop-rspec_rails]
@@ -74,8 +74,8 @@ module Rubosquad
74
74
 
75
75
  stdout, stderr, status = Open3.capture3(command)
76
76
 
77
- Rails.logger.debug "\nRubocop Output:"
78
- Rails.logger.debug '==Error type: Legend: C = Convention, W = Warning, E = Error, F = Fatal=='
77
+ puts "\nRubocop Output:"
78
+ puts '==Error type: Legend: C = Convention, W = Warning, E = Error, F = Fatal=='
79
79
 
80
80
  # Process and colorize output
81
81
  processed_output = ''
@@ -102,26 +102,26 @@ module Rubosquad
102
102
  end
103
103
  end
104
104
 
105
- Rails.logger.debug processed_output
105
+ puts processed_output
106
106
 
107
107
  if status.success?
108
- Rails.logger.debug "\nRubocop auto-corrections complete."
108
+ puts "\nRubocop auto-corrections complete."
109
109
  else
110
- Rails.logger.debug "\nRubocop completed with offenses:"
110
+ puts "\nRubocop completed with offenses:"
111
111
 
112
112
  offenses = stdout.scan(/(\d+) offense.* detected/)
113
113
  total_offenses = offenses.flatten.map(&:to_i).sum
114
114
 
115
- Rails.logger.debug "Files inspected: #{stdout[/(\d+) files? inspected/, 1] || 'Unknown'}"
116
- Rails.logger.debug "Total offenses detected: #{total_offenses}"
115
+ puts "Files inspected: #{stdout[/(\d+) files? inspected/, 1] || 'Unknown'}"
116
+ puts "Total offenses detected: #{total_offenses}"
117
117
 
118
118
  unless stderr.strip.empty?
119
- Rails.logger.debug "\nStandard error:"
120
- Rails.logger.debug stderr
119
+ puts "\nStandard error:"
120
+ puts stderr
121
121
  end
122
122
  end
123
123
 
124
- Rails.logger.debug "\nRuboCop extensions used: #{available_extensions.join(', ')}"
124
+ puts "\nRuboCop extensions used: #{available_extensions.join(', ')}"
125
125
  end
126
126
 
127
127
  # Detect the base branch to compare against
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubosquad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - LucasWaki