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
918bc420
Commit
918bc420
authored
Mar 01, 2012
by
Jon Frisby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolve conflict between generated rakefile and CLI tool.
parent
9d52904a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
16 deletions
+22
-16
annotate_models
bin/annotate_models
+1
-0
annotate.rb
lib/annotate.rb
+1
-1
auto_annotate_models.rake
...ators/annotate_models/templates/auto_annotate_models.rake
+15
-15
annotate_models.rake
lib/tasks/annotate_models.rake
+5
-0
No files found.
bin/annotate_models
View file @
918bc420
...
...
@@ -83,6 +83,7 @@ OptionParser.new do |opts|
end
.
parse!
ENV
[
'is_cli'
]
=
'1'
if
Annotate
.
load_tasks
Rake
::
Task
[
task
].
invoke
else
...
...
lib/annotate.rb
View file @
918bc420
...
...
@@ -18,7 +18,7 @@ module Annotate
load
'Rakefile'
# Rails 3 wants to load our .rake files for us.
# TODO: selectively do this require on Rails 2.x?
#
Dir[File.join(File.dirname(__FILE__), 'tasks', '**/*.rake')].each { |rake| load rake }
Dir
[
File
.
join
(
File
.
dirname
(
__FILE__
),
'tasks'
,
'**/*.rake'
)].
each
{
|
rake
|
load
rake
}
return
true
else
return
false
...
...
lib/generators/annotate_models/templates/auto_annotate_models.rake
View file @
918bc420
...
...
@@ -2,19 +2,19 @@
# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
# NOTE: to have a dev-mode tool do its thing in production.
if
(
Rails
.
env
.
development?
)
require
'annotate/tasks'
ENV
[
'position_in_class'
]
=
"before"
ENV
[
'position_in_fixture
'
]
=
"before"
ENV
[
'position_in_factory'
]
=
"befor
e"
ENV
[
'show_indexes'
]
=
"tru
e"
ENV
[
'include_version'
]
=
"false"
ENV
[
'exclude_tests'
]
=
"false"
ENV
[
'exclude_fixtures'
]
=
"false"
ENV
[
'ignore_model_sub_dir'
]
=
"false"
ENV
[
'skip_on_db_migrate'
]
=
"false"
ENV
[
'format_rdoc'
]
=
"false"
ENV
[
'format_markdown'
]
=
"false"
ENV
[
'no_sort'
]
=
"false"
ENV
[
'force'
]
=
"false"
task
:set_annotation_options
do
ENV
[
'position_in_class'
]
=
"before"
ENV
[
'position_in_fixture'
]
=
"before"
ENV
[
'position_in_factory
'
]
=
"before"
ENV
[
'show_indexes'
]
=
"tru
e"
ENV
[
'include_version'
]
=
"fals
e"
ENV
[
'exclude_tests'
]
=
"false"
ENV
[
'exclude_fixtures'
]
=
"false"
ENV
[
'ignore_model_sub_dir'
]
=
"false"
ENV
[
'skip_on_db_migrate'
]
=
"false"
ENV
[
'format_rdoc'
]
=
"false"
ENV
[
'format_markdown'
]
=
"false"
ENV
[
'no_sort'
]
=
"false"
ENV
[
'force'
]
=
"false"
end
end
lib/tasks/annotate_models.rake
View file @
918bc420
if
(
!
ENV
[
'is_cli'
])
task
:set_annotation_options
task
:annotate_models
=>
:set_annotation_options
end
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'
))
...
...
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