Skip to content

Commit

Permalink
Refactor: Organize and rename attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
stevepolitodesign committed Mar 30, 2024
1 parent 0b8bab7 commit 8f493f5
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/suspenders/cleanup/organize_gemfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,25 @@ def self.perform(gemfile)
new(gemfile).perform
end

attr_reader :gemfile, :lines, :current_group, :gem_groups, :new_lines,
:new_lines_markers
attr_reader :gemfile, :current_lines, :new_lines, :new_lines_markers,
:gem_groups

def initialize(gemfile)
@gemfile = gemfile
@lines = File.read(gemfile).lines
@current_group = nil
@gem_groups = {}

@current_lines = File.read(gemfile).lines
@new_lines = []
@new_lines_markers = []

@current_group = nil
@gem_groups = {}
end

def perform
lines.delete("\n")
# Remove line breaks to ensure consistent spacing
current_lines.delete("\n")

lines.each do |line|
current_lines.each do |line|
if line.starts_with?(/group/)
@current_group = line
end
Expand Down

0 comments on commit 8f493f5

Please sign in to comment.