annotate 2.6.3 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -13
- data/{AUTHORS.rdoc → AUTHORS.md} +3 -2
- data/CHANGELOG.md +326 -0
- data/README.md +331 -0
- data/RELEASE.md +19 -0
- data/annotate.gemspec +26 -33
- data/bin/annotate +17 -133
- data/lib/annotate/active_record_patch.rb +1 -1
- data/lib/annotate/annotate_models/file_patterns.rb +127 -0
- data/lib/annotate/annotate_models.rb +736 -287
- data/lib/annotate/annotate_routes/header_generator.rb +113 -0
- data/lib/annotate/annotate_routes/helpers.rb +69 -0
- data/lib/annotate/annotate_routes.rb +80 -109
- data/lib/annotate/constants.rb +38 -0
- data/lib/annotate/helpers.rb +30 -0
- data/lib/annotate/parser.rb +303 -0
- data/lib/annotate/version.rb +1 -1
- data/lib/annotate.rb +72 -77
- data/lib/generators/annotate/install_generator.rb +5 -4
- data/lib/generators/annotate/templates/auto_annotate_models.rake +49 -24
- data/lib/tasks/annotate_models.rake +51 -28
- data/lib/tasks/annotate_models_migrate.rake +63 -0
- data/lib/tasks/annotate_routes.rake +12 -3
- data/potato.md +41 -0
- metadata +45 -28
- data/.travis.yml +0 -6
- data/CHANGELOG.rdoc +0 -175
- data/README.rdoc +0 -246
- data/TODO.rdoc +0 -12
- data/lib/tasks/migrate.rake +0 -33
@@ -1,47 +1,70 @@
|
|
1
1
|
annotate_lib = File.expand_path(File.dirname(File.dirname(__FILE__)))
|
2
2
|
|
3
|
-
|
3
|
+
unless ENV['is_cli']
|
4
4
|
task :set_annotation_options
|
5
|
-
task :
|
5
|
+
task annotate_models: :set_annotation_options
|
6
6
|
end
|
7
7
|
|
8
|
-
desc
|
9
|
-
task :
|
8
|
+
desc 'Add schema information (as comments) to model and fixture files'
|
9
|
+
task annotate_models: :environment do
|
10
10
|
require "#{annotate_lib}/annotate/annotate_models"
|
11
11
|
require "#{annotate_lib}/annotate/active_record_patch"
|
12
12
|
|
13
|
-
options={
|
14
|
-
ENV['position'] = options[:position] = Annotate.fallback(ENV['position'], 'before')
|
15
|
-
options[:
|
16
|
-
options[:
|
17
|
-
options[:
|
18
|
-
options[:
|
19
|
-
options[:
|
20
|
-
options[:
|
21
|
-
options[:
|
22
|
-
options[:
|
13
|
+
options = {is_rake: true}
|
14
|
+
ENV['position'] = options[:position] = Annotate::Helpers.fallback(ENV['position'], 'before')
|
15
|
+
options[:additional_file_patterns] = ENV['additional_file_patterns'] ? ENV['additional_file_patterns'].split(',') : []
|
16
|
+
options[:position_in_class] = Annotate::Helpers.fallback(ENV['position_in_class'], ENV['position'])
|
17
|
+
options[:position_in_fixture] = Annotate::Helpers.fallback(ENV['position_in_fixture'], ENV['position'])
|
18
|
+
options[:position_in_factory] = Annotate::Helpers.fallback(ENV['position_in_factory'], ENV['position'])
|
19
|
+
options[:position_in_test] = Annotate::Helpers.fallback(ENV['position_in_test'], ENV['position'])
|
20
|
+
options[:position_in_serializer] = Annotate::Helpers.fallback(ENV['position_in_serializer'], ENV['position'])
|
21
|
+
options[:show_foreign_keys] = Annotate::Helpers.true?(ENV['show_foreign_keys'])
|
22
|
+
options[:show_complete_foreign_keys] = Annotate::Helpers.true?(ENV['show_complete_foreign_keys'])
|
23
|
+
options[:show_indexes] = Annotate::Helpers.true?(ENV['show_indexes'])
|
24
|
+
options[:simple_indexes] = Annotate::Helpers.true?(ENV['simple_indexes'])
|
25
|
+
options[:model_dir] = ENV['model_dir'] ? ENV['model_dir'].split(',') : ['app/models']
|
26
|
+
options[:root_dir] = ENV['root_dir']
|
27
|
+
options[:include_version] = Annotate::Helpers.true?(ENV['include_version'])
|
23
28
|
options[:require] = ENV['require'] ? ENV['require'].split(',') : []
|
24
|
-
options[:exclude_tests] = Annotate.true?(ENV['exclude_tests'])
|
25
|
-
options[:exclude_factories] = Annotate.true?(ENV['exclude_factories'])
|
26
|
-
options[:exclude_fixtures] = Annotate.true?(ENV['exclude_fixtures'])
|
27
|
-
options[:
|
28
|
-
options[:
|
29
|
-
options[:
|
30
|
-
options[:
|
31
|
-
options[:
|
32
|
-
options[:
|
33
|
-
options[:
|
29
|
+
options[:exclude_tests] = Annotate::Helpers.true?(ENV['exclude_tests'])
|
30
|
+
options[:exclude_factories] = Annotate::Helpers.true?(ENV['exclude_factories'])
|
31
|
+
options[:exclude_fixtures] = Annotate::Helpers.true?(ENV['exclude_fixtures'])
|
32
|
+
options[:exclude_serializers] = Annotate::Helpers.true?(ENV['exclude_serializers'])
|
33
|
+
options[:exclude_scaffolds] = Annotate::Helpers.true?(ENV['exclude_scaffolds'])
|
34
|
+
options[:exclude_controllers] = Annotate::Helpers.true?(ENV.fetch('exclude_controllers', 'true'))
|
35
|
+
options[:exclude_helpers] = Annotate::Helpers.true?(ENV.fetch('exclude_helpers', 'true'))
|
36
|
+
options[:exclude_sti_subclasses] = Annotate::Helpers.true?(ENV['exclude_sti_subclasses'])
|
37
|
+
options[:ignore_model_sub_dir] = Annotate::Helpers.true?(ENV['ignore_model_sub_dir'])
|
38
|
+
options[:format_bare] = Annotate::Helpers.true?(ENV['format_bare'])
|
39
|
+
options[:format_rdoc] = Annotate::Helpers.true?(ENV['format_rdoc'])
|
40
|
+
options[:format_yard] = Annotate::Helpers.true?(ENV['format_yard'])
|
41
|
+
options[:format_markdown] = Annotate::Helpers.true?(ENV['format_markdown'])
|
42
|
+
options[:sort] = Annotate::Helpers.true?(ENV['sort'])
|
43
|
+
options[:force] = Annotate::Helpers.true?(ENV['force'])
|
44
|
+
options[:frozen] = Annotate::Helpers.true?(ENV['frozen'])
|
45
|
+
options[:classified_sort] = Annotate::Helpers.true?(ENV['classified_sort'])
|
46
|
+
options[:trace] = Annotate::Helpers.true?(ENV['trace'])
|
47
|
+
options[:wrapper_open] = Annotate::Helpers.fallback(ENV['wrapper_open'], ENV['wrapper'])
|
48
|
+
options[:wrapper_close] = Annotate::Helpers.fallback(ENV['wrapper_close'], ENV['wrapper'])
|
49
|
+
options[:ignore_columns] = ENV.fetch('ignore_columns', nil)
|
50
|
+
options[:ignore_routes] = ENV.fetch('ignore_routes', nil)
|
51
|
+
options[:hide_limit_column_types] = Annotate::Helpers.fallback(ENV['hide_limit_column_types'], '')
|
52
|
+
options[:hide_default_column_types] = Annotate::Helpers.fallback(ENV['hide_default_column_types'], '')
|
53
|
+
options[:with_comment] = Annotate::Helpers.true?(ENV['with_comment'])
|
54
|
+
options[:ignore_unknown_models] = Annotate::Helpers.true?(ENV.fetch('ignore_unknown_models', 'false'))
|
55
|
+
|
34
56
|
AnnotateModels.do_annotations(options)
|
35
57
|
end
|
36
58
|
|
37
|
-
desc
|
38
|
-
task :
|
59
|
+
desc 'Remove schema information from model and fixture files'
|
60
|
+
task remove_annotation: :environment do
|
39
61
|
require "#{annotate_lib}/annotate/annotate_models"
|
40
62
|
require "#{annotate_lib}/annotate/active_record_patch"
|
41
63
|
|
42
|
-
options={
|
64
|
+
options = {is_rake: true}
|
43
65
|
options[:model_dir] = ENV['model_dir']
|
66
|
+
options[:root_dir] = ENV['root_dir']
|
44
67
|
options[:require] = ENV['require'] ? ENV['require'].split(',') : []
|
45
|
-
options[:trace] = Annotate.true?(ENV['trace'])
|
68
|
+
options[:trace] = Annotate::Helpers.true?(ENV['trace'])
|
46
69
|
AnnotateModels.remove_annotations(options)
|
47
70
|
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# These tasks are added to the project if you install annotate as a Rails plugin.
|
2
|
+
# (They are not used to build annotate itself.)
|
3
|
+
|
4
|
+
# Append annotations to Rake tasks for ActiveRecord, so annotate automatically gets
|
5
|
+
# run after doing db:migrate.
|
6
|
+
|
7
|
+
migration_tasks = %w(db:migrate db:migrate:up db:migrate:down db:migrate:reset db:migrate:redo db:rollback)
|
8
|
+
if defined?(Rails::Application) && Rails.version.split('.').first.to_i >= 6
|
9
|
+
require 'active_record'
|
10
|
+
|
11
|
+
databases = ActiveRecord::Tasks::DatabaseTasks.setup_initial_database_yaml
|
12
|
+
|
13
|
+
ActiveRecord::Tasks::DatabaseTasks.for_each(databases) do |spec_name|
|
14
|
+
migration_tasks.concat(%w(db:migrate db:migrate:up db:migrate:down).map { |task| "#{task}:#{spec_name}" })
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
migration_tasks.each do |task|
|
19
|
+
next unless Rake::Task.task_defined?(task)
|
20
|
+
|
21
|
+
Rake::Task[task].enhance do
|
22
|
+
Rake::Task[Rake.application.top_level_tasks.last].enhance do
|
23
|
+
annotation_options_task = if Rake::Task.task_defined?('app:set_annotation_options')
|
24
|
+
'app:set_annotation_options'
|
25
|
+
else
|
26
|
+
'set_annotation_options'
|
27
|
+
end
|
28
|
+
Rake::Task[annotation_options_task].invoke
|
29
|
+
Annotate::Migration.update_annotations
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
module Annotate
|
35
|
+
class Migration
|
36
|
+
@@working = false
|
37
|
+
|
38
|
+
def self.update_annotations
|
39
|
+
unless @@working || Annotate::Helpers.skip_on_migration?
|
40
|
+
@@working = true
|
41
|
+
|
42
|
+
self.update_models if Annotate::Helpers.include_models?
|
43
|
+
self.update_routes if Annotate::Helpers.include_routes?
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.update_models
|
48
|
+
if Rake::Task.task_defined?("annotate_models")
|
49
|
+
Rake::Task["annotate_models"].invoke
|
50
|
+
elsif Rake::Task.task_defined?("app:annotate_models")
|
51
|
+
Rake::Task["app:annotate_models"].invoke
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def self.update_routes
|
56
|
+
if Rake::Task.task_defined?("annotate_routes")
|
57
|
+
Rake::Task["annotate_routes"].invoke
|
58
|
+
elsif Rake::Task.task_defined?("app:annotate_routes")
|
59
|
+
Rake::Task["app:annotate_routes"].invoke
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -1,12 +1,21 @@
|
|
1
|
+
annotate_lib = File.expand_path(File.dirname(File.dirname(__FILE__)))
|
2
|
+
|
3
|
+
unless ENV['is_cli']
|
4
|
+
task :set_annotation_options
|
5
|
+
task annotate_routes: :set_annotation_options
|
6
|
+
end
|
7
|
+
|
1
8
|
desc "Adds the route map to routes.rb"
|
2
9
|
task :annotate_routes => :environment do
|
3
|
-
annotate_lib = File.expand_path(File.dirname(File.dirname(__FILE__)))
|
4
10
|
require "#{annotate_lib}/annotate/annotate_routes"
|
5
11
|
|
6
12
|
options={}
|
7
|
-
ENV['position'] = options[:position] = Annotate.fallback(ENV['position'], 'before')
|
8
|
-
options[:position_in_routes] = Annotate.fallback(ENV['position_in_routes'], ENV['position'])
|
13
|
+
ENV['position'] = options[:position] = Annotate::Helpers.fallback(ENV['position'], 'before')
|
14
|
+
options[:position_in_routes] = Annotate::Helpers.fallback(ENV['position_in_routes'], ENV['position'])
|
15
|
+
options[:ignore_routes] = Annotate::Helpers.fallback(ENV['ignore_routes'], nil)
|
9
16
|
options[:require] = ENV['require'] ? ENV['require'].split(',') : []
|
17
|
+
options[:wrapper_open] = Annotate::Helpers.fallback(ENV['wrapper_open'], ENV['wrapper'])
|
18
|
+
options[:wrapper_close] = Annotate::Helpers.fallback(ENV['wrapper_close'], ENV['wrapper'])
|
10
19
|
AnnotateRoutes.do_annotations(options)
|
11
20
|
end
|
12
21
|
|
data/potato.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
Colons can be used to align columns.
|
2
|
+
|
3
|
+
| Tables | Are | Cool |
|
4
|
+
| ------------- |:-------------:| -----:|
|
5
|
+
| col 3 is | right-aligned | $1600 |
|
6
|
+
| col 2 is | centered | $12 |
|
7
|
+
| zebra stripes | are neat | $1 |
|
8
|
+
|
9
|
+
There must be at least 3 dashes separating each header cell.
|
10
|
+
The outer pipes (|) are optional, and you don't need to make the
|
11
|
+
raw Markdown line up prettily. You can also use inline Markdown.
|
12
|
+
|
13
|
+
Markdown | Less | Pretty
|
14
|
+
--- | --- | ---
|
15
|
+
*Still* | `renders` | **nicely**
|
16
|
+
1 | 2 | 3
|
17
|
+
|
18
|
+
|
19
|
+
## Route Map
|
20
|
+
|
21
|
+
Prefix | Verb | URI Pattern | Controller#Action
|
22
|
+
--------- | ---------- | --------------- | --------------------
|
23
|
+
myaction1 | GET | /url1(.:format) | mycontroller1#action
|
24
|
+
myaction2 | POST | /url2(.:format) | mycontroller2#action
|
25
|
+
myaction3 | DELETE-GET | /url3(.:format) | mycontroller3#action \n")
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
Table name: `users`
|
30
|
+
|
31
|
+
### Columns
|
32
|
+
|
33
|
+
Name | Type | Attributes
|
34
|
+
----------------------- | ------------------ | ---------------------------
|
35
|
+
**`id`** | `integer` | `not null, primary key`
|
36
|
+
**`foreign_thing_id`** | `integer` | `not null`
|
37
|
+
|
38
|
+
### Foreign Keys
|
39
|
+
|
40
|
+
* `fk_rails_...` (_ON DELETE => on_delete_value ON UPDATE => on_update_value_):
|
41
|
+
* **`foreign_thing_id => foreign_things.id`**
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: annotate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Chaffee
|
@@ -12,41 +12,53 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2022-02-10 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rake
|
19
19
|
requirement: !ruby/object:Gem::Requirement
|
20
20
|
requirements:
|
21
|
-
- -
|
21
|
+
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
23
|
+
version: '10.4'
|
24
|
+
- - "<"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '14.0'
|
24
27
|
type: :runtime
|
25
28
|
prerelease: false
|
26
29
|
version_requirements: !ruby/object:Gem::Requirement
|
27
30
|
requirements:
|
28
|
-
- -
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.4'
|
34
|
+
- - "<"
|
29
35
|
- !ruby/object:Gem::Version
|
30
|
-
version: 0
|
36
|
+
version: '14.0'
|
31
37
|
- !ruby/object:Gem::Dependency
|
32
38
|
name: activerecord
|
33
39
|
requirement: !ruby/object:Gem::Requirement
|
34
40
|
requirements:
|
35
|
-
- -
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3.2'
|
44
|
+
- - "<"
|
36
45
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
46
|
+
version: '8.0'
|
38
47
|
type: :runtime
|
39
48
|
prerelease: false
|
40
49
|
version_requirements: !ruby/object:Gem::Requirement
|
41
50
|
requirements:
|
42
|
-
- -
|
51
|
+
- - ">="
|
43
52
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
53
|
+
version: '3.2'
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '8.0'
|
45
57
|
description: Annotates Rails/ActiveRecord Models, routes, fixtures, and others based
|
46
58
|
on the database schema.
|
47
59
|
email:
|
48
60
|
- alex@stinky.com
|
49
|
-
- cuong@gmail.com
|
61
|
+
- cuong.tran@gmail.com
|
50
62
|
- x@nofxx.com
|
51
63
|
- turadg@aleahmad.net
|
52
64
|
- jon@cloudability.com
|
@@ -54,54 +66,59 @@ executables:
|
|
54
66
|
- annotate
|
55
67
|
extensions: []
|
56
68
|
extra_rdoc_files:
|
57
|
-
- README.
|
58
|
-
- CHANGELOG.
|
59
|
-
- TODO.rdoc
|
69
|
+
- README.md
|
70
|
+
- CHANGELOG.md
|
60
71
|
files:
|
61
|
-
- .
|
62
|
-
-
|
63
|
-
- CHANGELOG.rdoc
|
72
|
+
- AUTHORS.md
|
73
|
+
- CHANGELOG.md
|
64
74
|
- LICENSE.txt
|
65
|
-
- README.
|
66
|
-
-
|
75
|
+
- README.md
|
76
|
+
- RELEASE.md
|
67
77
|
- annotate.gemspec
|
68
78
|
- bin/annotate
|
69
79
|
- lib/annotate.rb
|
70
80
|
- lib/annotate/active_record_patch.rb
|
71
81
|
- lib/annotate/annotate_models.rb
|
82
|
+
- lib/annotate/annotate_models/file_patterns.rb
|
72
83
|
- lib/annotate/annotate_routes.rb
|
84
|
+
- lib/annotate/annotate_routes/header_generator.rb
|
85
|
+
- lib/annotate/annotate_routes/helpers.rb
|
86
|
+
- lib/annotate/constants.rb
|
87
|
+
- lib/annotate/helpers.rb
|
88
|
+
- lib/annotate/parser.rb
|
73
89
|
- lib/annotate/tasks.rb
|
74
90
|
- lib/annotate/version.rb
|
75
91
|
- lib/generators/annotate/USAGE
|
76
92
|
- lib/generators/annotate/install_generator.rb
|
77
93
|
- lib/generators/annotate/templates/auto_annotate_models.rake
|
78
94
|
- lib/tasks/annotate_models.rake
|
95
|
+
- lib/tasks/annotate_models_migrate.rake
|
79
96
|
- lib/tasks/annotate_routes.rake
|
80
|
-
-
|
81
|
-
homepage:
|
97
|
+
- potato.md
|
98
|
+
homepage: https://github.com/ctran/annotate_models
|
82
99
|
licenses:
|
83
100
|
- Ruby
|
84
|
-
metadata:
|
101
|
+
metadata:
|
102
|
+
bug_tracker_uri: https://github.com/ctran/annotate_models/issues/
|
103
|
+
source_code_uri: https://github.com/ctran/annotate_models.git
|
85
104
|
post_install_message:
|
86
105
|
rdoc_options: []
|
87
106
|
require_paths:
|
88
107
|
- lib
|
89
108
|
required_ruby_version: !ruby/object:Gem::Requirement
|
90
109
|
requirements:
|
91
|
-
- -
|
110
|
+
- - ">="
|
92
111
|
- !ruby/object:Gem::Version
|
93
|
-
version:
|
112
|
+
version: 2.4.0
|
94
113
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
114
|
requirements:
|
96
|
-
- -
|
115
|
+
- - ">="
|
97
116
|
- !ruby/object:Gem::Version
|
98
117
|
version: '0'
|
99
118
|
requirements: []
|
100
|
-
|
101
|
-
rubygems_version: 2.2.2
|
119
|
+
rubygems_version: 3.3.7
|
102
120
|
signing_key:
|
103
121
|
specification_version: 4
|
104
122
|
summary: Annotates Rails Models, routes, fixtures, and others based on the database
|
105
123
|
schema.
|
106
124
|
test_files: []
|
107
|
-
has_rdoc:
|
data/.travis.yml
DELETED
data/CHANGELOG.rdoc
DELETED
@@ -1,175 +0,0 @@
|
|
1
|
-
== 2.6.2
|
2
|
-
* Retain the current annotate block unless --force is specified
|
3
|
-
* Always load models, since they may not be autoloaded by Rails
|
4
|
-
* The pg array type is now detected (see #158)
|
5
|
-
|
6
|
-
== 2.6.0.beta2
|
7
|
-
|
8
|
-
* support for composite_primary_keys (garysweaver)
|
9
|
-
* bug fix for annotate_one_file (vlado)
|
10
|
-
|
11
|
-
== 2.6.0.beta1
|
12
|
-
|
13
|
-
* It's now possible to use Annotate in standalone ActiveRecord (non-Rails)
|
14
|
-
projects again.
|
15
|
-
* Adding note that Markdown is actually MultiMarkdown, and recommending the use
|
16
|
-
of the `kramdown` engine for parsing it.
|
17
|
-
* Improved Markdown formatting considerably.
|
18
|
-
* Bugfix: Needed to use inline-code tag for column and table names, otherwise
|
19
|
-
underscores would cause havok with the formatting.
|
20
|
-
* Bugfix: Markdown syntax was incorrect (can't have trailing spaces before the
|
21
|
-
closing marker for an emphasis tag).
|
22
|
-
* Bugfix: Remove-annotations wasn't properly finding test/spec files, and
|
23
|
-
wasn't even looking for FactoryGirl factories under the new naming
|
24
|
-
convention.
|
25
|
-
* Bugfix: Load the Rakefile from the current directory, not the first Rakefile
|
26
|
-
in our load path.
|
27
|
-
* Added support for new FactoryGirl naming convention.
|
28
|
-
* Fix behavior of route annotations in newer versions of Rake that don't spit
|
29
|
-
out the CWD as their first line of output.
|
30
|
-
* Overhauled integration testing system to be much easier to work with, better
|
31
|
-
compartmentalized, and so forth -- at the cost that you must be using RVM to
|
32
|
-
utilize it. (It'll spit out appropriate pending messages if you don't.)
|
33
|
-
Also includes a mode for "tinkering" by hand with a scenario, and won't let
|
34
|
-
you run it through rspect if the repo is in a dirty state. Added appropriate
|
35
|
-
rake tasks to help with all of this.
|
36
|
-
* Routes can now be appended, pre-pended, or removed -- and do sane things in
|
37
|
-
all cases.
|
38
|
-
* Expose all `position_*` variables as CLI params.
|
39
|
-
* Make `ENV ['position']` work as a default for all the `ENV ['position_*']`
|
40
|
-
variables.
|
41
|
-
* Make rake tasks more resilient to unusual circumstances / code loading
|
42
|
-
behavior.
|
43
|
-
* Resolve annotate vs. annotate_models ambiguity once and for all by settling
|
44
|
-
on `annotate_models` _and_ `annotate_routes`. This avoids a name collision
|
45
|
-
with RMagick while not needlessly overloading the term.
|
46
|
-
* Fixed that schema kept prepending additional newlines
|
47
|
-
* Updates to make annotate smarter about when to touch a model
|
48
|
-
* Recognize column+type, and don't change a file unless the column+type
|
49
|
-
combination of the new schema are different than that of the old (i.e., don't
|
50
|
-
regenerate if columns happen to be in a different order. That's just how life
|
51
|
-
is sometimes)
|
52
|
-
* Change annotate to use options hash instead of ENV.
|
53
|
-
|
54
|
-
== 2.5.0
|
55
|
-
|
56
|
-
* Works better with Rails 3
|
57
|
-
* Bugfix: schema kept prepending additional newlines
|
58
|
-
* Updates to make annotate smarter about when to touch a model
|
59
|
-
* Recognize column+type, and don't change a file unless the column+type combination of the new schema are different than that of the old (i.e., don't regenerate if columns happen to be in a different order. That's just how life is sometimes.)
|
60
|
-
* Grab old specification even if it has \r\n as line endings rather than pure \ns
|
61
|
-
* Various warning and specification fixes
|
62
|
-
* Fix "no such file to load -- annotate/annotate_models (MissingSourceFile)"
|
63
|
-
error (require statements in tasks now use full path to lib files)
|
64
|
-
* warn about macros, to mitigate when we're included during a production run,
|
65
|
-
not just a rakefile run -- possibly at the expense of too much noise
|
66
|
-
* Adding rake as a runtime dependency
|
67
|
-
* If the schema is already in the model file, it will be replaced into the same
|
68
|
-
location. If it didn't previously exist, it'll be placed according to the
|
69
|
-
"position", as before.
|
70
|
-
* Allow task loading from Rakefile for gems (plugin installation already
|
71
|
-
auto-detects).
|
72
|
-
* Add skip_on_db_migrate option as well for people that don't want it
|
73
|
-
* Fix options parsing to convert strings to proper booleans
|
74
|
-
* Add support for Fabrication fabricators
|
75
|
-
* Leave magic encoding comment intact
|
76
|
-
* Fix issue #14 - RuntimeError: Already memoized
|
77
|
-
* Count a model as 'annotated' if any of its tests/fixtures are annotated
|
78
|
-
* Support FactoryGirl
|
79
|
-
* Support :change migrations (Rails 3.1)
|
80
|
-
* Allow models with non-standard capitalization
|
81
|
-
* Widen type column so we can handle longtexts with chopping things off.
|
82
|
-
* Skip trying to get list of models from commandline when running via Rake (was
|
83
|
-
preventing the use of multiple rake tasks in one command if one of them was
|
84
|
-
db:migrate).
|
85
|
-
* Add ability to skip annotations for a model by adding
|
86
|
-
'# -*- SkipSchemaAnnotations' anywhere in the file.
|
87
|
-
* Don't show column limits for integer and boolean types.
|
88
|
-
* Add sorting for columns and indexes. (Helpful for out-of-order migration
|
89
|
-
execution. Use --sort if you want this.)
|
90
|
-
* Annotate unit tests in subfolders.
|
91
|
-
* Add generator to install rakefile that automatically annotates on db:migrate.
|
92
|
-
* Correct Gemfile to clarify which environments need which gems.
|
93
|
-
* Add an .rvmrc to facilitate clean development.
|
94
|
-
* Refactor out ActiveRecord monkey-patch to permit extending without
|
95
|
-
side-effects.
|
96
|
-
* Use ObjectSpace to locate models to facilitate handling of models with
|
97
|
-
non-standard capitalization.
|
98
|
-
Note that this still requires that the inflector be configured to understand
|
99
|
-
the special case.
|
100
|
-
* Shore up test cases a bit.
|
101
|
-
* Merge against many of the older branches on Github whose functionality is
|
102
|
-
already reflected to reduce confusion about what is and is not implemented
|
103
|
-
here.
|
104
|
-
* Accept String or Symbol for :position (et al) options.
|
105
|
-
* Add RDoc output formatting as an option.
|
106
|
-
* Add Markdown output formatting as an option.
|
107
|
-
* Add option to force annotation regeneration.
|
108
|
-
* Add new configuration option for controlling where info is placed in
|
109
|
-
fixtures/factories.
|
110
|
-
* Fix for models without tables.
|
111
|
-
* Fix gemspec generation now that Jeweler looks at Gemfile.
|
112
|
-
* Fix warning: `NOTE: Gem::Specification#default_executable= is deprecated with
|
113
|
-
no replacement. It will be removed on or after 2011-10-01.`
|
114
|
-
* Fix handling of files with no trailing newline when putting annotations at
|
115
|
-
the end of the file.
|
116
|
-
* Now works on tables with no primary key.
|
117
|
-
* --format=markdown option
|
118
|
-
* --trace option to help debug "Unable to annotate" errors
|
119
|
-
* "Table name" annotation (if table name is different from model name)
|
120
|
-
* "Human name" annotation (enabling translation to non-English locales)
|
121
|
-
* Fix JRuby ObjectSpace compatibility bug (https://github.com/ctran/annotate_models/pull/85)
|
122
|
-
* Fix FactoryGirl compatibility bug (https://github.com/ctran/annotate_models/pull/82)
|
123
|
-
|
124
|
-
== 2.4.2 2009-11-21
|
125
|
-
|
126
|
-
* Annotates (spec|test)/factories/<model>_factory.rb files
|
127
|
-
|
128
|
-
== 2.4.1 2009-11-20
|
129
|
-
|
130
|
-
* Annotates thoughtbot's factory_girl factories (test/factories/<model>_factory.rb)
|
131
|
-
* Move default annotation position back to top
|
132
|
-
|
133
|
-
== 2.4.0 2009-12-13
|
134
|
-
|
135
|
-
* Incorporated lots of patches from the Github community, including support for
|
136
|
-
Blueprints fixtures
|
137
|
-
* Several bug fixes
|
138
|
-
|
139
|
-
== 2.1 2009-10-18
|
140
|
-
|
141
|
-
* New options
|
142
|
-
* -R to require additional files before loading the models
|
143
|
-
* -i to show database indexes in annotations
|
144
|
-
* -e to exclude annotating tests or fixtures
|
145
|
-
* -m to include the migration version number in the annotation
|
146
|
-
* --model-dir to annotate model files stored a different place than app/models
|
147
|
-
* Ignore unknown macros ('acts_as_whatever')
|
148
|
-
|
149
|
-
== 2.0 2009-02-03
|
150
|
-
|
151
|
-
* Add annotate_models plugin fork additions
|
152
|
-
* Annotates Rspec and Test Unit models
|
153
|
-
* Annotates Object Daddy exemplars
|
154
|
-
* Annotates geometrical columns
|
155
|
-
* Add AnnotateRoutes rake task
|
156
|
-
* Up gem structure to newgem defaults
|
157
|
-
|
158
|
-
== 1.0.4 2008-09-04
|
159
|
-
|
160
|
-
* Only update modified models since last run, thanks to sant0sk1
|
161
|
-
|
162
|
-
== 1.0.3 2008-05-02
|
163
|
-
|
164
|
-
* Add misc changes from Dustin Sallings and Henrik N
|
165
|
-
* Remove trailing whitespace
|
166
|
-
* More intuitive info messages
|
167
|
-
* Update README file with update-to-date example
|
168
|
-
|
169
|
-
== 1.0.2 2008-03-22
|
170
|
-
|
171
|
-
* Add contributions from Michael Bumann (http://github.com/bumi)
|
172
|
-
* added an option "position" to choose to put the annotation,
|
173
|
-
* spec/fixtures now also get annotated
|
174
|
-
* added a task to remove the annotations
|
175
|
-
* these options can be specified from command line as -d and -p [before|after]
|