Skip to content

Instantly share code, notes, and snippets.

@giorgian
giorgian / gist:4754737
Created February 11, 2013 14:35
Trying to create (or update) a data bag item via Chef REST API (using a non-ruby client), a key `action` gets removed
// Trying to create a data bag item foo bar with the following json via REST API:
{
"id": "bar",
"key": "value",
"action": "remove"
}
// The POST succeeds, but then the content of the data bag item is:
{
"id": "bar",
#!/bin/bash
set -e
source ~/.rvm/scripts/rvm
rvm use 1.9.2
ruby -v
# GET /employees/new
# GET /employees/new.xml
def new
@employee = Employee.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @employee }
end
end
>> source.last_build_date = Time.now
=> Sat Feb 20 14:17:23 +0100 2010
>> source.save
=> true
>> rss.channel.lastBuildDate.class
=> Time
>> rss.channel.lastBuildDate
=> Sat Feb 20 09:51:17 +0100 2010
>> source.last_build_date = rss.channel.lastBuildDate
=> Sat Feb 20 09:51:17 +0100 2010