Sha256: 1e9ce5a993d20ffe3600636e2608171b37ae772174541a5880da68a908412b79

Contents?: true

Size: 351 Bytes

Versions: 9

Compression:

Stored size: 351 Bytes

Contents

module TwirpRails
  module Twirp
    def self.auto_require_twirp_files(twirp_path)
      # protoc generates require without path in a _pb files
      $LOAD_PATH.unshift(twirp_path) unless $LOAD_PATH.include?(twirp_path)

      Dir.glob(Rails.root.join(twirp_path, '**/*_twirp.rb')).sort.each do |file|
        require file
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
twirp_rails-0.4.11 lib/twirp_rails/twirp.rb
twirp_rails-0.4.10 lib/twirp_rails/twirp.rb
twirp_rails-0.4.9 lib/twirp_rails/twirp.rb
twirp_rails-0.4.8 lib/twirp_rails/twirp.rb
twirp_rails-0.4.7 lib/twirp_rails/twirp.rb
twirp_rails-0.4.6 lib/twirp_rails/twirp.rb
twirp_rails-0.4.5 lib/twirp_rails/twirp.rb
twirp_rails-0.4.4 lib/twirp_rails/twirp.rb
twirp_rails-0.4.3 lib/twirp_rails/twirp.rb