Class: Diakonos::Extension

Inherits:
Object show all
Defined in:
lib/diakonos/extension.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dir) ⇒ Extension


7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/diakonos/extension.rb', line 7

def initialize( dir )
  @scripts = []
  @confs = []
  @dir = File.basename( dir )
  @info = YAML.load_file( File.join( dir, 'info.yaml' ) )

  Dir[ File.join( dir, '**', '*.rb' ) ].each do |ext_file|
    @scripts << ext_file
  end

  Dir[ File.join( dir, "*.conf" ) ].each do |conf_file|
    @confs << conf_file
  end
end

Instance Attribute Details

#confsObject (readonly)

Returns the value of attribute confs


5
6
7
# File 'lib/diakonos/extension.rb', line 5

def confs
  @confs
end

#dirObject (readonly)

Returns the value of attribute dir


5
6
7
# File 'lib/diakonos/extension.rb', line 5

def dir
  @dir
end

#scriptsObject (readonly)

Returns the value of attribute scripts


5
6
7
# File 'lib/diakonos/extension.rb', line 5

def scripts
  @scripts
end

Instance Method Details

#[](key) ⇒ Object


22
23
24
# File 'lib/diakonos/extension.rb', line 22

def []( key )
  @info[ key ]
end