|
|
@ -56,6 +56,20 @@ module Hyde |
|
|
|
@origin.filter(&block) |
|
|
|
block |
|
|
|
end |
|
|
|
|
|
|
|
# Include an application as a child of path. |
|
|
|
# @param filename [String] |
|
|
|
def plugin(filename) |
|
|
|
self.define_singleton_method(:run) do |object| |
|
|
|
unless object.is_a? Hyde::Node |
|
|
|
raise StandardError, "not a node instance or subclass instance" |
|
|
|
end |
|
|
|
|
|
|
|
object |
|
|
|
end |
|
|
|
@origin.children.append(self.instance_eval(File.read(filename))) |
|
|
|
self.singleton_class.undef_method :run |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |