IPGlider-annotate 2.2.6 → 2.2.7

Sign up to get free protection for your applications and to get access to all the features.
data/annotate.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{annotate}
5
- s.version = "2.2.6"
5
+ s.version = "2.2.7"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Marcos Piccinini"]
9
- s.date = %q{2009-02-14}
9
+ s.date = %q{2009-02-20}
10
10
  s.default_executable = %q{annotate}
11
11
  s.description = %q{Annotates Rails Models and Routes}
12
12
  s.email = ["x@nofxx.com"]
data/lib/annotate.rb CHANGED
@@ -2,7 +2,7 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module Annotate
5
- VERSION = '2.2.6'
5
+ VERSION = '2.2.7'
6
6
  end
7
7
 
8
8
  begin
@@ -73,6 +73,8 @@ module AnnotateModels
73
73
  # "before" or "after". Default is "before".
74
74
  # :position_in_class<Symbol>:: where to place the annotated section in model file
75
75
  # :position_in_fixture<Symbol>:: where to place the annotated section in fixture file
76
+ # :position_in_others<Symbol>:: where to place the annotated section in the rest of
77
+ # supported files
76
78
  #
77
79
  def annotate_one_file(file_name, info_block, options={})
78
80
  if File.exist?(file_name)
@@ -128,8 +130,8 @@ module AnnotateModels
128
130
  [
129
131
  File.join(UNIT_TEST_DIR, "#{model_name}_test.rb"), # test
130
132
  File.join(SPEC_MODEL_DIR, "#{model_name}_spec.rb"), # spec
131
- File.join(EXEMPLARS_DIR, "#{model_name}_exemplar.rb"), # Object Daddy
132
- ].each { |file| annotate_one_file(file, info) }
133
+ File.join(EXEMPLARS_DIR, "#{model_name}_exemplar.rb"), # Object Daddy
134
+ ].each { |file| annotate_one_file(file, info, options.merge(:position=>(options[:position_in_others] || options[:position]))) }
133
135
 
134
136
  FIXTURE_DIRS.each do |dir|
135
137
  fixture_file_name = File.join(dir,klass.table_name + ".yml")
@@ -3,7 +3,8 @@ task :annotate_models => :environment do
3
3
  require 'annotate/annotate_models'
4
4
  options={}
5
5
  options[:position_in_class] = ENV['position_in_class'] || ENV['position']
6
- options[:position_in_fixture] = ENV['position_in_fixture'] || ENV['position']
6
+ options[:position_in_fixture] = ENV['position_in_fixture'] || ENV['position']
7
+ options[:position_in_others] = ENV['position_in_others'] || ENV['position']
7
8
  AnnotateModels.do_annotations(options)
8
9
  end
9
10
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: IPGlider-annotate
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.6
4
+ version: 2.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcos Piccinini
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-14 00:00:00 -08:00
12
+ date: 2009-02-20 00:00:00 -08:00
13
13
  default_executable: annotate
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency