Linux vps-61133.fhnet.fr 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
Apache/2.4.25 (Debian)
Server IP : 93.113.207.21 & Your IP : 216.73.216.112
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
ruby /
vendor_ruby /
test /
unit /
Delete
Unzip
Name
Size
Permission
Date
Action
collector
[ DIR ]
drwxrwxrwx
2020-08-24 23:49
runner
[ DIR ]
drwxrwxrwx
2020-08-24 23:49
ui
[ DIR ]
drwxrwxrwx
2020-08-24 23:49
util
[ DIR ]
drwxrwxrwx
2020-08-24 23:49
assertion-failed-error.rb
748
B
-rwxrwxrwx
2016-03-01 23:55
assertions.rb
72.92
KB
-rwxrwxrwx
2016-03-01 23:55
attribute-matcher.rb
431
B
-rwxrwxrwx
2016-03-01 23:55
attribute.rb
4.59
KB
-rwxrwxrwx
2016-03-01 23:55
auto-runner-loader.rb
379
B
-rwxrwxrwx
2016-03-01 23:55
autorunner.rb
15.8
KB
-rwxrwxrwx
2016-03-01 23:55
code-snippet-fetcher.rb
1.49
KB
-rwxrwxrwx
2016-03-01 23:55
collector.rb
1.81
KB
-rwxrwxrwx
2016-03-01 23:55
color-scheme.rb
7.12
KB
-rwxrwxrwx
2016-03-01 23:55
color.rb
2.95
KB
-rwxrwxrwx
2016-03-01 23:55
data.rb
8.34
KB
-rwxrwxrwx
2016-03-01 23:55
diff.rb
25.4
KB
-rwxrwxrwx
2016-03-01 23:55
error.rb
3.61
KB
-rwxrwxrwx
2016-03-01 23:55
exception-handler.rb
2.7
KB
-rwxrwxrwx
2016-03-01 23:55
failure.rb
5.09
KB
-rwxrwxrwx
2016-03-01 23:55
fault-location-detector.rb
2.72
KB
-rwxrwxrwx
2016-03-01 23:55
fixture.rb
8.88
KB
-rwxrwxrwx
2016-03-01 23:55
notification.rb
3.34
KB
-rwxrwxrwx
2016-03-01 23:55
omission.rb
4.5
KB
-rwxrwxrwx
2016-03-01 23:55
pending.rb
3.61
KB
-rwxrwxrwx
2016-03-01 23:55
priority.rb
4.39
KB
-rwxrwxrwx
2016-03-01 23:55
test-suite-creator.rb
2.69
KB
-rwxrwxrwx
2016-03-01 23:55
testcase.rb
22.49
KB
-rwxrwxrwx
2016-03-01 23:55
testresult.rb
3.09
KB
-rwxrwxrwx
2016-03-01 23:55
testsuite.rb
4.8
KB
-rwxrwxrwx
2016-03-01 23:55
version.rb
58
B
-rwxrwxrwx
2016-03-01 23:55
Save
Rename
module Test module Unit class CodeSnippetFetcher def initialize @sources = {} end def fetch(path, line, options={}) n_context_line = options[:n_context_line] || 3 lines = source(path) return [] if lines.nil? min_line = [line - n_context_line, 1].max max_line = [line + n_context_line, lines.length].min window = min_line..max_line window.collect do |n| attributes = {:target_line? => (n == line)} [n, lines[n - 1].chomp, attributes] end end def source(path) @sources[path] ||= read_source(path) end private def read_source(path) return nil unless File.exist?(path) lines = [] File.open(path) do |file| first_line = file.gets break if first_line.nil? encoding = detect_encoding(first_line) if encoding first_line.force_encoding(encoding) file.set_encoding(encoding, encoding) end lines << first_line lines.concat(file.readlines) end lines end def detect_encoding(first_line) return nil unless first_line.respond_to?(:ascii_only?) return nil unless first_line.ascii_only? if /\b(?:en)?coding[:=]\s*([a-z\d_-]+)/i =~ first_line begin Encoding.find($1) rescue ArgumentError nil end else nil end end end end end