Marcus Rueckert
28d4254ec9
- in the dependency generator for Gemfile.lock we now skip vendored deps OBS-URL: https://build.opensuse.org/request/show/1045283 OBS-URL: https://build.opensuse.org/package/show/devel:languages:ruby/ruby-common?expand=0&rev=120
45 lines
1.0 KiB
Ruby
45 lines
1.0 KiB
Ruby
#!/bin/sh
|
|
=begin &>/dev/null
|
|
# workaround for rubinius bug
|
|
# https://github.com/rubinius/rubinius/issues/2732
|
|
export LC_ALL="en_US.UTF-8"
|
|
export LANG="en_US.UTF-8"
|
|
ruby=""
|
|
for bundler in $(/usr/bin/ruby-find-versioned bundler) ; do
|
|
if [ -x "$bundler" ] ; then
|
|
ruby="${bundler//bundler/ruby}"
|
|
break
|
|
fi
|
|
done
|
|
exec $ruby -x $0 "$@"
|
|
=end
|
|
#!/usr/bin/ruby
|
|
# vim: set sw=2 sts=2 et tw=80 :
|
|
require 'bundler'
|
|
require 'yaml'
|
|
|
|
app_info_file=".appinfo.yml"
|
|
gemfile_lock = STDIN.read.chomp
|
|
|
|
appdir = File.dirname(gemfile_lock)
|
|
Dir.chdir(appdir)
|
|
|
|
unless File.exist? app_info_file then
|
|
STDERR.puts "Warning: Skipping Gemfile.lock without appinfo.yaml file"
|
|
exit 0
|
|
end
|
|
|
|
app_config =YAML.load_file(app_info_file) || {}
|
|
ruby_abi=app_config[:ruby_abi]
|
|
|
|
if ruby_abi.nil? then
|
|
STDERR.puts "Error: Can not generate requires without a ruby abi. Skipping."
|
|
exit 0
|
|
end
|
|
|
|
Bundler.definition.specs.each do |dep|
|
|
# this skips local deps
|
|
next if dep.source and dep.source.path?
|
|
puts "rubygem(#{ruby_abi}:#{dep.name}) = #{dep.version}"
|
|
end
|