Skip to content
Snippets Groups Projects
Commit 1183d859 authored by Jacob Vosmaer (GitLab)'s avatar Jacob Vosmaer (GitLab)
Browse files

Eager-load ruby client code

parent 191511a0
No related branches found
No related tags found
1 merge request!7Revert info refs change
Pipeline #
Loading
Loading
@@ -4,6 +4,8 @@ require 'erb'
require_relative 'run.rb'
 
GEM_NAME = 'gitaly'
RUBY_PREFIX = 'ruby/lib'
RUBY_VERSION_FILE = 'gitaly/version.rb'
 
def main(version)
run!(%w[_support/generate-from-proto])
Loading
Loading
@@ -11,6 +13,7 @@ def main(version)
run!(%w[git diff --quiet --exit-code])
puts 'Testing for staged changes'
run!(%w[git diff --quiet --cached --exit-code])
write_ruby_requires
write_version_files(version)
version_msg = "Version #{version}"
run!(%W[git commit -m #{version_msg}])
Loading
Loading
@@ -45,11 +48,27 @@ module Gitaly
VERSION = "#{version}"
end
EOT
version_rb = 'ruby/lib/gitaly/version.rb'
version_rb = File.join(RUBY_PREFIX, RUBY_VERSION_FILE)
open(version_rb, 'w') { |f| f.write(version_rb_template.result) }
run!(%W[git add #{version_rb}])
end
 
def write_ruby_requires
requires = Dir.chdir(RUBY_PREFIX) { Dir['gitaly/*_services_pb.rb'] }
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 _support/release. 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)) }
run!(%W[git add #{gem_root}])
end
def error(msg)
warn "#{$0}: #{msg}"
end
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment