⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.78
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
ruby
/
gems
/
3.0.0
/
gems
/
rbs-1.0.4
/
lib
/
rbs
/
View File Name :
buffer.rb
module RBS class Buffer attr_reader :name attr_reader :content attr_reader :lines attr_reader :ranges def initialize(name:, content:) @name = name @content = content @lines = content.lines @ranges = [] offset = 0 lines.each do |line| size = line.size range = offset...(offset+size) ranges << range offset += size end end def pos_to_loc(pos) index = ranges.bsearch_index do |range| pos < range.end ? true : false end if index [index + 1, pos - ranges[index].begin] else [ranges.size + 1, 0] end end def loc_to_pos(loc) line, column = loc if range = ranges[line - 1] range.begin + column else last_position end end def last_position content.size end end end