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
b72dc16d
Commit
b72dc16d
authored
Dec 20, 2011
by
Ian Duggan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix options parsing to convert strings to proper booleans. Change annotate to…
Fix options parsing to convert strings to proper booleans. Change annotate to use options hash instead of ENV.
parent
672a22ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
annotate_models.rb
lib/annotate/annotate_models.rb
+2
-2
annotate_models.rake
lib/tasks/annotate_models.rake
+8
-3
No files found.
lib/annotate/annotate_models.rb
View file @
b72dc16d
...
...
@@ -179,7 +179,7 @@ module AnnotateModels
annotated
=
true
end
unless
ENV
[
'exclude_tests'
]
unless
options
[
:exclude_tests
]
[
File
.
join
(
UNIT_TEST_DIR
,
"
#{
model_name
}
_test.rb"
),
# test
File
.
join
(
SPEC_MODEL_DIR
,
"
#{
model_name
}
_spec.rb"
),
# spec
...
...
@@ -191,7 +191,7 @@ module AnnotateModels
end
end
unless
ENV
[
'exclude_fixtures'
]
unless
options
[
:exclude_fixtures
]
[
File
.
join
(
EXEMPLARS_TEST_DIR
,
"
#{
model_name
}
_exemplar.rb"
),
# Object Daddy
File
.
join
(
EXEMPLARS_SPEC_DIR
,
"
#{
model_name
}
_exemplar.rb"
),
# Object Daddy
...
...
lib/tasks/annotate_models.rake
View file @
b72dc16d
desc
"Add schema information (as comments) to model and fixture files"
task
:annotate_models
=>
:environment
do
require
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'annotate'
,
'annotate_models'
))
true_re
=
/(true|t|yes|y|1)$/i
options
=
{}
options
[
:position_in_class
]
=
ENV
[
'position_in_class'
]
||
ENV
[
'position'
]
||
:before
options
[
:position_in_fixture
]
=
ENV
[
'position_in_fixture'
]
||
ENV
[
'position'
]
||
:before
options
[
:show_indexes
]
=
ENV
[
'show_indexes'
]
options
[
:simple_indexes
]
=
ENV
[
'simple_indexes'
]
options
[
:show_indexes
]
=
ENV
[
'show_indexes'
]
=~
true_re
options
[
:simple_indexes
]
=
ENV
[
'simple_indexes'
]
=~
true_re
options
[
:model_dir
]
=
ENV
[
'model_dir'
]
options
[
:include_version
]
=
ENV
[
'include_version'
]
options
[
:include_version
]
=
ENV
[
'include_version'
]
=~
true_re
options
[
:require
]
=
ENV
[
'require'
]
?
ENV
[
'require'
].
split
(
','
)
:
[]
options
[
:exclude_tests
]
=
ENV
[
'exclude_tests'
]
=~
true_re
options
[
:exclude_fixtures
]
=
ENV
[
'exclude_fixtures'
]
=~
true_re
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