0.0
No commit activity in last 3 years
No release in over 3 years
Middleware that will insert a timestamp within the Rack environment.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
~> 2.0
~> 11.2
~> 3.5
 Project Readme

Rack Timestamp Middleware

Build Status Dependency Status Code Climate Test Coverage

Rack::Timestamp adds a timestamp to the Rack environment. By using this middleware at the top of the stack, it is usefull to know exactly when the request has been processed by the server. It will prevent Time.now to be spoiled by the execution time of the other middlewares and/or code within controllers/models/libs...

Installation

Add this line to your application's Gemfile:

gem 'rack-timestamp', '~> 1.1'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rack-timestamp

Usage

It is recommended to add the Rack::Timestamp middleware at the top of the stack in config/application.rb

config.middleware.insert_before 0, Rack::Timestamp

Then in your app:

puts env['rack.timestamp']
=> "Sun, 28 Aug 2016 04:19:34 GMT"

Running tests

To run tests:

$ bundle exec rake spec

Development

To install this gem for development purposes:

$ gem install bundler # note: you don't need to do this if you already have it installed
$ git clone git://github.com/mchaisse/rack-timestamp.git
$ cd rack-timestamp
$ bundle install

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/mchaisse/rack-timestamp. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.