Class: WpTheme

Inherits:
WpItem show all
Extended by:
Findable
Includes:
Childtheme, Info, Output, Versionable, Vulnerable
Defined in:
lib/common/models/wp_theme.rb,
lib/common/models/wp_theme/info.rb,
lib/common/models/wp_theme/output.rb,
lib/common/models/wp_theme/findable.rb,
lib/common/models/wp_theme/vulnerable.rb,
lib/common/models/wp_theme/childtheme.rb,
lib/common/models/wp_theme/versionable.rb

Defined Under Namespace

Modules: Childtheme, Findable, Info, Output, Versionable, Vulnerable

Instance Attribute Summary collapse

Attributes included from Info

#theme_author, #theme_author_uri, #theme_description, #theme_license, #theme_license_uri, #theme_name, #theme_tags, #theme_template, #theme_text_domain, #theme_uri

Attributes inherited from WpItem

#found_from, #name, #path, #version, #wp_content_dir, #wp_plugins_dir

Attributes included from WpItem::Vulnerable

#identifier, #vulns_file

Instance Method Summary collapse

Methods included from Findable

find

Methods included from Childtheme

#get_parent_theme, #get_parent_theme_style_url, #is_child_theme?, #parent_theme_limit

Methods included from Output

#additional_output

Methods included from Info

#parse_style

Methods included from Vulnerable

#identifier, #vulns_file

Methods included from Versionable

#version

Methods inherited from WpItem

#<=>, #==, #===, #initialize, #uri, #url

Methods included from WpItem::Output

#output

Methods included from WpItem::Infos

#changelog_url, #error_log_url, #has_changelog?, #has_directory_listing?, #has_error_log?, #has_readme?, #readme_url, #url_is_200?

Methods included from WpItem::Existable

#exists?

Methods included from WpItem::Vulnerable

#vulnerabilities, #vulnerable?, #vulnerable_to?

Methods included from WpItem::Versionable

#to_s, #version

Constructor Details

This class inherits a constructor from WpItem

Instance Attribute Details

#referenced_urlObject

Returns the value of attribute referenced_url


18
19
20
# File 'lib/common/models/wp_theme.rb', line 18

def referenced_url
  @referenced_url
end

Instance Method Details

#allowed_optionsObject


20
# File 'lib/common/models/wp_theme.rb', line 20

def allowed_options; super << :referenced_url end

#forge_uri(target_base_uri) ⇒ void

This method returns an undefined value.

Sets the @uri

Parameters:

  • target_base_uri (URI)

    The URI of the wordpress blog


27
28
29
# File 'lib/common/models/wp_theme.rb', line 27

def forge_uri(target_base_uri)
  @uri = target_base_uri.merge(URI.encode(wp_content_dir + '/themes/' + name + '/'))
end

#style_urlString

Returns The url to the theme stylesheet

Returns:

  • (String)

    The url to the theme stylesheet


32
33
34
# File 'lib/common/models/wp_theme.rb', line 32

def style_url
  @uri.merge('style.css').to_s
end