copyright 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardoc/checksums +1 -1
- data/.yardoc/objects/CopyrightHelper/copyright_years_i.dat +0 -0
- data/VERSION +1 -1
- data/copyright.gemspec +1 -1
- data/doc/CopyrightHelper.html +3 -3
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -2
- data/doc/index.html +1 -2
- data/doc/top-level-namespace.html +1 -1
- data/lib/copyright_helper.rb +2 -2
- data/test/test_copyright.rb +1 -1
- metadata +1 -1
data/.yardoc/checksums
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
LICENSE fbbe6793cea495dc7ab7a7c037bd2dc585d22327
|
2
|
-
lib/copyright_helper.rb
|
2
|
+
lib/copyright_helper.rb 6c6d3d9c332fdca252ed76d057e285cf07beaa49
|
Binary file
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/copyright.gemspec
CHANGED
data/doc/CopyrightHelper.html
CHANGED
@@ -153,7 +153,7 @@ When the argument is the year of now
|
|
153
153
|
When the argument if before of this year
|
154
154
|
|
155
155
|
</h4>
|
156
|
-
<pre class="example code"> <span class='copyright_years identifier id'>copyright_years</span><span class='lparen token'>(</span><span class='integer val'>1997</span><span class='rparen token'>)</span> <span class='comment val'>#=> "1997
|
156
|
+
<pre class="example code"> <span class='copyright_years identifier id'>copyright_years</span><span class='lparen token'>(</span><span class='integer val'>1997</span><span class='rparen token'>)</span> <span class='comment val'>#=> "1997-2009"</span>
|
157
157
|
</pre>
|
158
158
|
|
159
159
|
</div>
|
@@ -211,7 +211,7 @@ When the argument if before of this year
|
|
211
211
|
<span class='if if kw'>if</span> <span class='Date constant id'>Date</span><span class='dot token'>.</span><span class='civil identifier id'>civil</span><span class='lparen token'>(</span><span class='since identifier id'>since</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='year identifier id'>year</span> <span class='eq op'>==</span> <span class='Date constant id'>Date</span><span class='dot token'>.</span><span class='today identifier id'>today</span><span class='dot token'>.</span><span class='year identifier id'>year</span>
|
212
212
|
<span class='since identifier id'>since</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span>
|
213
213
|
<span class='else else kw'>else</span>
|
214
|
-
<span class='dstring node'>"#{since}
|
214
|
+
<span class='dstring node'>"#{since}-#{Date.today.year}"</span>
|
215
215
|
<span class='end end kw'>end</span>
|
216
216
|
<span class='end end kw'>end</span>
|
217
217
|
</pre>
|
@@ -225,7 +225,7 @@ When the argument if before of this year
|
|
225
225
|
</div>
|
226
226
|
|
227
227
|
<div id="footer">
|
228
|
-
Generated on Mon Dec 28 06:
|
228
|
+
Generated on Mon Dec 28 06:59:01 2009 by
|
229
229
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
230
230
|
0.5.2 (ruby-1.8.7).
|
231
231
|
</div>
|
data/doc/_index.html
CHANGED
data/doc/file.README.html
CHANGED
@@ -43,7 +43,6 @@
|
|
43
43
|
|
44
44
|
<pre class="code"><span class='require identifier id'>require</span> <span class='string val'>'rubygems'</span>
|
45
45
|
<span class='require identifier id'>require</span> <span class='string val'>'copyright'</span>
|
46
|
-
<span class='include identifier id'>include</span> <span class='CopyrightYears constant id'>CopyrightYears</span>
|
47
46
|
</pre>
|
48
47
|
|
49
48
|
<h2 id='author'>Author</h2>
|
@@ -57,7 +56,7 @@
|
|
57
56
|
<p>Copyright (c) 2009 Takaaki Kato. See LICENSE for details.</p></div></div>
|
58
57
|
|
59
58
|
<div id="footer">
|
60
|
-
Generated on Mon Dec 28 06:
|
59
|
+
Generated on Mon Dec 28 06:59:01 2009 by
|
61
60
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
62
61
|
0.5.2 (ruby-1.8.7).
|
63
62
|
</div>
|
data/doc/index.html
CHANGED
@@ -43,7 +43,6 @@
|
|
43
43
|
|
44
44
|
<pre class="code"><span class='require identifier id'>require</span> <span class='string val'>'rubygems'</span>
|
45
45
|
<span class='require identifier id'>require</span> <span class='string val'>'copyright'</span>
|
46
|
-
<span class='include identifier id'>include</span> <span class='CopyrightYears constant id'>CopyrightYears</span>
|
47
46
|
</pre>
|
48
47
|
|
49
48
|
<h2 id='author'>Author</h2>
|
@@ -57,7 +56,7 @@
|
|
57
56
|
<p>Copyright (c) 2009 Takaaki Kato. See LICENSE for details.</p></div></div>
|
58
57
|
|
59
58
|
<div id="footer">
|
60
|
-
Generated on Mon Dec 28 06:
|
59
|
+
Generated on Mon Dec 28 06:59:01 2009 by
|
61
60
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
|
62
61
|
0.5.2 (ruby-1.8.7).
|
63
62
|
</div>
|
data/lib/copyright_helper.rb
CHANGED
@@ -7,7 +7,7 @@ module CopyrightHelper
|
|
7
7
|
# @example When the argument is the year of now
|
8
8
|
# copyright_years(2009) #=> "2009"
|
9
9
|
# @example When the argument if before of this year
|
10
|
-
# copyright_years(1997) #=> "1997
|
10
|
+
# copyright_years(1997) #=> "1997-2009"
|
11
11
|
# @param [#is_a?(Integer)]
|
12
12
|
def copyright_years(since)
|
13
13
|
raise ArgumentError, "Argument should be a number" unless since.is_a?(Integer)
|
@@ -15,7 +15,7 @@ module CopyrightHelper
|
|
15
15
|
if Date.civil(since).year == Date.today.year
|
16
16
|
since.to_s
|
17
17
|
else
|
18
|
-
"#{since}
|
18
|
+
"#{since}-#{Date.today.year}"
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
data/test/test_copyright.rb
CHANGED
@@ -24,7 +24,7 @@ class CopyrightYearTest < Test::Unit::TestCase
|
|
24
24
|
|
25
25
|
should "return 2009 - 2010 when the argument is not the year of 'since'" do
|
26
26
|
years = copyright_years(2006)
|
27
|
-
assert_equal("2006
|
27
|
+
assert_equal("2006-2009", years)
|
28
28
|
end
|
29
29
|
|
30
30
|
should "raise the argument is bigger than the this year" do
|