git: bbe83034d6e1 - main - devel/rubygem-timecop: Add rubygem-timecop 0.9.6
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 30 Dec 2022 09:08:03 UTC
The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=bbe83034d6e153cba22337490cc965d54a8a3f3f commit bbe83034d6e153cba22337490cc965d54a8a3f3f Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org> AuthorDate: 2022-12-30 08:36:23 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2022-12-30 09:04:02 +0000 devel/rubygem-timecop: Add rubygem-timecop 0.9.6 timecop is 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. Features: - 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 - DateTime instance - Date instance - individual arguments (year, month, day, hour, minute, second) - a single integer argument that is interpreted as an offset in seconds from Time.now - Nested calls to Timecop#travel and Timecop#freeze are supported -- each block will maintain its interpretation of now. - Works with regular Ruby projects, and Ruby on Rails projects --- devel/Makefile | 1 + devel/rubygem-timecop/Makefile | 18 ++++++++++++++++++ devel/rubygem-timecop/distinfo | 3 +++ devel/rubygem-timecop/pkg-descr | 22 ++++++++++++++++++++++ 4 files changed, 44 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index e5e4d6e3cc6d..5fdd5d23f326 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -7109,6 +7109,7 @@ SUBDIR += rubygem-tilt SUBDIR += rubygem-tilt1 SUBDIR += rubygem-time + SUBDIR += rubygem-timecop SUBDIR += rubygem-timeliness SUBDIR += rubygem-timeout SUBDIR += rubygem-timers diff --git a/devel/rubygem-timecop/Makefile b/devel/rubygem-timecop/Makefile new file mode 100644 index 000000000000..7b4f524c481a --- /dev/null +++ b/devel/rubygem-timecop/Makefile @@ -0,0 +1,18 @@ +PORTNAME= timecop +PORTVERSION= 0.9.6 +CATEGORIES= devel rubygems +MASTER_SITES= RG + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Mock current time to test time-dependent code +WWW= https://github.com/travisjeffery/timecop + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= gem +USE_RUBY= yes + +#NO_ARCH= yes + +.include <bsd.port.mk> diff --git a/devel/rubygem-timecop/distinfo b/devel/rubygem-timecop/distinfo new file mode 100644 index 000000000000..81f763ba5209 --- /dev/null +++ b/devel/rubygem-timecop/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1669057523 +SHA256 (rubygem/timecop-0.9.6.gem) = cc8586a03284cf314db6f49a5ff41882b9435b1f40d96f4f3403c10ffa239d36 +SIZE (rubygem/timecop-0.9.6.gem) = 17408 diff --git a/devel/rubygem-timecop/pkg-descr b/devel/rubygem-timecop/pkg-descr new file mode 100644 index 000000000000..86a5757841c0 --- /dev/null +++ b/devel/rubygem-timecop/pkg-descr @@ -0,0 +1,22 @@ +timecop is 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. + +Features: +- 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 + - DateTime instance + - Date instance + - individual arguments (year, month, day, hour, minute, second) + - a single integer argument that is interpreted as an offset in seconds from + Time.now +- Nested calls to Timecop#travel and Timecop#freeze are supported -- each block + will maintain its interpretation of now. +- Works with regular Ruby projects, and Ruby on Rails projects