Skip to content

Commit

Permalink
replace class variables
Browse files Browse the repository at this point in the history
  • Loading branch information
keshavbiswa committed Jun 21, 2024
1 parent eb743b1 commit ccf6742
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions lib/helpers/deprecator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,22 @@ def deprecate_generator(old_generator_name, new_generator_constant)
end

def self.skip_warning
@@skip_warning = true
original = Faker::Deprecator.skip
Faker::Deprecator.skip = true
yield
ensure
@@skip_warning = false
Faker::Deprecator.skip = original
end

def self.skip_warning?
@@skip_warning
skip == true
end
def self.skip
@skip ||= false
end

def self.skip=(v)
@skip = v
end
end
end
Expand Down

0 comments on commit ccf6742

Please sign in to comment.