runt 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES +107 -71
- data/LICENSE.txt +43 -43
- data/README +100 -94
- data/Rakefile +119 -120
- data/TODO +11 -20
- data/doc/tutorial_schedule.rdoc +84 -51
- data/doc/tutorial_te.rdoc +190 -190
- data/lib/runt.rb +219 -110
- data/lib/runt/daterange.rb +74 -74
- data/lib/runt/dprecision.rb +141 -137
- data/lib/runt/pdate.rb +153 -126
- data/lib/runt/schedule.rb +88 -89
- data/lib/runt/temporalexpression.rb +695 -524
- data/setup.rb +1331 -1331
- data/site/blue-robot3.css +131 -131
- data/site/index.html +94 -93
- data/site/runt-logo.psd +0 -0
- data/test/daterangetest.rb +87 -87
- data/test/dprecisiontest.rb +55 -45
- data/test/icalendartest.rb +524 -0
- data/test/pdatetest.rb +117 -104
- data/test/runttest.rb +101 -0
- data/test/scheduletest.rb +148 -88
- data/test/temporalexpressiontest.rb +612 -402
- metadata +56 -43
- data/test/alltests.rb +0 -10
data/CHANGES
CHANGED
@@ -1,71 +1,107 @@
|
|
1
|
-
= Runt Changelog
|
2
|
-
|
3
|
-
== Version 0.
|
4
|
-
|
5
|
-
*
|
6
|
-
|
7
|
-
* Added
|
8
|
-
|
9
|
-
* Added
|
10
|
-
|
11
|
-
*
|
12
|
-
|
13
|
-
*
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
*
|
18
|
-
|
19
|
-
*
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
*
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
*
|
30
|
-
|
31
|
-
*
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
== Version 0.
|
40
|
-
|
41
|
-
*
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
*
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
*
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
*
|
68
|
-
*
|
69
|
-
*
|
70
|
-
|
71
|
-
|
1
|
+
= Runt Changelog
|
2
|
+
|
3
|
+
== Version 0.5.0
|
4
|
+
|
5
|
+
* Refactored Schedule implementation which greatly simplifies customization but does potentially break existing clients who relied on the ability to call add mulitple times (SEE BELOW)
|
6
|
+
|
7
|
+
* Added update method to Schedule allowing clients to update existing expressions
|
8
|
+
|
9
|
+
* Added select method to Schedule allowing clients to query Events using arbitrary criteria
|
10
|
+
|
11
|
+
* Added events method to Schedule which returns an Array of the currrently held Events
|
12
|
+
|
13
|
+
* Added time-related shortcuts to Runt module contributed by Ara T. Howard
|
14
|
+
|
15
|
+
* Added ability to work with Time class contributed by Paul Wright
|
16
|
+
|
17
|
+
* Implemented meaningful to_s methods for TExpr classes
|
18
|
+
|
19
|
+
* Added include? method to Standard Library Date class allowing Spec class better interaction with other expressions
|
20
|
+
|
21
|
+
* Applied patch to fix PDate serialization bug contributed by Jodi Showers
|
22
|
+
|
23
|
+
* Added BeforeTE, AfterTE, enhanced TExpr#dates method, RFC2445 (iCalendar) compliance unit test, contributed by Larry Karnowski
|
24
|
+
|
25
|
+
* Applied patch by Gordon Thiesfeld which fixes broken Time class compatibility
|
26
|
+
|
27
|
+
* Applied patch by Gordon Thiesfeld which allows REWeek expressions to span across two weeks
|
28
|
+
|
29
|
+
* Removed unused context.rb and contexttest.rb
|
30
|
+
|
31
|
+
* Removed unnecessary test suite alltests.rb
|
32
|
+
|
33
|
+
== Version 0.4.0
|
34
|
+
|
35
|
+
* Added DayIntervalTE contributed by Ira Burton which matches every n days past a given date
|
36
|
+
|
37
|
+
* Added YearTE requested by Pat Maddox
|
38
|
+
|
39
|
+
== Version 0.3.0
|
40
|
+
|
41
|
+
* TExpr (finally!) becomes a Module instead of a superclass
|
42
|
+
|
43
|
+
* Added overlap? method for all temporal expressions and DateRange
|
44
|
+
|
45
|
+
* Added REMonth expression which matches a range of dates each month
|
46
|
+
|
47
|
+
* Contributed by Emmett Shear: TExpr#dates method which returns an array of dates occurring within the supplied DateRange
|
48
|
+
|
49
|
+
* Rakefile fixes:
|
50
|
+
- test path allow gem to be installed with -t switch
|
51
|
+
- usage of gzip which will break on Win32
|
52
|
+
|
53
|
+
* Removed and then subsequently restored SpecTE
|
54
|
+
|
55
|
+
* General clean-up, including:
|
56
|
+
- renamed several methods on PDate
|
57
|
+
- renamed 'dateprecisiontest.rb' to 'dprecisiontest.rb'
|
58
|
+
|
59
|
+
* Fixed Object.id deprecation warning
|
60
|
+
|
61
|
+
|
62
|
+
== Version 0.2.0
|
63
|
+
|
64
|
+
* Fixed Schedule class
|
65
|
+
* Renamed Schedule#is_occurring? to Schedule#include?
|
66
|
+
* RAA deployment
|
67
|
+
* GEM deployment
|
68
|
+
* Renamed file dateprecisiontest.rb to dprecisiontest.rb
|
69
|
+
* Renamed several methods on PDate:
|
70
|
+
- second -> sec
|
71
|
+
- minute -> min
|
72
|
+
- hour_of_day -> hour
|
73
|
+
- day_of_month -> day
|
74
|
+
|
75
|
+
== Version 0.1.0
|
76
|
+
|
77
|
+
* Inspired by suggestions[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/95465] on c.l.r., did massive renaming and refactoring to make source more Ruby-esque:
|
78
|
+
|
79
|
+
- TemporalExpression class => TExpr
|
80
|
+
- DatePrecision module => DPrecision (file name changed also)
|
81
|
+
- TimePoint class => PDate (file name changed also)
|
82
|
+
- Added transparent use of bitwise set operators ( & , | ) for building composite expressions
|
83
|
+
- Added transparent use of - operator for diff expressions
|
84
|
+
|
85
|
+
* Updated TE Tutorial to reflect new and improved syntax usage
|
86
|
+
* Skipped several version numbers to celebrate
|
87
|
+
|
88
|
+
== Version 0.0.6
|
89
|
+
|
90
|
+
* TE Tutorial
|
91
|
+
* Website beautification
|
92
|
+
* Credits
|
93
|
+
|
94
|
+
== Version 0.0.4
|
95
|
+
|
96
|
+
* Improved Rake[http://rake.rubyforge.org] support
|
97
|
+
* Better documentation: README, TODO, CHANGES, etc.
|
98
|
+
* More Ruby-like source code layout and code organization inspired by Rake[http://rake.rubyforge.org] distribution
|
99
|
+
* Dropped the obviously superfluous 'alpha' from versioning
|
100
|
+
|
101
|
+
== Version 0.0.1
|
102
|
+
|
103
|
+
* Learned Ruby (or began trying, at any rate...)
|
104
|
+
* RubyForge project setup
|
105
|
+
* Basic implementation of the Java-based chronicJ[http://chronicJ.org] functionality in Ruby
|
106
|
+
|
107
|
+
|
data/LICENSE.txt
CHANGED
@@ -1,44 +1,44 @@
|
|
1
|
-
The Apache Software License, Version 1.1
|
2
|
-
|
3
|
-
Copyright (c) 2003-2004 Digital Clash LLC. All rights
|
4
|
-
reserved.
|
5
|
-
|
6
|
-
Redistribution and use in source and binary forms, with or without
|
7
|
-
modification, are permitted provided that the following conditions
|
8
|
-
are met:
|
9
|
-
|
10
|
-
1. Redistributions of source code must retain the above copyright
|
11
|
-
notice, this list of conditions and the following disclaimer.
|
12
|
-
|
13
|
-
2. Redistributions in binary form must reproduce the above copyright
|
14
|
-
notice, this list of conditions and the following disclaimer in
|
15
|
-
the documentation and/or other materials provided with the
|
16
|
-
distribution.
|
17
|
-
|
18
|
-
3. The end-user documentation included with the redistribution,
|
19
|
-
if any, must include the following acknowledgment:
|
20
|
-
"This product includes software developed by the
|
21
|
-
Runt team (http://runt.rubyforge.org/)."
|
22
|
-
Alternately, this acknowledgment may appear in the software itself,
|
23
|
-
if and wherever such third-party acknowledgments normally appear.
|
24
|
-
|
25
|
-
4. The names "Runt" and "Digital Clash" not be used to endorse or
|
26
|
-
promote products derived from this software without prior written
|
27
|
-
permission. For written permission, please contact
|
28
|
-
info@digitalclash.com.
|
29
|
-
|
30
|
-
5. Products derived from this software may not be called "Runt",
|
31
|
-
"Digital Clash", nor may "Runt" or "Digital Clash" appear in
|
32
|
-
their name, without prior written permission of Digital Clash LLC.
|
33
|
-
|
34
|
-
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
35
|
-
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
36
|
-
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
37
|
-
DISCLAIMED. IN NO EVENT SHALL DIGITAL CLASH LLC OR ITS CONTRIBUTORS
|
38
|
-
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
39
|
-
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
40
|
-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
41
|
-
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
42
|
-
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
43
|
-
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
1
|
+
The Apache Software License, Version 1.1
|
2
|
+
|
3
|
+
Copyright (c) 2003-2004 Digital Clash LLC. All rights
|
4
|
+
reserved.
|
5
|
+
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
7
|
+
modification, are permitted provided that the following conditions
|
8
|
+
are met:
|
9
|
+
|
10
|
+
1. Redistributions of source code must retain the above copyright
|
11
|
+
notice, this list of conditions and the following disclaimer.
|
12
|
+
|
13
|
+
2. Redistributions in binary form must reproduce the above copyright
|
14
|
+
notice, this list of conditions and the following disclaimer in
|
15
|
+
the documentation and/or other materials provided with the
|
16
|
+
distribution.
|
17
|
+
|
18
|
+
3. The end-user documentation included with the redistribution,
|
19
|
+
if any, must include the following acknowledgment:
|
20
|
+
"This product includes software developed by the
|
21
|
+
Runt team (http://runt.rubyforge.org/)."
|
22
|
+
Alternately, this acknowledgment may appear in the software itself,
|
23
|
+
if and wherever such third-party acknowledgments normally appear.
|
24
|
+
|
25
|
+
4. The names "Runt" and "Digital Clash" not be used to endorse or
|
26
|
+
promote products derived from this software without prior written
|
27
|
+
permission. For written permission, please contact
|
28
|
+
info@digitalclash.com.
|
29
|
+
|
30
|
+
5. Products derived from this software may not be called "Runt",
|
31
|
+
"Digital Clash", nor may "Runt" or "Digital Clash" appear in
|
32
|
+
their name, without prior written permission of Digital Clash LLC.
|
33
|
+
|
34
|
+
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
35
|
+
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
36
|
+
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
37
|
+
DISCLAIMED. IN NO EVENT SHALL DIGITAL CLASH LLC OR ITS CONTRIBUTORS
|
38
|
+
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
39
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
40
|
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
41
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
42
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
43
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
44
44
|
THE POSSIBILITY OF SUCH DAMAGE.
|
data/README
CHANGED
@@ -1,94 +1,100 @@
|
|
1
|
-
= RUNT -- Ruby Temporal Expressions
|
2
|
-
|
3
|
-
* Runt is a Ruby[http://www.ruby-lang.org/en/] implementation of select Martin Fowler patterns[http://www.martinfowler.com/articles].
|
4
|
-
|
5
|
-
* <em>TemporalExpression</em>s allow a developer to define patterns of date recurrence using set expressions.
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
*
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
$ ruby setup.rb
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
*
|
38
|
-
|
39
|
-
* See
|
40
|
-
|
41
|
-
* See
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
1
|
+
= RUNT -- Ruby Temporal Expressions
|
2
|
+
|
3
|
+
* Runt is a Ruby[http://www.ruby-lang.org/en/] implementation of select Martin Fowler patterns[http://www.martinfowler.com/articles].
|
4
|
+
|
5
|
+
* <em>TemporalExpression</em>s allow a developer to define patterns of date recurrence using set expressions.
|
6
|
+
|
7
|
+
= INSTALL
|
8
|
+
|
9
|
+
* gem install runt
|
10
|
+
|
11
|
+
<b>or</b>
|
12
|
+
|
13
|
+
* Unpack the Runt distribution.
|
14
|
+
|
15
|
+
$ tar -xzvf runt-<version>.tar.gz
|
16
|
+
|
17
|
+
* cd $UNPACK_DIR/runt/
|
18
|
+
|
19
|
+
* execute:
|
20
|
+
|
21
|
+
$ ruby setup.rb config
|
22
|
+
$ ruby setup.rb setup
|
23
|
+
$ ruby setup.rb install (may require root privilege)
|
24
|
+
|
25
|
+
<b>or</b>
|
26
|
+
|
27
|
+
$ ruby setup.rb --help
|
28
|
+
|
29
|
+
for more options.
|
30
|
+
|
31
|
+
= QUICK START
|
32
|
+
|
33
|
+
* require 'runt'
|
34
|
+
|
35
|
+
* See Runt website[http://runt.rubyforge.org].
|
36
|
+
|
37
|
+
* See $UNPACK_DIR/runt/test/*.rb for example usage.
|
38
|
+
|
39
|
+
* See this mini-TemporalExpression tutorial[http://runt.rubyforge.org/doc/files/doc/tutorial_te_rdoc.html]
|
40
|
+
|
41
|
+
* See http://chronicj.digitalclash.com/apidocs/index.html for commented Java source (JavaDoc)
|
42
|
+
|
43
|
+
Get in touch if you have questions or if Runt causes your computer to burst into flames...
|
44
|
+
|
45
|
+
Matt[mailto:mlipper@gmail.com]
|
46
|
+
|
47
|
+
== Credits
|
48
|
+
|
49
|
+
Rubyforge[http://rubyforge.org] for hosting this project.
|
50
|
+
|
51
|
+
M.Fowler[http://martinfowler.com], Matz[http://ruby-lang.org],
|
52
|
+
T.Funaba (Date/DateTime[http://www.funaba.org/en/ruby.html]),
|
53
|
+
J.Weirich (Rake[http://rake.rubyforge.org]),
|
54
|
+
PragmaticProgrammers[http://pragmaticprogrammer.com], and everyone on
|
55
|
+
ruby-talk[mailto:ruby-talk@ruby-lang.org] for their shameless public display
|
56
|
+
of smartness.
|
57
|
+
|
58
|
+
Hal Fulton, Mauricio Fernandez, and Mark Hubbart for the
|
59
|
+
thread[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/95465] on c.l.r.
|
60
|
+
that inspired a more Ruby-esque syntax for creating TE's. 2X Thanks to Hal, for
|
61
|
+
taking the time to exchange ideas off-line.
|
62
|
+
|
63
|
+
The ruby-nyc user's group for their suggestions and feedback.
|
64
|
+
|
65
|
+
BlueRobot[http://www.bluerobot.com/web/layouts/] for the CSS used to prettify the Runt website.
|
66
|
+
|
67
|
+
Emmett Shear for contributed TExpr#dates code and several thought-provoking feature requests.
|
68
|
+
|
69
|
+
Ira Burton for contributed DayIntervalTE class.
|
70
|
+
|
71
|
+
Jodi Showers for serialization bug fix.
|
72
|
+
|
73
|
+
Pat Maddox for YearTE.
|
74
|
+
|
75
|
+
Paul Wright for Time class compatibility.
|
76
|
+
|
77
|
+
Ara T. Howard for Numeric class extensions.
|
78
|
+
|
79
|
+
Larry Karnowski for BeforeTE, AfterTE, TExpr#dates enhancements, RFC2445 (iCalendar) compliance tests.
|
80
|
+
|
81
|
+
Gordon Thiesfeld for fixed Time integration and extended REWeek functionality
|
82
|
+
|
83
|
+
The number 12, and the letters E, J, and B.
|
84
|
+
|
85
|
+
= Etc...
|
86
|
+
|
87
|
+
Author:: Matthew Lipper <mlipper@gmail.com>
|
88
|
+
Requires:: Ruby 1.8.0 or later, Date/DateTime classes
|
89
|
+
License:: Copyright 2004 by Digital Clash LLC.
|
90
|
+
Released under the Apache Software license (see LICENSE.txt)
|
91
|
+
included in the distribution.
|
92
|
+
|
93
|
+
= Warranty
|
94
|
+
|
95
|
+
This software is provided "as is" and without any express or
|
96
|
+
implied warranties, including, without limitation, the implied
|
97
|
+
warranties of merchantibility and fitness for a particular
|
98
|
+
purpose.
|
99
|
+
|
100
|
+
link://../dcl-small.gif
|