Sha256: cdf96a368da36725c72a3955c00322ec186843fef86ac1623c68464b4ab2d626

Contents?: true

Size: 428 Bytes

Versions: 4

Compression:

Stored size: 428 Bytes

Contents

VResource.register_resource_extension(
  ".yaml",
  lambda{|data, klass, name| YAML.load(data)}, 
  lambda{|data, klass, name| YAML.dump(data)}
)

VResource.register_resource_extension(
  ".rb",
  lambda{|data, klass, name|
    script = ClassLoader.wrap_inside_namespace(klass, data)
    eval script, TOPLEVEL_BINDING, "#{klass.name}/#{name}"
  }, 
  lambda{|data, klass, name| raise "Writing '.rb' Resource isn't supported!"}
)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ruby-ext-0.4.3 lib/vresource/resource_extensions.rb
ruby-ext-0.4.2 lib/vresource/resource_extensions.rb
ruby-ext-0.4.1 lib/vresource/resource_extensions.rb
ruby-ext-0.4.0 lib/vresource/resource_extensions.rb