0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
ObjectLoader can load Ruby Objects containing methods and procs from Ruby files without having to use YAML or define classes named like the file.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.4
~> 0.7
 Project Readme

ObjectLoader

Description

ObjectLoader can load Ruby Objects containing methods and procs from Ruby files without having to use YAML or define classes named like the file.

Examples

# file: controller.rb
class Controller

  include ObjectLoader

  # ...

end

# file: my_controller.rb
Controller.object do

  def test1
    'This is the first test'
  end

  def test2(mesg)
    "Hello #{mesg}"
  end

end

# load a Controller object from a file.
controller = Controller.load_object('my_controller.rb')
# => #<Controller: ...>

controller.test1
# => "This is the first test"
controller.test2('one two three')
# => "Hello one two three"

Install

$ gem install object_loader

Copyright

Copyright (c) 2008-2012 Hal Brodigan

See {file:LICENSE.txt} for license information.