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
parentc700a6150855a6a8a0aafdde2717dc19e55cc6e8 (diff)
Use embedded ruby proto stubs
-rwxr-xr-x_support/generate-proto-ruby24
-rw-r--r--_support/makegen.go1
-rw-r--r--ruby/Gemfile1
-rw-r--r--ruby/Gemfile.lock3
-rw-r--r--ruby/lib/gitaly_server.rb1
-rw-r--r--ruby/proto/gitaly/version.rb4
-rw-r--r--ruby/spec/support/helpers/integration_helper.rb2
-rw-r--r--ruby/spec/test_repo_helper.rb4
8 files changed, 25 insertions, 15 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
diff --git a/_support/makegen.go b/_support/makegen.go
index 154106403..d9149a6aa 100644
--- a/_support/makegen.go
+++ b/_support/makegen.go
@@ -370,7 +370,6 @@ build: ../.ruby-bundle
../.ruby-bundle: {{ .GitalyRubyDir }}/Gemfile.lock {{ .GitalyRubyDir }}/Gemfile
cd {{ .GitalyRubyDir }} && bundle config # for debugging
cd {{ .GitalyRubyDir }} && bundle install $(BUNDLE_FLAGS)
- cd {{ .GitalyRubyDir }} && bundle show gitaly-proto # sanity check
touch $@
.PHONY: install
diff --git a/ruby/Gemfile b/ruby/Gemfile
index d1d31c4e4..6ec8b33f2 100644
--- a/ruby/Gemfile
+++ b/ruby/Gemfile
@@ -7,7 +7,6 @@ gem 'rugged', '~> 0.28'
gem 'github-linguist', '~> 6.1', require: 'linguist'
gem 'gitlab-markup', '~> 1.7.0'
gem 'activesupport', '~> 5.2.3'
-gem 'gitaly-proto', '~> 1.37.0'
gem 'rdoc', '~> 4.2'
gem 'gitlab-gollum-lib', '~> 4.2.7.7', require: false
gem 'gitlab-gollum-rugged_adapter', '~> 0.4.4.2', require: false
diff --git a/ruby/Gemfile.lock b/ruby/Gemfile.lock
index fa9f9bb2e..8c2965643 100644
--- a/ruby/Gemfile.lock
+++ b/ruby/Gemfile.lock
@@ -49,8 +49,6 @@ GEM
ffi (1.10.0)
gemojione (3.3.0)
json
- gitaly-proto (1.37.0)
- grpc (~> 1.0)
github-linguist (6.4.1)
charlock_holmes (~> 0.7.6)
escape_utils (~> 1.2.0)
@@ -217,7 +215,6 @@ DEPENDENCIES
bundler (>= 1.17.3)
factory_bot
faraday (~> 0.12)
- gitaly-proto (~> 1.37.0)
github-linguist (~> 6.1)
gitlab-gollum-lib (~> 4.2.7.7)
gitlab-gollum-rugged_adapter (~> 0.4.4.2)
diff --git a/ruby/lib/gitaly_server.rb b/ruby/lib/gitaly_server.rb
index a03f0dab6..7b72d9318 100644
--- a/ruby/lib/gitaly_server.rb
+++ b/ruby/lib/gitaly_server.rb
@@ -1,3 +1,4 @@
+$:.unshift(File.expand_path('../proto', __dir__))
require 'gitaly'
require_relative 'gitlab/git.rb'
diff --git a/ruby/proto/gitaly/version.rb b/ruby/proto/gitaly/version.rb
new file mode 100644
index 000000000..af4097271
--- /dev/null
+++ b/ruby/proto/gitaly/version.rb
@@ -0,0 +1,4 @@
+# This file was auto-generated by _support/generate-proto-ruby
+module Gitaly
+ VERSION = "1.53.0"
+end
diff --git a/ruby/spec/support/helpers/integration_helper.rb b/ruby/spec/support/helpers/integration_helper.rb
index 6e6631ba9..23a65ed55 100644
--- a/ruby/spec/support/helpers/integration_helper.rb
+++ b/ruby/spec/support/helpers/integration_helper.rb
@@ -1,6 +1,4 @@
require 'socket'
-
-require 'gitaly'
require 'spec_helper'
SOCKET_PATH = 'gitaly.socket'.freeze
diff --git a/ruby/spec/test_repo_helper.rb b/ruby/spec/test_repo_helper.rb
index 2ff26ff5c..5250bfaa7 100644
--- a/ruby/spec/test_repo_helper.rb
+++ b/ruby/spec/test_repo_helper.rb
@@ -1,8 +1,10 @@
require 'fileutils'
require 'securerandom'
-require 'gitaly'
require 'rugged'
+$:.unshift(File.expand_path('../proto', __dir__))
+require 'gitaly'
+
DEFAULT_STORAGE_DIR = File.expand_path('../tmp/repositories', __dir__)
DEFAULT_STORAGE_NAME = 'default'.freeze
TEST_REPO_PATH = File.join(DEFAULT_STORAGE_DIR, 'gitlab-test.git')