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
6049ee1f
Commit
6049ee1f
authored
Jan 29, 2010
by
Ryan Wilcox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
restored ability of annotate_models to run as a plugin.
In your rails env define module ANNOTATE_MODELS_PREFS with a constant of USE_PLUGIN = true to use plugin not gem
parent
b4abdb18
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
+18
-2
annotate.rake
lib/tasks/annotate.rake
+18
-2
No files found.
lib/tasks/annotate.rake
View file @
6049ee1f
def
is_plugin?
(
defined?
ANNOTATE_MODELS_PREFS
::
USE_PLUGIN
)
&&
(
!
ANNOTATE_MODELS_PREFS
::
USE_PLUGIN
.
nil?
)
?
ANNOTATE_MODELS_PREFS
::
USE_PLUGIN
:
false
end
desc
"Add schema information (as comments) to model and fixture files"
task
:annotate_models
=>
:environment
do
require
'annotate_models'
if
is_plugin?
require
File
.
expand_path
(
File
.
dirname
(
__FILE__
)
+
'/../annotate/annotate_models'
)
else
require
'annotate_models'
end
options
=
{}
options
[
:position_in_class
]
=
ENV
[
'position_in_class'
]
||
ENV
[
'position'
]
options
[
:position_in_fixture
]
=
ENV
[
'position_in_fixture'
]
||
ENV
[
'position'
]
...
...
@@ -10,6 +21,10 @@ end
desc
"Remove schema information from model and fixture files"
task
:remove_annotation
=>
:environment
do
require
'annotate_models'
if
is_plugin?
require
File
.
expand_path
(
File
.
dirname
(
__FILE__
)
+
'/../annotate/annotate_models'
)
else
require
'annotate_models'
end
AnnotateModels
.
remove_annotations
end
\ No newline at end of file
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