lib/twirp_rails/twirp.rb in twirp_rails-0.1.0 vs lib/twirp_rails/twirp.rb in twirp_rails-0.1.1
- old
+ new
@@ -1,7 +1,11 @@
module TwirpRails
module Twirp
def self.auto_require_twirp_files
+ # protoc generates require without path in a _pb files
+ twirp_path = Rails.root.join('lib/twirp').to_s
+ $LOAD_PATH.unshift(twirp_path) if !$LOAD_PATH.include?(twirp_path)
+
Dir.glob(Rails.root.join('lib/twirp/*_twirp.rb')).sort.each do |file|
require file
end
end
end