Sha256: 443f74c2c748914a1380459fc2481f9346e60fc481d8f6bfbb5789e3c1ec25d5

Contents?: true

Size: 1.02 KB

Versions: 13

Compression:

Stored size: 1.02 KB

Contents

module Spider
    
    module WidgetPlugin
        
        def self.included(mod)
            mod.extend(ModuleMethods)
            mod.module_eval{ include Annotations }
        end
        
        module ModuleMethods
            
            def self.plugin_name
                @plugin_name
            end
            
            def plugin_for(widget, plugin_name)
                @plugin_name = plugin_name
                widget.add_plugin(plugin_name, self)
                @path = File.dirname(File.expand_path(caller[0].split(':')[0]))
            end
            
            def get_overrides
                overrides = []
                path = @path+'/'+Inflector.underscore(self.to_s.split('::')[-1])+'.shtml'
                doc = open(path){ |f| Hpricot.XML(f) }
                doc.root.each_child do |child|
                    next unless child.is_a?(Hpricot::Elem)
                    overrides << child
                end
                return overrides
            end
            
        end
        
    end
    
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
spiderfw-0.5.13 lib/spiderfw/widget/widget_plugin.rb
spiderfw-0.5.12 lib/spiderfw/widget/widget_plugin.rb
spiderfw-0.5.11 lib/spiderfw/widget/widget_plugin.rb
spiderfw-0.5.10 lib/spiderfw/widget/widget_plugin.rb
spiderfw-0.5.9 lib/spiderfw/widget/widget_plugin.rb
spiderfw-0.5.7 lib/spiderfw/widget/widget_plugin.rb
spiderfw-0.5.6 lib/spiderfw/widget/widget_plugin.rb
spiderfw-0.5.5 lib/spiderfw/widget/widget_plugin.rb
spiderfw-0.5.4 lib/spiderfw/widget/widget_plugin.rb
spiderfw-0.5.3 lib/spiderfw/widget/widget_plugin.rb
spiderfw-0.5.2 lib/spiderfw/widget/widget_plugin.rb
spiderfw-0.5.1 lib/spiderfw/widget/widget_plugin.rb
spiderfw-0.5 lib/spiderfw/widget/widget_plugin.rb