Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2019-07-31 17:19:59 +0300
committerPaul Okstad <pokstad@gitlab.com>2019-07-31 17:19:59 +0300
commit949b025b29c25fb1076ba4669193f4e78e5d09ca (patch)
tree11e3b773d513d80894b7ebe2195c0e701570cdca /_support/generate-proto-ruby
parentc700a6150855a6a8a0aafdde2717dc19e55cc6e8 (diff)
Use embedded ruby proto stubs
Diffstat (limited to '_support/generate-proto-ruby')
-rwxr-xr-x_support/generate-proto-ruby24
1 files changed, 17 insertions, 7 deletions
diff --git a/_support/generate-proto-ruby b/_support/generate-proto-ruby
index c8742037e..a9ceab7d4 100755
--- a/_support/generate-proto-ruby
+++ b/_support/generate-proto-ruby
@@ -31,14 +31,24 @@ def write_ruby_requires
abort "No auto-generated Ruby service files found" if requires.empty?
requires.unshift(RUBY_VERSION_FILE)
gem_root = File.join(RUBY_PREFIX, 'gitaly.rb')
- gem_root_template = ERB.new <<EOT
-# This file is generated by #{File.basename($0)}. Do not edit.
-$:.unshift(File.expand_path('../gitaly', __FILE__))
-<% requires.each do |f| %>
-require '<%= f.sub(/\.rb$/, '') %>'
-<% end %>
-EOT
+ gem_root_template = ERB.new <<~EOT
+ # This file is generated by #{File.basename($0)}. Do not edit.
+ $:.unshift(File.expand_path('../gitaly', __FILE__))
+ <% requires.each do |f| %>
+ require '<%= f.sub(/\.rb$/, '') %>'
+ <% end %>
+ EOT
open(gem_root, 'w') { |f| f.write(gem_root_template.result(binding)) }
+
+ version_rb_template = <<~EOT
+ # This file was auto-generated by #{$0}
+ module Gitaly
+ VERSION = "#{File.read('VERSION').chomp}"
+ end
+ EOT
+ version_rb = File.join(RUBY_PREFIX, RUBY_VERSION_FILE)
+ open(version_rb, 'w') { |f| f.write(version_rb_template) }
+
end
main