[DRE-maint] Bug#986254: gem2deb creates gemspec file as a binary file for ruby-magic-static? gem
Antonio Terceiro
terceiro at debian.org
Wed Apr 7 18:36:25 BST 2021
On Wed, Apr 07, 2021 at 02:20:34PM -0300, Antonio Terceiro wrote:
> On Wed, Apr 07, 2021 at 04:49:38PM +0530, Nilesh Patra wrote:
> > And I tried changing the second "-lib" entry to ruby-lib (it does not
> > mean anything, this is a random example)
> >
> > and I get the same offending term: ruby lib^@ruby-lib
> > attaching the output, for ref
> >
> > So it looks like more than one entry in "require_paths" outputs a
> > "binary" gemspec which is troublesome.
> >
> > Nilesh
>
> This sounds like a bug in rubygems itself.
On the other hand, this seems to be done on purpose.
def to_ruby
require_relative 'openssl'
mark_version
result = []
result << "# -*- encoding: utf-8 -*-"
result << "#{Gem::StubSpecification::PREFIX}#{name} #{version} #{platform} #{raw_require_paths.join("\0")}"
result << "#{Gem::StubSpecification::PREFIX}#{extensions.join "\0"}" unless
extensions.empty?
However, trying to load such gemspec should work fine:
$ ruby -e 'puts Gem::Specification.new { |s| s.version = "1"; s.require_paths = ["foo", "bar"] }.to_ruby' > /tmp/g
$ file /tmp/g
/tmp/g: data
$ ruby -e 'puts Gem::Specification.load("/tmp/g")'
#<Gem::Specification name= version=1>
Praveen, can you share the exact error that you got originally?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-ruby-extras-maintainers/attachments/20210407/21ed1587/attachment-0001.sig>
More information about the Pkg-ruby-extras-maintainers
mailing list