Permalink
Browse files

add documentation for Timescop#scale (#42)

  • Loading branch information...
1 parent 3854a84 commit 6881a53c273d26470490b7f7f3a6289a82570909 @travisjeffery committed Sep 21, 2012
Showing with 25 additions and 2 deletions.
  1. +5 −0 History.rdoc
  2. +18 −0 README.markdown
  3. +1 −1 lib/timecop/version.rb
  4. +1 −1 timecop.gemspec
View
@@ -1,3 +1,8 @@
+=== 0.5.2 / 2012-09-20
+
+* Feature
+ * Timecop#scale, ability to accelerate time by a given scaling factor
+
=== 0.5.0 / 2012-09-12
* Maintenance
View
@@ -15,6 +15,7 @@ A gem providing "time travel" and "time freezing" capabilities, making it dead s
- Freeze time to a specific point.
- Travel back to a specific point in time, but allow time to continue moving forward from there.
+- Scale time by a given scaling factor that will cause time to move at an accelerated pace.
- No dependencies, can be used with _any_ ruby project
- Timecop api allows arguments to be passed into #freeze and #travel as one of the following:
- Time instance
@@ -75,6 +76,23 @@ sleep(10)
new_time == Time.now # ==> false
```
+### Timecop.scale
+
+Let's say you want to test a "live" integration wherein entire days could pass by
+in minutes while you're able to simulate "real" activity. For example, one such use case
+is being able to test reports and invoices that run in 30 day cycles in very little time, while also
+being able to simulate activity via subsequent calls to your application.
+
+```ruby
+# seconds will now seem like hours
+Timecop.lens(3600)
+Time.now
+# => 2012-09-20 21:23:25 -0500
+# seconds later, hours have past it's gone from 9pm at night to 6am in the morning
+Time.now
+# => 2012-09-21 06:22:59 -0500
+```
+
## REFERENCES
* {0.3.4 release}[http://blog.smartlogicsolutions.com/2009/12/07/timecop-0-3-4-released/]
View
@@ -1,3 +1,3 @@
class Timecop
- VERSION = "0.5.1"
+ VERSION = "0.5.2"
end
View
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Travis Jeffery", "John Trupiano"]
- s.date = %q{2012-09-05}
+ s.date = %q{2012-09-20}
s.description = %q{A gem providing "time travel" and "time freezing" capabilities, making it dead simple to test time-dependent code. It provides a unified method to mock Time.now, Date.today, and DateTime.now in a single call.}
s.email = %q{travisjeffery@gmail.com}
s.extra_rdoc_files = [

0 comments on commit 6881a53

Please sign in to comment.