# Conversion of ruby roles to json

**URL:** <https://discourse.chef.io/t/conversion-of-ruby-roles-to-json/1702>\
**Category:** Chef Infra (archive)\
**Created:** [February 19, 2011, 7:04am UTC](https://discourse.chef.io/t/conversion-of-ruby-roles-to-json/1702 "2011-02-19T07:04:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Diggins](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/tim_diggins/32/810_2.png) [@Tim\_Diggins](https://discourse.chef.io/u/Tim_Diggins)\
**Post date:** [February 19, 2011, 7:04am UTC](https://discourse.chef.io/t/conversion-of-ruby-roles-to-json/1702/1 "2011-02-19T07:04:24Z")

</div>

Just sharing a Rake task I created for converting roles in rb form to json  
form.

> <https://gist.github.com/timdiggins/834890>

(Why, you ask? Well, I find the ruby dsl is much more readable and writable  
than the json file. The ruby files are good for everything on the platform, but  
I’m testing my chef recipes and roles using vagrant with chef solo, which seems  
to require json files (json is only created when you upload to server)

all the best

Tim
