Class: Miko::SMF

Inherits:
Base
  • Object
show all
Defined in:
lib/scripts/smf.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) ⇒ SMF

Returns a new instance of SMF.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/scripts/smf.rb', line 5

def initialize( path )
  super( path )
  versions = []

  ## Verify that this is indeed Drupal's 
  File.open( path ).each_line {|x| versions << x if x =~ /.*forum_version.*/ }
  unless versions.empty?
    @version  = versions[0][/([\d.]+)/]
    @script   = "SMF"
    @acct_home = path.gsub("index.php", "")
  end

end