Skip to content

Commit

Permalink
[Fixed] Issue 9: proto_path has no effect
Browse files Browse the repository at this point in the history
  • Loading branch information
technohippy committed Dec 27, 2008
1 parent 383ea2e commit d9eec52
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/protobuf/compiler/visitors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,16 @@ def attach_proto?
end

def commented_proto_contents
File.read(proto_file).gsub(/^/, '# ') if proto_file
#File.read(proto_file).gsub(/^/, '# ') if proto_file
if proto_file
if File.exist? proto_file
File.read(proto_file).gsub(/^/, '# ')
elsif File.exist? "#{@proto_dir}/#{proto_file}"
File.read("#{@proto_dir}/#{proto_file}").gsub(/^/, '# ')
else
raise Errno::ENOENT.new(proto_file)
end
end
end

def write(str)
Expand Down

0 comments on commit d9eec52

Please sign in to comment.