OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
ruby
/
vendor_ruby
/
test
/
unit
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/10/2020 11:55:58 AM
rwxr-xr-x
📄
assertion-failed-error.rb
748 bytes
07/04/2017 08:50:15 PM
rw-r--r--
📄
assertions.rb
74 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
attribute-matcher.rb
431 bytes
07/04/2017 08:50:15 PM
rw-r--r--
📄
attribute.rb
6.85 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
auto-runner-loader.rb
379 bytes
07/04/2017 08:50:15 PM
rw-r--r--
📄
autorunner.rb
16.29 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
code-snippet-fetcher.rb
1.49 KB
07/04/2017 08:50:15 PM
rw-r--r--
📁
collector
-
02/10/2020 11:55:58 AM
rwxr-xr-x
📄
collector.rb
1.81 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
color-scheme.rb
7.12 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
color.rb
2.95 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
data.rb
8.34 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
diff.rb
25.42 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
error.rb
3.61 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
exception-handler.rb
2.7 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
failure.rb
5.09 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
fault-location-detector.rb
2.72 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
fixture.rb
9.03 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
notification.rb
3.34 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
omission.rb
4.5 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
pending.rb
3.61 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
priority.rb
4.39 KB
07/04/2017 08:50:15 PM
rw-r--r--
📁
runner
-
02/10/2020 11:55:58 AM
rwxr-xr-x
📄
test-suite-creator.rb
2.69 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
testcase.rb
23.96 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
testresult.rb
3.2 KB
07/04/2017 08:50:15 PM
rw-r--r--
📄
testsuite.rb
4.8 KB
07/04/2017 08:50:15 PM
rw-r--r--
📁
ui
-
02/10/2020 11:55:58 AM
rwxr-xr-x
📁
util
-
02/10/2020 11:55:58 AM
rwxr-xr-x
📄
version.rb
58 bytes
07/04/2017 08:50:15 PM
rw-r--r--
Editing: color.rb
Close
module Test module Unit class Color class Error < StandardError end class ParseError < Error end class << self def parse_256_color(string) case string when /\A([0-5])([0-5])([0-5])\z/ red, green, blue = $1, $2, $3 red.to_i * 36 + green.to_i * 6 + blue.to_i + 16 else message = "must be 'RGB' format and R, G and B " + "are in 0-5: #{string.inspect}" raise ParseError, message end end end NAMES = ["black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] attr_reader :name def initialize(name, options={}) @name = name if options.has_key?(:foreground) if options[:foreground].nil? @background = false else @background = !options[:foreground] end else @background = options[:background] end @intensity = options[:intensity] @bold = options[:bold] @italic = options[:italic] @underline = options[:underline] end def foreground? not background? end def background? @background end def intensity? @intensity end def bold? @bold end def italic? @italic end def underline? @underline end def ==(other) self.class === other and [name, background?, intensity?, bold?, italic?, underline?] == [other.name, other.background?, other.intensity?, other.bold?, other.italic?, other.underline?] end def sequence sequence = [] if @name == "none" elsif @name == "reset" sequence << "0" else if NAMES.include?(@name) color_parameter = foreground? ? 3 : 4 color_parameter += 6 if intensity? color = NAMES.index(@name) sequence << "#{color_parameter}#{color}" else sequence << (foreground? ? "38" : "48") sequence << "5" sequence << self.class.parse_256_color(@name).to_s end end sequence << "1" if bold? sequence << "3" if italic? sequence << "4" if underline? sequence end def escape_sequence "\e[#{sequence.join(';')}m" end def +(other) MixColor.new([self, other]) end end class MixColor attr_reader :colors def initialize(colors) @colors = colors end def sequence @colors.inject([]) do |result, color| result + color.sequence end end def escape_sequence "\e[#{sequence.join(';')}m" end def +(other) self.class.new([self, other]) end def ==(other) self.class === other and colors == other.colors end end end end