Class: Diakonos::Extension
Instance Attribute Summary collapse
-
#confs ⇒ Object
readonly
Returns the value of attribute confs.
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#scripts ⇒ Object
readonly
Returns the value of attribute scripts.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(dir) ⇒ Extension
constructor
A new instance of Extension.
Constructor Details
#initialize(dir) ⇒ Extension
Returns a new instance of 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
#confs ⇒ Object (readonly)
Returns the value of attribute confs.
5 6 7 |
# File 'lib/diakonos/extension.rb', line 5 def confs @confs end |
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
5 6 7 |
# File 'lib/diakonos/extension.rb', line 5 def dir @dir end |
#scripts ⇒ Object (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 |