New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

chill

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chill

  • 8.1.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

.oOo. .oOo. .oOo. chill .oOo. .oOo. .oOo.

chill plugs ruby code in to CouchDB

require 'pp'
require 'chill'

# make a database or connect to one
ChillDB.goes :KittensApp

# add a template (just in ruby instance)
KittensApp.templates(
  cat: {
    color: 'invisible',
    softness: 5,
    likes: %w{water food flying spaceships sunlight tictacs hugs exploding},
    dislikes: %w{mysql}
  }
)

# get a copy of a template, change some things, and save it
KittensApp.template(:cat).merge(
  color: 'green',
  softness: 8,
  dislikes: %w{stylesheets},
  _id: 'fredrick'
)

# add a view
KittensApp.design(:lists).views(
  soft_cats: 'function(doc) {
    if (doc.kind == "cat" && doc.softness > 1) emit(doc._id, null);
  }'
).commit!

# add a kitten
KittensApp.template(:cat).merge(
  _id: 'fredrick',
  softness: 16,
  dislikes: ['silly business']
).commit!

# use the view to get a list of non-hard cats
soft_ones = KittensApp.design(:lists).query(:soft_cats)
soft_ones.each do |cat|
  pp cat
end

# just load fredrick
fredrick = KittensApp['fredrick']


~~~ MORE INFORMATION THAN YOU REQUIRE ~~~
You can see a more fully baked version of the KittensApp database in
examples/kittens-app.rb. There you will see how to do all sorts of things.
It's the start of a really great kitten database you could use to keep
track of your cats. It's web scale and cloud ready.

                                                          --- <3 Bluebie

FAQs

Package last updated on 03 May 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc