Class: Miko::Wordpress

Inherits:
Base
  • Object
show all
Defined in:
lib/scripts/wordpress.rb

Instance Attribute Summary

Attributes inherited from Base

#acct_home, #path, #script, #version

Instance Method Summary collapse

Methods inherited from Base

#showVersion

Constructor Details

#initialize(path) ⇒ Wordpress

Returns a new instance of Wordpress.



5
6
7
8
9
10
11
# File 'lib/scripts/wordpress.rb', line 5

def initialize( path )
  super( path )

  @version     = returnversion( @path )
  @acct_home   = path.gsub("wp-includes/version.php", "")
  @script      = "Wordpress"
end

Instance Method Details

#returnversion(path) ⇒ Object



13
14
15
# File 'lib/scripts/wordpress.rb', line 13

def returnversion(path)
  File.read( path )[/.*wp_version.*=.*$/][/([\d.]+)/]
end