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
0c3673a3
Commit
0c3673a3
authored
Dec 25, 2008
by
Marcos Augusto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some fixes
parent
b331d071
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
18 deletions
+21
-18
README.rdoc
README.rdoc
+1
-1
Rakefile
Rakefile
+5
-7
annotate.gemspec
annotate.gemspec
+6
-6
annotate.rb
lib/annotate.rb
+1
-1
annotate_models.rb
lib/annotate_models/annotate_models.rb
+4
-3
annotate_routes.rb
lib/annotate_routes/annotate_routes.rb
+4
-0
No files found.
README.rdoc
View file @
0c3673a3
...
...
@@ -106,7 +106,7 @@ AnnotateModels mods by:
AnnotateRoutes originally by:
Gavin Montague ( http://github.com/
G
ovan/annotate-routes )
Gavin Montague ( http://github.com/
g
ovan/annotate-routes )
== Forked from:
...
...
Rakefile
View file @
0c3673a3
...
...
@@ -4,15 +4,13 @@ require File.dirname(__FILE__) + '/lib/annotate'
# Generate all the Rake tasks
# Run 'rake -T' to see list of generated tasks (from gem root directory)
$hoe
=
Hoe
.
new
(
'annotate'
,
Annotate
::
VERSION
)
do
|
p
|
p
.
developer
(
'
FIXME full name'
,
'FIXME email
'
)
p
.
developer
(
'
Marcos Piccinini'
,
'x@nofxx.com
'
)
p
.
changes
=
p
.
paragraphs_of
(
"History.txt"
,
0
..
1
).
join
(
"
\n\n
"
)
p
.
rubyforge_name
=
p
.
name
# TODO this is default value
#p.summary
p
.
rubyforge_name
=
p
.
name
p
.
url
=
"http://github.com/nofxx/annotate"
p
.
summary
=
"Annotates Rails Models and Routes"
p
.
description
=
"Annotates Rails Models and Routes"
# p.extra_deps = [
# ['activesupport','>= 2.0.2'],
# ]
p
.
extra_dev_deps
=
[
[
'newgem'
,
">=
#{
::
Newgem
::
VERSION
}
"
]
]
...
...
annotate.gemspec
View file @
0c3673a3
...
...
@@ -2,24 +2,24 @@
Gem
::
Specification
.
new
do
|
s
|
s
.
name
=
%q{annotate}
s
.
version
=
"2.
0.8
"
s
.
version
=
"2.
1.0
"
s
.
required_rubygems_version
=
Gem
::
Requirement
.
new
(
">= 0"
)
if
s
.
respond_to?
:required_rubygems_version
=
s
.
authors
=
[
"
FIXME full name
"
]
s
.
authors
=
[
"
Marcos Piccinini
"
]
s
.
date
=
%q{2008-12-25}
s
.
default_executable
=
%q{annotate}
s
.
description
=
%q{}
s
.
email
=
[
"
FIXME email
"
]
s
.
description
=
%q{
Annotates Rails Models and Routes
}
s
.
email
=
[
"
x@nofxx.com
"
]
s
.
executables
=
[
"annotate"
]
s
.
extra_rdoc_files
=
[
"History.txt"
,
"License.txt"
,
"Manifest.txt"
,
"README.rdoc"
]
s
.
files
=
[
"History.txt"
,
"License.txt"
,
"Manifest.txt"
,
"README.rdoc"
,
"Rakefile"
,
"annotate.gemspec"
,
"bin/annotate"
,
"config/hoe.rb"
,
"config/requirements.rb"
,
"lib/annotate.rb"
,
"lib/annotate_models/annotate_models.rb"
,
"lib/annotate_routes/annotate_routes.rb"
,
"lib/tasks/annotate_models.rake"
,
"lib/tasks/annotate_routes.rake"
,
"script/console"
,
"script/destroy"
,
"script/generate"
,
"setup.rb"
,
"spec/annotate_spec.rb"
,
"spec/spec.opts"
,
"spec/spec_helper.rb"
,
"tasks/rspec.rake"
]
s
.
has_rdoc
=
true
s
.
homepage
=
%q{
sudo gem install nofxx-
annotate}
s
.
homepage
=
%q{
http://github.com/nofxx/
annotate}
s
.
rdoc_options
=
[
"--main"
,
"README.rdoc"
]
s
.
require_paths
=
[
"lib"
]
s
.
rubyforge_project
=
%q{annotate}
s
.
rubygems_version
=
%q{1.3.1}
s
.
summary
=
%q{}
s
.
summary
=
%q{
Annotates Rails Models and Routes
}
if
s
.
respond_to?
:specification_version
then
current_version
=
Gem
::
Specification
::
CURRENT_SPECIFICATION_VERSION
...
...
lib/annotate.rb
View file @
0c3673a3
...
...
@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless
$:
.
include?
(
File
.
dirname
(
__FILE__
))
||
$:
.
include?
(
File
.
expand_path
(
File
.
dirname
(
__FILE__
)))
module
Annotate
VERSION
=
'2.
0.8
'
VERSION
=
'2.
1.0
'
end
...
...
lib/annotate_models/annotate_models.rb
View file @
0c3673a3
...
...
@@ -7,6 +7,7 @@ module AnnotateModels
# Object Daddy http://github.com/flogic/object_daddy/tree/master
EXEMPLARS_DIR
=
File
.
join
(
RAILS_ROOT
,
"spec/exemplars"
)
PREFIX
=
"== Schema Information"
COMPAT_PREFIX
=
"== Schema Info"
# Simple quoting for the default column value
def
quote
(
value
)
...
...
@@ -79,7 +80,7 @@ module AnnotateModels
false
else
# Remove old schema info
old_content
.
sub!
(
/^#
#{
PREFIX
}
.*?\n(#.*\n)*\n/
,
''
)
old_content
.
sub!
(
/^#
#{
COMPAT_
PREFIX
}
.*?\n(#.*\n)*\n/
,
''
)
# Write it back
new_content
=
options
[
:position
]
==
"before"
?
(
info_block
+
old_content
)
:
(
old_content
+
"
\n
"
+
info_block
)
...
...
@@ -94,7 +95,7 @@ module AnnotateModels
if
File
.
exist?
(
file_name
)
content
=
File
.
read
(
file_name
)
content
.
sub!
(
/^#
#{
PREFIX
}
.*?\n(#.*\n)*\n/
,
''
)
content
.
sub!
(
/^#
#{
COMPAT_
PREFIX
}
.*?\n(#.*\n)*\n/
,
''
)
File
.
open
(
file_name
,
"w"
)
{
|
f
|
f
.
puts
content
}
end
...
...
@@ -188,7 +189,7 @@ module AnnotateModels
if
annotated
.
empty?
puts
"Nothing annotated!"
else
puts
"Annotated (
#{
annotated
.
length
}
)
#{
annotated
.
join
(
', '
)
}
"
puts
"Annotated (
#{
annotated
.
length
}
)
:
#{
annotated
.
join
(
', '
)
}
"
end
end
...
...
lib/annotate_routes/annotate_routes.rb
View file @
0c3673a3
# == Annotate Routes
#
# Based on:
#
#
#
# Prepends the output of "rake routes" to the top of your routes.rb file.
# Yes, it's simple but I'm thick and often need a reminder of what my routes mean.
#
...
...
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