yaml

Optimizing a Ruby on Rails Project

I'm busy creating a very simplistic ruby on rails app that won't need a lot things that are loaded in the ruby on rails environment by default. I won't be using mysql, just one model that fetches data from a Yaml file. So I'm thinking I won't be needing ActiveRecord, or at least a large part of it. ( Correct me if I'm wrong here ); How...

What text format can I use to present data originally in an Excel spreadsheet?

I have an Excel spreadsheet that has many people's estimates of another person's height and weight. In addition, some people have left comments on both estimate cells like "This estimate takes into account such and such". I want to take the data from the spreadsheet (I've already figured out how to parse it), and represent it in a plain...

[Doctrine] Can fixtures "copy" items from other fixtures?

In my ACL fixtures I have resources and actions, most of the resources share common actions like CRUD, is there a way in Doctrine (yaml) to extend another element? Here is a blurb from my current yaml: Resource: R1: title: Article system_name: ARTICLE Actions: A1: title: Create system_nam...

C# Yaml Processing

Hi, I am using the C# Yaml Parser mentioned on Code Project Site If my Yaml looks like the following - id: tagid tag: - name: tagname value: tagvalue After it has been successfully parsed, how do I access the Data Items so that I can do some further processing. For example if I need to get the value of "name" what code woul...

How to get string Objects instead Unicode ones from JSON in Python?

I'm using Python (Python 2.5.2 on Ubuntu 8.10) to parse JSON from (ASCII encoded) text files. When loading these files with json (simplejson), all my string values are cast to Unicode objects instead of string objects. The problem is, I have to use the data with some libraries that only accept string objects. Is it possible to get stri...

BeanStalkd on Solaris doesnt return anything when called from the python library

i am using Solaris 10 OS(x86). i installed beanstalkd and it starts fine by using command "beanstalkd -d -l hostip -p 11300". i have Python 2.4.4 on my system i installed YAML and beanstalkc python libraries to connect beanstalkd with python my problem is when i try to write some code: import beanstalkc beanstalk = beanstalkc.Connectio...

Is it possible to specify formatting options for to_yaml in ruby?

The code require 'yaml' puts YAML.load(" is_something: values: ['yes', 'no'] ").to_yaml produces --- is_something: values: - "yes" - "no" While this is a correct yaml, it just looks ugly when you have a hash of arrays. Is there a way for me to get to_yaml to produce the inline array version of the yaml? An options has...

Google App Engine: Redirect All URLs

Hi, how do I have to configure the app.yaml file to redirect all urls to a certain url? Example I want http://test.appspot.com/hello or http://test.appspot.com/hello28928723 to redirect to http://domain.com I am only serving static files at the moment. Here is my app.yaml file: application: testapp version: 1 runtime: python api_versio...

Why isn't this a valid schema for Rx?

Hi! I'm using YAML as a configuration file format for a Python project. Recently I found Rx to be the only schema validator available for Python and YAML. :-/ Kwalify works with YAML, but it's only for Ruby and Java. :( I've been reading their lacking documentation all day and just can't seem to write a valid schema to represent my fi...

What's the purpose of "skip link navigation" in HTML generated from yaml-builder?

I'm using yaml builder to create a 3-column CSS layout. In the HTML it generates, there is one section that does not make any sense to me: <!-- start: skip link navigation --> <a class="skip" title="skip link" href="#navigation">Skip to the navigation</a><span class="hideme">.</span> <a class="skip" title="skip link" href="#content...

Object to YAML Serializer in C#

Is there a library ( in C#) that serializes an object's property to yaml format and converts it to string so that I can print it as a string? ...

Yaml Parser choking

Hey guys, I have a yaml snippet ... passwordregexp: '.{8},[0-9],[^0-9A-Za-z ],[A-Z],[a-z]' passwordregexpfailmessage: |- Contain at least 8 characters Contain at least 1 Number Contain at least 1 Special Character Contain at least 1 Upper Case Letter Contain at least 1 Lower Case Letter passwordresetperiod: 1000 pd...

Ruby to_yaml utf8 string

How can I make ruby to_yaml method to store utf8 strings with original signs but not escape sequence? ...

Skipping chosen types in ruby yaml serialisation

I'm serialising some object using YAML::dump(). Unfortunately that includes some elements that shouldn't be serialised, like locks with waiting threads sometimes. Is there any way to exclude selected types from serialisation, or force them to be serialised as an empty object instead? ...

Yaml load error in Ruby

I had this error when I do rake in the app directory, looks like YAML was failed to load. Can anybody help? Thanks C:\Development\RUBY\laibe\ilr>rake --trace (in C:/Development/RUBY/laibe/ilr) ** Invoke default (first_time) ** Invoke spec (first_time) ** Invoke db:test:prepare (first_time) ** Invoke db:abort_if_pending_migrations (firs...

How can I walk a YAML tree with Perl's YAML::Tiny?

I have a YAML document like this: --- version: 1 rootdirectory: - subdirectory: - file1 - file2 - subdirectory2 that I am loading into a YAML::Tiny object like this: $configuration = YAML::Tiny->read($configuration_file) I see from invoking the script with the Perl debugger that what I end up with is a set of nested has...

Converting xml to yaml with Ruby and Hpricot - what's going wrong here?

I'm trying to output an xml file blog.xml as yaml, for dropping into vision.app, a tool for designing shopify e-commerce sites locally. Shopify's yaml looks like this: - id: 2 handle: bigcheese-blog title: Bigcheese blog url: /blogs/bigcheese-blog articles: - id: 1 title: 'One thing you probably did not know yet...' ...

How do I traverse all the nodes in a YAML tree in Ruby?

I am loading an arbitrary YAML document, and want to walk every node in the tree. I don't know how nested the tree is beforehand, so I can't just use a simple each statement to walk all the nodes. Here is how I'm loading the document: tree = File.open( "#{RAILS_ROOT}/config/locales/es.yml" ){ |yf| YAML::load (yf)} ...

How do I parse YAML with nil values?

I apologize for the very specific issue I'm posting here but I hope it will help others that may also run across this issue. I have a string that is being formatted to the following: [[,action1,,],[action2],[]] I would like to translate this to valid YAML so that it can be parsed which would look like this: [['','acton1','',''],['ac...

Using ruby global value in YAML file

I am writing an app that has different parts running on multiple servers. As a result, I have a ruby file filled with global values, which contain the IP addresses of the machines on which each part is running. The app has a Rails front end that connects to a remote database (on one of the other servers). Is it possible to make use of ...