forked from gsamokovarov/web-console
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove warning by defining the constant in the right place
- Loading branch information
1 parent
405d4af
commit dc3df04
Showing
1 changed file
with
12 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
class SourceLocation | ||
def initialize(binding) | ||
@binding = binding | ||
end | ||
module WebConsole | ||
class SourceLocation | ||
def initialize(binding) | ||
@binding = binding | ||
end | ||
|
||
if RUBY_VERSION >= "2.6" | ||
def path() @binding.source_location.first end | ||
def lineno() @binding.source_location.last end | ||
else | ||
def path() @binding.eval("__FILE__") end | ||
def lineno() @binding.eval("__LINE__") end | ||
if RUBY_VERSION >= "2.6" | ||
def path() @binding.source_location.first end | ||
def lineno() @binding.source_location.last end | ||
else | ||
def path() @binding.eval("__FILE__") end | ||
def lineno() @binding.eval("__LINE__") end | ||
end | ||
end | ||
end |