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
667b76ea
Commit
667b76ea
authored
Jul 02, 2009
by
Marcos Piccinini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lil fix and v bump
parent
28916f44
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
VERSION.yml
VERSION.yml
+2
-2
annotate.gemspec
annotate.gemspec
+5
-3
annotate_models.rb
lib/annotate/annotate_models.rb
+3
-1
No files found.
VERSION.yml
View file @
667b76ea
---
---
:major
:
2
:major
:
2
:minor
:
3
:minor
:
3
:patch
:
0
:patch
:
1
annotate.gemspec
View file @
667b76ea
...
@@ -2,11 +2,11 @@
...
@@ -2,11 +2,11 @@
Gem
::
Specification
.
new
do
|
s
|
Gem
::
Specification
.
new
do
|
s
|
s
.
name
=
%q{annotate}
s
.
name
=
%q{annotate}
s
.
version
=
"2.3.
0
"
s
.
version
=
"2.3.
1
"
s
.
required_rubygems_version
=
Gem
::
Requirement
.
new
(
">= 0"
)
if
s
.
respond_to?
:required_rubygems_version
=
s
.
required_rubygems_version
=
Gem
::
Requirement
.
new
(
">= 0"
)
if
s
.
respond_to?
:required_rubygems_version
=
s
.
authors
=
[
"Cuong Tran"
,
"Marcos Piccinini"
]
s
.
authors
=
[
"Cuong Tran"
,
"Marcos Piccinini"
]
s
.
date
=
%q{2009-0
6-11
}
s
.
date
=
%q{2009-0
7-02
}
s
.
default_executable
=
%q{annotate}
s
.
default_executable
=
%q{annotate}
s
.
email
=
%q{x@nofxx.com}
s
.
email
=
%q{x@nofxx.com}
s
.
executables
=
[
"annotate"
]
s
.
executables
=
[
"annotate"
]
...
@@ -18,6 +18,8 @@ Gem::Specification.new do |s|
...
@@ -18,6 +18,8 @@ Gem::Specification.new do |s|
"History.txt"
,
"History.txt"
,
"README.rdoc"
,
"README.rdoc"
,
"Rakefile"
,
"Rakefile"
,
"VERSION.yml"
,
"annotate.gemspec"
,
"bin/annotate"
,
"bin/annotate"
,
"lib/annotate.rb"
,
"lib/annotate.rb"
,
"lib/annotate/annotate_models.rb"
,
"lib/annotate/annotate_models.rb"
,
...
@@ -33,7 +35,7 @@ Gem::Specification.new do |s|
...
@@ -33,7 +35,7 @@ Gem::Specification.new do |s|
s
.
homepage
=
%q{http://github.com/nofxx/annotate}
s
.
homepage
=
%q{http://github.com/nofxx/annotate}
s
.
rdoc_options
=
[
"--charset=UTF-8"
]
s
.
rdoc_options
=
[
"--charset=UTF-8"
]
s
.
require_paths
=
[
"lib"
]
s
.
require_paths
=
[
"lib"
]
s
.
rubygems_version
=
%q{1.3.
3
}
s
.
rubygems_version
=
%q{1.3.
4
}
s
.
summary
=
%q{Annotates Rails Models, routes, and others}
s
.
summary
=
%q{Annotates Rails Models, routes, and others}
s
.
test_files
=
[
s
.
test_files
=
[
"spec/annotate/annotate_models_spec.rb"
,
"spec/annotate/annotate_models_spec.rb"
,
...
...
lib/annotate/annotate_models.rb
View file @
667b76ea
...
@@ -10,6 +10,8 @@ module AnnotateModels
...
@@ -10,6 +10,8 @@ module AnnotateModels
SPEC_MODEL_DIR
=
File
.
join
(
"spec"
,
"models"
)
SPEC_MODEL_DIR
=
File
.
join
(
"spec"
,
"models"
)
# Object Daddy http://github.com/flogic/object_daddy/tree/master
# Object Daddy http://github.com/flogic/object_daddy/tree/master
EXEMPLARS_DIR
=
File
.
join
(
"spec"
,
"exemplars"
)
EXEMPLARS_DIR
=
File
.
join
(
"spec"
,
"exemplars"
)
# Machinist http://github.com/notahat/machinist
BLUEPRINT
=
File
.
join
(
"spec"
,
"blueprint"
)
def
model_dir
def
model_dir
@model_dir
||
"app/models"
@model_dir
||
"app/models"
...
@@ -114,7 +116,7 @@ module AnnotateModels
...
@@ -114,7 +116,7 @@ module AnnotateModels
old_content
.
sub!
(
/^#
#{
COMPAT_PREFIX
}
.*?\n(#.*\n)*\n/
,
''
)
old_content
.
sub!
(
/^#
#{
COMPAT_PREFIX
}
.*?\n(#.*\n)*\n/
,
''
)
# Write it back
# Write it back
new_content
=
options
[
:position
]
.
to_sym
==
:before
?
(
info_block
+
old_content
)
:
(
old_content
+
"
\n
"
+
info_block
)
new_content
=
options
[
:position
]
==
'before'
?
(
info_block
+
old_content
)
:
(
old_content
+
"
\n
"
+
info_block
)
File
.
open
(
file_name
,
"wb"
)
{
|
f
|
f
.
puts
new_content
}
File
.
open
(
file_name
,
"wb"
)
{
|
f
|
f
.
puts
new_content
}
true
true
...
...
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