Class: Miko::Drupal

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

Returns a new instance of Drupal.



5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/scripts/drupal.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 =~ /Drupal.*/ }
  unless versions.empty?
    @version  = versions[0][/([\d.]+)/]
    @script   = "Drupal"
    @acct_home = path.gsub("CHANGELOG.txt", "")
  end

end