[Pkg-puppet-devel] [facter] 131/352: (FACT-186) Consolidate gem runtime dependencies

Stig Sandbeck Mathisen ssm at debian.org
Sun Apr 6 22:21:38 UTC 2014


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

ssm pushed a commit to branch master
in repository facter.

commit 294ef91c4b0bcb6df6edee6cb4dc1583b769f653
Author: Josh Cooper <josh at puppetlabs.com>
Date:   Fri Jan 3 15:15:01 2014 -0800

    (FACT-186) Consolidate gem runtime dependencies
    
    Previously, the Gemfile and ext/project_data.yaml both described gem runtime
    dependencies, the former requiring an exact match, the latter a pessimistic
    match.
    
    This commit makes project_data.yaml be the single source of truth, and it
    specifies exact versions.
    
    Rubygems and bundler have different ideas about what constitutes a platform.
    Rubygems requires an arch and os, e.g. x86-mingw32, while bundler has a
    hard-coded list, see Bundler::Dependency::PLATFORM_MAP. As result, we need
    to use the rubygems platform when building the facter gem, but use the
    bundler platform when expressing gem dependencies.
---
 Gemfile               | 20 ++++++++++++--------
 ext/project_data.yaml | 20 +++++++++++++-------
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/Gemfile b/Gemfile
index 8fd33e2..446e8ca 100644
--- a/Gemfile
+++ b/Gemfile
@@ -20,14 +20,18 @@ group :development, :test do
   gem 'puppetlabs_spec_helper'
 end
 
-platform :mswin, :mingw do
-  gem "ffi", "1.9.0", :require => false
-  gem "sys-admin", "1.5.6", :require => false
-  gem "win32-api", "1.4.8", :require => false
-  gem "win32-dir", "0.4.3", :require => false
-  gem "windows-api", "0.4.2", :require => false
-  gem "windows-pr", "1.2.2", :require => false
-  gem "win32console", "1.3.2", :require => false
+require 'yaml'
+data = YAML.load_file(File.join(File.dirname(__FILE__), 'ext', 'project_data.yaml'))
+bundle_platforms = data['bundle_platforms']
+data['gem_platform_dependencies'].each_pair do |gem_platform, info|
+  if bundle_deps = info['gem_runtime_dependencies']
+    bundle_platform = bundle_platforms[gem_platform] or raise "Missing bundle_platform"
+    platform(bundle_platform.intern) do
+      bundle_deps.each_pair do |name, version|
+        gem(name, version, :require => false)
+      end
+    end
+  end
 end
 
 gem 'facter', ">= 1.0.0", :path => File.expand_path("..", __FILE__)
diff --git a/ext/project_data.yaml b/ext/project_data.yaml
index 60fbffc..1a19a12 100644
--- a/ext/project_data.yaml
+++ b/ext/project_data.yaml
@@ -14,12 +14,18 @@ gem_test_files: 'spec/**/*'
 gem_executables: 'facter'
 gem_default_executables: 'facter'
 gem_platform_dependencies:
+  universal-darwin:
+    gem_runtime_dependencies:
+      CFPropertyList: '2.2.6'
   x86-mingw32:
     gem_runtime_dependencies:
-      ffi: '~> 1.9.0'
-      sys-admin: '~> 1.5.6'
-      win32-api: '~> 1.4.8'
-      win32-dir: '~> 0.4.3'
-      windows-api: '~> 0.4.2'
-      windows-pr: '~> 1.2.2'
-      win32console: '~> 1.3.2'
+      ffi: '1.9.0'
+      sys-admin: '1.5.6'
+      win32-api: '1.4.8'
+      win32-dir: '0.4.3'
+      windows-api: '0.4.2'
+      windows-pr: '1.2.2'
+      win32console: '1.3.2'
+bundle_platforms:
+  universal-darwin: ruby
+  x86-mingw32: mingw

-- 
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