Class: Miko::Moodle

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

Returns a new instance of Moodle.



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

def initialize( path )
  super( path )

  versions = []
  File.open( path ).each_line {|x| versions << x if x =~ /MOODLE VERSION INFORMATION.*/ }

  unless versions.empty?
    @script     = "Moodle"
    @version    = File.read( path )[/.*release.*=.*/].to_s.split("=")[1].gsub("'", "").split(";")[0].gsub(" ", "")
    @acct_home  = @path.gsub("version.php", "")

  end
end