Skip to content

Commit b5a1fda

Browse files
committed
clean up some config and documentation
1 parent c787275 commit b5a1fda

File tree

7 files changed

+43
-65
lines changed

7 files changed

+43
-65
lines changed

README.rdoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,13 @@ Released under the same license as Ruby. No Support. No Warranty.
118118
== AUTHOR:
119119

120120
Original code by: Dave Thomas -- Pragmatic Programmers, LLC <http://agilewebdevelopment.com/plugins/annotate_models>
121+
121122
Overhauled by: Alex Chaffee <http://alexch.github.com>
123+
122124
Gemmed by: Cuong Tran <http://github.com/ctran>
125+
123126
Maintained by: Alex Chaffee and Cuong Tran
127+
124128
Homepage: http://github.com/ctran/annotate_models
125129

126130
Modifications by:

Rakefile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1+
here = File.dirname __FILE__
2+
13
require 'rubygems'
24
require 'rake'
3-
require './lib/annotate'
5+
require "#{here}/lib/annotate"
46

57
# want other tests/tasks run by default? Add them to the list
68
task :default => [:spec]
79

8-
begin
9-
require 'mg'
10-
rescue LoadError
11-
abort "Please `gem install mg`"
12-
end
13-
1410
# mg ("minimalist gems") defines rake tasks:
1511
#
1612
# rake gem
@@ -24,7 +20,11 @@ end
2420
#
2521
# rake package
2622
# Build gem and tarball into dist/
27-
23+
begin
24+
require 'mg'
25+
rescue LoadError
26+
abort "Please `gem install mg`"
27+
end
2828
MG.new("annotate_models.gemspec")
2929

3030
require 'rspec/core/rake_task'

annotate.gemspec

Lines changed: 15 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,25 @@
1-
# Generated by jeweler
2-
# DO NOT EDIT THIS FILE DIRECTLY
3-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4-
# -*- encoding: utf-8 -*-
1+
require './lib/annotate'
52

63
Gem::Specification.new do |s|
7-
s.name = %q{annotate_models}
8-
s.version = "2.4.0"
9-
10-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11-
s.authors = ["Cuong Tran", "Alex Chaffee", "Marcos Piccinini"]
4+
s.name = %q{annotate}
5+
s.version = Annotate.version # "2.5.0"
126
s.description = %q{Annotates Rails/ActiveRecord Models, routes, fixtures, and others based on the database schema.}
7+
s.summary = %q{Annotates Rails Models, routes, fixtures, and others based on the database schema.}
8+
s.authors = ["Cuong Tran", "Alex Chaffee", "Marcos Piccinini"]
139
14-
s.executables = ["annotate"]
15-
s.extra_rdoc_files = [
16-
"README.rdoc"
17-
]
18-
s.files = [
19-
"History.txt",
20-
"README.rdoc",
21-
"VERSION.yml",
22-
"bin/annotate",
23-
"lib/annotate.rb",
24-
"lib/annotate/annotate_models.rb",
25-
"lib/annotate/annotate_routes.rb",
26-
"lib/tasks/annotate_models.rake",
27-
"lib/tasks/annotate_routes.rake",
28-
"spec/annotate/annotate_models_spec.rb",
29-
"spec/annotate/annotate_routes_spec.rb",
30-
"spec/annotate_spec.rb",
31-
"spec/spec.opts",
32-
"spec/spec_helper.rb",
33-
"tasks/migrate.rake"
34-
]
10+
11+
s.executables = ["annotate"] # todo: annotate_models
12+
s.extra_rdoc_files = ["README.rdoc"]
13+
14+
s.files = %w( README.rdoc VERSION.yml History.txt )
15+
s.files += Dir.glob("lib/**/*")
16+
s.files += Dir.glob("tasks/**/*")
17+
s.files += ["bin/annotate"] # todo: annotate_models
18+
3519
s.homepage = %q{http://github.com/ctran/annotate_models}
3620
s.rdoc_options = ["--charset=UTF-8"]
3721
s.require_paths = ["lib"]
3822
s.rubyforge_project = %q{annotate}
39-
s.rubygems_version = %q{1.3.5}
40-
s.summary = %q{Annotates Rails Models, routes, fixtures, and others based on the database schema.}
41-
s.test_files = [
42-
"spec/annotate/annotate_models_spec.rb",
43-
"spec/annotate/annotate_routes_spec.rb",
44-
"spec/annotate_spec.rb",
45-
"spec/spec_helper.rb"
46-
]
47-
s.add_runtime_dependency('rake')
48-
s.add_development_dependency('jeweler')
49-
s.add_development_dependency('rspec', '~> 1.3.2')
50-
s.add_development_dependency('activesupport', '>= 2.1.0')
5123

52-
if s.respond_to? :specification_version then
53-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
54-
s.specification_version = 3
55-
56-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
57-
else
58-
end
59-
else
60-
end
24+
s.add_runtime_dependency 'rake' # ?
6125
end
62-

annotate_models.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
1414
s.files = %w( README.rdoc VERSION.yml History.txt )
1515
s.files += Dir.glob("lib/**/*")
1616
s.files += Dir.glob("tasks/**/*")
17-
s.files += ["bin/annotate"] # todo: change to annotate_models
17+
s.files += ["bin/annotate"] # todo: annotate_models
1818

1919
s.homepage = %q{http://github.com/ctran/annotate_models}
2020
s.rdoc_options = ["--charset=UTF-8"]

lib/tasks/annotate_models.rake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
annotate_lib = File.expand_path(File.dirname(File.dirname(__FILE__)))
2+
13
desc "Add schema information (as comments) to model and fixture files"
24
task :annotate_models => :environment do
3-
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'annotate', 'annotate_models'))
5+
require "#{annotate_lib}/annotate/annotate_models"
46
options={}
57
options[:position_in_class] = ENV['position_in_class'] || ENV['position'] || :before
68
options[:position_in_fixture] = ENV['position_in_fixture'] || ENV['position'] || :before
@@ -14,7 +16,7 @@ end
1416

1517
desc "Remove schema information from model and fixture files"
1618
task :remove_annotation => :environment do
17-
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'annotate', 'annotate_models'))
19+
require "#{annotate_lib}/annotate/annotate_models"
1820
options={}
1921
options[:model_dir] = ENV['model_dir']
2022
AnnotateModels.remove_annotations(options)

lib/tasks/annotate_routes.rake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
desc "Prepends the route map to the top of routes.rb"
22
task :annotate_routes do
3-
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'annotate', 'annotate_routes'))
3+
annotate_lib = File.expand_path(File.dirname(File.dirname(__FILE__)))
4+
require "#{annotate_lib}/annotate/annotate_routes"
45
AnnotateRoutes.do_annotate
56
end

todo.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
11
TODO
22
-----
33
* clean up history
4-
* change default position back to "top" for all
4+
* change default position back to "top" for all annotations
55
* add "top" and "bottom" as synonyms for "before" and "after"
66
* change 'exclude' to 'only' (double negatives are not unconfusing)
77

8+
TODO (proposed)
9+
----------------
10+
* make a mailing list
11+
* push two identical gems, named 'annotate' and 'annotate_models'
12+
* supply two binaries, named 'annotate' and 'annotate_models', since there's already a unix tool named 'annotate'
13+
* test EVERYTHING
14+
15+

0 commit comments

Comments
 (0)