Commit 60fc98a2 by Cuong Tran
parent 7b5d2ed7
== 0.0.1 2008-02-27
== 1.0.2 2008-03-22
* Add contributions from Michael Bumann (http://github.com/bumi)
* added an option "position" to choose to put the annotation,
* spec/fixtures now also get annotated
* added a task to remove the annotations
* these options can be specified from command line as -d and -p [before|after]
* 1 major enhancement:
* Initial release
......@@ -28,6 +28,9 @@ created comment block.
cd [your project]
annotate
annotate -d
annotate -p [before|after]
annotate -h
== Source
......@@ -41,6 +44,7 @@ Released under the same license as Ruby. No Support. No Warranty.
== Modifications
- alex@pivotallabs.com
- ctran@pragmaquest.com
- Jack Danger at http://6brand.com/
- Cuong Tran - http://github.com/ctran
- Jack Danger - http://github.com/JackDanger
- Michael Bumann - http://github.com/bumi
#!/usr/bin/env ruby
require 'optparse'
require 'annotate_models/tasks'
Rake::Task['annotate_models'].invoke
task = "annotate_models"
OptionParser.new do |opts|
opts.banner = "Usage: annotate [options]"
opts.on('-d', '--delete') { task = "remove_annotation" }
opts.on('-p', '--position [before|after]', ['before', 'after']) { |p| ENV['position'] = p }
end.parse!
Rake::Task[task].invoke
Mon, 10 Mar 2008 02:26:29 -0500
Sat, 22 Mar 2008 21:58:55 -0500
......@@ -56,7 +56,7 @@
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Mon Mar 10 01:50:15 -0500 2008</td>
<td>Sat Mar 22 21:48:28 -0500 2008</td>
</tr>
</table>
</div>
......@@ -69,12 +69,23 @@
<div id="contextContent">
<div id="description">
<h2>0.0.1 2008-02-27</h2>
<h2>1.0.2 2008-03-22</h2>
<ul>
<li>1 major enhancement:
<li>Add contributions from Michael Bumann (<a
href="http://github.com/bumi">github.com/bumi</a>)
<ul>
<li>Initial release
<li>added an option &quot;position&quot; to choose to put the annotation,
</li>
<li>spec/fixtures now also get annotated
</li>
<li>added a task to remove the annotations
</li>
<li>these options can be specified from command line as -d and -p
[before|after]
</li>
</ul>
......
......@@ -56,7 +56,7 @@
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Mon Mar 10 01:50:15 -0500 2008</td>
<td>Sat Mar 22 20:47:25 -0500 2008</td>
</tr>
</table>
</div>
......
......@@ -56,7 +56,7 @@
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Mon Mar 10 01:50:15 -0500 2008</td>
<td>Sat Mar 22 21:53:08 -0500 2008</td>
</tr>
</table>
</div>
......@@ -103,6 +103,9 @@ block.
<pre>
cd [your project]
annotate
annotate -d
annotate -p [before|after]
annotate -h
</pre>
<h2>Source</h2>
<pre>
......@@ -119,7 +122,9 @@ Released under the same license as Ruby. No Support. No Warranty.
<h2>Modifications</h2>
<pre>
- alex@pivotallabs.com
- ctran@pragmaquest.com
- Cuong Tran - http://github.com/ctran
- Jack Danger - http://github.com/JackDanger
- Michael Bumann - http://github.com/bumi
</pre>
</div>
......
......@@ -56,7 +56,7 @@
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Mon Mar 10 02:16:17 -0500 2008</td>
<td>Sat Mar 22 21:29:04 -0500 2008</td>
</tr>
</table>
</div>
......@@ -73,6 +73,7 @@
<h3 class="section-bar">Required files</h3>
<div class="name-list">
optparse&nbsp;&nbsp;
annotate_models/tasks&nbsp;&nbsp;
</div>
</div>
......
......@@ -56,7 +56,7 @@
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Mon Mar 10 02:16:17 -0500 2008</td>
<td>Sat Mar 22 20:47:25 -0500 2008</td>
</tr>
</table>
</div>
......
......@@ -56,7 +56,7 @@
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Mon Mar 10 02:19:56 -0500 2008</td>
<td>Sat Mar 22 21:42:43 -0500 2008</td>
</tr>
</table>
</div>
......
......@@ -56,7 +56,7 @@
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Mon Mar 10 02:19:56 -0500 2008</td>
<td>Sat Mar 22 21:39:51 -0500 2008</td>
</tr>
</table>
</div>
......
......@@ -56,7 +56,7 @@
</tr>
<tr class="top-aligned-row">
<td><strong>Last Update:</strong></td>
<td>Mon Mar 10 01:50:15 -0500 2008</td>
<td>Sat Mar 22 21:56:42 -0500 2008</td>
</tr>
</table>
</div>
......@@ -105,7 +105,13 @@ can run from command line
h2. Demonstration of usage
</p>
<p>
Go to your RAILS_ROOT dir, then run <tt>annotate</tt>
Go to your project dir (RAILS_ROOT), then run: <tt>annotate</tt>
</p>
<p>
To remove annotations: <tt>annotate -d</tt>
</p>
<p>
To add annotations at the end of files: <tt>annotate -p after</tt>
</p>
<p>
h2. How to submit patches
......@@ -116,7 +122,7 @@ href="http://drnicwilliams.com/2008/02/03/using-git-within-a-team">drnicwilliams
</p>
<p>
The trunk repository is <tt><a
href="http://github.com/ctran/annotate_models">github.com/ctran/annotate_models</a></tt>.
href="http://github.com/ctran/annotate_models">github.com/ctran/annotate_models</a></tt>
</p>
<p>
A svn mirror is on rubyforge
......
......@@ -5,12 +5,12 @@
<!--
annotate-models's annotate-models-1.0.1 Documentation
annotate-models-1.0.2 Documentation
-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title> annotate-models's annotate-models-1.0.1 Documentation</title>
<title> annotate-models-1.0.2 Documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<frameset rows="20%, 80%">
......
......@@ -46,9 +46,14 @@ module AnnotateModels
end
# Add a schema block to a file. If the file already contains
# a schema info block (a comment starting
# with "Schema as of ..."), remove it first.
# a schema info block (a comment starting with "Schema as of ..."), remove it first.
#
# === Options (opts)
# :position<Symbol>:: where to place the annotated section in fixture or model file,
# "before" or "after". Default is "before".
# :position_in_class<Symbol>:: where to place the annotated section in model file
# :position_in_fixture<Symbol>:: where to place the annotated section in fixture file
#
def annotate_one_file(file_name, info_block, options={})
if File.exist?(file_name)
content = File.read(file_name)
......@@ -57,7 +62,7 @@ module AnnotateModels
content.sub!(/^# #{PREFIX}.*?\n(#.*\n)*\n/, '')
# Write it back
new_content = options[:position] == "before" ? (info_block + content) : (content + info_block)
new_content = options[:position] == "after" ? (content + info_block) : (info_block + content)
File.open(file_name, "w") { |f| f.puts new_content }
end
end
......
......@@ -2,7 +2,7 @@ module AnnotateModels #:nodoc:
module VERSION #:nodoc:
MAJOR = 1
MINOR = 0
TINY = 1
TINY = 2
STRING = [MAJOR, MINOR, TINY].join('.')
end
......
......@@ -33,7 +33,7 @@
<h1>annotate-models</h1>
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/annotate-models"; return false'>
<p>Get Version</p>
<a href="http://rubyforge.org/projects/annotate-models" class="numbers">1.0.1</a>
<a href="http://rubyforge.org/projects/annotate-models" class="numbers">1.0.2</a>
</div>
<h1>&#x2192; &#8216;annotate-models&#8217;</h1>
......@@ -62,7 +62,13 @@ This is now a gem that can run from command line</p>
<h2>Demonstration of usage</h2>
<p>Go to your <span class="caps">RAILS</span>_ROOT dir, then run <code>annotate</code></p>
<p>Go to your project dir (RAILS_ROOT), then run: <code>annotate</code></p>
<p>To remove annotations: <code>annotate -d</code></p>
<p>To add annotations at the end of files: <code>annotate -p after</code></p>
<h2>How to submit patches</h2>
......@@ -71,7 +77,7 @@ This is now a gem that can run from command line</p>
<p>See <a href="http://drnicwilliams.com/2008/02/03/using-git-within-a-team/">Using Git within a project</a></p>
<p>The trunk repository is <code>http://github.com/ctran/annotate_models</code>.</p>
<p>The trunk repository is <code>http://github.com/ctran/annotate_models</code></p>
<p>A svn mirror is on rubyforge <code>svn://rubyforge.org/var/svn/annotate-models/trunk</code></p>
......@@ -88,7 +94,7 @@ This is now a gem that can run from command line</p>
<p>Comments are welcome. Send an email to <a href="mailto:ctran@pragmaquest.com">Cuong Tran</a></p>
<p class="coda">
<a href="http://www.pragmaquest.com">Cuong Tran</a>, 10th March 2008<br>
<a href="http://www.pragmaquest.com">Cuong Tran</a>, 22nd March 2008<br>
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
</p>
</div>
......
......@@ -21,13 +21,17 @@ This is now a gem that can run from command line
h2. Demonstration of usage
Go to your RAILS_ROOT dir, then run <code>annotate</code>
Go to your project dir (RAILS_ROOT), then run: <code>annotate</code>
To remove annotations: <code>annotate -d</code>
To add annotations at the end of files: <code>annotate -p after</code>
h2. How to submit patches
See "Using Git within a project":http://drnicwilliams.com/2008/02/03/using-git-within-a-team/
The trunk repository is <code>http://github.com/ctran/annotate_models</code>.
The trunk repository is <code>http://github.com/ctran/annotate_models</code>
A svn mirror is on rubyforge <code>svn://rubyforge.org/var/svn/annotate-models/trunk</code>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment