Take the 2008 Git User's Survey and help out! [ hide ]

public
Fork of ctran/annotate_models
Description: Annotate ActiveRecord models as a gem
Homepage: http://agilewebdevelopment.com/plugins/annotate_models
Clone URL: git://github.com/dustin/annotate_models.git
Search Repo:
ctran (author)
Sat Mar 22 20:02:15 -0700 2008
commit  60fc98a2525dbb00374776945e53af67f1c3ccf8
tree    480a0bde8a57aad611c8bbcb247fc7294a60a7d5
parent  7b5d2ed74fa2f4161dbd15ea838c6886a3839650
...
1
 
 
 
 
 
 
 
 
2
3
4
...
 
1
2
3
4
5
6
7
8
9
 
 
0
@@ -1,4 +1,9 @@
0
-== 0.0.1 2008-02-27
0
+== 1.0.2 2008-03-22
0
+
0
+* Add contributions from Michael Bumann (http://github.com/bumi)
0
+ * added an option "position" to choose to put the annotation,
0
+ * spec/fixtures now also get annotated
0
+ * added a task to remove the annotations
0
+ * these options can be specified from command line as -d and -p [before|after]
0
+
0
 
0
-* 1 major enhancement:
0
- * Initial release
...
28
29
30
 
 
 
31
32
33
...
41
42
43
44
45
 
 
 
46
...
28
29
30
31
32
33
34
35
36
...
44
45
46
 
 
47
48
49
50
0
@@ -28,6 +28,9 @@ created comment block.
0
 
0
   cd [your project]
0
   annotate
0
+ annotate -d
0
+ annotate -p [before|after]
0
+ annotate -h
0
 
0
 == Source
0
 
0
@@ -41,6 +44,7 @@ Released under the same license as Ruby. No Support. No Warranty.
0
 
0
 == Modifications
0
  - alex@pivotallabs.com
0
- - ctran@pragmaquest.com
0
- - Jack Danger at http://6brand.com/
0
+ - Cuong Tran - http://github.com/ctran
0
+ - Jack Danger - http://github.com/JackDanger
0
+ - Michael Bumann - http://github.com/bumi
0
 
...
1
 
 
2
3
4
 
 
 
 
 
 
 
5
 
...
1
2
3
4
5
 
6
7
8
9
10
11
12
13
14
0
@@ -1,5 +1,14 @@
0
 #!/usr/bin/env ruby
0
+
0
+require 'optparse'
0
 require 'annotate_models/tasks'
0
 
0
-Rake::Task['annotate_models'].invoke
0
+task = "annotate_models"
0
+
0
+OptionParser.new do |opts|
0
+ opts.banner = "Usage: annotate [options]"
0
+ opts.on('-d', '--delete') { task = "remove_annotation" }
0
+ opts.on('-p', '--position [before|after]', ['before', 'after']) { |p| ENV['position'] = p }
0
+end.parse!
0
 
0
+Rake::Task[task].invoke
...
1
 
...
 
1
0
@@ -1 +1 @@
0
-Mon, 10 Mar 2008 02:26:29 -0500
0
+Sat, 22 Mar 2008 21:58:55 -0500
...
56
57
58
59
 
60
61
62
...
69
70
71
72
 
73
74
 
 
75
76
77
 
 
 
 
 
 
 
 
 
 
 
78
79
80
...
56
57
58
 
59
60
61
62
...
69
70
71
 
72
73
 
74
75
76
77
 
78
79
80
81
82
83
84
85
86
87
88
89
90
91
0
@@ -56,7 +56,7 @@
0
     </tr>
0
     <tr class="top-aligned-row">
0
       <td><strong>Last Update:</strong></td>
0
- <td>Mon Mar 10 01:50:15 -0500 2008</td>
0
+ <td>Sat Mar 22 21:48:28 -0500 2008</td>
0
     </tr>
0
     </table>
0
   </div>
0
@@ -69,12 +69,23 @@
0
   <div id="contextContent">
0
 
0
     <div id="description">
0
- <h2>0.0.1 2008-02-27</h2>
0
+ <h2>1.0.2 2008-03-22</h2>
0
 <ul>
0
-<li>1 major enhancement:
0
+<li>Add contributions from Michael Bumann (<a
0
+href="http://github.com/bumi">github.com/bumi</a>)
0
 
0
 <ul>
0
-<li>Initial release
0
+<li>added an option &quot;position&quot; to choose to put the annotation,
0
+
0
+</li>
0
+<li>spec/fixtures now also get annotated
0
+
0
+</li>
0
+<li>added a task to remove the annotations
0
+
0
+</li>
0
+<li>these options can be specified from command line as -d and -p
0
+[before|after]
0
 
0
 </li>
0
 </ul>
...
56
57
58
59
 
60
61
62
...
56
57
58
 
59
60
61
62
0
@@ -56,7 +56,7 @@
0
     </tr>
0
     <tr class="top-aligned-row">
0
       <td><strong>Last Update:</strong></td>
0
- <td>Mon Mar 10 01:50:15 -0500 2008</td>
0
+ <td>Sat Mar 22 20:47:25 -0500 2008</td>
0
     </tr>
0
     </table>
0
   </div>
...
56
57
58
59
 
60
61
62
...
103
104
105
 
 
 
106
107
108
...
119
120
121
122
 
 
 
123
124
125
...
56
57
58
 
59
60
61
62
...
103
104
105
106
107
108
109
110
111
...
122
123
124
 
125
126
127
128
129
130
0
@@ -56,7 +56,7 @@
0
     </tr>
0
     <tr class="top-aligned-row">
0
       <td><strong>Last Update:</strong></td>
0
- <td>Mon Mar 10 01:50:15 -0500 2008</td>
0
+ <td>Sat Mar 22 21:53:08 -0500 2008</td>
0
     </tr>
0
     </table>
0
   </div>
0
@@ -103,6 +103,9 @@ block.
0
 <pre>
0
   cd [your project]
0
   annotate
0
+ annotate -d
0
+ annotate -p [before|after]
0
+ annotate -h
0
 </pre>
0
 <h2>Source</h2>
0
 <pre>
0
@@ -119,7 +122,9 @@ Released under the same license as Ruby. No Support. No Warranty.
0
 <h2>Modifications</h2>
0
 <pre>
0
  - alex@pivotallabs.com
0
- - ctran@pragmaquest.com
0
+ - Cuong Tran - http://github.com/ctran
0
+ - Jack Danger - http://github.com/JackDanger
0
+ - Michael Bumann - http://github.com/bumi
0
 </pre>
0
 
0
     </div>
...
56
57
58
59
 
60
61
62
...
73
74
75
 
76
77
78
...
56
57
58
 
59
60
61
62
...
73
74
75
76
77
78
79
0
@@ -56,7 +56,7 @@
0
     </tr>
0
     <tr class="top-aligned-row">
0
       <td><strong>Last Update:</strong></td>
0
- <td>Mon Mar 10 02:16:17 -0500 2008</td>
0
+ <td>Sat Mar 22 21:29:04 -0500 2008</td>
0
     </tr>
0
     </table>
0
   </div>
0
@@ -73,6 +73,7 @@
0
       <h3 class="section-bar">Required files</h3>
0
 
0
       <div class="name-list">
0
+ optparse&nbsp;&nbsp;
0
       annotate_models/tasks&nbsp;&nbsp;
0
       </div>
0
     </div>
...
56
57
58
59
 
60
61
62
...
56
57
58
 
59
60
61
62
0
@@ -56,7 +56,7 @@
0
     </tr>
0
     <tr class="top-aligned-row">
0
       <td><strong>Last Update:</strong></td>
0
- <td>Mon Mar 10 02:16:17 -0500 2008</td>
0
+ <td>Sat Mar 22 20:47:25 -0500 2008</td>
0
     </tr>
0
     </table>
0
   </div>
...
56
57
58
59
 
60
61
62
...
56
57
58
 
59
60
61
62
0
@@ -56,7 +56,7 @@
0
     </tr>
0
     <tr class="top-aligned-row">
0
       <td><strong>Last Update:</strong></td>
0
- <td>Mon Mar 10 02:19:56 -0500 2008</td>
0
+ <td>Sat Mar 22 21:42:43 -0500 2008</td>
0
     </tr>
0
     </table>
0
   </div>
...
56
57
58
59
 
60
61
62
...
56
57
58
 
59
60
61
62
0
@@ -56,7 +56,7 @@
0
     </tr>
0
     <tr class="top-aligned-row">
0
       <td><strong>Last Update:</strong></td>
0
- <td>Mon Mar 10 02:19:56 -0500 2008</td>
0
+ <td>Sat Mar 22 21:39:51 -0500 2008</td>
0
     </tr>
0
     </table>
0
   </div>
...
56
57
58
59
 
60
61
62
...
105
106
107
108
 
 
 
 
 
 
 
109
110
111
...
116
117
118
119
 
120
121
122
...
56
57
58
 
59
60
61
62
...
105
106
107
 
108
109
110
111
112
113
114
115
116
117
...
122
123
124
 
125
126
127
128
0
@@ -56,7 +56,7 @@
0
     </tr>
0
     <tr class="top-aligned-row">
0
       <td><strong>Last Update:</strong></td>
0
- <td>Mon Mar 10 01:50:15 -0500 2008</td>
0
+ <td>Sat Mar 22 21:56:42 -0500 2008</td>
0
     </tr>
0
     </table>
0
   </div>
0
@@ -105,7 +105,13 @@ can run from command line
0
 h2. Demonstration of usage
0
 </p>
0
 <p>
0
-Go to your RAILS_ROOT dir, then run <tt>annotate</tt>
0
+Go to your project dir (RAILS_ROOT), then run: <tt>annotate</tt>
0
+</p>
0
+<p>
0
+To remove annotations: <tt>annotate -d</tt>
0
+</p>
0
+<p>
0
+To add annotations at the end of files: <tt>annotate -p after</tt>
0
 </p>
0
 <p>
0
 h2. How to submit patches
0
@@ -116,7 +122,7 @@ href="http://drnicwilliams.com/2008/02/03/using-git-within-a-team">drnicwilliams
0
 </p>
0
 <p>
0
 The trunk repository is <tt><a
0
-href="http://github.com/ctran/annotate_models">github.com/ctran/annotate_models</a></tt>.
0
+href="http://github.com/ctran/annotate_models">github.com/ctran/annotate_models</a></tt>
0
 </p>
0
 <p>
0
 A svn mirror is on rubyforge
...
5
6
7
8
 
9
10
11
12
13
 
14
15
16
...
5
6
7
 
8
9
10
11
12
 
13
14
15
16
0
@@ -5,12 +5,12 @@
0
 
0
 <!--
0
 
0
- annotate-models's annotate-models-1.0.1 Documentation
0
+ annotate-models-1.0.2 Documentation
0
 
0
   -->
0
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
0
 <head>
0
- <title> annotate-models's annotate-models-1.0.1 Documentation</title>
0
+ <title> annotate-models-1.0.2 Documentation</title>
0
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
0
 </head>
0
 <frameset rows="20%, 80%">
...
46
47
48
49
50
51
 
 
 
 
 
 
 
 
52
53
54
...
57
58
59
60
 
61
62
63
...
46
47
48
 
 
 
49
50
51
52
53
54
55
56
57
58
59
...
62
63
64
 
65
66
67
68
0
@@ -46,9 +46,14 @@ module AnnotateModels
0
     end
0
 
0
     # Add a schema block to a file. If the file already contains
0
- # a schema info block (a comment starting
0
- # with "Schema as of ..."), remove it first.
0
-
0
+ # a schema info block (a comment starting with "Schema as of ..."), remove it first.
0
+ #
0
+ # === Options (opts)
0
+ # :position<Symbol>:: where to place the annotated section in fixture or model file,
0
+ # "before" or "after". Default is "before".
0
+ # :position_in_class<Symbol>:: where to place the annotated section in model file
0
+ # :position_in_fixture<Symbol>:: where to place the annotated section in fixture file
0
+ #
0
     def annotate_one_file(file_name, info_block, options={})
0
       if File.exist?(file_name)
0
         content = File.read(file_name)
0
@@ -57,7 +62,7 @@ module AnnotateModels
0
         content.sub!(/^# #{PREFIX}.*?\n(#.*\n)*\n/, '')
0
 
0
         # Write it back
0
- new_content = options[:position] == "before" ? (info_block + content) : (content + info_block)
0
+ new_content = options[:position] == "after" ? (content + info_block) : (info_block + content)
0
         File.open(file_name, "w") { |f| f.puts new_content }
0
       end
0
     end
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@ module AnnotateModels #:nodoc:
0
   module VERSION #:nodoc:
0
     MAJOR = 1
0
     MINOR = 0
0
- TINY = 1
0
+ TINY = 2
0
 
0
     STRING = [MAJOR, MINOR, TINY].join('.')
0
   end
...
33
34
35
36
 
37
38
39
...
62
63
64
65
 
 
 
 
 
 
 
66
67
68
...
71
72
73
74
 
75
76
77
...
88
89
90
91
 
92
93
94
...
33
34
35
 
36
37
38
39
...
62
63
64
 
65
66
67
68
69
70
71
72
73
74
...
77
78
79
 
80
81
82
83
...
94
95
96
 
97
98
99
100
0
@@ -33,7 +33,7 @@
0
     <h1>annotate-models</h1>
0
     <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/annotate-models"; return false'>
0
       <p>Get Version</p>
0
- <a href="http://rubyforge.org/projects/annotate-models" class="numbers">1.0.1</a>
0
+ <a href="http://rubyforge.org/projects/annotate-models" class="numbers">1.0.2</a>
0
     </div>
0
     <h1>&#x2192; &#8216;annotate-models&#8217;</h1>
0
 
0
@@ -62,7 +62,13 @@ This is now a gem that can run from command line</p>
0
   <h2>Demonstration of usage</h2>
0
 
0
 
0
- <p>Go to your <span class="caps">RAILS</span>_ROOT dir, then run <code>annotate</code></p>
0
+ <p>Go to your project dir (RAILS_ROOT), then run: <code>annotate</code></p>
0
+
0
+
0
+ <p>To remove annotations: <code>annotate -d</code></p>
0
+
0
+
0
+ <p>To add annotations at the end of files: <code>annotate -p after</code></p>
0
 
0
 
0
   <h2>How to submit patches</h2>
0
@@ -71,7 +77,7 @@ This is now a gem that can run from command line</p>
0
   <p>See <a href="http://drnicwilliams.com/2008/02/03/using-git-within-a-team/">Using Git within a project</a></p>
0
 
0
 
0
- <p>The trunk repository is <code>http://github.com/ctran/annotate_models</code>.</p>
0
+ <p>The trunk repository is <code>http://github.com/ctran/annotate_models</code></p>
0
 
0
 
0
   <p>A svn mirror is on rubyforge <code>svn://rubyforge.org/var/svn/annotate-models/trunk</code></p>
0
@@ -88,7 +94,7 @@ This is now a gem that can run from command line</p>
0
 
0
   <p>Comments are welcome. Send an email to <a href="mailto:ctran@pragmaquest.com">Cuong Tran</a></p>
0
     <p class="coda">
0
- <a href="http://www.pragmaquest.com">Cuong Tran</a>, 10th March 2008<br>
0
+ <a href="http://www.pragmaquest.com">Cuong Tran</a>, 22nd March 2008<br>
0
       Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
0
     </p>
0
 </div>
...
21
22
23
24
 
 
 
 
 
25
26
27
28
29
30
 
31
32
33
...
21
22
23
 
24
25
26
27
28
29
30
31
32
33
 
34
35
36
37
0
@@ -21,13 +21,17 @@ This is now a gem that can run from command line
0
 
0
 h2. Demonstration of usage
0
 
0
-Go to your RAILS_ROOT dir, then run <code>annotate</code>
0
+Go to your project dir (RAILS_ROOT), then run: <code>annotate</code>
0
+
0
+To remove annotations: <code>annotate -d</code>
0
+
0
+To add annotations at the end of files: <code>annotate -p after</code>
0
 
0
 h2. How to submit patches
0
 
0
 See "Using Git within a project":http://drnicwilliams.com/2008/02/03/using-git-within-a-team/
0
 
0
-The trunk repository is <code>http://github.com/ctran/annotate_models</code>.
0
+The trunk repository is <code>http://github.com/ctran/annotate_models</code>
0
 
0
 A svn mirror is on rubyforge <code>svn://rubyforge.org/var/svn/annotate-models/trunk</code>
0
 

Comments

    No one has commented yet.