diff --git a/.gitignore b/.gitignore index 57f6cd6ad..35e6e1a4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.swp test.db factory_girl-*.gem -rdoc -coverage \ No newline at end of file +doc +.yardoc +coverage diff --git a/.yardopts b/.yardopts new file mode 100644 index 000000000..85a6fd087 --- /dev/null +++ b/.yardopts @@ -0,0 +1,3 @@ +lib/**/*.rb +- +LICENSE diff --git a/Gemfile b/Gemfile index 240f4e976..958b9da8a 100644 --- a/Gemfile +++ b/Gemfile @@ -7,4 +7,6 @@ gem "activerecord", :require => false gem "rr" gem "sqlite3-ruby", :require => false gem "appraisal" +gem "yard" +gem "bluecloth" diff --git a/Gemfile.lock b/Gemfile.lock index 8a000f694..ba3f0841d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -16,6 +16,7 @@ GEM rake arel (1.0.1) activesupport (~> 3.0.0) + bluecloth (2.0.9) builder (2.1.2) cucumber (0.9.4) builder (~> 2.1.2) @@ -43,6 +44,7 @@ GEM sqlite3-ruby (1.3.2) term-ansicolor (1.0.5) tzinfo (0.3.23) + yard (0.6.4) PLATFORMS ruby @@ -50,9 +52,11 @@ PLATFORMS DEPENDENCIES activerecord appraisal + bluecloth cucumber rake rcov rr rspec (~> 2.0) sqlite3-ruby + yard diff --git a/Rakefile b/Rakefile index 205080878..e0f434b7f 100644 --- a/Rakefile +++ b/Rakefile @@ -1,13 +1,13 @@ require 'rubygems' require 'bundler/setup' require 'rake' -require 'rake/rdoctask' require 'rcov/rcovtask' require 'date' require 'rake/gempackagetask' require 'rspec/core/rake_task' require 'cucumber/rake/task' require 'appraisal' +require 'yard' desc 'Default: run the specs and features.' task :default => 'spec:unit' do @@ -35,23 +35,8 @@ Rcov::RcovTask.new do |t| t.verbose = true end -desc 'Generate documentation for the factory_girl plugin.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'Factory Girl' - rdoc.options << '--line-numbers' << "--main" << "README.rdoc" - rdoc.rdoc_files.include('README.rdoc') - rdoc.rdoc_files.include('CONTRIBUTION_GUIDELINES.rdoc') - rdoc.rdoc_files.include('lib/**/*.rb') -end - -desc 'Update documentation on website' -task :sync_docs => 'rdoc' do - `rsync -ave ssh rdoc/ dev@dev.thoughtbot.com:/home/dev/www/dev.thoughtbot.com/factory_girl` -end - desc "Clean files generated by rake tasks" -task :clobber => [:clobber_rdoc, :clobber_rcov] +task :clobber => [:clobber_rcov] Cucumber::Rake::Task.new(:features) do |t| t.fork = true @@ -64,3 +49,6 @@ Rake::GemPackageTask.new($specification) do |package| package.need_tar = true end +YARD::Rake::YardocTask.new do |t| +end + diff --git a/lib/factory_girl/definition_proxy.rb b/lib/factory_girl/definition_proxy.rb index ae203ed95..5b8204d66 100644 --- a/lib/factory_girl/definition_proxy.rb +++ b/lib/factory_girl/definition_proxy.rb @@ -22,7 +22,7 @@ def initialize(factory) # # Arguments: # * name: +Symbol+ or +String+ - # The name of this attribute. This will be assigned using :"#{name}=" for + # The name of this attribute. This will be assigned using "name=" for # generated instances. # * value: +Object+ # If no block is given, this value will be used for this attribute.