Commit d129f0e7 by Alex Chaffee

clean up some config and documentation

parent c7872753
...@@ -118,9 +118,13 @@ Released under the same license as Ruby. No Support. No Warranty. ...@@ -118,9 +118,13 @@ Released under the same license as Ruby. No Support. No Warranty.
== AUTHOR: == AUTHOR:
Original code by: Dave Thomas -- Pragmatic Programmers, LLC <http://agilewebdevelopment.com/plugins/annotate_models> Original code by: Dave Thomas -- Pragmatic Programmers, LLC <http://agilewebdevelopment.com/plugins/annotate_models>
Overhauled by: Alex Chaffee <http://alexch.github.com> Overhauled by: Alex Chaffee <http://alexch.github.com>
Gemmed by: Cuong Tran <http://github.com/ctran> Gemmed by: Cuong Tran <http://github.com/ctran>
Maintained by: Alex Chaffee and Cuong Tran Maintained by: Alex Chaffee and Cuong Tran
Homepage: http://github.com/ctran/annotate_models Homepage: http://github.com/ctran/annotate_models
Modifications by: Modifications by:
......
here = File.dirname __FILE__
require 'rubygems' require 'rubygems'
require 'rake' require 'rake'
require './lib/annotate' require "#{here}/lib/annotate"
# want other tests/tasks run by default? Add them to the list # want other tests/tasks run by default? Add them to the list
task :default => [:spec] task :default => [:spec]
begin
require 'mg'
rescue LoadError
abort "Please `gem install mg`"
end
# mg ("minimalist gems") defines rake tasks: # mg ("minimalist gems") defines rake tasks:
# #
# rake gem # rake gem
...@@ -24,7 +20,11 @@ end ...@@ -24,7 +20,11 @@ end
# #
# rake package # rake package
# Build gem and tarball into dist/ # Build gem and tarball into dist/
begin
require 'mg'
rescue LoadError
abort "Please `gem install mg`"
end
MG.new("annotate_models.gemspec") MG.new("annotate_models.gemspec")
require 'rspec/core/rake_task' require 'rspec/core/rake_task'
......
# Generated by jeweler require './lib/annotate'
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = %q{annotate_models} s.name = %q{annotate}
s.version = "2.4.0" s.version = Annotate.version # "2.5.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Cuong Tran", "Alex Chaffee", "Marcos Piccinini"]
s.description = %q{Annotates Rails/ActiveRecord Models, routes, fixtures, and others based on the database schema.} s.description = %q{Annotates Rails/ActiveRecord Models, routes, fixtures, and others based on the database schema.}
s.summary = %q{Annotates Rails Models, routes, fixtures, and others based on the database schema.}
s.authors = ["Cuong Tran", "Alex Chaffee", "Marcos Piccinini"]
s.email = ["alex@stinky.com", "ctran@pragmaquest.com", "x@nofxx.com"] s.email = ["alex@stinky.com", "ctran@pragmaquest.com", "x@nofxx.com"]
s.executables = ["annotate"]
s.extra_rdoc_files = [ s.executables = ["annotate"] # todo: annotate_models
"README.rdoc" s.extra_rdoc_files = ["README.rdoc"]
]
s.files = [ s.files = %w( README.rdoc VERSION.yml History.txt )
"History.txt", s.files += Dir.glob("lib/**/*")
"README.rdoc", s.files += Dir.glob("tasks/**/*")
"VERSION.yml", s.files += ["bin/annotate"] # todo: annotate_models
"bin/annotate",
"lib/annotate.rb",
"lib/annotate/annotate_models.rb",
"lib/annotate/annotate_routes.rb",
"lib/tasks/annotate_models.rake",
"lib/tasks/annotate_routes.rake",
"spec/annotate/annotate_models_spec.rb",
"spec/annotate/annotate_routes_spec.rb",
"spec/annotate_spec.rb",
"spec/spec.opts",
"spec/spec_helper.rb",
"tasks/migrate.rake"
]
s.homepage = %q{http://github.com/ctran/annotate_models} s.homepage = %q{http://github.com/ctran/annotate_models}
s.rdoc_options = ["--charset=UTF-8"] s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"] s.require_paths = ["lib"]
s.rubyforge_project = %q{annotate} s.rubyforge_project = %q{annotate}
s.rubygems_version = %q{1.3.5}
s.summary = %q{Annotates Rails Models, routes, fixtures, and others based on the database schema.}
s.test_files = [
"spec/annotate/annotate_models_spec.rb",
"spec/annotate/annotate_routes_spec.rb",
"spec/annotate_spec.rb",
"spec/spec_helper.rb"
]
s.add_runtime_dependency('rake')
s.add_development_dependency('jeweler')
s.add_development_dependency('rspec', '~> 1.3.2')
s.add_development_dependency('activesupport', '>= 2.1.0')
if s.respond_to? :specification_version then s.add_runtime_dependency 'rake' # ?
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
else
end
else
end
end end
...@@ -14,7 +14,7 @@ Gem::Specification.new do |s| ...@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.files = %w( README.rdoc VERSION.yml History.txt ) s.files = %w( README.rdoc VERSION.yml History.txt )
s.files += Dir.glob("lib/**/*") s.files += Dir.glob("lib/**/*")
s.files += Dir.glob("tasks/**/*") s.files += Dir.glob("tasks/**/*")
s.files += ["bin/annotate"] # todo: change to annotate_models s.files += ["bin/annotate"] # todo: annotate_models
s.homepage = %q{http://github.com/ctran/annotate_models} s.homepage = %q{http://github.com/ctran/annotate_models}
s.rdoc_options = ["--charset=UTF-8"] s.rdoc_options = ["--charset=UTF-8"]
......
annotate_lib = File.expand_path(File.dirname(File.dirname(__FILE__)))
desc "Add schema information (as comments) to model and fixture files" desc "Add schema information (as comments) to model and fixture files"
task :annotate_models => :environment do task :annotate_models => :environment do
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'annotate', 'annotate_models')) require "#{annotate_lib}/annotate/annotate_models"
options={} options={}
options[:position_in_class] = ENV['position_in_class'] || ENV['position'] || :before options[:position_in_class] = ENV['position_in_class'] || ENV['position'] || :before
options[:position_in_fixture] = ENV['position_in_fixture'] || ENV['position'] || :before options[:position_in_fixture] = ENV['position_in_fixture'] || ENV['position'] || :before
...@@ -14,7 +16,7 @@ end ...@@ -14,7 +16,7 @@ end
desc "Remove schema information from model and fixture files" desc "Remove schema information from model and fixture files"
task :remove_annotation => :environment do task :remove_annotation => :environment do
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'annotate', 'annotate_models')) require "#{annotate_lib}/annotate/annotate_models"
options={} options={}
options[:model_dir] = ENV['model_dir'] options[:model_dir] = ENV['model_dir']
AnnotateModels.remove_annotations(options) AnnotateModels.remove_annotations(options)
......
desc "Prepends the route map to the top of routes.rb" desc "Prepends the route map to the top of routes.rb"
task :annotate_routes do task :annotate_routes do
require File.expand_path(File.join(File.dirname(__FILE__), '..', 'annotate', 'annotate_routes')) annotate_lib = File.expand_path(File.dirname(File.dirname(__FILE__)))
require "#{annotate_lib}/annotate/annotate_routes"
AnnotateRoutes.do_annotate AnnotateRoutes.do_annotate
end end
TODO TODO
----- -----
* clean up history * clean up history
* change default position back to "top" for all * change default position back to "top" for all annotations
* add "top" and "bottom" as synonyms for "before" and "after" * add "top" and "bottom" as synonyms for "before" and "after"
* change 'exclude' to 'only' (double negatives are not unconfusing) * change 'exclude' to 'only' (double negatives are not unconfusing)
TODO (proposed)
----------------
* make a mailing list
alex@stinky.com
ctran@pragmaquest.com
x@nofxx.com
turadg@aleahmad.net
jfrisby@mrjoy.com
Jack Danger Canty
Marcos Piccinini
peterpunk
* push two identical gems, named 'annotate' and 'annotate_models'
* supply two binaries, named 'annotate' and 'annotate_models', since there's already a unix tool named 'annotate'
* test EVERYTHING
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment