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
667ab388
Commit
667ab388
authored
Dec 20, 2011
by
Cuong Tran
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #66 from ijcd/gemfile-tasks
Allow task loading from Rakefile for gems (by ijcd)
parents
24e3e743
da365eab
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
4 deletions
+22
-4
README.rdoc
README.rdoc
+15
-3
tasks.rb
lib/annotate/tasks.rb
+6
-0
migrate.rake
tasks/migrate.rake
+1
-1
No files found.
README.rdoc
View file @
667ab388
...
@@ -43,7 +43,6 @@ Into Gemfile from Github:
...
@@ -43,7 +43,6 @@ Into Gemfile from Github:
gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
gem 'annotate', :git => 'git://github.com/ctran/annotate_models.git'
Into environment gems From Rubygems.org:
Into environment gems From Rubygems.org:
sudo gem install annotate
sudo gem install annotate
...
@@ -55,7 +54,6 @@ Into environment gems from Github checkout:
...
@@ -55,7 +54,6 @@ Into environment gems from Github checkout:
rake build
rake build
sudo gem install pkg/annotate-*.gem
sudo gem install pkg/annotate-*.gem
== USAGE
== USAGE
(If you used the Gemfile install, prefix the below commands with `bundle exec`.)
(If you used the Gemfile install, prefix the below commands with `bundle exec`.)
...
@@ -84,7 +82,21 @@ To automatically annotate after running 'rake db:migrate':
...
@@ -84,7 +82,21 @@ To automatically annotate after running 'rake db:migrate':
If you install annotate_models as a plugin, it will automatically
If you install annotate_models as a plugin, it will automatically
adjust your <tt>rake db:migrate</tt> tasks so that they update the
adjust your <tt>rake db:migrate</tt> tasks so that they update the
annotations in your model files for you once the migration is
annotations in your model files for you once the migration is
completed.
completed. To get the same behavior from a gem, add the following to
your Rakefile:
require 'annotate/tasks'
To customize the behavior of annotate when it is running as a Rake
task, use the following (in your Rakefile or wherever):
ENV['position_in_class'] = "before"
ENV['position_in_fixture'] = "before"
ENV['show_indexes'] = "false"
ENV['include_version'] = "false"
ENV['exclude_tests'] = "false"
ENV['exclude_fixtures'] = "false"
ENV['skip_on_db_migrate'] = "false"
== OPTIONS
== OPTIONS
...
...
lib/annotate/tasks.rb
0 → 100644
View file @
667ab388
require
'rubygems'
require
'rake'
# Make tasks visible for Rails also when used as gem.
Dir
[
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'tasks'
,
'**/*.rake'
)].
each
{
|
rake
|
load
rake
}
Dir
[
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'..'
,
'tasks'
,
'**/*.rake'
)].
each
{
|
rake
|
load
rake
}
tasks/migrate.rake
View file @
667ab388
...
@@ -24,7 +24,7 @@ module Annotate
...
@@ -24,7 +24,7 @@ module Annotate
@@working
=
false
@@working
=
false
def
self
.
update_annotations
def
self
.
update_annotations
unless
@@working
unless
@@working
||
(
ENV
[
'skip_on_db_migrate'
]
=~
/(true|t|yes|y|1)$/i
)
@@working
=
true
@@working
=
true
Rake
::
Task
[
'annotate_models'
].
invoke
Rake
::
Task
[
'annotate_models'
].
invoke
end
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