yaml

Has anyone succesfully loaded a YAML file using SnakeYAML from a local Maven repo?

If I reference the SnakeYAML jar directly from a test program (see bottom), everything works. If I'm inside my Maven-created project, I get the following output from my unit tests: java.lang.NoSuchMethodError: java.util.LinkedList.push(Ljava/lang/Object;)V at org.yaml.snakeyaml.scanner.ScannerImpl.addIndent(ScannerImpl.java:482) ...

Which java YAML library should I use?

There are at least 4 YAML implementations listed at yaml.org. Which one of these (or another) would you recommend, and why? There are two ways you could answer this question, either by voting for one of the 4, or by giving a good answer that compares them or strongly justifies one of them. I'll add the 4 mentioned so people can vote, b...

How to set the character encoding in a yaml file

We are working with the simple backend for the new Rails 2.2 i18n system, and I wanted to know the proper syntax for setting the encoding in a yaml file. On other words what is the yaml for this xml: <?xml encoding="UTF-8" ?> ...

Best way to export a database table to a YAML file?

I have some data in my development database that I would like to utilize as fixtures in my test environment. What is the best way in Rails 2.x to export a database table to a YAML fixture? ...

How should I design the interface to a SQL column generator in PHP?

I'm working on a framework in PHP, part of this frameworks job is to write SQL code to generate new MySQL columns. What is the most elegant way to pass in a bunch of parameters for a column and then turn that into SQL code? As an example here is some YAML I have, that specifies parameters for creating a varchar column: - type: characte...

How can I include an yaml file inside another?

So I have two yaml files A and B and I want the contents of A to be inserted inside B, either spliced into the existing data structure (eg. an array), or as a child of an element, eg. the value for a certain hash key. Is this possible at all? How? If not, any pointers to a normative reference? ...

JYaml: dump object without including class name

I have an ArrayList of objects being dumped to a YAML string and have been comparing the performance of JYaml and SnakeYaml in handling this. ArrayList<HashMap> testList = new ArrayList<HashMap>(); HashMap<String, String> testMap1 = new HashMap<String, String>(); HashMap<String, String> testMap2 = new HashMap<String, String>...

How to include metadata in a template file?

I have a system that filters template files through erb. Using convention over configuration, the output files get created in a file hierarchy that mirrors the input files. Many of the files have the same names, and I was able to use the directories to differentiate them. That plan worked until I needed to associate additional info wi...

What are the advantages and disadvantes of yaml vs xml for Object graph de/serialization?

The use case is long term serialization of complex object graphs in a textual format. ...

Are there any .net equivalents to Rails fixtures?

I'm looking for a project/tool that will insert data into a database before a test and roll it back after a test has run. I know that ruby on rails has yaml fixtures, so I was hoping there is a project out there for .net projects. ...

How to specify default values when loading files using yaml?

I saved a object of class Foo using foo.to_yaml. Now i added an instance variable to the Foo class with default value set to 0 in the initializer method. now when I try to load the object from yaml file the instance variable is set to nil. Is there some way in which I can set it to 0 if the the yaml file doesnt contain any value for th...

Ruby on Rails :serialize UTF8 problem

When I serialize a hash containing UTF8 strings, like this: poll.variants = {0 => 'тест',1 => '-тест-',2 => 'test # test "тест'} to an ActiveRecord field, the resulting field contains: --- 0: !binary | 0YLQtdGB0YI= 1: !binary | LdGC0LXRgdGCLQ== 2: !binary | dGVzdCAjIHRlc3QgItGC0LXRgdGC The utf8 strings get treated as bi...

Ruby: Write escaped string to YAML

The following... require 'yaml' test = "I'm a b&d string" File.open('test.yaml', 'w') do |out| out.write(test.to_yaml) end ...outputs ... --- this is a b&d string How can I get it to output --- 'this is a b&d string' ??? ...

Yaml Emitter in C++

Is there a C++ library for emitting YAML? Wikipedia mentions a c++ wrapper for libyaml, but the link is broken. The official YAML site only offers yaml-cpp, which was also suggested in this SO question, but cpp-yaml is only a parser, not an emitter. Am I out of luck? Edit: I'm looking for an object oriented interface, hence the C++ r...

Store data in C# source files vs. XML etc...?

This is a C# question. I was just wandering if anyone tried storing their data (like config files for example), in the *.cs file, instead of XML? I really hate XML. The whole idea of parsing html-like structure every time you need some data seems stupid. Are there lightweight alternatives (like YAML) to XML? In my case I actually need...

YAML as a Data DSL in .NET (C#)

Anyone out there using YAML as a data DSL in .NET? I'd like to use YAML because it's more lightweight than XML. I intend to use this DSL as a "power user" configuration tool for one of my existing applications. My concerns: How is the support for YAML using one of the .NET community libraries? Does YAML have staying power? Will ...

Yaml merge in Python

So I'm toying around with the idea of making myself (and anyone who cares to use it of course) a little boilerplate library in Python for Pygame. I would like a system where settings for the application are provided with a yaml file. So I was thinking it would be useful if the library provided a default yaml tree and merged it with a u...

YAML parser in Delphi?

Are there any YAML parsers or YAML Serialization libs in Delphi? ...

YAML: dictionary with empty value

How do I write in YAML a dictionary (map) where one key has the empty string as its value? ...

How do I populate a table in rails from a fixture?

Quick summary: I have a Rails app that is a personal checklist / to-do list. Basically, you can log in and manage your to-do list. My Question: When a user creates a new account, I want to populate their checklist with 20-30 default to-do items. I know I could say: wash_the_car = ChecklistItem.new wash_the_car.name = 'Wash and wax the ...