annotated-rails 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +13 -1
- data/README.md +11 -10
- data/lib/annotated-rails.rb +9 -2
- data/lib/annotated/rake_task.rake +18 -0
- data/lib/annotated/version.rb +1 -1
- metadata +3 -2
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,14 @@
|
|
1
1
|
TODO
|
2
2
|
----
|
3
3
|
|
4
|
-
*
|
4
|
+
* add initializer(or|and just add configuration) in order to configure annotation rake task invocation and other future configuration values:
|
5
|
+
|
6
|
+
# or maybe you want place this in environments/development.rb? this is your choice
|
7
|
+
if defined? Annotated::Rails
|
8
|
+
config.annotated-rails.rake_task = true
|
9
|
+
config. bla bla
|
10
|
+
end
|
11
|
+
|
5
12
|
* add exception handling for "bad" models:
|
6
13
|
|
7
14
|
Annotaiting GoodModel BadModel(failed)
|
@@ -14,6 +21,11 @@ current(master)
|
|
14
21
|
|
15
22
|
nothing here yet
|
16
23
|
|
24
|
+
0.0.2
|
25
|
+
-----
|
26
|
+
|
27
|
+
* added rake task (hooked into database migration tasks).
|
28
|
+
|
17
29
|
0.0.1
|
18
30
|
-----
|
19
31
|
|
data/README.md
CHANGED
@@ -45,28 +45,29 @@ And then execute:
|
|
45
45
|
|
46
46
|
$ bundle
|
47
47
|
|
48
|
-
|
48
|
+
## Usage
|
49
49
|
|
50
|
-
|
50
|
+
* First way: <strong>almost do nothing</strong>, your `rake db:migrate` or similar database-changing tasks will do the job if gem already installed.
|
51
51
|
|
52
|
-
|
52
|
+
* Second way: use [guard](https://github.com/guard/guard) and [guard-migrate](https://github.com/guard/guard-migrate) and for you <strong>nothing to do at all</strong> :).
|
53
|
+
|
54
|
+
* Third way (to use from commandline):
|
53
55
|
|
54
|
-
To annotate:
|
56
|
+
To annotate:
|
55
57
|
|
56
|
-
|
58
|
+
bundle exec annotate-rails
|
57
59
|
|
58
|
-
To remove annotation:
|
60
|
+
To remove annotation:
|
59
61
|
|
60
|
-
|
62
|
+
bundle exec annotate-rails -d
|
61
63
|
|
62
|
-
To see CLI help:
|
64
|
+
To see CLI help:
|
63
65
|
|
64
|
-
|
66
|
+
bundle exec annotate-rails -h|--help
|
65
67
|
|
66
68
|
## Future plans
|
67
69
|
|
68
70
|
* look at the CHANGELOG for what is going to be done
|
69
|
-
* add guard/something similar support
|
70
71
|
* add annotations for other things
|
71
72
|
|
72
73
|
## Testing
|
data/lib/annotated-rails.rb
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
desc "annotate-rails task"
|
2
|
+
task 'annotate-rails' do
|
3
|
+
require 'annotated/models'
|
4
|
+
Annotated::Models.instance.annotate!(options={})
|
5
|
+
end
|
6
|
+
|
7
|
+
%w[
|
8
|
+
db:migrate
|
9
|
+
db:rollback
|
10
|
+
db:forward
|
11
|
+
].each do |db_schema_change_task|
|
12
|
+
if Rake::Task.task_defined? db_schema_change_task
|
13
|
+
# "after-hook"
|
14
|
+
task db_schema_change_task do
|
15
|
+
Rake::Task['annotate-rails'].invoke
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/annotated/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: annotated-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-03
|
12
|
+
date: 2012-04-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -144,6 +144,7 @@ files:
|
|
144
144
|
- bin/annotate-rails
|
145
145
|
- lib/annotated-rails.rb
|
146
146
|
- lib/annotated/models.rb
|
147
|
+
- lib/annotated/rake_task.rake
|
147
148
|
- lib/annotated/version.rb
|
148
149
|
- spec/annotated/models/annotator_spec.rb
|
149
150
|
- spec/annotated/models_spec.rb
|