how to place YAML inside a YAML document

I am working with Rails fixtures for testing my rails application. It is all good except one of my database columns is supposed to hold YAML content. But, I am sure how to put the YAML markup I want to load into my database inside the YAML file. Here is an example:

mvnforum:
    name: mvnforum
    abstraction_type: SVN
    url: src: test username: admin #is this possible?
    sourcepath: mvnforum/src/
    webroot:
    codesecure_project: mvnforum

If it is impossible to have YAML inside a YAML file what would be the best why to load this into a database for testing?

Answers


If you want to put YAML code inside a YAML document, you need to treat it like a string:

url: "src: test username: admin"

If you need a multiline string, you can do

mvnforum:
   name: mvnforum
   abstraction_type: SVN
   url: "
src: test\n
username: admin\n
"
   sourcepath: mvnforum/src/
   webroot:
   codesecure_project: mvnforum

Need Your Help

Javascript dynamic link issues?

javascript

There might be a duplicate of this (I've tried checking questions on creating dynamic links but they reference a static link - I want this link to be hidden from the user). On testing the following...

OutOfMemoryError although I'm down scale the bitmaps

android bitmap imageview out-of-memory android-resources

I use small resource images (max 25kb, max 256x256) and load some larger images from the internet with picasso. The picasso loading never failed until now. But the resource image loading does somet...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.