Skip to content

Commit

Permalink
Improve coverage output
Browse files Browse the repository at this point in the history
  • Loading branch information
joeldrapper committed Sep 18, 2024
1 parent 60ce7ea commit 1fad2aa
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions config/quickdraw.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
command_name "quickdraw"
enable_coverage_for_eval
enable_coverage :branch
add_filter %r{^/fixtures/}

add_group "SGML", "lib/phlex/sgml"
add_group "HTML", "lib/phlex/html"
add_group "SVG", "lib/phlex/svg"
add_group "CSV", "lib/phlex/csv"
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/phlex/html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Phlex::HTML < Phlex::SGML
# A list of HTML attributes that have the potential to execute unsafe JavaScript.
UNSAFE_ATTRIBUTES = Set.new(%w[onabort onafterprint onbeforeprint onbeforeunload onblur oncanplay oncanplaythrough onchange onclick oncontextmenu oncopy oncuechange oncut ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended onerror onfocus onhashchange oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmessage onmousedown onmousemove onmouseout onmouseover onmouseup onmousewheel onoffline ononline onpagehide onpageshow onpaste onpause onplay onplaying onpopstate onprogress onratechange onreset onresize onscroll onsearch onseeked onseeking onselect onstalled onstorage onsubmit onsuspend ontimeupdate ontoggle onunload onvolumechange onwaiting onwheel srcdoc]).freeze

extend Phlex::Elements
extend Phlex::SGML::Elements
include VoidElements, StandardElements

# Output an HTML doctype.
Expand Down
2 changes: 1 addition & 1 deletion lib/phlex/html/standard_elements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Standard HTML elements accept content and always have a closing tag.
module Phlex::HTML::StandardElements
extend Phlex::Elements
extend Phlex::SGML::Elements

# @!method a(**attributes, &content)
# Outputs an `<a>` tag.
Expand Down
2 changes: 1 addition & 1 deletion lib/phlex/html/void_elements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Void HTML elements don't accept content and never have a closing tag.
module Phlex::HTML::VoidElements
extend Phlex::Elements
extend Phlex::SGML::Elements

# @!method area(**attributes, &content)
# Outputs an `<area>` tag.
Expand Down
3 changes: 2 additions & 1 deletion lib/phlex/sgml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# **Standard Generalized Markup Language** for behaviour common to {HTML} and {SVG}.
class Phlex::SGML
autoload :Elements, "phlex/sgml/elements"
autoload :SafeObject, "phlex/sgml/safe_object"
autoload :SafeValue, "phlex/sgml/safe_value"

Expand Down Expand Up @@ -29,7 +30,7 @@ def __element_method__?(method_name)
if instance_methods.include?(method_name)
owner = instance_method(method_name).owner

if Phlex::Elements === owner && owner.__registered_elements__[method_name]
if Phlex::SGML::Elements === owner && owner.__registered_elements__[method_name]
true
else
false
Expand Down
2 changes: 1 addition & 1 deletion lib/phlex/elements.rb → lib/phlex/sgml/elements.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

module Phlex::Elements
module Phlex::SGML::Elements
def __registered_elements__
@__registered_elements__ ||= {}
end
Expand Down
2 changes: 1 addition & 1 deletion lib/phlex/svg/standard_elements.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

module Phlex::SVG::StandardElements
extend Phlex::Elements
extend Phlex::SGML::Elements

# @!method a(**attributes, &content)
# Outputs an `<a>` tag.
Expand Down

0 comments on commit 1fad2aa

Please sign in to comment.