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
e5bedc0d
Commit
e5bedc0d
authored
Jan 13, 2015
by
Kamil Bielawski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specify wrapper opening and closing with parameters
parent
5ef55de9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
0 deletions
+19
-0
README.rdoc
README.rdoc
+4
-0
annotate
bin/annotate
+13
-0
annotate_models.rake
lib/tasks/annotate_models.rake
+2
-0
No files found.
README.rdoc
View file @
e5bedc0d
...
...
@@ -167,6 +167,10 @@ you can do so with a simple environment variable, instead of editing the
Place the annotations at the top (before) or the bottom (after) of the routes.rb file
--ps, --position-in-serializer [before|top|after|bottom]
Place the annotations at the top (before) or the bottom (after) of the serializer files
--w, --wrapper STR Wrap annotation with the text passed as parameter.
If --w option is used, the same text will be used as opening and closing
--wo, --wrapper-open STR Annotation wrapper opening.
--wc, --wrapper-close STR Annotation wrapper closing
-r, --routes Annotate routes.rb with the output of 'rake routes'
-v, --version Show the current version of this gem
-m, --show-migration Include the migration version number in the annotation
...
...
bin/annotate
View file @
e5bedc0d
...
...
@@ -78,6 +78,19 @@ OptionParser.new do |opts|
has_set_position
[
'position_in_serializer'
]
=
true
end
opts
.
on
(
'--w'
,
'--wrapper STR'
,
'Wrap annotation with the text passed as parameter.'
,
'If --w option is used, the same text will be used as opening and closing'
)
do
|
p
|
ENV
[
'wrapper'
]
=
p
end
opts
.
on
(
'--wo'
,
'--wrapper-open STR'
,
'Annotation wrapper opening.'
)
do
|
p
|
ENV
[
'wrapper_open'
]
=
p
end
opts
.
on
(
'--wc'
,
'--wrapper-close STR'
,
'Annotation wrapper closing'
)
do
|
p
|
ENV
[
'wrapper_close'
]
=
p
end
opts
.
on
(
'-r'
,
'--routes'
,
"Annotate routes.rb with the output of 'rake routes'"
)
do
target
=
{
...
...
lib/tasks/annotate_models.rake
View file @
e5bedc0d
...
...
@@ -31,6 +31,8 @@ task :annotate_models => :environment do
options
[
:sort
]
=
Annotate
.
true?
(
ENV
[
'sort'
])
options
[
:force
]
=
Annotate
.
true?
(
ENV
[
'force'
])
options
[
:trace
]
=
Annotate
.
true?
(
ENV
[
'trace'
])
options
[
:wrapper_open
]
=
Annotate
.
fallback
(
ENV
[
'wrapper_open'
],
ENV
[
'wrapper'
])
options
[
:wrapper_close
]
=
Annotate
.
fallback
(
ENV
[
'wrapper_close'
],
ENV
[
'wrapper'
])
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