Skip to content

Commit 17eb3b3

Browse files
committed
hack: make sure default position is 'before'; also remove VERSION.yml from gemspec
1 parent a786d70 commit 17eb3b3

File tree

4 files changed

+3
-2
lines changed

4 files changed

+3
-2
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ Gemfile.lock
99
*.gem
1010
/.idea/
1111
.rvmrc
12-
.bundle
1312
.bundle/

annotate.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
1212
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
1313
s.extra_rdoc_files = ["README.rdoc"]
1414

15-
s.files = %w( README.rdoc VERSION.yml History.txt )
15+
s.files = %w( README.rdoc History.txt )
1616
s.files += Dir.glob("lib/**/*")
1717
s.files += Dir.glob("tasks/**/*")
1818
s.files += ["bin/annotate"] # todo: annotate_models

bin/annotate

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ OptionParser.new do |opts|
2020
task = :remove_annotation
2121
end
2222

23+
ENV['position'] = 'before' # hack: make sure default position is "before"
2324
opts.on('-p', '--position [before|after]', ['before', 'after'],
2425
"Place the annotations at the top (before) or the bottom (after) of the model file") do |p|
2526
ENV['position'] = p

lib/annotate/annotate_models.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def annotate_one_file(file_name, info_block, options={})
197197
# Strip the old schema info, and insert new schema info.
198198
old_content.sub!(encoding, '')
199199
old_content.sub!(PATTERN, '')
200+
200201
new_content = (options[:position] || 'before').to_s == 'after' ?
201202
(encoding_header + (old_content.rstrip + "\n\n" + info_block)) :
202203
(encoding_header + info_block + old_content)

0 commit comments

Comments
 (0)