Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redisk

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redisk

  • 0.2.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= redisk

An interface to Redis that mimic's Ruby's IO classes

== WHAT

Redis (http://code.google.com/p/redis/) is a super awesome persisted key-value store.

Why are we still logging to files then?

Redisk is a set of Ruby classes that mimic's Ruby's built in IO classes to allow drop in replacement for logging and other fun things.

== USAGE

Currently, Redisk provides two main classes Redisk::IO and Redisk::Logger.

Redisk::IO implements most of the methods of Ruby's IO class (http://ruby-doc.org/core/classes/IO.html)

require 'redisk'

io = Redisk::IO.new('mylog.log') # not a file, a Redis List
io.puts "Log this!"
io.gets #=> "Log this!"
io.gets #=> nil
io.lineno = 2

Its much more interesting to use it with logger.

logger = Logger.new(Redisk::IO.new('test.log))
logger.info("Hahah, I'm logging to redis")
logger.warn("whu?")
logger.error("zuh")

Theres also a nifty wrapper for that behavior:

logger = Redisk::Logger.new('test.log')
logger.info "10 less characters!"    

By default, Redisk uses the Redis on localhost:6379, but you can change that by setting

Redisk.redis = 'myhost:myport'

Check out the small but growing list of examples in examples/

== INSTALL (NOW!)

Proudly tested and working on Ruby 1.8.6, 1.8.7, and 1.9.1

Gems are on gemcutter:

gem install redisk

Dependencies:

redis running somewhere

gems:
  redis
  redis-namespace

== Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

== Copyright

Copyright (c) 2009 Aaron Quint. See LICENSE for details.

FAQs

Package last updated on 15 Aug 2010

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