Project

dev-time

0.0
No commit activity in last 3 years
No release in over 3 years
Ever wish it were last month instead of right now when trying to test your Rails app? DevTime uses the Delorean gem to add time travel capabilies to your application so you can make it so!
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.2.0
>= 3.1
 Project Readme

Dev Time

Ever wish it were last month instead of right now when trying to test your Rails app? DevTime uses the Delorean gem to add time travel capabilies to your application so you can make it so!

Requirements

rails >= 3.1

Installation

Add dev-item to your Gemfile

gem 'dev-time'

Then run bundle install and start your app as normal.

Usage

Go to http://localhost:3000/time-machine and get started time travelling!

Dev Time also provides a couple of helpers you can add to your layout to help you know what time is is while you're travelling. Inserting the following to layouts/application.html.erb

<html>
  <head>
    ...
    <%= dev_time_stylesheet_link_tag %>
  </head>
  <body>
    <%= dev_time_current_time_display %>
    ...
  </body>
</html>

will display a ribbon in the upper left corner of the app showing the current time. This ribbon will only be shown while you are time travelling -- once you return to the present it will disappear. These helpers will also work when not in development mode, but they will just return ''.

Notes

The time machine understands many ways of talking about time. Both absolute (e.g. November 5, 1999) and relative (e.g. 3 years ago) will work.

Note that if your development server checks for timeout (like Unicorn does) you may need to start it with a very long timeout setting (e.g. 1 year) in order to avoid having the worker killed while it is time travelling.