Module: Opensteam::ExtensionBase
- Defined in:
- lib/opensteam/extension_base.rb
Overview
module to handle Opensteam Extensions (not in use right now)
Defined Under Namespace
Classes: Backend, Extension
Constant Summary
collapse
- @@extension_path =
File.join( "#{RAILS_ROOT}", "vendor", "opensteam_extensions")
Class Method Summary
collapse
Class Method Details
.init_extensions(which = :backend) ⇒ Object
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/opensteam/extension_base.rb', line 30
def init_extensions( which = :backend )
return false unless ActiveRecord::Base.connection.tables.include?( "extensions" )
path = File.join( extension_path, which.to_s, "**" )
Dir.glob( path ).each do |ext_path|
ext_name = File.basename( ext_path )
"Opensteam::ExtensionBase::#{which.to_s.classify}".constantize.find_or_create_by_name( :name => ext_name, :path => path )
end
end
|
.verify_extensions(which = :backend) ⇒ Object
43
44
45
46
|
# File 'lib/opensteam/extension_base.rb', line 43
def verify_extensions( which = :backend )
return false unless ActiveRecord::Base.connection.tables.include?( "extensions" )
"Opensteam::ExtensionBase::#{which.to_s.classify}".constantize.find(:all).collect(&:verify_path)
end
|