Skip to content

Commit

Permalink
Rename warn method to warn_for_deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
jkowens committed Sep 26, 2022
1 parent e521b60 commit 8773621
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,4 @@ Naming/AccessorMethodName:
Enabled: false

Style/SlicingWithRange:
Enabled: false

Enabled: false
6 changes: 3 additions & 3 deletions lib/sinatra/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ def condition(name = "#{caller.first[/`.*'/]} condition", &block)
end

def public=(value)
warn ':public is no longer used to avoid overloading Module#public, use :public_folder or :public_dir instead'
warn_for_deprecation ':public is no longer used to avoid overloading Module#public, use :public_folder or :public_dir instead'
set(:public_folder, value)
end

Expand Down Expand Up @@ -1772,8 +1772,8 @@ def synchronize(&block)
end

# used for deprecation warnings
def warn(message)
super message + "\n\tfrom #{cleaned_caller.first.join(':')}"
def warn_for_deprecation(message)
warn message + "\n\tfrom #{cleaned_caller.first.join(':')}"
end

# Like Kernel#caller but excluding certain magic entries
Expand Down

0 comments on commit 8773621

Please sign in to comment.