runt 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,132 +1,132 @@
1
-
2
- body {
3
- color:#333;
4
- background-color:#CCCCCC;
5
- margin:20px;
6
- padding:0px;
7
- font:11px verdana, arial, helvetica, sans-serif;
8
- }
9
- h1 {
10
- margin:0px 0px 15px 0px;
11
- padding:0px;
12
- font-size:14px;
13
- font-weight:900;
14
- color:#ccc;
15
- }
16
- h2 {
17
- font:bold 12px/14px verdana, arial, helvetica, sans-serif;
18
- margin:0px 0px 5px 0px;
19
- padding:0px;
20
- }
21
- p {
22
- font:11px/20px verdana, arial, helvetica, sans-serif;
23
- margin:0px 0px 16px 0px;
24
- padding:0px;
25
- }
26
- .Content>p {margin:0px;}
27
- .Content>p+p {text-indent:30px;}
28
-
29
- a {
30
- color:#09c;
31
- font-size:11px;
32
- font-family:verdana, arial, helvetica, sans-serif;
33
- font-weight:600;
34
- text-decoration:none;
35
- }
36
- a:link {color:#09c;}
37
- a:visited {color:#07a;}
38
- a:hover {background-color:#eee;}
39
-
40
-
41
- /* All the content boxes belong to the content class. */
42
- .content {
43
- position:relative; /* Position is declared "relative" to gain control of stacking order (z-index). */
44
- width:auto;
45
- min-width:120px;
46
- margin:0px 210px 20px 170px;
47
- border:1px solid black;
48
- background-color:white;
49
- padding:10px;
50
- z-index:3; /* This allows the content to overlap the right menu in narrow windows in good browsers. */
51
- }
52
-
53
- /* 2004-03-12 MSL */
54
- .ruby-link {
55
- color: rgb(255, 0, 0);
56
- }
57
-
58
- .keyword {
59
- font-weight:bold;
60
- }
61
-
62
-
63
- #navAlpha {
64
- position:absolute;
65
- width:150px;
66
- top:20px;
67
- left:20px;
68
- border:1px dashed black;
69
- background-color:#eee;
70
- padding:10px;
71
- z-index:2;
72
-
73
- /* Here is the ugly brilliant hack that protects IE5/Win from its own stupidity.
74
- Thanks to Tantek Celik for the hack and to Eric Costello for publicizing it.
75
- IE5/Win incorrectly parses the "\"}"" value, prematurely closing the style
76
- declaration. The incorrect IE5/Win value is above, while the correct value is
77
- below. See http://glish.com/css/hacks.asp for details. */
78
- voice-family: "\"}\"";
79
- voice-family:inherit;
80
- width:128px;
81
- }
82
- /* I've heard this called the "be nice to Opera 5" rule. Basically, it feeds correct
83
- length values to user agents that exhibit the parsing error exploited above yet get
84
- the CSS box model right and understand the CSS2 parent-child selector. ALWAYS include
85
- a "be nice to Opera 5" rule every time you use the Tantek Celik hack (above). */
86
- body>#navAlpha {width:128px;}
87
-
88
- #navBeta {
89
- position:absolute;
90
- width:190px;
91
- top:20px;
92
- right:20px;
93
- border:1px dashed black;
94
- background-color:#eee;
95
- padding:10px;
96
- z-index:1;
97
- /* Again, the ugly brilliant hack. */
98
- voice-family: "\"}\"";
99
- voice-family:inherit;
100
- width:168px;
101
- }
102
- /* Again, "be nice to Opera 5". */
103
- body>#navBeta {width:168px;}
104
-
105
- /* 2004-03-12 MSL */
106
-
107
- #contentFooter {
108
- text-align: center;
109
- font-size:10px;
110
- }
111
-
112
- #contentFooter a {
113
- font-size:10px;
114
- }
115
-
116
-
117
- #logo {
118
- border: 0px solid ;
119
- width: 97px;
120
- height: 33px;
121
- vertical-align: -50%;
122
- }
123
-
124
-
125
- #dcl-logo {
126
- border: 0px solid ;
127
- width: 140px;
128
- height: 29px;
129
- vertical-align: -110%;
130
- margin: 2px;
131
- }
1
+
2
+ body {
3
+ color:#333;
4
+ background-color:#CCCCCC;
5
+ margin:20px;
6
+ padding:0px;
7
+ font:11px verdana, arial, helvetica, sans-serif;
8
+ }
9
+ h1 {
10
+ margin:0px 0px 15px 0px;
11
+ padding:0px;
12
+ font-size:14px;
13
+ font-weight:900;
14
+ color:#ccc;
15
+ }
16
+ h2 {
17
+ font:bold 12px/14px verdana, arial, helvetica, sans-serif;
18
+ margin:0px 0px 5px 0px;
19
+ padding:0px;
20
+ }
21
+ p {
22
+ font:11px/20px verdana, arial, helvetica, sans-serif;
23
+ margin:0px 0px 16px 0px;
24
+ padding:0px;
25
+ }
26
+ .Content>p {margin:0px;}
27
+ .Content>p+p {text-indent:30px;}
28
+
29
+ a {
30
+ color:#09c;
31
+ font-size:11px;
32
+ font-family:verdana, arial, helvetica, sans-serif;
33
+ font-weight:600;
34
+ text-decoration:none;
35
+ }
36
+ a:link {color:#09c;}
37
+ a:visited {color:#07a;}
38
+ a:hover {background-color:#eee;}
39
+
40
+
41
+ /* All the content boxes belong to the content class. */
42
+ .content {
43
+ position:relative; /* Position is declared "relative" to gain control of stacking order (z-index). */
44
+ width:auto;
45
+ min-width:120px;
46
+ margin:0px 210px 20px 170px;
47
+ border:1px solid black;
48
+ background-color:white;
49
+ padding:10px;
50
+ z-index:3; /* This allows the content to overlap the right menu in narrow windows in good browsers. */
51
+ }
52
+
53
+ /* 2004-03-12 MSL */
54
+ .ruby-link {
55
+ color: rgb(255, 0, 0);
56
+ }
57
+
58
+ .keyword {
59
+ font-weight:bold;
60
+ }
61
+
62
+
63
+ #navAlpha {
64
+ position:absolute;
65
+ width:150px;
66
+ top:20px;
67
+ left:20px;
68
+ border:1px dashed black;
69
+ background-color:#eee;
70
+ padding:10px;
71
+ z-index:2;
72
+
73
+ /* Here is the ugly brilliant hack that protects IE5/Win from its own stupidity.
74
+ Thanks to Tantek Celik for the hack and to Eric Costello for publicizing it.
75
+ IE5/Win incorrectly parses the "\"}"" value, prematurely closing the style
76
+ declaration. The incorrect IE5/Win value is above, while the correct value is
77
+ below. See http://glish.com/css/hacks.asp for details. */
78
+ voice-family: "\"}\"";
79
+ voice-family:inherit;
80
+ width:128px;
81
+ }
82
+ /* I've heard this called the "be nice to Opera 5" rule. Basically, it feeds correct
83
+ length values to user agents that exhibit the parsing error exploited above yet get
84
+ the CSS box model right and understand the CSS2 parent-child selector. ALWAYS include
85
+ a "be nice to Opera 5" rule every time you use the Tantek Celik hack (above). */
86
+ body>#navAlpha {width:128px;}
87
+
88
+ #navBeta {
89
+ position:absolute;
90
+ width:190px;
91
+ top:20px;
92
+ right:20px;
93
+ border:1px dashed black;
94
+ background-color:#eee;
95
+ padding:10px;
96
+ z-index:1;
97
+ /* Again, the ugly brilliant hack. */
98
+ voice-family: "\"}\"";
99
+ voice-family:inherit;
100
+ width:168px;
101
+ }
102
+ /* Again, "be nice to Opera 5". */
103
+ body>#navBeta {width:168px;}
104
+
105
+ /* 2004-03-12 MSL */
106
+
107
+ #contentFooter {
108
+ text-align: center;
109
+ font-size:10px;
110
+ }
111
+
112
+ #contentFooter a {
113
+ font-size:10px;
114
+ }
115
+
116
+
117
+ #logo {
118
+ border: 0px solid ;
119
+ width: 97px;
120
+ height: 33px;
121
+ vertical-align: -50%;
122
+ }
123
+
124
+
125
+ #dcl-logo {
126
+ border: 0px solid ;
127
+ width: 140px;
128
+ height: 29px;
129
+ vertical-align: -110%;
130
+ margin: 2px;
131
+ }
132
132
 
File without changes
@@ -1,94 +1,72 @@
1
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
- "http://www.w3.org/TR/html4/strict.dtd">
3
-
4
- <html>
5
- <head>
6
- <title>Runt - Ruby Temporal Expressions</title>
7
- <style type="text/css" media="screen">@import "blue-robot3.css";</style>
8
-
9
- </head>
10
-
11
- <body>
12
-
13
- <div class="content">
14
- <h1><a href="http://runt.rubyforge.org"><img id="logo" src="runt-logo.gif" title="Choose your own damn acronym" alt="runt logo"></a>Ruby Temporal Expressions</h1>
15
- <p><span class="keyword">Runt</span> is an implementation of select temporal patterns by <a href="http://www.martinfowler.com">Martin Fowler</a> in the super-fantastic <a href="http://ruby-lang.org"><span class="ruby-link">Ruby</span></a> language.
16
- <span class="keyword">Runt</span> provides:
17
- <ul>
18
- <li>ability to define recurring events using simple, set-like expressions</li>
19
- <li>an interfaced-based API for creating schedules for arbitrary events/objects</li>
20
- <li>precisioned date types using <a href="http://martinfowler.com/ap2/timePoint.html">Time Point</a>s</li>
21
- <li>date <a href="http://martinfowler.com/ap2/range.html">Range</a>s</li>
22
- <li>everlasting peace and/or eternal life</li>
23
- </ul>
24
- </p>
25
- <p>Visit our <a href="http://rubyforge.org/projects/runt/">project page</a> provided by the generous folks at <a href="http://rubyforge.org">Rubyforge</a>.</p>
26
- </div>
27
-
28
- <div class="content">
29
-
30
- <h2>Known Issues</h2>
31
- <p>
32
- <ul>
33
- <li>We are still learning <a href="http://ruby-lang.org"><span class="ruby-link">Ruby</span></a>. So far, this has been a distinctly painless experience.</li>
34
- <li>Supposedly, this page looks nasty in IE4.5/Mac.</li>
35
- </ul>
36
- </p>
37
- <h2>Credits</h2>
38
- <p>
39
- <ul>
40
- <li><a href="http://rubyforge.org">Rubyforge</a> for hosting this project</li>
41
- <li>
42
- <a href="http://martinfowler.com">M.Fowler</a>,<a href="http://ruby-lang.org">Matz</a>,
43
- T.Funaba(<a href="http://www.funaba.org/en/ruby.html">Date/DateTime</a>),
44
- <a href="mailto:ruby-talk@ruby-lang.org">ruby-talk</a>,
45
- <a href="http://pragmaticprogrammer.com">PragProgs</a>,
46
- J.Weirich(<a href="http://rake.rubyforge.org">Rake</a>), Hal Fulton, Mauricio Fernandez, and
47
- Mark Hubbart for the <a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/95465">thread</a> on c.l.r. that
48
- inspired a more Ruby-esque syntax for creating TE's. 2X Thanks to Hal, for taking the time to exchange
49
- ideas off-line.
50
- </li>
51
- <li><a href="http://www.bluerobot.com/web/layouts/">Blue Robot</a> for the CSS</li>
52
- <li>Emmett Shear for contributed <a href="http://runt.rubyforge.org/doc/classes/Runt/TExpr.html">TExpr#dates</a> code and several thought-provoking feature requests.</li>
53
- <li>Ira Burton for contributed <a href="http://runt.rubyforge.org/doc/classes/Runt/TExpr.html">DayIntervalTE class</a></li>
54
- </ul>
55
- </p>
56
- </div>
57
-
58
- <div id="contentFooter" class="content">
59
- <a href="http://www.digitalclash.com">&lt;&lt;<img id="dcl-logo" src="dcl-small.gif" title="Digital Clash LLC" alt="Digital Clash logo">&copy;2004, Digital Clash LLC&gt;&gt;</a>
60
- <br/><i>&quot;The weather is here, wish you were beautiful...&quot;</i>
61
- </div>
62
-
63
- <div id="navAlpha">
64
- <h2>Links</h2>
65
- <p>
66
- <a href="http://rubyforge.org/projects/runt/" title="Download Runt">Download</a><br>
67
- <a href="./doc/index.html" title="RDoc for Runt">RDocs</a><br>
68
- <a href="./doc/files/doc/tutorial_te_rdoc.html" title="TE Tutorial">Tutorial</a><br>
69
- <a href="./doc/files/README.html">README</a><br/>
70
- <a href="./doc/files/TODO.html">TODO</a><br/>
71
- <a href="./doc/files/CHANGES.html">CHANGES</a><br/>
72
- ----<br/>
73
- <a href="http://ChronicJ.org/" title="ChronicJ project">ChronicJ</a><br>
74
- </p>
75
- </div>
76
-
77
- <div id="navBeta">
78
- <h2>Suggested Reading</h2>
79
- <p>Most of the usage and design patterns contained in this library are based on a series of articles by Martin Fowler. Some suggested reading:</p>
80
- <p>
81
- <a href="http://martinfowler.com/ap2/timeNarrative.html">Time Narrative</a><br/>
82
- <a href="http://martinfowler.com/apsupp/recurring.pdf">Recurring Events</a><br/>
83
- <a href="http://martinfowler.com/ap2/timePoint.html">Time Point</a><br/>
84
- <a href="http://martinfowler.com/ap2/range.html">Range</a><br/>
85
- ----<br/>
86
- <p><span class="keyword">Runt</span> was originally hacked in Java. Documentation for that project may also be helpful:</p>
87
- <a href="http://www.chronicj.org/apidocs/index.html" title="ChronicJ project">ChronicJ JavaDocs</a><br>
88
- </p>
89
- </div>
90
-
91
- <!-- BlueRobot was here. -->
92
-
93
- </body>
94
- </html>
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2
+ "http://www.w3.org/TR/html4/strict.dtd">
3
+
4
+ <html>
5
+ <head>
6
+ <title>Runt - Ruby Temporal Expressions</title>
7
+ <style type="text/css" media="screen">@import "blue-robot3.css";</style>
8
+
9
+ </head>
10
+
11
+ <body>
12
+
13
+ <div class="content">
14
+ <h1><a href="http://runt.rubyforge.org"><img id="logo" src="runt-logo.gif" title="Choose your own damn acronym" alt="runt logo"></a>Ruby Temporal Expressions</h1>
15
+ <p><span class="keyword">Runt</span> is an implementation of select temporal patterns by <a href="http://www.martinfowler.com">Martin Fowler</a> in the super-fantastic <a href="http://ruby-lang.org"><span class="ruby-link">Ruby</span></a> language.
16
+ <span class="keyword">Runt</span> provides:
17
+ <ul>
18
+ <li>ability to define recurring events using simple, set-like expressions</li>
19
+ <li>an interfaced-based API for creating schedules for arbitrary events/objects</li>
20
+ <li>precisioned date types using <a href="http://martinfowler.com/ap2/timePoint.html">Time Point</a>s</li>
21
+ <li>date <a href="http://martinfowler.com/ap2/range.html">Range</a>s</li>
22
+ <li>everlasting peace and/or eternal life</li>
23
+ </ul>
24
+ </p>
25
+ <p>Visit our <a href="http://rubyforge.org/projects/runt/">project page</a> provided by the generous folks at <a href="http://rubyforge.org">Rubyforge</a>.</p>
26
+ </div>
27
+
28
+ <div class="content">
29
+
30
+ <h2>Getting Started</h2>
31
+ <p>
32
+ Check out the <a href="./doc/files/doc/tutorial_te_rdoc.html" title="TE Tutorial">temporal expressions tutorial</a>. Then try
33
+ <a href="./doc/files/doc/tutorial_schedule_rdoc.html" title="Schedule Tutorial">schedule tutorial</a> and finally,
34
+ <a href="./doc/files/doc/tutorial_sugar_rdoc.html" title="Sugar Tutorial">sugar tutorial</a> for some useful shortcuts.
35
+ </p>
36
+ </div>
37
+
38
+ <div id="contentFooter" class="content">
39
+ <a href="http://www.digitalclash.com">&lt;&lt;<img id="dcl-logo" src="dcl-small.gif" title="Digital Clash LLC" alt="Digital Clash logo">&copy;2008, Digital Clash LLC&gt;&gt;</a>
40
+ <br/><i>&quot;The weather is here, wish you were beautiful...&quot;</i>
41
+ </div>
42
+
43
+ <div id="navAlpha">
44
+ <h2>Links</h2>
45
+ <p>
46
+ <a href="http://rubyforge.org/projects/runt/" title="Download Runt">Download</a><br>
47
+ ----<br/>
48
+ <a href="./doc/index.html" title="RDoc for Runt">RDocs</a><br>
49
+ <a href="./doc/files/doc/tutorial_te_rdoc.html" title="TE Tutorial">Expression Tutorial</a><br>
50
+ <a href="./doc/files/doc/tutorial_schedule_rdoc.html" title="Schedule Tutorial">Schedule Tutorial</a><br>
51
+ <a href="./doc/files/doc/tutorial_sugar_rdoc.html" title="Sugar Tutorial">Sugar Tutorial</a><br>
52
+ ----<br/>
53
+ <a href="./doc/files/README.html">README</a><br/>
54
+ <a href="./doc/files/CHANGES.html">CHANGES</a><br/>
55
+ </p>
56
+ </div>
57
+
58
+ <div id="navBeta">
59
+ <h2>Suggested Reading</h2>
60
+ <p>Most of the usage and design patterns contained in this library are based on a series of articles by Martin Fowler. Some suggested reading:</p>
61
+ <p>
62
+ <a href="http://martinfowler.com/ap2/timeNarrative.html">Time Narrative</a><br/>
63
+ <a href="http://martinfowler.com/apsupp/recurring.pdf">Recurring Events</a><br/>
64
+ <a href="http://martinfowler.com/ap2/timePoint.html">Time Point</a><br/>
65
+ <a href="http://martinfowler.com/ap2/range.html">Range</a><br/>
66
+ </p>
67
+ </div>
68
+
69
+ <!-- BlueRobot was here. -->
70
+
71
+ </body>
72
+ </html>
File without changes
Binary file
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'baseexpressiontest'
4
+
5
+ # Unit tests for AfterTE class
6
+ # Author:: Matthew Lipper
7
+
8
+ class AfterTETest < BaseExpressionTest
9
+
10
+ include TExpr
11
+
12
+ def test_include_inclusive
13
+ expr = AfterTE.new(@pdate_20071030, true)
14
+ assert !expr.include?(@date_20050101), "Should not include an earlier date"
15
+ assert expr.include?(@pdate_20071114), "Should include a later date"
16
+ assert expr.include?(@pdate_20071030), "Should include the same date"
17
+ end
18
+
19
+ def test_include_non_inclusive
20
+ expr = AfterTE.new(@pdate_20071030)
21
+ assert !expr.include?(@date_20050101), "Should not include an earlier date"
22
+ assert expr.include?(@pdate_20071114), "Should include a later date"
23
+ assert !expr.include?(@pdate_20071030), "Should not include the same date"
24
+ end
25
+
26
+ def test_to_s
27
+ expr = AfterTE.new(@pdate_20071114)
28
+ assert_equal "after #{Runt.format_date(@pdate_20071114)}", expr.to_s
29
+ end
30
+
31
+ end