Module: Zarby::Functions

Included in:
Kernel
Defined in:
lib/zarby/functions.rb

Instance Method Summary collapse

Instance Method Details

#location(call_loc) ⇒ Object



12
13
14
# File 'lib/zarby/functions.rb', line 12

def location(call_loc)
  " ⓩ Ⓐ Ⓡ Ⓑ ⓟ Ⓡ ⓘ ⓝ Ⓣ - from: #{name}##{call_loc.label} (in #{project_path call_loc.path}, at line: #{call_loc.lineno})" # rubocop:disable Layout/LineLength
end

#project_path(full_path) ⇒ Object



16
17
18
19
# File 'lib/zarby/functions.rb', line 16

def project_path(full_path)
  root_path = Rails.root.nil? ? File.expand_path("../../..", __dir__) : Rails.root.to_s
  full_path.sub "#{root_path}/", ""
end

#zp(*_args) ⇒ Object



7
8
9
10
# File 'lib/zarby/functions.rb', line 7

def zp(*_args)
  IO.console.winsize
  puts location caller_locations.first
end