Remove redundant empty lines in models

parent 9c68c8c9
require 'rubygems' require 'rubygems'
require 'rake' require 'rake'
require 'lib/annotate' require 'lib/annotate'
require 'yaml'
# 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]
......
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
# -*- encoding: utf-8 -*- # -*- encoding: utf-8 -*-
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = %q{annotate} s.name = %q{doubledrones-annotate}
s.version = "2.4.0" s.version = "2.4.0.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Cuong Tran", "Alex Chaffee", "Marcos Piccinini"] s.authors = ["Cuong Tran", "Alex Chaffee", "Marcos Piccinini", "Marcin Michałowski", "Marcin Nowicki"]
s.date = %q{2009-10-23} s.date = %q{2010-08-13}
s.default_executable = %q{annotate} s.default_executable = %q{annotate}
s.description = %q{Annotates Rails Models, routes, fixtures, and others based on the database schema.} s.description = %q{Annotates Rails Models, routes, fixtures, and others based on the database schema.}
s.email = ["alex@stinky.com", "ctran@pragmaquest.com", "x@nofxx.com"] s.email = ["alex@stinky.com", "ctran@pragmaquest.com", "x@nofxx.com", "dev@doubledrones.com"]
s.executables = ["annotate"] s.executables = ["annotate"]
s.extra_rdoc_files = [ s.extra_rdoc_files = [
"README.rdoc" "README.rdoc"
...@@ -34,7 +34,7 @@ Gem::Specification.new do |s| ...@@ -34,7 +34,7 @@ Gem::Specification.new do |s|
"spec/spec_helper.rb", "spec/spec_helper.rb",
"tasks/migrate.rake" "tasks/migrate.rake"
] ]
s.homepage = %q{http://github.com/ctran/annotate} s.homepage = %q{http://github.com/doubledrones/annotate_models}
s.rdoc_options = ["--charset=UTF-8"] s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"] s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.5} s.rubygems_version = %q{1.3.5}
......
...@@ -84,7 +84,7 @@ module AnnotateModels ...@@ -84,7 +84,7 @@ module AnnotateModels
info << get_index_info(klass) info << get_index_info(klass)
end end
info << "#\n\n" info << "#\n"
end end
def get_index_info(klass) def get_index_info(klass)
...@@ -119,7 +119,7 @@ module AnnotateModels ...@@ -119,7 +119,7 @@ module AnnotateModels
old_content = File.read(file_name) old_content = File.read(file_name)
# Ignore the Schema version line because it changes with each migration # Ignore the Schema version line because it changes with each migration
header = Regexp.new(/(^# Table name:.*?\n(#.*\n)*\n)/) header = Regexp.new(/(^# Table name:.*?\n(#.*\n)*)/)
old_header = old_content.match(header).to_s old_header = old_content.match(header).to_s
new_header = info_block.match(header).to_s new_header = info_block.match(header).to_s
...@@ -130,7 +130,7 @@ module AnnotateModels ...@@ -130,7 +130,7 @@ module AnnotateModels
old_content.sub!(/^# #{COMPAT_PREFIX}.*?\n(#.*\n)*\n/, '') old_content.sub!(/^# #{COMPAT_PREFIX}.*?\n(#.*\n)*\n/, '')
# Write it back # Write it back
new_content = options[:position] == 'before' ? (info_block + old_content) : (old_content + "\n" + info_block) new_content = options[:position] == 'before' ? (info_block + old_content) : (old_content + info_block)
File.open(file_name, "wb") { |f| f.puts new_content } File.open(file_name, "wb") { |f| f.puts new_content }
true true
......
...@@ -38,7 +38,6 @@ describe AnnotateModels do ...@@ -38,7 +38,6 @@ describe AnnotateModels do
# id :integer not null, primary key # id :integer not null, primary key
# id :integer not null, primary key # id :integer not null, primary key
# #
EOS EOS
end end
......
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