Commit 5f17dbf7 by Jon Frisby

Merge remote-tracking branch 'alexch/master' into development

Conflicts: .gitignore Gemfile History.txt Rakefile annotate.gemspec lib/annotate/annotate_models.rb spec/annotate/annotate_models_spec.rb spec/spec_helper.rb todo.txt
parents aa07dc71 2f6dbdc0
...@@ -3,6 +3,7 @@ source :rubygems ...@@ -3,6 +3,7 @@ source :rubygems
group :development do group :development do
gem 'jeweler' gem 'jeweler'
gem 'rspec' gem 'rspec'
gem 'wrong'
end end
gem 'activesupport', '>= 3.0.0', :require => nil gem 'activesupport', '>= 3.0.0', :require => nil
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
ParseTree (3.0.8)
RubyInline (>= 3.7.0)
sexp_processor (>= 3.0.0)
RubyInline (3.11.2)
ZenTest (~> 4.3)
ZenTest (4.6.2)
activesupport (3.0.0) activesupport (3.0.0)
diff-lcs (1.1.3) diff-lcs (1.1.3)
file-tail (1.0.8)
tins (~> 0.3)
git (1.2.5) git (1.2.5)
jeweler (1.6.4) jeweler (1.6.4)
bundler (~> 1.0) bundler (~> 1.0)
git (>= 1.2.5) git (>= 1.2.5)
rake rake
predicated (0.2.6)
rake (0.9.2.2) rake (0.9.2.2)
rspec (2.7.0) rspec (2.7.0)
rspec-core (~> 2.7.0) rspec-core (~> 2.7.0)
...@@ -17,6 +26,27 @@ GEM ...@@ -17,6 +26,27 @@ GEM
rspec-expectations (2.7.0) rspec-expectations (2.7.0)
diff-lcs (~> 1.1.2) diff-lcs (~> 1.1.2)
rspec-mocks (2.7.0) rspec-mocks (2.7.0)
ruby2ruby (1.3.1)
ruby_parser (~> 2.0)
sexp_processor (~> 3.0)
ruby_parser (2.0.6)
sexp_processor (~> 3.0)
sexp_processor (3.1.0)
sourcify (0.5.0)
file-tail (>= 1.0.5)
ruby2ruby (>= 1.2.5)
ruby_parser (>= 2.0.5)
sexp_processor (>= 3.0.5)
tins (0.3.9)
wrong (0.6.1)
ParseTree (~> 3.0)
diff-lcs (~> 1.1.2)
file-tail (~> 1.0)
predicated (>= 0.2.3)
ruby2ruby (~> 1.2)
ruby_parser (~> 2.0.4)
sexp_processor (~> 3.0)
sourcify (>= 0.3.0)
PLATFORMS PLATFORMS
ruby ruby
...@@ -25,3 +55,4 @@ DEPENDENCIES ...@@ -25,3 +55,4 @@ DEPENDENCIES
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
jeweler jeweler
rspec rspec
wrong
...@@ -21,8 +21,10 @@ ...@@ -21,8 +21,10 @@
non-standard capitalization. non-standard capitalization.
Note that this still requires that the inflector be configured to understand Note that this still requires that the inflector be configured to understand
the special case. the special case.
* Merge away a few branches whose changes we already have in order to clean up * Shore up test cases a bit.
the Github network graph. * Merge against many of the older branches on Github whose functionality is
already reflected to reduce confusion about what is and is not implemented
here.
* Accept String or Symbol for :position (et al) options. * Accept String or Symbol for :position (et al) options.
* Rename "annotate" bin to "annotate_models" to avoid conflicting with * Rename "annotate" bin to "annotate_models" to avoid conflicting with
ImageMagick. ImageMagick.
......
...@@ -142,9 +142,9 @@ Released under the same license as Ruby. No Support. No Warranty. ...@@ -142,9 +142,9 @@ Released under the same license as Ruby. No Support. No Warranty.
== AUTHOR: == AUTHOR:
Original code by: Dave Thomas -- Pragmatic Programmers, LLC Original code by: Dave Thomas -- Pragmatic Programmers, LLC <http://agilewebdevelopment.com/plugins/annotate_models>
Overhauled by: Alex Chaffee Overhauled by: Alex Chaffee <http://alexch.github.com>
Gemmed by: Cuong Tran Gemmed by: Cuong Tran <http://github.com/ctran>
Maintained by: Alex Chaffee and Cuong Tran Maintained by: Alex Chaffee and Cuong Tran
Integrated by: Jon Frisby Integrated by: Jon Frisby
......
...@@ -58,15 +58,18 @@ Gem::Specification.new do |s| ...@@ -58,15 +58,18 @@ Gem::Specification.new do |s|
s.add_runtime_dependency(%q<activesupport>, [">= 3.0.0"]) s.add_runtime_dependency(%q<activesupport>, [">= 3.0.0"])
s.add_development_dependency(%q<jeweler>, [">= 0"]) s.add_development_dependency(%q<jeweler>, [">= 0"])
s.add_development_dependency(%q<rspec>, [">= 0"]) s.add_development_dependency(%q<rspec>, [">= 0"])
s.add_development_dependency(%q<wrong>, [">= 0"])
else else
s.add_dependency(%q<activesupport>, [">= 3.0.0"]) s.add_dependency(%q<activesupport>, [">= 3.0.0"])
s.add_dependency(%q<jeweler>, [">= 0"]) s.add_dependency(%q<jeweler>, [">= 0"])
s.add_dependency(%q<rspec>, [">= 0"]) s.add_dependency(%q<rspec>, [">= 0"])
s.add_dependency(%q<wrong>, [">= 0"])
end end
else else
s.add_dependency(%q<activesupport>, [">= 3.0.0"]) s.add_dependency(%q<activesupport>, [">= 3.0.0"])
s.add_dependency(%q<jeweler>, [">= 0"]) s.add_dependency(%q<jeweler>, [">= 0"])
s.add_dependency(%q<rspec>, [">= 0"]) s.add_dependency(%q<rspec>, [">= 0"])
s.add_dependency(%q<wrong>, [">= 0"])
end end
end end
...@@ -77,6 +77,13 @@ EOS ...@@ -77,6 +77,13 @@ EOS
describe "#get_model_class" do describe "#get_model_class" do
require "tmpdir" require "tmpdir"
module ::ActiveRecord
class Base
def self.has_many name
end
end
end
def create(file, body="hi") def create(file, body="hi")
file_path = File.join(AnnotateModels.model_dir, file) file_path = File.join(AnnotateModels.model_dir, file)
FileUtils.mkdir_p(File.dirname(file_path)) FileUtils.mkdir_p(File.dirname(file_path))
...@@ -168,6 +175,18 @@ EOS ...@@ -168,6 +175,18 @@ EOS
EOS EOS
check_class_name 'bar/non_namespaced_foo_with_capitals_inside_bar.rb', 'NonNamespacedFooWithCapitalsInsideBar' check_class_name 'bar/non_namespaced_foo_with_capitals_inside_bar.rb', 'NonNamespacedFooWithCapitalsInsideBar'
end end
it "should allow known macros" do
create('foo_with_known_macro.rb', <<-EOS)
class FooWithKnownMacro < ActiveRecord::Base
has_many :yah
end
EOS
capturing(:stderr) do
check_class_name 'foo_with_known_macro.rb', 'FooWithKnownMacro'
end.should == ""
end
end end
describe "#remove_annotation_of_file" do describe "#remove_annotation_of_file" do
......
...@@ -6,6 +6,8 @@ rescue LoadError ...@@ -6,6 +6,8 @@ rescue LoadError
require 'rspec' require 'rspec'
end end
require "wrong/adapters/rspec"
$:.unshift(File.dirname(__FILE__) + '/../lib') $:.unshift(File.dirname(__FILE__) + '/../lib')
require 'active_support' require 'active_support'
require 'active_support/core_ext/string/inflections' require 'active_support/core_ext/string/inflections'
......
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