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
d61ff54d
Commit
d61ff54d
authored
Feb 20, 2009
by
Miguel Herranz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Now -p option also have effect on test, spec and Object Daddy files.
parent
7a85f89f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
6 deletions
+9
-6
annotate.gemspec
annotate.gemspec
+2
-2
annotate.rb
lib/annotate.rb
+1
-1
annotate_models.rb
lib/annotate/annotate_models.rb
+4
-2
annotate_models.rake
lib/tasks/annotate_models.rake
+2
-1
No files found.
annotate.gemspec
View file @
d61ff54d
...
...
@@ -2,11 +2,11 @@
Gem
::
Specification
.
new
do
|
s
|
s
.
name
=
%q{annotate}
s
.
version
=
"2.2.
6
"
s
.
version
=
"2.2.
7
"
s
.
required_rubygems_version
=
Gem
::
Requirement
.
new
(
">= 0"
)
if
s
.
respond_to?
:required_rubygems_version
=
s
.
authors
=
[
"Marcos Piccinini"
]
s
.
date
=
%q{2009-02-
14
}
s
.
date
=
%q{2009-02-
20
}
s
.
default_executable
=
%q{annotate}
s
.
description
=
%q{Annotates Rails Models and Routes}
s
.
email
=
[
"x@nofxx.com"
]
...
...
lib/annotate.rb
View file @
d61ff54d
...
...
@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless
$:
.
include?
(
File
.
dirname
(
__FILE__
))
||
$:
.
include?
(
File
.
expand_path
(
File
.
dirname
(
__FILE__
)))
module
Annotate
VERSION
=
'2.2.
6
'
VERSION
=
'2.2.
7
'
end
begin
...
...
lib/annotate/annotate_models.rb
View file @
d61ff54d
...
...
@@ -73,6 +73,8 @@ module AnnotateModels
# "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
# :position_in_others<Symbol>:: where to place the annotated section in the rest of
# supported files
#
def
annotate_one_file
(
file_name
,
info_block
,
options
=
{})
if
File
.
exist?
(
file_name
)
...
...
@@ -128,8 +130,8 @@ module AnnotateModels
[
File
.
join
(
UNIT_TEST_DIR
,
"
#{
model_name
}
_test.rb"
),
# test
File
.
join
(
SPEC_MODEL_DIR
,
"
#{
model_name
}
_spec.rb"
),
# spec
File
.
join
(
EXEMPLARS_DIR
,
"
#{
model_name
}
_exemplar.rb"
),
# Object Daddy
].
each
{
|
file
|
annotate_one_file
(
file
,
info
)
}
File
.
join
(
EXEMPLARS_DIR
,
"
#{
model_name
}
_exemplar.rb"
),
# Object Daddy
].
each
{
|
file
|
annotate_one_file
(
file
,
info
,
options
.
merge
(
:position
=>
(
options
[
:position_in_others
]
||
options
[
:position
]))
)
}
FIXTURE_DIRS
.
each
do
|
dir
|
fixture_file_name
=
File
.
join
(
dir
,
klass
.
table_name
+
".yml"
)
...
...
lib/tasks/annotate_models.rake
View file @
d61ff54d
...
...
@@ -3,7 +3,8 @@ task :annotate_models => :environment do
require
'annotate/annotate_models'
options
=
{}
options
[
:position_in_class
]
=
ENV
[
'position_in_class'
]
||
ENV
[
'position'
]
options
[
:position_in_fixture
]
=
ENV
[
'position_in_fixture'
]
||
ENV
[
'position'
]
options
[
:position_in_fixture
]
=
ENV
[
'position_in_fixture'
]
||
ENV
[
'position'
]
options
[
:position_in_others
]
=
ENV
[
'position_in_others'
]
||
ENV
[
'position'
]
AnnotateModels
.
do_annotations
(
options
)
end
...
...
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