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

dilation

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dilation

  • 0.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Dilation

A timer that provides an event based interface to hook into for your app. In addition, the back end timer can be swapped out, so for testing, you can control the passage of time.

Synopsis

require 'rubygems'
require 'dilation'

class WakeHandler
  def call
    puts 'awake'
  end
end

def stop_handler
  puts 'stop'
end

c = Dilation::Core.new

trap 'INT' do
  c.stop
  abort
end

c.listen_for :start do puts 'start' end
c.listen_for :stop, method(:stop_handler)
c.listen_for :sleep, lambda { puts 'sleep' }
c.listen_for :wake, WakeHandler.new
c.listen_for :tick, lambda { puts 'tick' }

puts 'sleeping'

c.sleep 5

puts 'starting'
counter = 0

c.listen_for :tick, lambda { counter += 1 }

c.start
while counter < 5
end

c.stop

puts 'ok'

TODO

Installation

Add this line to your application's Gemfile:

gem 'dilation'

And then execute:

$ bundle

Or install it yourself as:

$ gem install dilation

Usage

The rubydoc.info docs contain API documentation. The API docs contain detailed info about all of Dilation's public API.

Release Policy

Dilation follows the principles of semantic versioning. The API documentation define Dilation's public API. Patch level releases contain only bug fixes. Minor releases contain backward-compatible new features. Major new releases contain backwards-incompatible changes to the public API.

Ruby Interpreter Compatibility

Dilation has been tested on the following ruby interpreters:

  • MRI 1.9.2

Development

  • Source hosted on GitHub.
  • Report issues on GitHub Issues.
  • Pull requests are very welcome! Please include spec and/or feature coverage for every patch, and create a topic branch for every separate change you make.
  • Documentation is generated with YARD (cheat sheet). To generate while developing:
yard server --reload

Todo

  • Better interface to swap backend
  • dilation/test_support
  • Code Climate
  • Travis ** test on interpreters *** 1.8.7 *** 1.9.3 *** REE *** Rubinius
  • make Celluloid optional
  • ability to override Kernel#sleep

Thanks

Copyright (c) 2010-2012 Jim Deville. Released under the terms of the MIT license. See LICENSE for details.

FAQs

Package last updated on 22 Jun 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