Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Tools for using YAML w/ Ruby easier.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 yamler.gemspec
README
Yamler - Making YAML easy and fun to use with Ruby
=========================================================================

Using YAML in Ruby is pretty easy, but I find myself doing several things
every time I use YAML. First is I always seem to pass it through ERB. The
other is that I want to pass it a binding, because I want to give it
access to some variables or methods. Finally I sometimes end up merging
several YAML files into one file, because other wise it would be too big
and unwieldy to manage. Enter Yamler:

=== Examples:
  # Renders said file through ERB, and then through YAML.load:
  Yamler.load('/path/to/file.yml')

  # Does the same as above but makes a method called say_hi
  # available to the binding of the Yamler::Template instance.
  Yamler.load('/path/to/file.yml') do
    def say_hi
      'hi'
    end
  end
  
  # Renders said file through ERB, and then through YAML.load:
  Yamler.load('/path/to/file.yml', {:locals => {:username => 'markbates'}, :foo => :bar})
Something went wrong with that request. Please try again.