[Pkg-puppet-devel] [facter] 15/46: (maint) Make facter gemspec report correct version

Stig Sandbeck Mathisen ssm at debian.org
Sun Sep 1 10:47:28 UTC 2013


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository facter.

commit 28408fb0e42dede8382b76e324ed0675a0020dc4
Author: Jeff McCune <jeff at puppetlabs.com>
Date:   Mon Apr 22 17:08:12 2013 -0700

    (maint) Make facter gemspec report correct version
    
    Without this patch the Gem system thinks that the version of Facter
    running from a development branch is `1.6.11` even though many versions
    have been released since then.  This is a problem because a project that
    requires Facter >= 1.7.0 should be able to satisfy this dependency using
    the `stable` development branch, however it cannot because the version
    information is out of date.
    
    This patch addresses the problem by using Facter's public version API to
    determine the version of Facter contained in the git branch.
    
    This patch also attempts to make it clear to the reader that the gemspec
    is intended for use with the VCS branches under active development and
    _not_ as the way to produce a gem release package.
---
 .gemspec |   22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/.gemspec b/.gemspec
index d2ec27b..c6f1b27 100644
--- a/.gemspec
+++ b/.gemspec
@@ -1,8 +1,28 @@
 # -*- encoding: utf-8 -*-
+#
+# PLEASE NOTE
+# This gemspec is not intended to be used for building the Facter gem.  This
+# gemspec is intended for use with bundler when Facter is a dependency of
+# another project.  For example, the stdlib project is able to integrate with
+# the master branch of Facter by using a Gemfile path of
+# git://github.com/puppetlabs/facter.git
+#
+# Please see the [packaging
+# repository](https://github.com/puppetlabs/packaging) for information on how
+# to build the Puppet gem package.
+
+begin
+  require 'facter/version'
+rescue LoadError
+  $LOAD_PATH.unshift(File.expand_path("../lib", __FILE__))
+  require 'facter/version'
+end
 
 Gem::Specification.new do |s|
   s.name = "facter"
-  s.version = "1.6.11"
+  version = Facter.version
+  mdata = version.match(/(\d+\.\d+\.\d+)/)
+  s.version = mdata ? mdata[1] : version
 
   s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
   s.authors = ["Puppet Labs"]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git



More information about the Pkg-puppet-devel mailing list