copyright 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,2 +1,2 @@
1
- lib/copyright.rb a8d9d93e893b4de1d450cafc9b3416c13a45acf1
2
1
  LICENSE fbbe6793cea495dc7ab7a7c037bd2dc585d22327
2
+ lib/copyright_helper.rb e4d17757ddaeb20eaa98866869cf35351d1714db
Binary file
data/README.md CHANGED
@@ -6,7 +6,7 @@ Ruby on Rails plugin to add a helper method for copyright period
6
6
 
7
7
  require 'rubygems'
8
8
  require 'copyright'
9
- include CopyrightYears
9
+
10
10
 
11
11
  ## Author
12
12
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{copyright}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Takaaki Kato"]
@@ -20,8 +20,8 @@ Gem::Specification.new do |s|
20
20
  ".document",
21
21
  ".gitignore",
22
22
  ".yardoc/checksums",
23
- ".yardoc/objects/CopyrightYears.dat",
24
- ".yardoc/objects/CopyrightYears/copyright_years_i.dat",
23
+ ".yardoc/objects/CopyrightHelper.dat",
24
+ ".yardoc/objects/CopyrightHelper/copyright_years_i.dat",
25
25
  ".yardoc/objects/root.dat",
26
26
  ".yardoc/proxy_types",
27
27
  "LICENSE",
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
  "Rakefile",
30
30
  "VERSION",
31
31
  "copyright.gemspec",
32
+ "doc/CopyrightHelper.html",
32
33
  "doc/CopyrightYears.html",
33
34
  "doc/_index.html",
34
35
  "doc/class_list.html",
@@ -44,7 +45,7 @@ Gem::Specification.new do |s|
44
45
  "doc/method_list.html",
45
46
  "doc/top-level-namespace.html",
46
47
  "init.rb",
47
- "lib/copyright.rb",
48
+ "lib/copyright_helper.rb",
48
49
  "test/test_copyright.rb",
49
50
  "test/test_helper.rb"
50
51
  ]
@@ -0,0 +1,234 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta name="Content-Type" content="text/html; charset=UTF-8" />
6
+ <title>Module: CopyrightHelper</title>
7
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
+
10
+ <script type="text/javascript" charset="utf-8">
11
+ relpath = '';
12
+ if (relpath != '') relpath += '/';
13
+ </script>
14
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
+
17
+ </head>
18
+ <body>
19
+ <div id="header">
20
+ <div id="menu">
21
+
22
+ <a href="_index.html">Index (C)</a> &raquo;
23
+
24
+
25
+ <span class="title">CopyrightHelper</span>
26
+
27
+ </div>
28
+
29
+ <div id="search">
30
+ <a id="class_list_link" href="#">Namespace List</a>
31
+ <a id="method_list_link" href="#">Method List</a>
32
+ <a id ="file_list_link" href="#">File List</a>
33
+ </div>
34
+
35
+ <div class="clear"></div>
36
+ </div>
37
+
38
+ <iframe id="search_frame"></iframe>
39
+
40
+ <div id="content"><h1>Module: CopyrightHelper
41
+
42
+
43
+ </h1>
44
+
45
+ <dl class="box">
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+ <dt class="r1 last">Defined in:</dt>
54
+ <dd class="r1 last">lib/copyright_helper.rb</dd>
55
+
56
+ </dl>
57
+ <div class="clear"></div>
58
+
59
+ <h2>Overview</h2><div class="docstring">
60
+ <div class="discussion">
61
+ <p>
62
+ Adds a method for copyright period
63
+ </p>
64
+
65
+
66
+ </div>
67
+ </div>
68
+ <div class="tags">
69
+ <h3>Author:</h3>
70
+ <ul class="author">
71
+
72
+ <li>
73
+
74
+
75
+
76
+
77
+
78
+
79
+ Takaaki Kato <takaaki.kato@gmail.com>
80
+
81
+
82
+
83
+ </li>
84
+
85
+ </ul>
86
+
87
+ </div>
88
+
89
+
90
+ <h2>Instance Method Summary</h2>
91
+
92
+ <ul class="summary">
93
+
94
+ <li class="public ">
95
+ <span class="summary_signature">
96
+
97
+ <a href="#copyright_years-instance_method" title="#copyright_years (instance method)">- (Object) <strong>copyright_years</strong>(since) </a>
98
+
99
+
100
+
101
+ </span>
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+ <span class="summary_desc">
110
+ Returns copyright period in years.
111
+
112
+ </span>
113
+
114
+ </li>
115
+
116
+
117
+ </ul>
118
+
119
+
120
+ <div id="instance_method_details" class="method_details_list">
121
+ <h2>Instance Method Details</h2>
122
+
123
+
124
+ <div class="method_details first">
125
+ <p class="signature first" id="copyright_years-instance_method">
126
+
127
+ - (<tt>Object</tt>) <strong>copyright_years</strong>(since)
128
+
129
+
130
+
131
+ </p><div class="docstring">
132
+ <div class="discussion">
133
+ <p>
134
+ Returns copyright period in years
135
+ </p>
136
+
137
+
138
+ </div>
139
+ </div>
140
+ <div class="tags">
141
+
142
+ <div class="examples">
143
+ <h3>Examples:</h3>
144
+
145
+ <h4>
146
+ When the argument is the year of now
147
+
148
+ </h4>
149
+ <pre class="example code"> <span class='copyright_years identifier id'>copyright_years</span><span class='lparen token'>(</span><span class='integer val'>2009</span><span class='rparen token'>)</span> <span class='comment val'>#=&gt; &quot;2009&quot;</span>
150
+ </pre>
151
+
152
+ <h4>
153
+ When the argument if before of this year
154
+
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'>#=&gt; &quot;1997 - 2009&quot;</span>
157
+ </pre>
158
+
159
+ </div>
160
+ <h3>Parameters:</h3>
161
+ <ul class="param">
162
+
163
+ <li>
164
+
165
+ <span class='type'>(<tt>#is_a?(Integer)</tt>)</span>
166
+
167
+
168
+ <span class='name'></span>
169
+
170
+
171
+
172
+ </li>
173
+
174
+ </ul>
175
+ <h3>Raises:</h3>
176
+ <ul class="raise">
177
+
178
+ <li>
179
+
180
+ <span class='type'>(<tt>ArgumentError</tt>)</span>
181
+
182
+
183
+
184
+
185
+ </li>
186
+
187
+ </ul>
188
+
189
+ </div><table class="source_code">
190
+ <tr>
191
+ <td>
192
+ <pre class="lines">
193
+
194
+
195
+ 12
196
+ 13
197
+ 14
198
+ 15
199
+ 16
200
+ 17
201
+ 18
202
+ 19
203
+ 20</pre>
204
+ </td>
205
+ <td>
206
+ <pre class="code"><span class="info file"># File 'lib/copyright_helper.rb', line 12</span>
207
+
208
+ <span class='def def kw'>def</span> <span class='copyright_years identifier id'>copyright_years</span><span class='lparen token'>(</span><span class='since identifier id'>since</span><span class='rparen token'>)</span>
209
+ <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='string val'>&quot;Argument should be a number&quot;</span> <span class='unless unless_mod kw'>unless</span> <span class='since identifier id'>since</span><span class='dot token'>.</span><span class='is_a? fid id'>is_a?</span><span class='lparen token'>(</span><span class='Integer constant id'>Integer</span><span class='rparen token'>)</span>
210
+ <span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='comma token'>,</span> <span class='string val'>&quot;since should not be a future&quot;</span> <span class='if if_mod 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='gt op'>&gt;</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>
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
+ <span class='since identifier id'>since</span><span class='dot token'>.</span><span class='to_s identifier id'>to_s</span>
213
+ <span class='else else kw'>else</span>
214
+ <span class='dstring node'>&quot;#{since} - #{Date.today.year}&quot;</span>
215
+ <span class='end end kw'>end</span>
216
+ <span class='end end kw'>end</span>
217
+ </pre>
218
+ </td>
219
+ </tr>
220
+ </table>
221
+ </div>
222
+
223
+ </div>
224
+
225
+ </div>
226
+
227
+ <div id="footer">
228
+ Generated on Mon Dec 28 06:46:33 2009 by
229
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
230
+ 0.5.2 (ruby-1.8.7).
231
+ </div>
232
+
233
+ </body>
234
+ </html>
@@ -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 05:44:10 2009 by
228
+ Generated on Mon Dec 28 05:56:21 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>
@@ -66,7 +66,7 @@
66
66
  <ul>
67
67
 
68
68
  <li>
69
- <a href="CopyrightYears.html" title="CopyrightYears">CopyrightYears</a>
69
+ <a href="CopyrightHelper.html" title="CopyrightHelper">CopyrightHelper</a>
70
70
 
71
71
  </li>
72
72
 
@@ -79,7 +79,7 @@
79
79
  </div></div>
80
80
 
81
81
  <div id="footer">
82
- Generated on Mon Dec 28 05:44:10 2009 by
82
+ Generated on Mon Dec 28 06:46:33 2009 by
83
83
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
84
84
  0.5.2 (ruby-1.8.7).
85
85
  </div>
@@ -25,7 +25,7 @@
25
25
 
26
26
  <li class="r2 ">
27
27
 
28
- <a href="CopyrightYears.html" title="CopyrightYears">CopyrightYears</a>
28
+ <a href="CopyrightHelper.html" title="CopyrightHelper">CopyrightHelper</a>
29
29
 
30
30
 
31
31
 
@@ -57,7 +57,7 @@
57
57
  <p>Copyright (c) 2009 Takaaki Kato. See LICENSE for details.</p></div></div>
58
58
 
59
59
  <div id="footer">
60
- Generated on Mon Dec 28 05:44:10 2009 by
60
+ Generated on Mon Dec 28 06:46:33 2009 by
61
61
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
62
62
  0.5.2 (ruby-1.8.7).
63
63
  </div>
@@ -57,7 +57,7 @@
57
57
  <p>Copyright (c) 2009 Takaaki Kato. See LICENSE for details.</p></div></div>
58
58
 
59
59
  <div id="footer">
60
- Generated on Mon Dec 28 05:44:10 2009 by
60
+ Generated on Mon Dec 28 06:46:33 2009 by
61
61
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
62
62
  0.5.2 (ruby-1.8.7).
63
63
  </div>
@@ -18,9 +18,9 @@
18
18
 
19
19
  <li class="r1 ">
20
20
 
21
- <a href="CopyrightYears.html#copyright_years-instance_method" title="#copyright_years">#copyright_years</a>
21
+ <a href="CopyrightHelper.html#copyright_years-instance_method" title="#copyright_years">#copyright_years</a>
22
22
 
23
- <small>(CopyrightYears)</small>
23
+ <small>(CopyrightHelper)</small>
24
24
 
25
25
 
26
26
 
@@ -57,7 +57,7 @@
57
57
  <p class="children">
58
58
 
59
59
 
60
- <strong class="modules">Modules:</strong> <a href="CopyrightYears.html" title="CopyrightYears">CopyrightYears</a>
60
+ <strong class="modules">Modules:</strong> <a href="CopyrightHelper.html" title="CopyrightHelper">CopyrightHelper</a>
61
61
 
62
62
 
63
63
 
@@ -70,7 +70,7 @@
70
70
  </div>
71
71
 
72
72
  <div id="footer">
73
- Generated on Mon Dec 28 05:44:10 2009 by
73
+ Generated on Mon Dec 28 06:46:33 2009 by
74
74
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool">yard</a>
75
75
  0.5.2 (ruby-1.8.7).
76
76
  </div>
data/init.rb CHANGED
@@ -1 +1 @@
1
- ActionController::Base.helper(CopyrightYears) if defined?(ActionController)
1
+ ActionController::Base.helper(CopyrightHelper)
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Adds a method for copyright period
4
4
  # @author Takaaki Kato <takaaki.kato@gmail.com>
5
- module CopyrightYears
5
+ module CopyrightHelper
6
6
  # Returns copyright period in years
7
7
  # @example When the argument is the year of now
8
8
  # copyright_years(2009) #=> "2009"
@@ -2,7 +2,7 @@
2
2
  # -*- coding: utf-8 -*-
3
3
 
4
4
  require 'test_helper'
5
- include CopyrightYears
5
+ include CopyrightHelper
6
6
 
7
7
  class CopyrightYearTest < Test::Unit::TestCase
8
8
 
@@ -5,5 +5,5 @@ require 'mocha'
5
5
 
6
6
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
7
7
  $LOAD_PATH.unshift(File.dirname(__FILE__))
8
- require 'copyright'
8
+ require 'copyright_helper'
9
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: copyright
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takaaki Kato
@@ -45,8 +45,8 @@ files:
45
45
  - .document
46
46
  - .gitignore
47
47
  - .yardoc/checksums
48
- - .yardoc/objects/CopyrightYears.dat
49
- - .yardoc/objects/CopyrightYears/copyright_years_i.dat
48
+ - .yardoc/objects/CopyrightHelper.dat
49
+ - .yardoc/objects/CopyrightHelper/copyright_years_i.dat
50
50
  - .yardoc/objects/root.dat
51
51
  - .yardoc/proxy_types
52
52
  - LICENSE
@@ -54,6 +54,7 @@ files:
54
54
  - Rakefile
55
55
  - VERSION
56
56
  - copyright.gemspec
57
+ - doc/CopyrightHelper.html
57
58
  - doc/CopyrightYears.html
58
59
  - doc/_index.html
59
60
  - doc/class_list.html
@@ -69,7 +70,7 @@ files:
69
70
  - doc/method_list.html
70
71
  - doc/top-level-namespace.html
71
72
  - init.rb
72
- - lib/copyright.rb
73
+ - lib/copyright_helper.rb
73
74
  - test/test_copyright.rb
74
75
  - test/test_helper.rb
75
76
  has_rdoc: true