fpm-cookery 0.26.1 → 0.27.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b8dcc176b33a7c7e5528cc48f2cca03f9df91ac
4
- data.tar.gz: 95f2469915db560eb6e658cafb42769c1f11acf8
3
+ metadata.gz: 2db5b71e180868ebd32db10eb630c9d0a24f975d
4
+ data.tar.gz: de82341b062459e515d836d76eec7fb6fe30b926
5
5
  SHA512:
6
- metadata.gz: 14585fd542f177e7a08367979698a6c9f39aa1cda129e79a543e07cb0e7640cc3a7d7c9e326a81d728c3ff13dddf0bb7d7a8726d0d574f79141942fc359e9682
7
- data.tar.gz: 23bae9ba992f8c2f1049435e6b4bcc9da0da01c794779d5cfb661234d83713f1d155178871b743472dc697e2dfbd5ed06458cb459ea265ce6720ba51a18b6769
6
+ metadata.gz: 298216d99ecf3533e188f31114c40230f90c22e5476bc57faa270467f0d4439f940b6b41624991257d8c2b99bc3b6b13454566c9314f44fcf35c39a14231caa2
7
+ data.tar.gz: e65f6b0a111d725c03c0093be43fa39c98b7dd664849189280051f0f945c47135f441ee8b60186fc4ff01405b1e41d6b2f16e2017868c6ed72441e61e4fc699f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # v0.27.0 (2015-04-02)
2
+ * Make default prefix configurable. (#104)
3
+ * Unbreak running on Ruby 2.2. (#105)
4
+ * Fix Puppet dependecy. (#105)
5
+
1
6
  # v0.26.1 (2015-02-22)
2
7
  * Revert "Avoid using git ls-files in gemspec".
3
8
 
data/fpm-cookery.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency "rake"
23
23
  s.add_runtime_dependency "fpm", "~> 1.1"
24
24
  s.add_runtime_dependency "facter"
25
- s.add_runtime_dependency "puppet", ">= 3.4.3"
25
+ s.add_runtime_dependency "puppet", "~> 3.4"
26
26
  s.add_runtime_dependency "addressable"
27
27
  s.add_runtime_dependency "systemu"
28
28
  end
@@ -1,17 +1,24 @@
1
- require 'puppet'
2
- require 'puppet/resource'
3
- require 'puppet/transaction/report'
4
1
  require 'fpm/cookery/facts'
5
2
  require 'fpm/cookery/log'
6
3
 
7
- # Init Puppet before using it
8
- Puppet.initialize_settings
4
+ begin
5
+ require 'puppet'
6
+ require 'puppet/resource'
7
+ require 'puppet/transaction/report'
8
+
9
+ # Init Puppet before using it
10
+ Puppet.initialize_settings
11
+ rescue Exception
12
+ end
9
13
 
10
14
  module FPM
11
15
  module Cookery
12
16
  class DependencyInspector
13
-
14
17
  def self.verify!(depends, build_depends)
18
+ unless defined?(Puppet::Resource)
19
+ Log.warn "Unable to load Puppet. Automatic dependency installation disabled."
20
+ return
21
+ end
15
22
 
16
23
  Log.info "Verifying build_depends and depends with Puppet"
17
24
 
@@ -15,7 +15,7 @@ module FPM
15
15
 
16
16
  # Most of the path helper stuff comes from brew2deb and homebrew.
17
17
  def prefix(path = nil)
18
- current_pathname_for('usr')/path
18
+ current_pathname_for(default_prefix || '/usr')/path
19
19
  end
20
20
 
21
21
  def etc(path = nil)
@@ -70,6 +70,8 @@ module FPM
70
70
 
71
71
  private
72
72
  def current_pathname_for(dir)
73
+ dir.gsub!(%r{^/}, '') if dir
74
+
73
75
  if omnibus_installing?
74
76
  Path.new("/#{dir}")
75
77
  else
@@ -71,7 +71,8 @@ module FPM
71
71
  attr_rw :arch, :description, :homepage, :maintainer, :md5, :name,
72
72
  :revision, :section, :sha1, :sha256, :spec, :vendor, :version,
73
73
  :pre_install, :post_install, :pre_uninstall, :post_uninstall,
74
- :license, :omnibus_package, :omnibus_dir, :chain_package
74
+ :license, :omnibus_package, :omnibus_dir, :chain_package,
75
+ :default_prefix
75
76
 
76
77
  attr_rw_list :build_depends, :config_files, :conflicts, :depends,
77
78
  :exclude, :patches, :provides, :replaces, :omnibus_recipes,
@@ -1,5 +1,5 @@
1
1
  module FPM
2
2
  module Cookery
3
- VERSION = '0.26.1'
3
+ VERSION = '0.27.0'
4
4
  end
5
5
  end
@@ -6,6 +6,7 @@ describe "PathHelper" do
6
6
  Class.new {
7
7
  include FPM::Cookery::PathHelper
8
8
 
9
+ def default_prefix; '/usr' end
9
10
  def destdir; FPM::Cookery::Path.new('/tmp/dest') end
10
11
  }.new
11
12
  end
data/spec/recipe_spec.rb CHANGED
@@ -193,6 +193,12 @@ describe "Recipe" do
193
193
  end
194
194
  end
195
195
 
196
+ describe "#default_prefix" do
197
+ it "can be set" do
198
+ check_attribute(:default_prefix, '/usr/local')
199
+ end
200
+ end
201
+
196
202
  def self.spec_recipe_attribute_list(name, list)
197
203
  class_eval %Q{
198
204
  describe "##{name}" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fpm-cookery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.1
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernd Ahlers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-22 00:00:00.000000000 Z
11
+ date: 2015-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -70,16 +70,16 @@ dependencies:
70
70
  name: puppet
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 3.4.3
75
+ version: '3.4'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 3.4.3
82
+ version: '3.4'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: addressable
85
85
  requirement: !ruby/object:Gem::Requirement