From: Jonathan Cairns Date: 2013-02-06T20:59:32+09:00 Subject: Re: Expanding gemspecs --047d7b6224344ddf2a04d50cf46f Content-Type: text/plain; charset=ISO-8859-1 > You're looking at a plain old file sitting in the gem bundle. While that's used for packaging, it isn't the gem's specification. Look in $(gem env gemdir)/specifications: Ah, so the gemspec file in the gem directory is not loaded when loading the gem itself? That makes sense. You learn something every day! It looks like this isn't an issue then, as gem already does what I was hoping it would do. Thanks Ryan On 6 February 2013 11:44, Ryan Davis wrote: > > On Feb 6, 2013, at 02:53 , Jon Cairns wrote: > > > That doesn't seem to be the case, at least for my gems! It appears that > > it's down to the author. Here's a random example I picked from my gem > > home, highline-1.6.15: > > > > --------- > > SPEC = Gem::Specification.new do |spec| > > spec.name = "highline" > > spec.version = GEM_VERSION > > spec.platform = Gem::Platform::RUBY > > spec.summary = "HighLine is a high-level command-line IO library." > > spec.files = `git ls-files`.split("\n") > > > > spec.test_files = `git ls-files -- test/*.rb`.split("\n") > > You're looking at a plain old file sitting in the gem bundle. While that's > used for packaging, it isn't the gem's specification. Look in $(gem env > gemdir)/specifications: > > % gem i -i xxx highline > Fetching: highline-1.6.15.gem (100%) > Successfully installed highline-1.6.15 > 1 gem installed > > % cat xxx/specifications/highline-1.6.15.gemspec > # -*- encoding: utf-8 -*- > > Gem::Specification.new do |s| > s.name = "highline" > s.version = "1.6.15" > > s.required_rubygems_version = Gem::Requirement.new(">= 0") if > s.respond_to? :required_rubygems_version= > s.authors = ["James Edward Gray II"] > s.date = "2012-09-13" > s.description = "A high-level IO library that provides validation, type > conversion, and more for\ncommand-line interfaces. HighLine also includes a > complete menu system that can\ncrank out anything from simple list > selection to complete shells with just\nminutes of work.\n" > s.email = "james@graysoftinc.com" > s.extra_rdoc_files = ["README.rdoc", "INSTALL", "TODO", "CHANGELOG", > "LICENSE"] > s.files = ["README.rdoc", "INSTALL", "TODO", "CHANGELOG", "LICENSE"] > s.homepage = "http://highline.rubyforge.org" > s.rdoc_options = ["--title", "HighLine Documentation", "--main", > "README"] > s.require_paths = ["lib"] > s.rubyforge_project = "highline" > s.rubygems_version = "1.8.25" > s.summary = "HighLine is a high-level command-line IO library." > > if s.respond_to? :specification_version then > s.specification_version = 3 > > if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then > else > end > else > end > end > > -- *Jon Cairns* * * e-mail: jon@joncairns.com website: http://joncairns.com twitter: @joonty --047d7b6224344ddf2a04d50cf46f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
>=A0You're looking at a plain old file sitting in the gem bundle. = While that's used for packaging, it isn't the gem's specificati= on. Look in $(gem env gemdir)/specifications:

Ah= , so the gemspec file in the gem directory is not loaded when loading the g= em itself? That makes sense. You learn something every day!

=
It looks like this isn't an issue then, as gem already does wh= at I was hoping it would do.

=
Thanks Ryan


<= div class=3D"gmail_quote"> On 6 February 2013 11:44, Ryan Davis <ryand-ruby@zenspider.com&= gt; wrote:

On Feb 6, 2013, at 02:53 , Jon Cairns <lists@ruby-forum.com> wrote:

> That doesn't seem to be the case, at least for my gems! It appears= that
> it's down to the author. Here's a random example I picked from= my gem
> home, highline-1.6.15:
>
> ---------
> SPEC =3D Gem::Specification.new do |spec|
> =A0spec.name =A0 = =A0 =3D "highline"
> =A0spec.version =A0=3D GEM_VERSION
> =A0spec.platform =3D Gem::Platform::RUBY
> =A0spec.summary =A0=3D "HighLine is a high-level command-line IO = library."
> =A0spec.files =A0 =A0=3D `git ls-files`.split("\n")
>
> =A0spec.test_files =A0 =A0 =A0 =3D =A0`git ls-files -- test/*.rb`.spli= t("\n")

You're looking at a plain old file sitting in the gem bundle. Whi= le that's used for packaging, it isn't the gem's specification.= Look in $(gem env gemdir)/specifications:

% gem i -i xxx highline
Fetching: highline-1.6.15.gem (100%)
Successfully installed highline-1.6.15
1 gem installed

% cat xxx/specifications/highline-1.6.15.gemspec
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
=A0 s.name =3D "highli= ne"
=A0 s.version =3D "1.6.15"

=A0 s.required_rubygems_version =3D Gem::Requirement.new(">=3D 0&qu= ot;) if s.respond_to? :required_rubygems_version=3D
=A0 s.authors =3D ["James Edward Gray II"]
=A0 s.date =3D "2012-09-13"
=A0 s.description =3D "A high-level IO library that provides validatio= n, type conversion, and more for\ncommand-line interfaces. HighLine also in= cludes a complete menu system that can\ncrank out anything from simple list= selection to complete shells with just\nminutes of work.\n"
=A0 s.email =3D "james@grayso= ftinc.com"
=A0 s.extra_rdoc_files =3D ["README.rdoc", "INSTALL", &= quot;TODO", "CHANGELOG", "LICENSE"]
=A0 s.files =3D ["README.rdoc", "INSTALL", "TODO&q= uot;, "CHANGELOG", "LICENSE"]
=A0 s.homepage =3D "http://highline.rubyforge.org"
=A0 s.rdoc_options =3D ["--title", "HighLine Documentation&q= uot;, "--main", "README"]
=A0 s.require_paths =3D ["lib"]
=A0 s.rubyforge_project =3D "highline"
=A0 s.rubygems_version =3D "1.8.25"
=A0 s.summary =3D "HighLine is a high-level command-= line IO library."

=A0 if s.respond_to? :specification_version then
=A0 =A0 s.specification_version =3D 3

=A0 =A0 if Gem::Version.new(Gem::VERSION) >=3D Gem::Version.new('1.2= .0') then
=A0 =A0 else
=A0 =A0 end
=A0 else
=A0 end
end




--
Jon Cairns

e-ma= il:=A0jon@joncairns.com
twitter= :=A0@joonty
--047d7b6224344ddf2a04d50cf46f--