Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
annotate
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
annotate
Commits
60fc98a2
Commit
60fc98a2
authored
Mar 22, 2008
by
Cuong Tran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge changes from
http://github.com/bumi/annotate_models/tree/master
parent
7b5d2ed7
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
90 additions
and
34 deletions
+90
-34
History.txt
History.txt
+8
-3
README.txt
README.txt
+6
-2
annotate
bin/annotate
+10
-1
created.rid
doc/created.rid
+1
-1
History_txt.html
doc/files/History_txt.html
+15
-4
License_txt.html
doc/files/License_txt.html
+1
-1
README_txt.html
doc/files/README_txt.html
+7
-2
annotate.html
doc/files/bin/annotate.html
+2
-1
tasks_rb.html
doc/files/lib/annotate_models/tasks_rb.html
+1
-1
version_rb.html
doc/files/lib/annotate_models/version_rb.html
+1
-1
annotate_models_rb.html
doc/files/lib/annotate_models_rb.html
+1
-1
index_txt.html
doc/files/website/index_txt.html
+9
-3
index.html
doc/index.html
+2
-2
annotate_models.rb
lib/annotate_models.rb
+9
-4
version.rb
lib/annotate_models/version.rb
+1
-1
index.html
website/index.html
+10
-4
index.txt
website/index.txt
+6
-2
No files found.
History.txt
View file @
60fc98a2
== 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
README.txt
View file @
60fc98a2
...
...
@@ -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
bin/annotate
View file @
60fc98a2
#!/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
doc/created.rid
View file @
60fc98a2
Mon, 10 Mar 2008 02:26:29
-0500
Sat, 22 Mar 2008 21:58:55
-0500
doc/files/History_txt.html
View file @
60fc98a2
...
...
@@ -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
"
position
"
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>
...
...
doc/files/License_txt.html
View file @
60fc98a2
...
...
@@ -56,7 +56,7 @@
</tr>
<tr
class=
"top-aligned-row"
>
<td><strong>
Last Update:
</strong></td>
<td>
Mon Mar 10 01:50:1
5 -0500 2008
</td>
<td>
Sat Mar 22 20:47:2
5 -0500 2008
</td>
</tr>
</table>
</div>
...
...
doc/files/README_txt.html
View file @
60fc98a2
...
...
@@ -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>
...
...
doc/files/bin/annotate.html
View file @
60fc98a2
...
...
@@ -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
annotate_models/tasks
</div>
</div>
...
...
doc/files/lib/annotate_models/tasks_rb.html
View file @
60fc98a2
...
...
@@ -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>
...
...
doc/files/lib/annotate_models/version_rb.html
View file @
60fc98a2
...
...
@@ -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>
...
...
doc/files/lib/annotate_models_rb.html
View file @
60fc98a2
...
...
@@ -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>
...
...
doc/files/website/index_txt.html
View file @
60fc98a2
...
...
@@ -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
...
...
doc/index.html
View file @
60fc98a2
...
...
@@ -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%"
>
...
...
lib/annotate_models.rb
View file @
60fc98a2
...
...
@@ -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
...
...
lib/annotate_models/version.rb
View file @
60fc98a2
...
...
@@ -2,7 +2,7 @@ module AnnotateModels #:nodoc:
module
VERSION
#:nodoc:
MAJOR
=
1
MINOR
=
0
TINY
=
1
TINY
=
2
STRING
=
[
MAJOR
,
MINOR
,
TINY
].
join
(
'.'
)
end
...
...
website/index.html
View file @
60fc98a2
...
...
@@ -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>
→
‘
annotate-models
’
</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>
...
...
website/index.txt
View file @
60fc98a2
...
...
@@ -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>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment