Skip to content

Commit

Permalink
Add deprecation warning for unsafe_modify method
Browse files Browse the repository at this point in the history
In #46, we resolved a deadlock in Ruby 3.1 caused by `unsafe_modify`.
We'll deprecate this as it was a fix for one particular issue. Instead,
it's possible to do:

    before do
      @previous_base_url, ENV["BASE_URL"] = ENV["BASE_URL"], "http://localhost:3000"
    end

    after do
      ENV["BASE_URL"] = @previous_base_url
    end
  • Loading branch information
dorianmariecom authored and nickcharlton committed Sep 24, 2024
1 parent f62a6d7 commit 8fca4b8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/climate_control.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ def unsafe_modify(environment_overrides = {}, &block)
merge(ENV, previous: previous, middle: middle, after: after)
end

deprecate :unsafe_modify, :modify, 2024, 11

def env
ENV
end
Expand Down

0 comments on commit 8fca4b8

Please sign in to comment.