Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

Commit

Permalink
Update Gemfile and Rakefile
Browse files Browse the repository at this point in the history
* Use simplified gemfile/rakefile
* Update travis test matrix
* Include blacksmith rake tasks
  • Loading branch information
nanliu committed Oct 27, 2014
1 parent ffc158d commit 744493d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .fixtures.yml
@@ -1,5 +1,5 @@
fixtures:
repositories:
stdlib: 'git://github.com/puppetlabs/puppetlabs-stdlib.git'
stdlib: 'http://github.com/puppetlabs/puppetlabs-stdlib.git'
symlinks:
staging: "#{source_dir}"
22 changes: 8 additions & 14 deletions .travis.yml
@@ -1,22 +1,16 @@
language: ruby
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"
before_install:
- gem update bundler
- bundle --version
- gem update --system 2.1.11
- gem --version
rvm:
- 1.8.7
- 1.9.3
env:
- PUPPET_GEM_VERSION="~> 3.2.0"
- PUPPET_GEM_VERSION=">= 3.0.0"
branches:
only:
- master
matrix:
exclude:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION=">= 3.0.0"
fast_finish: true
include:
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.7.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0"
notifications:
email: false
20 changes: 1 addition & 19 deletions Gemfile
@@ -1,25 +1,7 @@
source "https://rubygems.org"

group :development, :test do
gem 'rake'
gem 'bodeco_module_helper', :git => 'https://github.com/bodeco/bodeco_module_helper.git'
gem 'rspec', "~> 2.11.0", :require => false
gem 'mocha', "~> 0.10.5", :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'rspec-puppet', :require => false
gem 'puppet-lint'
end

facterversion = ENV['GEM_FACTER_VERSION']
if facterversion
gem 'facter', facterversion
else
gem 'facter', :require => false
end

ENV['GEM_PUPPET_VERSION'] ||= ENV['PUPPET_GEM_VERSION']
puppetversion = ENV['GEM_PUPPET_VERSION']
if puppetversion
gem 'puppet', puppetversion
else
gem 'puppet', :require => false
end
52 changes: 1 addition & 51 deletions Rakefile
@@ -1,51 +1 @@
require 'rubygems'
require 'puppetlabs_spec_helper/rake_tasks'

def io_popen(command)
IO.popen(command) do |io|
io.each do |line|
print line
yield line if block_given?
end
end
end

# Customize lint option
task :lint do
PuppetLint.configuration.send("disable_80chars")
PuppetLint.configuration.send("disable_class_parameter_defaults")
end

desc "Validate manifests, templates, and ruby files in lib."
task :validate do
Dir['manifests/**/*.pp'].each do |manifest|
sh "puppet parser validate --noop #{manifest}"
end
Dir['lib/**/*.rb'].each do |lib_file|
sh "ruby -c #{lib_file}"
end
Dir['templates/**/*.erb'].each do |template|
sh "erb -P -x -T '-' #{template} | ruby -c"
end
end

# Initialize vagrant instance for testing
desc "Powers on Vagrant VMs with specific manifests"
task :vagrant, :manifest do |t, args|
Rake::Task["spec_prep"].execute

prefix = "VAGRANT_MANIFEST='#{args[:manifest]||'init.pp'}'"

puts args[:manifest]
provision = false
io_popen("export #{prefix}; vagrant up --provider=vmware_fusion") do |line|
provision = true if line =~ /Machine is already running./
end
io_popen("export #{prefix}; vagrant provision") if provision
end

# Cleanup vagrant environment
task :vagrant_clean do
`vagrant destroy -f`
Rake::Task["spec_clean"].execute
end
require 'bodeco_module_helper/rake_tasks'
2 changes: 1 addition & 1 deletion manifests/extract.pp
Expand Up @@ -67,7 +67,7 @@
warning('strip is only supported with GNU tar, ignoring the parameter')
$strip_opt = ''
} else {
$strip_opt = " --strip=$strip"
$strip_opt = " --strip=${strip}"
}
} else {
$strip_opt = ''
Expand Down

0 comments on commit 744493d

Please sign in to comment.