Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/Vagrantfile
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/Vagrantfile	(revision 30956)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/Vagrantfile	(revision 30960)
@@ -2,8 +2,4 @@
 # vi: set ft=ruby :
 
-# All Vagrant configuration is done below. The "2" in Vagrant.configure
-# configures the configuration version (we support older styles for
-# backwards compatibility). Please don't change it unless you know what
-# you're doing.
 Vagrant.configure("2") do |config|
   # The most common configuration options are documented and commented below.
@@ -18,26 +14,56 @@
   config.vm.provider "virtualbox" do |v|
     v.memory = 1024
-    v.cpus = 2
+    v.cpus = 1
   end
 
-  config.vm.define "zoo1" do |zoo1|
-    zoo1.vm.box = "ubuntu/trusty64"
-    zoo1.vm.network "private_network", type: "dhcp"
+  config.vm.box = "ubuntu/trusty64"
+  #  config.vm.box = "ubuntu/xenial64"
+
+  config.vm.provision :puppet do |puppet|
+     puppet.manifests_path = "manifests"
+     puppet.manifest_file  = "base-zookeeper-solr.pp"
+     puppet.module_path = "modules"
   end
 
-  config.vm.define "solr1" do |solr1|
-    solr1.vm.box = "ubuntu/trusty64"
-    solr1.vm.network "private_network", type: "dhcp"
+  config.vm.define :zoo1 do |box|
+    box.vm.network "private_network", ip: "10.11.0.52"
+    box.vm.host_name = "zoo1"  
   end
 
-  config.vm.define "solr2" do |solr2|
-    solr2.vm.box = "ubuntu/trusty64"
-    solr2.vm.network "private_network", type: "dhcp"
+  config.vm.define :solr1 do |box|
+    box.vm.network "private_network", ip: "10.11.0.53"
+    box.vm.host_name = "solr1"  
   end
 
-  config.vm.define "solr3" do |solr3|
-    solr3.vm.box = "ubuntu/trusty64"
-    solr3.vm.network "private_network", type: "dhcp"
+  config.vm.define :solr2 do |box|
+    box.vm.network "private_network", ip: "10.11.0.54"
+    box.vm.host_name = "solr1"  
   end
+
+  config.vm.define :solr3 do |box|
+    box.vm.network "private_network", ip: "10.11.0.55"
+    box.vm.host_name = "solr1"  
+  end
+
+      
+#  config.vm.define "zoo1" do |zoo1|
+#    zoo1.vm.box = "ubuntu/trusty64"
+#    zoo1.vm.network "private_network", type: "dhcp"
+#  end
+#
+#  config.vm.define "solr1" do |solr1|
+#    solr1.vm.box = "ubuntu/trusty64"
+#    solr1.vm.network "private_network", type: "dhcp"
+#  end
+#
+#  config.vm.define "solr2" do |solr2|
+#    solr2.vm.box = "ubuntu/trusty64"
+#    solr2.vm.network "private_network", type: "dhcp"
+#  end
+#
+#  config.vm.define "solr3" do |solr3|
+#    solr3.vm.box = "ubuntu/trusty64"
+#    solr3.vm.network "private_network", type: "dhcp"
+#  end
   
   
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/manifests/base-zookeeper-solr.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/manifests/base-zookeeper-solr.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/manifests/base-zookeeper-solr.pp	(revision 30960)
@@ -0,0 +1,137 @@
+$install_dir = "/opt"
+$zookeeper_home = "${install_dir}/zookeeper"
+$solr_home  = "${install_dir}/solr"
+
+$user = "htrc"
+$group = "solr"
+
+$zookeeper_master = '10.11.0.52'
+$solr_1 = '10.11.0.53'
+$solr_2 = '10.11.0.54'
+$solr_3 = '10.11.0.55'
+
+include zookeeper
+include solr
+
+file { 
+	   "/home/${user}":
+        ensure => "directory",
+        owner  => "${user}",
+        group  => "${group}",
+        mode   => 700,
+        require =>  [ User["${user}"], Group["${group}"] ],
+
+}
+
+group { "${group}":
+  ensure => "present",
+}
+
+user { 
+	   "${user}":
+        ensure => "present",
+        home => "/home/${user}",
+        name => "${user}",
+        shell => "/bin/bash",
+        managehome => true,
+	gid => $group
+}
+	
+#sudo add-apt-repository ppa:webupd8team/java
+#sudo apt-get update
+#sudo apt-get install oracle-java8-installer
+
+#echo debconf shared/accepted-oracle-license-v1-1 select true | \
+#  sudo debconf-set-selections
+#echo debconf shared/accepted-oracle-license-v1-1 seen true | \
+#  sudo debconf-set-selections
+  
+ exec { 'add-apt-repository':
+    command => '/usr/bin/add-apt-repository ppa:webupd8team/java -y && \
+                echo debconf shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections && \
+                echo debconf shared/accepted-oracle-license-v1-1 seen true | /usr/bin/debconf-set-selections'
+ }
+
+                
+ exec { 'apt-get update':
+    command => '/usr/bin/apt-get update',
+    require => [ Exec['add-apt-repository'], File["/home/${user}"] ]
+ }
+
+ package { "oracle-java8-installer" :
+   ensure => present,
+  require => [ Exec['apt-get update'], File["/home/${user}"] ]
+ }
+
+#package { "subversion" :
+#   ensure => present,
+#  require => [ Exec['apt-get update'], File["/home/${user}"] ]
+#}
+
+#package { "maven" :
+#   ensure => present,
+#  require => [ Exec['apt-get update'], File["/home/${user}"] ]
+#}
+
+file { 
+	"/home/${user}/.ssh":
+    ensure => "directory",
+    owner  => "${user}",
+    group  => "${group}",
+    mode   => 750,
+	require => [ Exec['apt-get update'], File["/home/${user}"] ]
+}
+
+file {
+  "/home/${user}/.ssh/id_rsa":
+  source => "puppet:///modules/zookeeper/id_rsa",
+  ensure => present,
+  mode => 600,
+  owner => $user,
+  group => $group,
+  require => File["/home/${user}/.ssh"]
+ }
+ 
+file {
+  "/home/${user}/.ssh/id_rsa.pub":
+  source => "puppet:///modules/zookeeper/id_rsa.pub",
+  ensure => present,
+  mode => 644,
+  owner => $user,
+  group => $group,
+  require => File["/home/${user}/.ssh"]
+ }
+
+ssh_authorized_key { "ssh_key":
+    ensure => "present",
+    key    => "AAAAB3NzaC1yc2EAAAADAQABAAABAQCeHdBPVGuSPVOO+n94j/Y5f8VKGIAzjaDe30hu9BPetA+CGFpszw4nDkhyRtW5J9zhGKuzmcCqITTuM6BGpHax9ZKP7lRRjG8Lh380sCGA/691EjSVmR8krLvGZIQxeyHKpDBLEmcpJBB5yoSyuFpK+4RhmJLf7ImZA7mtxhgdPGhe6crUYRbLukNgv61utB/hbre9tgNX2giEurBsj9CI5yhPPNgq6iP8ZBOyCXgUNf37bAe7AjQUMV5G6JMZ1clEeNPN+Uy5Yrfojrx3wHfG40NuxuMrFIQo5qCYa3q9/SVOxsJILWt+hZ2bbxdGcQOd9AXYFNNowPayY0BdAkSr",
+    type   => "ssh-rsa",
+    user   => "${user}",
+    require => File["/home/${user}/.ssh/id_rsa.pub"]
+}
+
+file{
+  "/home/${user}/.ssh/config":
+  owner => "${user}",
+  group => "${group}",
+  mode => 755,
+  content => "StrictHostKeyChecking no",
+  require => File["/home/${user}/.ssh/id_rsa.pub"]
+}
+
+host { 'solr1':
+    ip => "${solr_1}",
+}
+
+host { 'solr2':
+    ip => "${solr_2}",
+}
+
+host { 'solr3':
+    ip => "${solr_3}",
+}
+
+host { 'zookeeper':
+    ip => "${zookeeper_master}",
+}
+
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/solr/manifests/init.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/solr/manifests/init.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/solr/manifests/init.pp	(revision 30960)
@@ -0,0 +1,49 @@
+class solr {
+
+ exec { "download_solr":
+  command => "wget -O /tmp/solr-6.2.1.tar.gz   http://www-us.apache.org/dist/lucene/solr/6.2.1/solr-6.2.1.tgz",
+  timeout => 0,
+  path => $path,
+  unless => "ls ${install_dir} | grep solr-6.2.1",
+  require => Package["oracle-java8-installer"]
+ }
+
+ exec { "unpack_solr":
+  command => "tar -zxf /tmp/solr-6.2.1.tar.gz -C ${install_dir}",
+  path => $path,
+  creates => "${solr_home}-6.2.1",
+  require => Exec["download_solr"]
+ }
+
+ exec { "rename_solr":
+  command => "ln -s ${install_dir}/solr-6.2.1 ${install_dir}/solr",
+  path => $path,
+  creates => "${solr_home}",
+  require => Exec["unpack_solr"]
+ }
+
+ exec { 'chown_solr':
+  command => "/bin/chown -R ${user}:${group} ${solr_home}-6.2.1",
+  path => '/bin',
+  user => 'root',
+  require => Exec["rename_solr"]
+ }
+
+ file {
+  "/home/${user}/.bashrc-setup-solr":
+  content => template('solr/setup-solr.bash'),
+  mode => 644,
+  owner => $user,
+  group => $group,
+  require => [  Exec["unpack_solr"], File["/home/${user}"] ]
+ }
+
+ file_line { "setup_solr_home":
+    ensure => present,
+    path => "/home/${user}/.bashrc",
+    line => ". .bashrc-setup-solr",
+    require => [  Exec["unpack_solr"], File["/home/${user}"] ]	
+ }
+
+}
+
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/solr/templates/setup-solr.bash
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/solr/templates/setup-solr.bash	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/solr/templates/setup-solr.bash	(revision 30960)
@@ -0,0 +1,4 @@
+
+export SOLR_HOME="<%= @solr_home %>"
+export PATH="$SOLR_HOME/bin:$PATH"
+
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.fixtures.yml
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.fixtures.yml	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.fixtures.yml	(revision 30960)
@@ -0,0 +1,4 @@
+fixtures:
+  symlinks:
+    stdlib: "#{source_dir}"
+    test:   "#{source_dir}/spec/fixtures/test"
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.gemspec
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.gemspec	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.gemspec	(revision 30960)
@@ -0,0 +1,40 @@
+#
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+  s.name = "puppetmodule-stdlib"
+
+  s.version = "4.0.2"
+
+  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+  s.authors = ["Puppet Labs"]
+  s.date = "2013-04-12"
+  s.description = [ 'This Gem format of the stdlib module is intended to make',
+                    'it easier for _module authors_ to resolve dependencies',
+                    'using a Gemfile when running automated testing jobs like',
+                    'Travis or Jenkins.  The recommended best practice for',
+                    'installation by end users is to use the `puppet module',
+                    'install` command to install stdlib from the [Puppet',
+                    'Forge](http://forge.puppetlabs.com/puppetlabs/stdlib).' ].join(' ')
+  s.email = "puppet-dev@puppetlabs.com"
+  s.executables = []
+  s.files = [ 'CHANGELOG', 'CONTRIBUTING.md', 'Gemfile', 'LICENSE', 'Modulefile',
+              'README.markdown', 'README_DEVELOPER.markdown', 'RELEASE_PROCESS.markdown',
+              'Rakefile', 'spec/spec.opts' ]
+  s.files += Dir['lib/**/*.rb'] + Dir['manifests/**/*.pp'] + Dir['tests/**/*.pp'] + Dir['spec/**/*.rb']
+  s.homepage = "http://forge.puppetlabs.com/puppetlabs/stdlib"
+  s.rdoc_options = ["--title", "Puppet Standard Library Development Gem", "--main", "README.markdown", "--line-numbers"]
+  s.require_paths = ["lib"]
+  s.rubyforge_project = "puppetmodule-stdlib"
+  s.rubygems_version = "1.8.24"
+  s.summary = "This gem provides a way to make the standard library available for other module spec testing tasks."
+
+  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
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.gitattributes
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.gitattributes	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.gitattributes	(revision 30960)
@@ -0,0 +1,5 @@
+#This file is generated by ModuleSync, do not edit.
+*.rb  eol=lf
+*.erb eol=lf
+*.pp  eol=lf
+*.sh  eol=lf
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.gitignore
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.gitignore	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.gitignore	(revision 30960)
@@ -0,0 +1,15 @@
+#This file is generated by ModuleSync, do not edit.
+pkg/
+Gemfile.lock
+vendor/
+spec/fixtures/manifests/
+spec/fixtures/modules/
+.vagrant/
+.bundle/
+coverage/
+log/
+.idea/
+*.iml
+!spec/fixtures/
+spec/fixtures/manifests/site.pp
+spec/fixtures/modules/*
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.project
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.project	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.project	(revision 30960)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>stdlib</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.cloudsmith.geppetto.pp.dsl.ui.modulefileBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.cloudsmith.geppetto.pp.dsl.ui.puppetNature</nature>
+		<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
+	</natures>
+</projectDescription>
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.rspec
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.rspec	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.rspec	(revision 30960)
@@ -0,0 +1,2 @@
+--color
+--format documentation
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.rubocop.yml
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.rubocop.yml	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.rubocop.yml	(revision 30960)
@@ -0,0 +1,508 @@
+require: rubocop-rspec
+AllCops:
+  TargetRubyVersion: 1.9
+  Include:
+    - ./**/*.rb
+  Exclude:
+    - vendor/**/*
+    - .vendor/**/*
+    - pkg/**/*
+    - spec/fixtures/**/*
+Lint/ConditionPosition:
+  Enabled: True
+
+Lint/ElseLayout:
+  Enabled: True
+
+Lint/UnreachableCode:
+  Enabled: True
+
+Lint/UselessComparison:
+  Enabled: True
+
+Lint/EnsureReturn:
+  Enabled: True
+
+Lint/HandleExceptions:
+  Enabled: True
+
+Lint/LiteralInCondition:
+  Enabled: True
+
+Lint/ShadowingOuterLocalVariable:
+  Enabled: True
+
+Lint/LiteralInInterpolation:
+  Enabled: True
+
+Style/HashSyntax:
+  Enabled: True
+
+Style/RedundantReturn:
+  Enabled: True
+
+Lint/AmbiguousOperator:
+  Enabled: True
+
+Lint/AssignmentInCondition:
+  Enabled: True
+
+Style/SpaceBeforeComment:
+  Enabled: True
+
+Style/AndOr:
+  Enabled: True
+
+Style/RedundantSelf:
+  Enabled: True
+
+# Method length is not necessarily an indicator of code quality
+Metrics/MethodLength:
+  Enabled: False
+
+# Module length is not necessarily an indicator of code quality
+Metrics/ModuleLength:
+  Enabled: False
+
+Style/WhileUntilModifier:
+  Enabled: True
+
+Lint/AmbiguousRegexpLiteral:
+  Enabled: True
+
+Lint/Eval:
+  Enabled: True
+
+Lint/BlockAlignment:
+  Enabled: True
+
+Lint/DefEndAlignment:
+  Enabled: True
+
+Lint/EndAlignment:
+  Enabled: True
+
+Lint/DeprecatedClassMethods:
+  Enabled: True
+
+Lint/Loop:
+  Enabled: True
+
+Lint/ParenthesesAsGroupedExpression:
+  Enabled: True
+
+Lint/RescueException:
+  Enabled: True
+
+Lint/StringConversionInInterpolation:
+  Enabled: True
+
+Lint/UnusedBlockArgument:
+  Enabled: True
+
+Lint/UnusedMethodArgument:
+  Enabled: True
+
+Lint/UselessAccessModifier:
+  Enabled: True
+
+Lint/UselessAssignment:
+  Enabled: True
+
+Lint/Void:
+  Enabled: True
+
+Style/AccessModifierIndentation:
+  Enabled: True
+
+Style/AccessorMethodName:
+  Enabled: True
+
+Style/Alias:
+  Enabled: True
+
+Style/AlignArray:
+  Enabled: True
+
+Style/AlignHash:
+  Enabled: True
+
+Style/AlignParameters:
+  Enabled: True
+
+Metrics/BlockNesting:
+  Enabled: True
+
+Style/AsciiComments:
+  Enabled: True
+
+Style/Attr:
+  Enabled: True
+
+Style/BracesAroundHashParameters:
+  Enabled: True
+
+Style/CaseEquality:
+  Enabled: True
+
+Style/CaseIndentation:
+  Enabled: True
+
+Style/CharacterLiteral:
+  Enabled: True
+
+Style/ClassAndModuleCamelCase:
+  Enabled: True
+
+Style/ClassAndModuleChildren:
+  Enabled: False
+
+Style/ClassCheck:
+  Enabled: True
+
+# Class length is not necessarily an indicator of code quality
+Metrics/ClassLength:
+  Enabled: False
+
+Style/ClassMethods:
+  Enabled: True
+
+Style/ClassVars:
+  Enabled: True
+
+Style/WhenThen:
+  Enabled: True
+
+Style/WordArray:
+  Enabled: True
+
+Style/UnneededPercentQ:
+  Enabled: True
+
+Style/Tab:
+  Enabled: True
+
+Style/SpaceBeforeSemicolon:
+  Enabled: True
+
+Style/TrailingBlankLines:
+  Enabled: True
+
+Style/SpaceInsideBlockBraces:
+  Enabled: True
+
+Style/SpaceInsideBrackets:
+  Enabled: True
+
+Style/SpaceInsideHashLiteralBraces:
+  Enabled: True
+
+Style/SpaceInsideParens:
+  Enabled: True
+
+Style/LeadingCommentSpace:
+  Enabled: True
+
+Style/SpaceBeforeFirstArg:
+  Enabled: True
+
+Style/SpaceAfterColon:
+  Enabled: True
+
+Style/SpaceAfterComma:
+  Enabled: True
+
+Style/SpaceAfterMethodName:
+  Enabled: True
+
+Style/SpaceAfterNot:
+  Enabled: True
+
+Style/SpaceAfterSemicolon:
+  Enabled: True
+
+Style/SpaceAroundEqualsInParameterDefault:
+  Enabled: True
+
+Style/SpaceAroundOperators:
+  Enabled: True
+
+Style/SpaceBeforeBlockBraces:
+  Enabled: True
+
+Style/SpaceBeforeComma:
+  Enabled: True
+
+Style/CollectionMethods:
+  Enabled: True
+
+Style/CommentIndentation:
+  Enabled: True
+
+Style/ColonMethodCall:
+  Enabled: True
+
+Style/CommentAnnotation:
+  Enabled: True
+
+# 'Complexity' is very relative
+Metrics/CyclomaticComplexity:
+  Enabled: False
+
+Style/ConstantName:
+  Enabled: True
+
+Style/Documentation:
+  Enabled: False
+
+Style/DefWithParentheses:
+  Enabled: True
+
+Style/PreferredHashMethods:
+  Enabled: True
+
+Style/DotPosition:
+  EnforcedStyle: trailing
+
+Style/DoubleNegation:
+  Enabled: True
+
+Style/EachWithObject:
+  Enabled: True
+
+Style/EmptyLineBetweenDefs:
+  Enabled: True
+
+Style/IndentArray:
+  Enabled: True
+
+Style/IndentHash:
+  Enabled: True
+
+Style/IndentationConsistency:
+  Enabled: True
+
+Style/IndentationWidth:
+  Enabled: True
+
+Style/EmptyLines:
+  Enabled: True
+
+Style/EmptyLinesAroundAccessModifier:
+  Enabled: True
+
+Style/EmptyLiteral:
+  Enabled: True
+
+# Configuration parameters: AllowURI, URISchemes.
+Metrics/LineLength:
+  Enabled: False
+
+Style/MethodCallParentheses:
+  Enabled: True
+
+Style/MethodDefParentheses:
+  Enabled: True
+
+Style/LineEndConcatenation:
+  Enabled: True
+
+Style/TrailingWhitespace:
+  Enabled: True
+
+Style/StringLiterals:
+  Enabled: True
+
+Style/TrailingCommaInArguments:
+  Enabled: True
+
+Style/TrailingCommaInLiteral:
+  Enabled: True
+
+Style/GlobalVars:
+  Enabled: True
+
+Style/GuardClause:
+  Enabled: True
+
+Style/IfUnlessModifier:
+  Enabled: True
+
+Style/MultilineIfThen:
+  Enabled: True
+
+Style/NegatedIf:
+  Enabled: True
+
+Style/NegatedWhile:
+  Enabled: True
+
+Style/Next:
+  Enabled: True
+
+Style/SingleLineBlockParams:
+  Enabled: True
+
+Style/SingleLineMethods:
+  Enabled: True
+
+Style/SpecialGlobalVars:
+  Enabled: True
+
+Style/TrivialAccessors:
+  Enabled: True
+
+Style/UnlessElse:
+  Enabled: True
+
+Style/VariableInterpolation:
+  Enabled: True
+
+Style/VariableName:
+  Enabled: True
+
+Style/WhileUntilDo:
+  Enabled: True
+
+Style/EvenOdd:
+  Enabled: True
+
+Style/FileName:
+  Enabled: True
+
+Style/For:
+  Enabled: True
+
+Style/Lambda:
+  Enabled: True
+
+Style/MethodName:
+  Enabled: True
+
+Style/MultilineTernaryOperator:
+  Enabled: True
+
+Style/NestedTernaryOperator:
+  Enabled: True
+
+Style/NilComparison:
+  Enabled: True
+
+Style/FormatString:
+  Enabled: True
+
+Style/MultilineBlockChain:
+  Enabled: True
+
+Style/Semicolon:
+  Enabled: True
+
+Style/SignalException:
+  Enabled: True
+
+Style/NonNilCheck:
+  Enabled: True
+
+Style/Not:
+  Enabled: True
+
+Style/NumericLiterals:
+  Enabled: True
+
+Style/OneLineConditional:
+  Enabled: True
+
+Style/OpMethod:
+  Enabled: True
+
+Style/ParenthesesAroundCondition:
+  Enabled: True
+
+Style/PercentLiteralDelimiters:
+  Enabled: True
+
+Style/PerlBackrefs:
+  Enabled: True
+
+Style/PredicateName:
+  Enabled: True
+
+Style/RedundantException:
+  Enabled: True
+
+Style/SelfAssignment:
+  Enabled: True
+
+Style/Proc:
+  Enabled: True
+
+Style/RaiseArgs:
+  Enabled: True
+
+Style/RedundantBegin:
+  Enabled: True
+
+Style/RescueModifier:
+  Enabled: True
+
+# based on https://github.com/voxpupuli/modulesync_config/issues/168
+Style/RegexpLiteral:
+  EnforcedStyle: percent_r
+  Enabled: True
+
+Lint/UnderscorePrefixedVariableName:
+  Enabled: True
+
+Metrics/ParameterLists:
+  Enabled: False
+
+Lint/RequireParentheses:
+  Enabled: True
+
+Style/SpaceBeforeFirstArg:
+  Enabled: True
+
+Style/ModuleFunction:
+  Enabled: True
+
+Lint/Debugger:
+  Enabled: True
+
+Style/IfWithSemicolon:
+  Enabled: True
+
+Style/Encoding:
+  Enabled: True
+
+Style/BlockDelimiters:
+  Enabled: True
+
+Style/MultilineBlockLayout:
+  Enabled: True
+
+# 'Complexity' is very relative
+Metrics/AbcSize:
+  Enabled: False
+
+# 'Complexity' is very relative
+Metrics/PerceivedComplexity:
+  Enabled: False
+
+Lint/UselessAssignment:
+  Enabled: True
+
+Style/ClosingParenthesisIndentation:
+  Enabled: False
+
+# RSpec
+
+# We don't use rspec in this way
+RSpec/DescribeClass:
+  Enabled: False
+
+# Example length is not necessarily an indicator of code quality
+RSpec/ExampleLength:
+  Enabled: False
+
+RSpec/NamedSubject:
+  Enabled: False
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.sync.yml
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.sync.yml	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.sync.yml	(revision 30960)
@@ -0,0 +1,7 @@
+---
+.gitignore:
+  paths:
+    - '!spec/fixtures/'
+    - 'spec/fixtures/manifests/site.pp'
+    - 'spec/fixtures/modules/*'
+
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.travis.yml
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.travis.yml	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/.travis.yml	(revision 30960)
@@ -0,0 +1,41 @@
+#This file is generated by ModuleSync, do not edit.
+---
+sudo: false
+language: ruby
+cache: bundler
+script: "bundle exec rake validate lint spec"
+matrix:
+  fast_finish: true
+  include:
+  - rvm: 2.3.1
+    dist: trusty
+    env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-14.04
+    script: bundle exec rake beaker
+    services: docker
+    sudo: required
+  - rvm: 2.3.1
+    dist: trusty
+    env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7
+    script: bundle exec rake beaker
+    services: docker
+    sudo: required
+  - rvm: 2.3.1
+    bundler_args: --without system_tests
+    env: PUPPET_GEM_VERSION="~> 4.0"
+  - rvm: 2.1.9
+    bundler_args: --without system_tests
+    env: PUPPET_GEM_VERSION="~> 4.0"
+  - rvm: 2.1.5
+    bundler_args: --without system_tests
+    env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
+  - rvm: 2.1.5
+    bundler_args: --without system_tests
+    env: PUPPET_GEM_VERSION="~> 3.7.0" FUTURE_PARSER="yes"
+  - rvm: 2.1.5
+    bundler_args: --without system_tests
+    env: PUPPET_GEM_VERSION="~> 3.0"
+  - rvm: 1.9.3
+    bundler_args: --without system_tests
+    env: PUPPET_GEM_VERSION="~> 3.0"
+notifications:
+  email: false
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/CHANGELOG.md
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/CHANGELOG.md	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/CHANGELOG.md	(revision 30960)
@@ -0,0 +1,717 @@
+## Supported Release 4.13.1
+### Summary
+
+This bugfix release addresses the `undefined method 'optional_repeated_param'` error messages seen by users of puppet 3.7.
+
+It also improves the user experience around function deprecations by emitting one warning per function(-name) instead of only one deprecation overall. This allows users to identify all deprecated functions used in one agent run, with less back-and-forth.
+
+#### Bugfixes
+
+* Emit deprecations warnings for each function, instead of once per process. (MODULES-3961)
+* Use a universally available API for the v4 deprecation stubs of `is_*` and `validate_*`. (MODULES-3962)
+* Make `getvar()` compatible to ruby 1.8.7. (MODULES-3969)
+* Add v4 deprecation stubs for the `is_` counterparts of the deprecated functions to emit the deprecations warnings in all cases.
+
+
+## Supported Release 4.13.0
+### Summary
+
+This version of stdlib deprecates a whole host of functions, and provides stepping stones to move to Puppet 4 type validations. Be sure to check out the new `deprecation()` and `validate_legacy()` functions to migrate off the deprecated v3-style data validations.
+
+Many thanks to all community contributors: bob, Dmitry Ilyin, Dominic Cleal, Joris, Joseph Yaworski, Loic Antoine-Gombeaud, Maksym Melnychok, Michiel Brandenburg, Nate Potter, Romain TartiÃšre, Stephen Benjamin, and Steve Moore, as well as anyone contributing in the code review process and by submitting issues.
+
+Special thanks to [Voxpupuli's](https://voxpupuli.org/) Igor GaliÄ for donating the puppet-tea types to kickstart this part of stdlib.
+
+
+#### Deprecations
+* `validate_absolute_path`, `validate_array`, `validate_bool`, `validate_hash`, `validate_integer`, `validate_ip_address`, `validate_ipv4_address`, `validate_ipv6_address`, `validate_numeric`, `validate_re`, `validate_slength`, `validate_string`, and their `is_` counter parts are now deprecated on Puppet 4. See the `validate_legacy()` description in the README for help on migrating away from those functions.
+* The `dig` function is provided by core puppet since 4.5.0 with slightly different calling convention. The stdlib version can still be accessed as `dig44` for now.
+
+
+#### Features
+* Add Puppet 4 data types for Unix, and Windows paths, and URLs.
+* Add `deprecation` function to warn users of functionality that will be removed soon.
+* Add `validate_legacy` function to help with migrating to Puppet 4 data types.
+
+* Add `any2bool` function, a combination of of `string2bool` and `num2bool`.
+* Add `delete_regex` function to delete array elements matching a regular expression.
+* Add `puppet_environmentpath` fact to expose the `environmentpath` setting.
+* Add `regexpescape` function to safely insert arbitrary strings into regular expressions.
+* Add `shell_escape`, `shell_join`, and `shell_split` functions for safer working with shell scripts..
+
+* The `delete` function now also accepts regular expressions as search term.
+* The `loadyaml` function now accepts a default value, which is returned when there is an error loading the file.
+
+#### Bugfixes
+* Fix `file_line.match_for_absence` implementation and description to actually work. (MODULES-3590)
+* Fix `getparam` so that it can now also return `false`. (MODULES-3933)
+* Fix the fixture setup for testing and adjust `load_module_metadata` and `loadjson` tests.
+* Fix `defined_with_params` to handle `undef` correctly on all puppet versions. (PUP-6422, MODULES-3543)
+* Fix `file_line.path` validation to use puppet's built in `absolute_path?` matcher.
+
+#### Minor Improvements
+* README changes: improved descriptions of `deep_merge`, `delete`, `ensure_packages`, `file_line.after`, `range`, and `validate_numeric`.
+* The `getvar` function now returns nil in all situations where the variable is not found.
+* Update the `dig44` function with better `undef`, `nil`, and `false` handling.
+* Better wording on `str2bool` argument validation error message.
+
+
+### Known issues
+* The `validate_legacy` function relies on internal APIs from Puppet 4.4.0 (PE 2016.1) onwards, and doesn't work on earlier versions.
+* Puppet 4.5.0 (PE 2016.2) has a number of improvements around data types - especially error handling - that make working with them much nicer.
+
+## Supported Release 4.12.0
+###Summary
+
+This release provides several new functions, bugfixes, modulesync changes, and some documentation updates.
+
+####Features
+- Adds `clamp`. This function keeps values within a specified range.
+- Adds `validate_x509_rsa_key_pair`. This function validates an x509 RSA certificate and key pair.
+- Adds `dig`. This function performs a deep lookup in nested hashes or arrays.
+- Extends the `base64` support to fit `rfc2045` and `rfc4648`.
+- Adds `is_ipv6_address` and `is_ipv4_address`. These functions validate the specified ipv4 or ipv6 addresses.
+- Adds `enclose_ipv6`. This function encloses IPv6 addresses in square brackets.
+- Adds `ensure_resources`. This function takes a list of resources and creates them if they do not exist.
+- Extends `suffix` to support applying a suffix to keys in a hash.
+- Apply modulesync changes.
+- Add validate_email_address function.
+
+####Bugfixes
+- Fixes `fqdn_rand_string` tests, since Puppet 4.4.0 and later have a higher `fqdn_rand` ceiling.
+- (MODULES-3152) Adds a check to `package_provider` to prevent failures if Gem is not installed.
+- Fixes to README.md.
+- Fixes catch StandardError rather than the gratuitous Exception
+- Fixes file_line attribute validation.
+- Fixes concat with Hash arguments.
+
+## Supported Release 4.11.0
+###Summary
+
+Provides a validate_absolute_paths and Debian 8 support. There is a fix to the is_package_provider fact and a test improvement.
+
+####Features
+-  Adds new parser called is_absolute_path
+-  Supports Debian 8
+
+####Bugfixes
+-  Allow package_provider fact to resolve on PE 3.x
+
+####Improvements
+- ensures that the test passes independently of changes to rubygems for ensure_resource
+
+##2015-12-15 - Supported Release 4.10.0
+###Summary
+
+Includes the addition of several new functions and considerable improvements to the existing functions, tests and documentation. Includes some bug fixes which includes compatibility, test and fact issues.
+
+####Features
+- Adds service_provider fact
+- Adds is_a() function
+- Adds package_provider fact
+- Adds validate_ip_address function
+- Adds seeded_rand function
+
+####Bugfixes
+- Fix backwards compatibility from an improvement to the parseyaml function
+- Renaming of load_module_metadata test to include _spec.rb
+- Fix root_home fact on AIX 5.x, now '-c' rather than '-C'
+- Fixed Gemfile to work with ruby 1.8.7
+
+####Improvements
+- (MODULES-2462) Improvement of parseyaml function
+- Improvement of str2bool function
+- Improvement to readme
+- Improvement of intersection function
+- Improvement of validate_re function
+- Improved speed on Facter resolution of service_provider
+- empty function now handles numeric values
+- Package_provider now prevents deprecation warning about the allow_virtual parameter
+- load_module_metadata now succeeds on empty file
+- Check added to ensure puppetversion value is not nil
+- Improvement to bool2str to return a string of choice using boolean
+- Improvement to naming convention in validate_ipv4_address function
+
+## Supported Release 4.9.1
+###Summary
+
+Small release for support of newer PE versions. This increments the version of PE in the metadata.json file.
+
+##2015-09-08 - Supported Release 4.9.0
+###Summary
+
+This release adds new features including the new functions dos2unix, unix2dos, try_get_value, convert_base as well as other features and improvements.
+
+####Features
+- (MODULES-2370) allow `match` parameter to influence `ensure => absent` behavior
+- (MODULES-2410) Add new functions dos2unix and unix2dos
+- (MODULE-2456) Modify union to accept more than two arrays
+- Adds a convert_base function, which can convert numbers between bases
+- Add a new function "try_get_value"
+
+####Bugfixes
+- n/a
+
+####Improvements
+- (MODULES-2478) Support root_home fact on AIX through "lsuser" command
+- Acceptance test improvements
+- Unit test improvements
+- Readme improvements
+
+## 2015-08-10 - Supported Release 4.8.0
+### Summary
+This release adds a function for reading metadata.json from any module, and expands file\_line's abilities.
+
+#### Features
+- New parameter `replace` on `file_line`
+- New function `load_module_metadata()` to load metadata.json and return the content as a hash.
+- Added hash support to `size()`
+
+#### Bugfixes
+- Fix various docs typos
+- Fix `file_line` resource on puppet < 3.3
+
+##2015-06-22 - Supported Release 4.7.0
+###Summary
+
+Adds Solaris 12 support along with improved Puppet 4 support. There are significant test improvements, and some minor fixes.
+
+####Features
+- Add support for Solaris 12
+
+####Bugfixes
+- Fix for AIO Puppet 4
+- Fix time for ruby 1.8.7
+- Specify rspec-puppet version
+- range() fix for typeerror and missing functionality
+- Fix pw_hash() on JRuby < 1.7.17
+- fqdn_rand_string: fix argument error message
+- catch and rescue from looking up non-existent facts
+- Use puppet_install_helper, for Puppet 4
+
+####Improvements
+- Enforce support for Puppet 4 testing
+- fqdn_rotate/fqdn_rand_string acceptance tests and implementation
+- Simplify mac address regex
+- validate_integer, validate_numeric: explicitely reject hashes in arrays
+- Readme edits
+- Remove all the pops stuff for rspec-puppet
+- Sync via modulesync
+- Add validate_slength optional 3rd arg
+- Move tests directory to examples directory
+
+##2015-04-14 - Supported Release 4.6.0
+###Summary
+
+Adds functions and function argument abilities, and improves compatibility with the new puppet parser
+
+####Features
+- MODULES-444: `concat()` can now take more than two arrays
+- `basename()` added to have Ruby File.basename functionality
+- `delete()` can now take an array of items to remove
+- `prefix()` can now take a hash
+- `upcase()` can now take a hash or array of upcaseable things
+- `validate_absolute_path()` can now take an array
+- `validate_cmd()` can now use % in the command to embed the validation file argument in the string
+- MODULES-1473: deprecate `type()` function in favor of `type3x()`
+- MODULES-1473: Add `type_of()` to give better type information on future parser
+- Deprecate `private()` for `assert_private()` due to future parser
+- Adds `ceiling()` to take the ceiling of a number
+- Adds `fqdn_rand_string()` to generate random string based on fqdn
+- Adds `pw_hash()` to generate password hashes
+- Adds `validate_integer()`
+- Adds `validate_numeric()` (like `validate_integer()` but also accepts floats)
+
+####Bugfixes
+- Fix seeding of `fqdn_rotate()`
+- `ensure_resource()` is more verbose on debug mode
+- Stricter argument checking for `dirname()`
+- Fix `is_domain_name()` to better match RFC
+- Fix `uriescape()` when called with array
+- Fix `file_line` resource when using the `after` attribute with `match`
+
+##2015-01-14 - Supported Release 4.5.1
+###Summary
+
+This release changes the temporary facter_dot_d cache locations outside of the /tmp directory due to a possible security vunerability. CVE-2015-1029
+
+####Bugfixes
+- Facter_dot_d cache will now be stored in puppet libdir instead of tmp
+
+##2014-12-15 - Supported Release 4.5.0
+###Summary
+
+This release improves functionality of the member function and adds improved future parser support.
+
+####Features
+- MODULES-1329: Update member() to allow the variable to be an array.
+- Sync .travis.yml, Gemfile, Rakefile, and CONTRIBUTING.md via modulesync
+
+####Bugfixes
+- Fix range() to work with numeric ranges with the future parser
+- Accurately express SLES support in metadata.json (was missing 10SP4 and 12)
+- Don't require `line` to match the `match` parameter
+
+##2014-11-10 - Supported Release 4.4.0
+###Summary
+This release has an overhauled readme, new private manifest function, and fixes many future parser bugs.
+
+####Features
+- All new shiny README
+- New `private()` function for making private manifests (yay!)
+
+####Bugfixes
+- Code reuse in `bool2num()` and `zip()`
+- Fix many functions to handle `generate()` no longer returning a string on new puppets
+- `concat()` no longer modifies the first argument (whoops)
+- strict variable support for `getvar()`, `member()`, `values_at`, and `has_interface_with()`
+- `to_bytes()` handles PB and EB now
+- Fix `tempfile` ruby requirement for `validate_augeas()` and `validate_cmd()`
+- Fix `validate_cmd()` for windows
+- Correct `validate_string()` docs to reflect non-handling of `undef`
+- Fix `file_line` matching on older rubies
+
+
+##2014-07-15 - Supported Release 4.3.2
+###Summary
+
+This release merely updates metadata.json so the module can be uninstalled and
+upgraded via the puppet module command.
+
+##2014-07-14 - Supported Release 4.3.1
+### Summary
+This supported release updates the metadata.json to work around upgrade behavior of the PMT.
+
+#### Bugfixes
+- Synchronize metadata.json with PMT-generated metadata to pass checksums
+
+##2014-06-27 - Supported Release 4.3.0
+### Summary
+This release is the first supported release of the stdlib 4 series. It remains
+backwards-compatible with the stdlib 3 series. It adds two new functions, one bugfix, and many testing updates.
+
+#### Features
+- New `bool2str()` function
+- New `camelcase()` function
+
+#### Bugfixes
+- Fix `has_interface_with()` when interfaces fact is nil
+
+##2014-06-04 - Release 4.2.2
+### Summary
+
+This release adds PE3.3 support in the metadata and fixes a few tests.
+
+## 2014-05-08 - Release - 4.2.1
+### Summary
+This release moves a stray symlink that can cause problems.
+
+## 2014-05-08 - Release - 4.2.0
+### Summary
+This release adds many new functions and fixes, and continues to be backwards compatible with stdlib 3.x
+
+#### Features
+- New `base64()` function
+- New `deep_merge()` function
+- New `delete_undef_values()` function
+- New `delete_values()` function
+- New `difference()` function
+- New `intersection()` function
+- New `is_bool()` function
+- New `pick_default()` function
+- New `union()` function
+- New `validate_ipv4_address` function
+- New `validate_ipv6_address` function
+- Update `ensure_packages()` to take an option hash as a second parameter.
+- Update `range()` to take an optional third argument for range step
+- Update `validate_slength()` to take an optional third argument for minimum length
+- Update `file_line` resource to take `after` and `multiple` attributes
+
+#### Bugfixes
+- Correct `is_string`, `is_domain_name`, `is_array`, `is_float`, and `is_function_available` for parsing odd types such as bools and hashes.
+- Allow facts.d facts to contain `=` in the value
+- Fix `root_home` fact on darwin systems
+- Fix `concat()` to work with a second non-array argument
+- Fix `floor()` to work with integer strings
+- Fix `is_integer()` to return true if passed integer strings
+- Fix `is_numeric()` to return true if passed integer strings
+- Fix `merge()` to work with empty strings
+- Fix `pick()` to raise the correct error type
+- Fix `uriescape()` to use the default URI.escape list
+- Add/update unit & acceptance tests.
+
+
+##2014-03-04 - Supported Release - 3.2.1
+###Summary
+This is a supported release
+
+####Bugfixes
+- Fixed `is_integer`/`is_float`/`is_numeric` for checking the value of arithmatic expressions.
+
+####Known bugs
+* No known bugs
+
+---
+
+##### 2013-05-06 - Jeff McCune <jeff@puppetlabs.com> - 4.1.0
+
+ * (#20582) Restore facter\_dot\_d to stdlib for PE users (3b887c8)
+ * (maint) Update Gemfile with GEM\_FACTER\_VERSION (f44d535)
+
+##### 2013-05-06 - Alex Cline <acline@us.ibm.com> - 4.1.0
+
+ * Terser method of string to array conversion courtesy of ethooz. (d38bce0)
+
+##### 2013-05-06 - Alex Cline <acline@us.ibm.com> 4.1.0
+
+ * Refactor ensure\_resource expectations (b33cc24)
+
+##### 2013-05-06 - Alex Cline <acline@us.ibm.com> 4.1.0
+
+ * Changed str-to-array conversion and removed abbreviation. (de253db)
+
+##### 2013-05-03 - Alex Cline <acline@us.ibm.com> 4.1.0
+
+ * (#20548) Allow an array of resource titles to be passed into the ensure\_resource function (e08734a)
+
+##### 2013-05-02 - RaphaÃ«l Pinson <raphael.pinson@camptocamp.com> - 4.1.0
+
+ * Add a dirname function (2ba9e47)
+
+##### 2013-04-29 - Mark Smith-Guerrero <msmithgu@gmail.com> - 4.1.0
+
+ * (maint) Fix a small typo in hash() description (928036a)
+
+##### 2013-04-12 - Jeff McCune <jeff@puppetlabs.com> - 4.0.2
+
+ * Update user information in gemspec to make the intent of the Gem clear.
+
+##### 2013-04-11 - Jeff McCune <jeff@puppetlabs.com> - 4.0.1
+
+ * Fix README function documentation (ab3e30c)
+
+##### 2013-04-11 - Jeff McCune <jeff@puppetlabs.com> - 4.0.0
+
+ * stdlib 4.0 drops support with Puppet 2.7
+ * stdlib 4.0 preserves support with Puppet 3
+
+##### 2013-04-11 - Jeff McCune <jeff@puppetlabs.com> - 4.0.0
+
+ * Add ability to use puppet from git via bundler (9c5805f)
+
+##### 2013-04-10 - Jeff McCune <jeff@puppetlabs.com> - 4.0.0
+
+ * (maint) Make stdlib usable as a Ruby GEM (e81a45e)
+
+##### 2013-04-10 - Erik DalÃ©n <dalen@spotify.com> - 4.0.0
+
+ * Add a count function (f28550e)
+
+##### 2013-03-31 - Amos Shapira <ashapira@atlassian.com> - 4.0.0
+
+ * (#19998) Implement any2array (7a2fb80)
+
+##### 2013-03-29 - Steve Huff <shuff@vecna.org> - 4.0.0
+
+ * (19864) num2bool match fix (8d217f0)
+
+##### 2013-03-20 - Erik DalÃ©n <dalen@spotify.com> - 4.0.0
+
+ * Allow comparisons of Numeric and number as String (ff5dd5d)
+
+##### 2013-03-26 - Richard Soderberg <rsoderberg@mozilla.com> - 4.0.0
+
+ * add suffix function to accompany the prefix function (88a93ac)
+
+##### 2013-03-19 - Kristof Willaert <kristof.willaert@gmail.com> - 4.0.0
+
+ * Add floor function implementation and unit tests (0527341)
+
+##### 2012-04-03 - Eric Shamow <eric@puppetlabs.com> - 4.0.0
+
+ * (#13610) Add is\_function\_available to stdlib (961dcab)
+
+##### 2012-12-17 - Justin Lambert <jlambert@eml.cc> - 4.0.0
+
+ * str2bool should return a boolean if called with a boolean (5d5a4d4)
+
+##### 2012-10-23 - Uwe Stuehler <ustuehler@team.mobile.de> - 4.0.0
+
+ * Fix number of arguments check in flatten() (e80207b)
+
+##### 2013-03-11 - Jeff McCune <jeff@puppetlabs.com> - 4.0.0
+
+ * Add contributing document (96e19d0)
+
+##### 2013-03-04 - RaphaÃ«l Pinson <raphael.pinson@camptocamp.com> - 4.0.0
+
+ * Add missing documentation for validate\_augeas and validate\_cmd to README.markdown (a1510a1)
+
+##### 2013-02-14 - Joshua Hoblitt <jhoblitt@cpan.org> - 4.0.0
+
+ * (#19272) Add has\_element() function (95cf3fe)
+
+##### 2013-02-07 - RaphaÃ«l Pinson <raphael.pinson@camptocamp.com> - 4.0.0
+
+ * validate\_cmd(): Use Puppet::Util::Execution.execute when available (69248df)
+
+##### 2012-12-06 - RaphaÃ«l Pinson <raphink@gmail.com> - 4.0.0
+
+ * Add validate\_augeas function (3a97c23)
+
+##### 2012-12-06 - RaphaÃ«l Pinson <raphink@gmail.com> - 4.0.0
+
+ * Add validate\_cmd function (6902cc5)
+
+##### 2013-01-14 - David Schmitt <david@dasz.at> - 4.0.0
+
+ * Add geppetto project definition (b3fc0a3)
+
+##### 2013-01-02 - Jaka Hudoklin <jakahudoklin@gmail.com> - 4.0.0
+
+ * Add getparam function to get defined resource parameters (20e0e07)
+
+##### 2013-01-05 - Jeff McCune <jeff@puppetlabs.com> - 4.0.0
+
+ * (maint) Add Travis CI Support (d082046)
+
+##### 2012-12-04 - Jeff McCune <jeff@puppetlabs.com> - 4.0.0
+
+ * Clarify that stdlib 3 supports Puppet 3 (3a6085f)
+
+##### 2012-11-30 - Erik DalÃ©n <dalen@spotify.com> - 4.0.0
+
+ * maint: style guideline fixes (7742e5f)
+
+##### 2012-11-09 - James Fryman <james@frymanet.com> - 4.0.0
+
+ * puppet-lint cleanup (88acc52)
+
+##### 2012-11-06 - Joe Julian <me@joejulian.name> - 4.0.0
+
+ * Add function, uriescape, to URI.escape strings. Redmine #17459 (fd52b8d)
+
+##### 2012-09-18 - Chad Metcalf <chad@wibidata.com> - 3.2.0
+
+ * Add an ensure\_packages function. (8a8c09e)
+
+##### 2012-11-23 - Erik DalÃ©n <dalen@spotify.com> - 3.2.0
+
+ * (#17797) min() and max() functions (9954133)
+
+##### 2012-05-23 - Peter Meier <peter.meier@immerda.ch> - 3.2.0
+
+ * (#14670) autorequire a file\_line resource's path (dfcee63)
+
+##### 2012-11-19 - Joshua Harlan Lifton <lifton@puppetlabs.com> - 3.2.0
+
+ * Add join\_keys\_to\_values function (ee0f2b3)
+
+##### 2012-11-17 - Joshua Harlan Lifton <lifton@puppetlabs.com> - 3.2.0
+
+ * Extend delete function for strings and hashes (7322e4d)
+
+##### 2012-08-03 - Gary Larizza <gary@puppetlabs.com> - 3.2.0
+
+ * Add the pick() function (ba6dd13)
+
+##### 2012-03-20 - Wil Cooley <wcooley@pdx.edu> - 3.2.0
+
+ * (#13974) Add predicate functions for interface facts (f819417)
+
+##### 2012-11-06 - Joe Julian <me@joejulian.name> - 3.2.0
+
+ * Add function, uriescape, to URI.escape strings. Redmine #17459 (70f4a0e)
+
+##### 2012-10-25 - Jeff McCune <jeff@puppetlabs.com> - 3.1.1
+
+ * (maint) Fix spec failures resulting from Facter API changes (97f836f)
+
+##### 2012-10-23 - Matthaus Owens <matthaus@puppetlabs.com> - 3.1.0
+
+ * Add PE facts to stdlib (cdf3b05)
+
+##### 2012-08-16 - Jeff McCune <jeff@puppetlabs.com> - 3.0.1
+
+ * Fix accidental removal of facts\_dot\_d.rb in 3.0.0 release
+
+##### 2012-08-16 - Jeff McCune <jeff@puppetlabs.com> - 3.0.0
+
+ * stdlib 3.0 drops support with Puppet 2.6
+ * stdlib 3.0 preserves support with Puppet 2.7
+
+##### 2012-08-07 - Dan Bode <dan@puppetlabs.com> - 3.0.0
+
+ * Add function ensure\_resource and defined\_with\_params (ba789de)
+
+##### 2012-07-10 - Hailee Kenney <hailee@puppetlabs.com> - 3.0.0
+
+ * (#2157) Remove facter\_dot\_d for compatibility with external facts (f92574f)
+
+##### 2012-04-10 - Chris Price <chris@puppetlabs.com> - 3.0.0
+
+ * (#13693) moving logic from local spec\_helper to puppetlabs\_spec\_helper (85f96df)
+
+##### 2012-10-25 - Jeff McCune <jeff@puppetlabs.com> - 2.5.1
+
+ * (maint) Fix spec failures resulting from Facter API changes (97f836f)
+
+##### 2012-10-23 - Matthaus Owens <matthaus@puppetlabs.com> - 2.5.0
+
+ * Add PE facts to stdlib (cdf3b05)
+
+##### 2012-08-15 - Dan Bode <dan@puppetlabs.com> - 2.5.0
+
+ * Explicitly load functions used by ensure\_resource (9fc3063)
+
+##### 2012-08-13 - Dan Bode <dan@puppetlabs.com> - 2.5.0
+
+ * Add better docs about duplicate resource failures (97d327a)
+
+##### 2012-08-13 - Dan Bode <dan@puppetlabs.com> - 2.5.0
+
+ * Handle undef for parameter argument (4f8b133)
+
+##### 2012-08-07 - Dan Bode <dan@puppetlabs.com> - 2.5.0
+
+ * Add function ensure\_resource and defined\_with\_params (a0cb8cd)
+
+##### 2012-08-20 - Jeff McCune <jeff@puppetlabs.com> - 2.5.0
+
+ * Disable tests that fail on 2.6.x due to #15912 (c81496e)
+
+##### 2012-08-20 - Jeff McCune <jeff@puppetlabs.com> - 2.5.0
+
+ * (Maint) Fix mis-use of rvalue functions as statements (4492913)
+
+##### 2012-08-20 - Jeff McCune <jeff@puppetlabs.com> - 2.5.0
+
+ * Add .rspec file to repo root (88789e8)
+
+##### 2012-06-07 - Chris Price <chris@puppetlabs.com> - 2.4.0
+
+ * Add support for a 'match' parameter to file\_line (a06c0d8)
+
+##### 2012-08-07 - Erik DalÃ©n <dalen@spotify.com> - 2.4.0
+
+ * (#15872) Add to\_bytes function (247b69c)
+
+##### 2012-07-19 - Jeff McCune <jeff@puppetlabs.com> - 2.4.0
+
+ * (Maint) use PuppetlabsSpec::PuppetInternals.scope (master) (deafe88)
+
+##### 2012-07-10 - Hailee Kenney <hailee@puppetlabs.com> - 2.4.0
+
+ * (#2157) Make facts\_dot\_d compatible with external facts (5fb0ddc)
+
+##### 2012-03-16 - Steve Traylen <steve.traylen@cern.ch> - 2.4.0
+
+ * (#13205) Rotate array/string randomley based on fqdn, fqdn\_rotate() (fef247b)
+
+##### 2012-05-22 - Peter Meier <peter.meier@immerda.ch> - 2.3.3
+
+ * fix regression in #11017 properly (f0a62c7)
+
+##### 2012-05-10 - Jeff McCune <jeff@puppetlabs.com> - 2.3.3
+
+ * Fix spec tests using the new spec\_helper (7d34333)
+
+##### 2012-05-10 - Puppet Labs <support@puppetlabs.com> - 2.3.2
+
+ * Make file\_line default to ensure => present (1373e70)
+ * Memoize file\_line spec instance variables (20aacc5)
+ * Fix spec tests using the new spec\_helper (1ebfa5d)
+ * (#13595) initialize\_everything\_for\_tests couples modules Puppet ver (3222f35)
+ * (#13439) Fix MRI 1.9 issue with spec\_helper (15c5fd1)
+ * (#13439) Fix test failures with Puppet 2.6.x (665610b)
+ * (#13439) refactor spec helper for compatibility with both puppet 2.7 and master (82194ca)
+ * (#13494) Specify the behavior of zero padded strings (61891bb)
+
+##### 2012-03-29 Puppet Labs <support@puppetlabs.com> - 2.1.3
+
+* (#11607) Add Rakefile to enable spec testing
+* (#12377) Avoid infinite loop when retrying require json
+
+##### 2012-03-13 Puppet Labs <support@puppetlabs.com> - 2.3.1
+
+* (#13091) Fix LoadError bug with puppet apply and puppet\_vardir fact
+
+##### 2012-03-12 Puppet Labs <support@puppetlabs.com> - 2.3.0
+
+* Add a large number of new Puppet functions
+* Backwards compatibility preserved with 2.2.x
+
+##### 2011-12-30 Puppet Labs <support@puppetlabs.com> - 2.2.1
+
+* Documentation only release for the Forge
+
+##### 2011-12-30 Puppet Labs <support@puppetlabs.com> - 2.1.2
+
+* Documentation only release for PE 2.0.x
+
+##### 2011-11-08 Puppet Labs <support@puppetlabs.com> - 2.2.0
+
+* #10285 - Refactor json to use pson instead.
+* Maint  - Add watchr autotest script
+* Maint  - Make rspec tests work with Puppet 2.6.4
+* #9859  - Add root\_home fact and tests
+
+##### 2011-08-18 Puppet Labs <support@puppetlabs.com> - 2.1.1
+
+* Change facts.d paths to match Facter 2.0 paths.
+* /etc/facter/facts.d
+* /etc/puppetlabs/facter/facts.d
+
+##### 2011-08-17 Puppet Labs <support@puppetlabs.com> - 2.1.0
+
+* Add R.I. Pienaar's facts.d custom facter fact
+* facts defined in /etc/facts.d and /etc/puppetlabs/facts.d are
+  automatically loaded now.
+
+##### 2011-08-04 Puppet Labs <support@puppetlabs.com> - 2.0.0
+
+* Rename whole\_line to file\_line
+* This is an API change and as such motivating a 2.0.0 release according to semver.org.
+
+##### 2011-08-04 Puppet Labs <support@puppetlabs.com> - 1.1.0
+
+* Rename append\_line to whole\_line
+* This is an API change and as such motivating a 1.1.0 release.
+
+##### 2011-08-04 Puppet Labs <support@puppetlabs.com> - 1.0.0
+
+* Initial stable release
+* Add validate\_array and validate\_string functions
+* Make merge() function work with Ruby 1.8.5
+* Add hash merging function
+* Add has\_key function
+* Add loadyaml() function
+* Add append\_line native
+
+##### 2011-06-21 Jeff McCune <jeff@puppetlabs.com> - 0.1.7
+
+* Add validate\_hash() and getvar() functions
+
+##### 2011-06-15 Jeff McCune <jeff@puppetlabs.com> - 0.1.6
+
+* Add anchor resource type to provide containment for composite classes
+
+##### 2011-06-03 Jeff McCune <jeff@puppetlabs.com> - 0.1.5
+
+* Add validate\_bool() function to stdlib
+
+##### 0.1.4 2011-05-26 Jeff McCune <jeff@puppetlabs.com>
+
+* Move most stages after main
+
+##### 0.1.3 2011-05-25 Jeff McCune <jeff@puppetlabs.com>
+
+* Add validate\_re() function
+
+##### 0.1.2 2011-05-24 Jeff McCune <jeff@puppetlabs.com>
+
+* Update to add annotated tag
+
+##### 0.1.1 2011-05-24 Jeff McCune <jeff@puppetlabs.com>
+
+* Add stdlib::stages class with a standard set of stages
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/CONTRIBUTING.md
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/CONTRIBUTING.md	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/CONTRIBUTING.md	(revision 30960)
@@ -0,0 +1,218 @@
+Checklist (and a short version for the impatient)
+=================================================
+
+  * Commits:
+
+    - Make commits of logical units.
+
+    - Check for unnecessary whitespace with "git diff --check" before
+      committing.
+
+    - Commit using Unix line endings (check the settings around "crlf" in
+      git-config(1)).
+
+    - Do not check in commented out code or unneeded files.
+
+    - The first line of the commit message should be a short
+      description (50 characters is the soft limit, excluding ticket
+      number(s)), and should skip the full stop.
+
+    - Associate the issue in the message. The first line should include
+      the issue number in the form "(#XXXX) Rest of message".
+
+    - The body should provide a meaningful commit message, which:
+
+      - uses the imperative, present tense: "change", not "changed" or
+        "changes".
+
+      - includes motivation for the change, and contrasts its
+        implementation with the previous behavior.
+
+    - Make sure that you have tests for the bug you are fixing, or
+      feature you are adding.
+
+    - Make sure the test suites passes after your commit:
+      `bundle exec rspec spec/acceptance` More information on [testing](#Testing) below
+
+    - When introducing a new feature, make sure it is properly
+      documented in the README.md
+
+  * Submission:
+
+    * Pre-requisites:
+
+      - Make sure you have a [GitHub account](https://github.com/join)
+
+      - [Create a ticket](https://tickets.puppetlabs.com/secure/CreateIssue!default.jspa), or [watch the ticket](https://tickets.puppetlabs.com/browse/) you are patching for.
+
+    * Preferred method:
+
+      - Fork the repository on GitHub.
+
+      - Push your changes to a topic branch in your fork of the
+        repository. (the format ticket/1234-short_description_of_change is
+        usually preferred for this project).
+
+      - Submit a pull request to the repository in the puppetlabs
+        organization.
+
+The long version
+================
+
+  1.  Make separate commits for logically separate changes.
+
+      Please break your commits down into logically consistent units
+      which include new or changed tests relevant to the rest of the
+      change.  The goal of doing this is to make the diff easier to
+      read for whoever is reviewing your code.  In general, the easier
+      your diff is to read, the more likely someone will be happy to
+      review it and get it into the code base.
+
+      If you are going to refactor a piece of code, please do so as a
+      separate commit from your feature or bug fix changes.
+
+      We also really appreciate changes that include tests to make
+      sure the bug is not re-introduced, and that the feature is not
+      accidentally broken.
+
+      Describe the technical detail of the change(s).  If your
+      description starts to get too long, that is a good sign that you
+      probably need to split up your commit into more finely grained
+      pieces.
+
+      Commits which plainly describe the things which help
+      reviewers check the patch and future developers understand the
+      code are much more likely to be merged in with a minimum of
+      bike-shedding or requested changes.  Ideally, the commit message
+      would include information, and be in a form suitable for
+      inclusion in the release notes for the version of Puppet that
+      includes them.
+
+      Please also check that you are not introducing any trailing
+      whitespace or other "whitespace errors".  You can do this by
+      running "git diff --check" on your changes before you commit.
+
+  2.  Sending your patches
+
+      To submit your changes via a GitHub pull request, we _highly_
+      recommend that you have them on a topic branch, instead of
+      directly on "master".
+      It makes things much easier to keep track of, especially if
+      you decide to work on another thing before your first change
+      is merged in.
+
+      GitHub has some pretty good
+      [general documentation](http://help.github.com/) on using
+      their site.  They also have documentation on
+      [creating pull requests](http://help.github.com/send-pull-requests/).
+
+      In general, after pushing your topic branch up to your
+      repository on GitHub, you can switch to the branch in the
+      GitHub UI and click "Pull Request" towards the top of the page
+      in order to open a pull request.
+
+
+  3.  Update the related GitHub issue.
+
+      If there is a GitHub issue associated with the change you
+      submitted, then you should update the ticket to include the
+      location of your branch, along with any other commentary you
+      may wish to make.
+
+Testing
+=======
+
+Getting Started
+---------------
+
+Our puppet modules provide [`Gemfile`](./Gemfile)s which can tell a ruby
+package manager such as [bundler](http://bundler.io/) what Ruby packages,
+or Gems, are required to build, develop, and test this software.
+
+Please make sure you have [bundler installed](http://bundler.io/#getting-started)
+on your system, then use it to install all dependencies needed for this project,
+by running
+
+```shell
+% bundle install
+Fetching gem metadata from https://rubygems.org/........
+Fetching gem metadata from https://rubygems.org/..
+Using rake (10.1.0)
+Using builder (3.2.2)
+-- 8><-- many more --><8 --
+Using rspec-system-puppet (2.2.0)
+Using serverspec (0.6.3)
+Using rspec-system-serverspec (1.0.0)
+Using bundler (1.3.5)
+Your bundle is complete!
+Use `bundle show [gemname]` to see where a bundled gem is installed.
+```
+
+NOTE some systems may require you to run this command with sudo.
+
+If you already have those gems installed, make sure they are up-to-date:
+
+```shell
+% bundle update
+```
+
+With all dependencies in place and up-to-date we can now run the tests:
+
+```shell
+% bundle exec rake spec
+```
+
+This will execute all the [rspec tests](http://rspec-puppet.com/) tests
+under [spec/defines](./spec/defines), [spec/classes](./spec/classes),
+and so on. rspec tests may have the same kind of dependencies as the
+module they are testing. While the module defines in its [Modulefile](./Modulefile),
+rspec tests define them in [.fixtures.yml](./fixtures.yml).
+
+Some puppet modules also come with [beaker](https://github.com/puppetlabs/beaker)
+tests. These tests spin up a virtual machine under
+[VirtualBox](https://www.virtualbox.org/)) with, controlling it with
+[Vagrant](http://www.vagrantup.com/) to actually simulate scripted test
+scenarios. In order to run these, you will need both of those tools
+installed on your system.
+
+You can run them by issuing the following command
+
+```shell
+% bundle exec rake spec_clean
+% bundle exec rspec spec/acceptance
+```
+
+This will now download a pre-fabricated image configured in the [default node-set](./spec/acceptance/nodesets/default.yml),
+install puppet, copy this module and install its dependencies per [spec/spec_helper_acceptance.rb](./spec/spec_helper_acceptance.rb)
+and then run all the tests under [spec/acceptance](./spec/acceptance).
+
+Writing Tests
+-------------
+
+XXX getting started writing tests.
+
+If you have commit access to the repository
+===========================================
+
+Even if you have commit access to the repository, you will still need to
+go through the process above, and have someone else review and merge
+in your changes.  The rule is that all changes must be reviewed by a
+developer on the project (that did not write the code) to ensure that
+all changes go through a code review process.
+
+Having someone other than the author of the topic branch recorded as
+performing the merge is the record that they performed the code
+review.
+
+
+Additional Resources
+====================
+
+* [Getting additional help](http://puppet.com/community/get-help)
+
+* [Writing tests](https://docs.puppet.com/guides/module_guides/bgtm.html#step-three-module-testing)
+
+* [General GitHub documentation](http://help.github.com/)
+
+* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
+
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/Gemfile
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/Gemfile	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/Gemfile	(revision 30960)
@@ -0,0 +1,50 @@
+#This file is generated by ModuleSync, do not edit.
+
+source ENV['GEM_SOURCE'] || "https://rubygems.org"
+
+def location_from_env(env, default_location = [])
+  if location = ENV[env]
+    if location =~ /^((?:git|https?)[:@][^#]*)#(.*)/
+      [{ :git => $1, :branch => $2, :require => false }]
+    elsif location =~ /^file:\/\/(.*)/
+      ['>= 0', { :path => File.expand_path($1), :require => false }]
+    else
+      [location, { :require => false }]
+    end
+  else
+    default_location
+  end
+end
+
+group :development, :unit_tests do
+  gem 'metadata-json-lint'
+  gem 'puppet_facts'
+  gem 'puppet-blacksmith', '>= 3.4.0'
+  gem 'puppetlabs_spec_helper', '>= 1.2.1'
+  gem 'rspec-puppet', '>= 2.3.2', :git => 'https://github.com/rodjek/rspec-puppet.git', :branch => 'fb27c533e2664057fba4b73d0bd902a946abfce0'
+  # the newly released mocha 1.2.0 causes hangs during spec testing. See MODULES-3958 for a long-term solution
+  gem 'mocha', '< 1.2.0'
+  gem 'rspec-puppet-facts'
+  gem 'simplecov'
+  gem 'parallel_tests'
+  gem 'rubocop', '0.41.2' if RUBY_VERSION < '2.0.0'
+  gem 'rubocop' if RUBY_VERSION >= '2.0.0'
+  gem 'rubocop-rspec', '~> 1.6' if RUBY_VERSION >= '2.3.0'
+  gem 'json_pure', '<= 2.0.1' if RUBY_VERSION < '2.0.0'
+end
+group :system_tests do
+  gem 'beaker', *location_from_env('BEAKER_VERSION', []) if RUBY_VERSION >= '2.3.0'
+  gem 'beaker', *location_from_env('BEAKER_VERSION', ['< 3']) if RUBY_VERSION < '2.3.0'
+  gem 'beaker-rspec', *location_from_env('BEAKER_RSPEC_VERSION', ['>= 3.4'])
+  gem 'serverspec'
+  gem 'beaker-puppet_install_helper'
+  gem 'master_manipulator'
+  gem 'beaker-hostgenerator', *location_from_env('BEAKER_HOSTGENERATOR_VERSION', [])
+end
+
+gem 'facter', *location_from_env('FACTER_GEM_VERSION')
+gem 'puppet', *location_from_env('PUPPET_GEM_VERSION')
+
+if File.exists? "#{__FILE__}.local"
+  eval(File.read("#{__FILE__}.local"), binding)
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/LICENSE
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/LICENSE	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/LICENSE	(revision 30960)
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/NOTICE
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/NOTICE	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/NOTICE	(revision 30960)
@@ -0,0 +1,23 @@
+stdlib puppet module
+
+Copyright (C) 2011-2016 Puppet Labs, Inc.
+
+and some parts:
+
+Copyright (C) 2011 Krzysztof Wilczynski
+
+
+Puppet Labs can be contacted at: info@puppetlabs.com
+
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/README.markdown
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/README.markdown	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/README.markdown	(revision 30960)
@@ -0,0 +1,1668 @@
+# stdlib
+
+#### Table of Contents
+
+1. [Overview](#overview)
+2. [Module Description - What the module does and why it is useful](#module-description)
+3. [Setup - The basics of getting started with stdlib](#setup)
+4. [Usage - Configuration options and additional functionality](#usage)
+5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
+5. [Limitations - OS compatibility, etc.](#limitations)
+6. [Development - Guide for contributing to the module](#development)
+
+## Overview
+
+Adds a standard library of resources for Puppet modules.
+
+## Module Description
+
+This module provides a standard library of resources for the development of Puppet modules. Puppet modules make heavy use of this standard library. The stdlib module adds the following resources to Puppet:
+
+ * Stages
+ * Facts
+ * Functions
+ * Defined resource types
+ * Data Types
+ * Providers
+
+> *Note:* As of version 3.7, Puppet Enterprise no longer includes the stdlib module. If you're running Puppet Enterprise, you should install the most recent release of stdlib for compatibility with Puppet modules.
+
+## Setup
+
+Installing the stdlib module adds the functions, facts, and resources of this standard library to Puppet.
+
+## Usage
+
+After you've installed stdlib, all of its functions, facts, and resources are available for module use or development.
+
+If you want to use a standardized set of run stages for Puppet, `include stdlib` in your manifest.
+
+* `stdlib`: Most of stdlib's features are automatically loaded by Puppet. To use standardized run stages in Puppet, declare this class in your manifest with `include stdlib`.
+
+  When declared, stdlib declares all other classes in the module. The only other class currently included in the module is `stdlib::stages`.
+
+The `stdlib::stages` class declares various run stages for deploying infrastructure, language runtimes, and application layers. The high level stages are (in order):
+
+  * setup
+  * main
+  * runtime
+  * setup_infra
+  * deploy_infra
+  * setup_app
+  * deploy_app
+  * deploy
+
+  Sample usage:
+
+  ~~~
+  node default {
+    include stdlib
+    class { java: stage => 'runtime' }
+  }
+  ~~~
+
+## Reference
+
+### Classes
+
+#### Public Classes
+
+  The stdlib class has no parameters.
+
+#### Private Classes
+
+* `stdlib::stages`: Manages a standard set of run stages for Puppet. It is managed by the stdlib class and should not be declared independently.
+
+### Resource Types
+
+#### `file_line`
+
+Ensures that a given line is contained within a file. The implementation matches the full line, including whitespace at the beginning and end. If the line is not contained in the given file, Puppet appends the line to the end of the file to ensure the desired state.  Multiple resources can be declared to manage multiple lines in the same file.
+
+Example:
+
+    file_line { 'sudo_rule':
+      path => '/etc/sudoers',
+      line => '%sudo ALL=(ALL) ALL',
+    }
+
+    file_line { 'sudo_rule_nopw':
+      path => '/etc/sudoers',
+      line => '%sudonopw ALL=(ALL) NOPASSWD: ALL',
+    }
+
+In this example, Puppet ensures that both of the specified lines are contained in the file `/etc/sudoers`.
+
+Match Example:
+
+    file_line { 'bashrc_proxy':
+      ensure => present,
+      path   => '/etc/bashrc',
+      line   => 'export HTTP_PROXY=http://squid.puppetlabs.vm:3128',
+      match  => '^export\ HTTP_PROXY\=',
+    }
+
+In this code example, `match` looks for a line beginning with export followed by HTTP_PROXY and replaces it with the value in line.
+
+Match Example With `ensure => absent`:
+
+    file_line { 'bashrc_proxy':
+      ensure            => absent,
+      path              => '/etc/bashrc',
+      line              => 'export HTTP_PROXY=http://squid.puppetlabs.vm:3128',
+      match             => '^export\ HTTP_PROXY\=',
+      match_for_absence => true,
+    }
+
+In this code example, `match` looks for a line beginning with export
+followed by HTTP_PROXY and delete it.  If multiple lines match, an
+error will be raised unless the `multiple => true` parameter is set.
+
+**Autorequires:** If Puppet is managing the file that contains the line being managed, the `file_line` resource autorequires that file.
+
+##### Parameters
+
+All parameters are optional, unless otherwise noted.
+
+* `after`: Specifies the line after which Puppet adds any new lines using a regular expression. (Existing lines are added in place.) Valid options: String containing a regex. Default: Undefined.
+* `ensure`: Ensures whether the resource is present. Valid options: 'present', 'absent'. Default: 'present'.
+* `line`: **Required.** Sets the line to be added to the file located by the `path` parameter. Valid options: String. Default: Undefined.
+* `match`: Specifies a regular expression to run against existing lines in the file; if a match is found, it is replaced rather than adding a new line. A regex comparison is performed against the line value, and if it does not match, an exception is raised. Valid options: String containing a regex. Default: Undefined.
+* `match_for_absence`: An optional value to determine if match should be applied when `ensure => absent`. If set to true and match is set, the line that matches match will be deleted. If set to false (the default), match is ignored when `ensure => absent` and the value of `line` is used instead. Ignored when `ensure => present`. Default: false.
+* `multiple`: Determines if `match` and/or `after` can change multiple lines. If set to false, an exception will be raised if more than one line matches. Valid options: 'true', 'false'. Default: Undefined.
+* `name`: Sets the name to use as the identity of the resource. This is necessary if you want the resource namevar to differ from the supplied `title` of the resource. Valid options: String. Default: Undefined.
+* `path`: **Required.** Defines the file in which Puppet will ensure the line specified by `line`. Must be an absolute path to the file.
+* `replace`: Defines whether the resource will overwrite an existing line that matches the `match` parameter. If set to false and a line is found matching the `match` param, the line will not be placed in the file. Valid options: true, false, yes, no. Default: true
+
+### Data Types
+
+#### `Stdlib::Absolutepath`
+
+A strict absolute path type. Uses a Variant of Unixpath and Windowspath types.
+
+Acceptable input examples:    /var/log
+                              /usr2/username/bin:/usr/local/bin:/usr/bin:.
+                              C:\\WINDOWS\\System32
+Unacceptable input example:   ../relative_path
+
+#### `Stdlib::Httpsurl`
+
+Matches https URLs.
+
+Acceptable input example:     https://hello.com
+Unacceptable input example:   httds://notquiteright.org
+
+#### `Stdlib::Httpurl`
+
+Matches both https and http URLs.
+
+Acceptable input example:     https://hello.com
+                              http://hello.com
+Unacceptable input example:   httds://notquiteright.org
+
+#### `Stdlib::Unixpath`
+
+Matches paths on Unix type Operating Systems.
+
+Acceptable input example:     /usr2/username/bin:/usr/local/bin:/usr/bin:.
+                              /var/tmp
+Unacceptable input example:   C:/whatever
+
+#### `Stdlib::Windowspath`
+
+Matches paths on Windows Operating systems.
+
+Acceptable input example:     C:\\WINDOWS\\System32
+                              C:\\
+                              \\\\host\\windows
+Unacceptable input example:   /usr2/username/bin:/usr/local/bin:/usr/bin:.
+
+### Functions
+
+#### `abs`
+
+Returns the absolute value of a number; for example, '-34.56' becomes '34.56'. Takes a single integer and float value as an argument. *Type*: rvalue.
+
+#### `any2array`
+
+Converts any object to an array containing that object. Empty argument lists are converted to an empty array. Arrays are left untouched. Hashes are converted to arrays of alternating keys and values. *Type*: rvalue.
+
+#### `base64`
+
+Converts a string to and from base64 encoding. Requires an `action` ('encode', 'decode') and either a plain or base64-encoded `string`, and an optional `method` ('default', 'strict', 'urlsafe')
+
+For backward compatibility, `method` will be set as `default` if not specified.
+
+*Examples:*
+~~~
+base64('encode', 'hello')
+base64('encode', 'hello', 'default')
+# return: "aGVsbG8=\n"
+
+base64('encode', 'hello', 'strict')
+# return: "aGVsbG8="
+
+base64('decode', 'aGVsbG8=')
+base64('decode', 'aGVsbG8=\n')
+base64('decode', 'aGVsbG8=', 'default')
+base64('decode', 'aGVsbG8=\n', 'default')
+base64('decode', 'aGVsbG8=', 'strict')
+# return: "hello"
+
+base64('encode', 'https://puppetlabs.com', 'urlsafe')
+# return: "aHR0cHM6Ly9wdXBwZXRsYWJzLmNvbQ=="
+
+base64('decode', 'aHR0cHM6Ly9wdXBwZXRsYWJzLmNvbQ==', 'urlsafe')
+# return: "https://puppetlabs.com"
+~~~
+
+*Type*: rvalue.
+
+#### `basename`
+
+Returns the `basename` of a path (optionally stripping an extension). For example:
+  * ('/path/to/a/file.ext') returns 'file.ext'
+  * ('relative/path/file.ext') returns 'file.ext'
+  * ('/path/to/a/file.ext', '.ext') returns 'file'
+
+*Type*: rvalue.
+
+#### `bool2num`
+
+Converts a boolean to a number. Converts values:
+  * 'false', 'f', '0', 'n', and 'no' to 0.
+  * 'true', 't', '1', 'y', and 'yes' to 1.
+  Requires a single boolean or string as an input. *Type*: rvalue.
+
+#### `bool2str`
+
+Converts a boolean to a string using optionally supplied arguments. The optional second and third arguments represent what true and false are converted to respectively. If only one argument is given, it is converted from a boolean to a string containing 'true' or 'false'.
+
+*Examples:*
+~~~
+bool2str(true)                    => 'true'
+bool2str(true, 'yes', 'no')       => 'yes'
+bool2str(false, 't', 'f')         => 'f'
+~~~
+
+Requires a single boolean as input. *Type*: rvalue.
+
+#### `capitalize`
+
+Capitalizes the first character of a string or array of strings and lowercases the remaining characters of each string. Requires either a single string or an array as an input. *Type*: rvalue.
+
+#### `ceiling`
+
+Returns the smallest integer greater than or equal to the argument. Takes a single numeric value as an argument. *Type*: rvalue.
+
+#### `chomp`
+
+Removes the record separator from the end of a string or an array of strings; for example, 'hello\n' becomes 'hello'. Requires a single string or array as an input. *Type*: rvalue.
+
+#### `chop`
+
+Returns a new string with the last character removed. If the string ends with '\r\n', both characters are removed. Applying `chop` to an empty string returns an empty string. If you want to merely remove record separators, then you should use the `chomp` function. Requires a string or an array of strings as input. *Type*: rvalue.
+
+#### `clamp`
+
+Keeps value within the range [Min, X, Max] by sort based on integer value (order of params doesn't matter). Takes strings, arrays or numerics. Strings are converted and compared numerically. Arrays of values are flattened into a list for further handling. For example:
+  * `clamp('24', [575, 187])` returns 187.
+  * `clamp(16, 88, 661)` returns 88.
+  * `clamp([4, 3, '99'])` returns 4.
+  *Type*: rvalue.
+
+#### `concat`
+
+Appends the contents of multiple arrays onto the first array given. For example:
+  * `concat(['1','2','3'],'4')` returns ['1','2','3','4'].
+  * `concat(['1','2','3'],'4',['5','6','7'])` returns ['1','2','3','4','5','6','7'].
+  *Type*: rvalue.
+
+#### `convert_base`
+
+Converts a given integer or base 10 string representing an integer to a specified base, as a string. For example:
+  * `convert_base(5, 2)` results in: '101'
+  * `convert_base('254', '16')` results in: 'fe'
+
+#### `count`
+
+If called with only an array, it counts the number of elements that are **not** nil/undef. If called with a second argument, counts the number of elements in an array that matches the second argument. *Type*: rvalue.
+
+#### `deep_merge`
+
+Recursively merges two or more hashes together and returns the resulting hash.
+  $hash1 = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
+  $hash2 = {'two' => 'dos', 'three' => { 'five' => 5 } }
+  $merged_hash = deep_merge($hash1, $hash2)
+
+The resulting hash is equivalent to:
+  $merged_hash = { 'one' => 1, 'two' => 'dos', 'three' => { 'four' => 4, 'five' => 5 } }
+
+When there is a duplicate key that is a hash, they are recursively merged. When there is a duplicate key that is not a hash, the key in the rightmost hash will "win.".
+*Type*: rvalue, rvalue.
+
+#### `defined_with_params`
+
+Takes a resource reference and an optional hash of attributes. Returns 'true' if a resource with the specified attributes has already been added to the catalog. Returns 'false' otherwise.
+
+  ~~~
+  user { 'dan':
+    ensure => present,
+  }
+
+  if ! defined_with_params(User[dan], {'ensure' => 'present' }) {
+    user { 'dan': ensure => present, }
+  }
+  ~~~
+
+*Type*: rvalue.
+
+#### `delete`
+
+Deletes all instances of a given element from an array, substring from a string, or key from a hash.
+
+For example, `delete(['a','b','c','b'], 'b')` returns ['a','c']; `delete('abracadabra', 'bra')` returns 'acada'. `delete({'a' => 1,'b' => 2,'c' => 3},['b','c'])` returns {'a'=> 1}, `delete(['ab', 'b'], 'b')` returns ['ab'].
+
+*Type*: rvalue.
+
+#### `delete_at`
+
+Deletes a determined indexed value from an array. For example, `delete_at(['a','b','c'], 1)` returns ['a','c']. *Type*: rvalue.
+
+#### `delete_regex`
+
+Deletes all instances of a given element from an array or hash that match a provided regular expression. A string will be treated as a one-item array.
+
+For example, `delete_regex(['a','b','c','b'], 'b')` returns ['a','c']; `delete_regex({'a' => 1,'b' => 2,'c' => 3},['b','c'])` returns {'a'=> 1}, `delete_regex(['abf', 'ab', 'ac'], '^ab.*')` returns ['ac']. `delete_regex(['ab', 'b'], 'b')` returns ['ab'].
+
+*Type*: rvalue.
+
+#### `delete_values`
+
+Deletes all instances of a given value from a hash. For example, `delete_values({'a'=>'A','b'=>'B','c'=>'C','B'=>'D'}, 'B')` returns {'a'=>'A','c'=>'C','B'=>'D'} *Type*: rvalue.
+
+#### `delete_undef_values`
+
+Deletes all instances of the undef value from an array or hash. For example, `$hash = delete_undef_values({a=>'A', b=>'', c=>undef, d => false})` returns {a => 'A', b => '', d => false}. *Type*: rvalue.
+
+#### `deprecation`
+
+Prints deprecation warnings and logs a warning once for a given key:
+
+```
+deprecation(key, message)
+```
+
+* key: to keep the number of messages low, during the lifetime of a puppet process, only one message per key is logged.
+* message: the text to be logged.
+
+The Puppet settings '[disable_warnings](https://docs.puppet.com/puppet/latest/reference/configuration.html#disablewarnings)', '[max_deprecations](https://docs.puppet.com/puppet/latest/reference/configuration.html#maxdeprecations)', and '[strict](https://docs.puppet.com/puppet/latest/reference/configuration.html#strict)' affect this function. Set 'strict' to `error` to fail immediately with the deprecation message, `off` to output emit no messages at all, or `warning` (default) to log all warnings.
+
+Additionally you can set the environment variable `STDLIB_LOG_DEPRECATION` to decide whether or not to log deprecation warnings: if this environment variable is set to `true`, the functions log a warning, if it is set to `false`, no warnings are logged. If no value is set at all, Puppet 4 will emit warnings, while Puppet 3 will not. Using this setting is especially useful for automated tests to avoid flooding your logs before you are ready to migrate.
+
+*Type*: String, String.
+
+#### `difference`
+
+Returns the difference between two arrays. The returned array is a copy of the original array, removing any items that also appear in the second array. For example, `difference(["a","b","c"],["b","c","d"])` returns ["a"]. *Type*: rvalue.
+
+#### `dig`
+
+DEPRECATED: This function has been replaced in Puppet 4.5.0, use dig44() for backwards compatibility or use the new version.
+
+*Type*: rvalue.
+
+Retrieves a value within multiple layers of hashes and arrays via an array of keys containing a path. The function goes through the structure by each path component and tries to return the value at the end of the path.
+
+In addition to the required path argument, the function accepts the default argument. It is returned if the path is not correct, if no value was found, or if any other error has occurred.
+
+~~~ruby
+$data = {
+  'a' => {
+    'b' => [
+      'b1',
+      'b2',
+      'b3',
+    ]
+  }
+}
+
+$value = dig($data, ['a', 'b', 2])
+# $value = 'b3'
+
+# with all possible options
+$value = dig($data, ['a', 'b', 2], 'not_found')
+# $value = 'b3'
+
+# using the default value
+$value = dig($data, ['a', 'b', 'c', 'd'], 'not_found')
+# $value = 'not_found'
+~~~
+
+1. **$data** The data structure we are working with.
+2. **['a', 'b', 2]** The path array.
+3. **'not_found'** The default value. It will be returned if nothing is found.
+   (optional, defaults to *undef*)
+
+#### `dig44`
+
+*Type*: rvalue.
+
+Retrieves a value within multiple layers of hashes and arrays via an array of keys containing a path. The function goes through the structure by each path component and tries to return the value at the end of the path.
+
+In addition to the required path argument, the function accepts the default argument. It is returned if the path is not correct, if no value was found, or if any other error has occurred.
+
+~~~ruby
+$data = {
+  'a' => {
+    'b' => [
+      'b1',
+      'b2',
+      'b3',
+    ]
+  }
+}
+
+$value = dig44($data, ['a', 'b', 2])
+# $value = 'b3'
+
+# with all possible options
+$value = dig44($data, ['a', 'b', 2], 'not_found')
+# $value = 'b3'
+
+# using the default value
+$value = dig44($data, ['a', 'b', 'c', 'd'], 'not_found')
+# $value = 'not_found'
+~~~
+
+1. **$data** The data structure we are working with.
+2. **['a', 'b', 2]** The path array.
+3. **'not_found'** The default value. It will be returned if nothing is found.
+   (optional, defaults to *undef*)
+
+#### `dirname`
+
+Returns the `dirname` of a path. For example, `dirname('/path/to/a/file.ext')` returns '/path/to/a'. *Type*: rvalue.
+
+#### `dos2unix`
+
+Returns the Unix version of the given string. Very useful when using a File resource with a cross-platform template. *Type*: rvalue.
+
+~~~
+file{$config_file:
+  ensure  => file,
+  content => dos2unix(template('my_module/settings.conf.erb')),
+}
+~~~
+
+See also [unix2dos](#unix2dos).
+
+#### `downcase`
+
+Converts the case of a string or of all strings in an array to lowercase. *Type*: rvalue.
+
+#### `empty`
+
+Returns true if the argument is an array or hash that contains no elements, or an empty string. Returns false when the argument is a numerical value. *Type*: rvalue.
+
+#### `enclose_ipv6`
+
+Takes an array of ip addresses and encloses the ipv6 addresses with square brackets. *Type*: rvalue.
+
+#### `ensure_packages`
+
+Takes a list of packages array/hash and only installs them if they don't already exist. It optionally takes a hash as a second parameter to be passed as the third argument to the `ensure_resource()` or `ensure_resources()` function. *Type*: statement.
+
+For Array:
+
+    ensure_packages(['ksh','openssl'], {'ensure' => 'present'})
+
+For Hash:
+
+    ensure_packages({'ksh' => { ensure => '20120801-1' } ,  'mypackage' => { source => '/tmp/myrpm-1.0.0.x86_64.rpm', provider => "rpm" }}, {'ensure' => 'present'})
+
+#### `ensure_resource`
+
+Takes a resource type, title, and a hash of attributes that describe the resource(s).
+
+~~~
+user { 'dan':
+  ensure => present,
+}
+~~~
+
+This example only creates the resource if it does not already exist:
+
+  `ensure_resource('user', 'dan', {'ensure' => 'present' })`
+
+If the resource already exists, but does not match the specified parameters, this function attempts to recreate the resource, leading to a duplicate resource definition error.
+
+An array of resources can also be passed in, and each will be created with the type and parameters specified if it doesn't already exist.
+
+  `ensure_resource('user', ['dan','alex'], {'ensure' => 'present'})`
+
+*Type*: statement.
+
+#### `ensure_resources`
+
+Takes a resource type, title (only hash), and a hash of attributes that describe the resource(s).
+
+~~~
+user { 'dan':
+  gid => 'mygroup',
+  ensure => present,
+}
+
+ensure_resources($user)
+~~~
+
+An hash of resources should be passed in and each will be created with the type and parameters specified if it doesn't already exist:
+
+    ensure_resources('user', {'dan' => { gid => 'mygroup', uid => '600' } ,  'alex' => { gid => 'mygroup' }}, {'ensure' => 'present'})
+
+From Hiera Backend:
+
+~~~
+userlist:
+  dan:
+    gid: 'mygroup'
+    uid: '600'
+  alex:
+    gid: 'mygroup'
+
+ensure_resources('user', hiera_hash('userlist'), {'ensure' => 'present'})
+~~~
+
+### `flatten`
+
+Flattens deeply nested arrays and returns a single flat array as a result. For example, `flatten(['a', ['b', ['c']]])` returns ['a','b','c']. *Type*: rvalue.
+
+#### `floor`
+
+Takes a single numeric value as an argument, and returns the largest integer less than or equal to the argument. *Type*: rvalue.
+
+#### `fqdn_rand_string`
+
+Generates a random alphanumeric string using an optionally-specified character set (default is alphanumeric), combining the `$fqdn` fact and an optional seed for repeatable randomness.
+
+*Usage:*
+~~~
+fqdn_rand_string(LENGTH, [CHARSET], [SEED])
+~~~
+*Examples:*
+~~~
+fqdn_rand_string(10)
+fqdn_rand_string(10, 'ABCDEF!@#$%^')
+fqdn_rand_string(10, '', 'custom seed')
+~~~
+
+*Type*: rvalue.
+
+#### `fqdn_rotate`
+
+Rotates an array or string a random number of times, combining the `$fqdn` fact and an optional seed for repeatable randomness.
+
+*Usage:*
+
+~~~
+fqdn_rotate(VALUE, [SEED])
+~~~
+
+*Examples:*
+
+~~~
+fqdn_rotate(['a', 'b', 'c', 'd'])
+fqdn_rotate('abcd')
+fqdn_rotate([1, 2, 3], 'custom seed')
+~~~
+
+*Type*: rvalue.
+
+#### `get_module_path`
+
+Returns the absolute path of the specified module for the current environment.
+
+  `$module_path = get_module_path('stdlib')`
+
+*Type*: rvalue.
+
+#### `getparam`
+
+Takes a resource reference and the name of the parameter, and returns the value of the resource's parameter.
+
+For example, the following returns 'param_value':
+
+  ~~~
+  define example_resource($param) {
+  }
+
+  example_resource { "example_resource_instance":
+    param => "param_value"
+  }
+
+  getparam(Example_resource["example_resource_instance"], "param")
+  ~~~
+
+*Type*: rvalue.
+
+#### `getvar`
+
+Looks up a variable in a remote namespace.
+
+For example:
+
+  ~~~
+  $foo = getvar('site::data::foo')
+  # Equivalent to $foo = $site::data::foo
+  ~~~
+
+This is useful if the namespace itself is stored in a string:
+
+  ~~~
+  $datalocation = 'site::data'
+  $bar = getvar("${datalocation}::bar")
+  # Equivalent to $bar = $site::data::bar
+  ~~~
+
+*Type*: rvalue.
+
+#### `grep`
+
+Searches through an array and returns any elements that match the provided regular expression. For example, `grep(['aaa','bbb','ccc','aaaddd'], 'aaa')` returns ['aaa','aaaddd']. *Type*: rvalue.
+
+#### `has_interface_with`
+
+Returns a boolean based on kind and value:
+  * macaddress
+  * netmask
+  * ipaddress
+  * network
+
+*Examples:*
+
+  ~~~
+  has_interface_with("macaddress", "x:x:x:x:x:x")
+  has_interface_with("ipaddress", "127.0.0.1")    => true
+  ~~~
+
+If no kind is given, then the presence of the interface is checked:
+
+  ~~~
+  has_interface_with("lo")                        => true
+  ~~~
+
+*Type*: rvalue.
+
+#### `has_ip_address`
+
+Returns 'true' if the client has the requested IP address on some interface. This function iterates through the `interfaces` fact and checks the `ipaddress_IFACE` facts, performing a simple string comparison. *Type*: rvalue.
+
+#### `has_ip_network`
+
+Returns 'true' if the client has an IP address within the requested network. This function iterates through the `interfaces` fact and checks the `network_IFACE` facts, performing a simple string comparision. *Type*: rvalue.
+
+#### `has_key`
+
+Determines if a hash has a certain key value.
+
+*Example*:
+
+  ~~~
+  $my_hash = {'key_one' => 'value_one'}
+  if has_key($my_hash, 'key_two') {
+    notice('we will not reach here')
+  }
+  if has_key($my_hash, 'key_one') {
+    notice('this will be printed')
+  }
+  ~~~
+
+*Type*: rvalue.
+
+#### `hash`
+
+Converts an array into a hash. For example, `hash(['a',1,'b',2,'c',3])` returns {'a'=>1,'b'=>2,'c'=>3}. *Type*: rvalue.
+
+#### `intersection`
+
+Returns an array an intersection of two. For example, `intersection(["a","b","c"],["b","c","d"])` returns ["b","c"]. *Type*: rvalue.
+
+#### `is_a`
+
+Boolean check to determine whether a variable is of a given data type. This is equivalent to the `=~` type checks. This function is available only in Puppet 4 or in Puppet 3 with the "future" parser.
+
+  ~~~
+  foo = 3
+  $bar = [1,2,3]
+  $baz = 'A string!'
+
+  if $foo.is_a(Integer) {
+    notify  { 'foo!': }
+  }
+  if $bar.is_a(Array) {
+    notify { 'bar!': }
+  }
+  if $baz.is_a(String) {
+    notify { 'baz!': }
+  }
+  ~~~
+
+See the [the Puppet type system](https://docs.puppetlabs.com/references/latest/type.html#about-resource-types) for more information about types.
+See the [`assert_type()`](https://docs.puppetlabs.com/references/latest/function.html#asserttype) function for flexible ways to assert the type of a value.
+
+#### `is_absolute_path`
+
+Returns 'true' if the given path is absolute. *Type*: rvalue.
+
+#### `is_array`
+
+Returns 'true' if the variable passed to this function is an array. *Type*: rvalue.
+
+#### `is_bool`
+
+Returns 'true' if the variable passed to this function is a boolean. *Type*: rvalue.
+
+#### `is_domain_name`
+
+Returns 'true' if the string passed to this function is a syntactically correct domain name. *Type*: rvalue.
+
+#### `is_float`
+
+Returns 'true' if the variable passed to this function is a float. *Type*: rvalue.
+
+#### `is_function_available`
+
+Accepts a string as an argument and determines whether the Puppet runtime has access to a function by that name. It returns 'true' if the function exists, 'false' if not. *Type*: rvalue.
+
+#### `is_hash`
+
+Returns 'true' if the variable passed to this function is a hash. *Type*: rvalue.
+
+#### `is_integer`
+
+Returns 'true' if the variable returned to this string is an integer. *Type*: rvalue.
+
+#### `is_ip_address`
+
+Returns 'true' if the string passed to this function is a valid IP address. *Type*: rvalue.
+
+#### `is_ipv6_address`
+
+Returns 'true' if the string passed to this function is a valid IPv6 address. *Type*: rvalue.
+
+#### `is_ipv4_address`
+
+Returns 'true' if the string passed to this function is a valid IPv4 address. *Type*: rvalue.
+
+#### `is_mac_address`
+
+Returns 'true' if the string passed to this function is a valid MAC address. *Type*: rvalue.
+
+#### `is_numeric`
+
+Returns 'true' if the variable passed to this function is a number. *Type*: rvalue.
+
+#### `is_string`
+
+Returns 'true' if the variable passed to this function is a string. *Type*: rvalue.
+
+#### `join`
+
+Joins an array into a string using a separator. For example, `join(['a','b','c'], ",")` results in: "a,b,c". *Type*: rvalue.
+
+#### `join_keys_to_values`
+
+Joins each key of a hash to that key's corresponding value with a separator. Keys and values are cast to strings. The return value is an array in which each element is one joined key/value pair. For example, `join_keys_to_values({'a'=>1,'b'=>2}, " is ")` results in ["a is 1","b is 2"]. *Type*: rvalue.
+
+#### `keys`
+
+Returns the keys of a hash as an array. *Type*: rvalue.
+
+#### `loadyaml`
+
+Loads a YAML file containing an array, string, or hash, and returns the data in the corresponding native data type.
+
+For example:
+
+  ~~~
+  $myhash = loadyaml('/etc/puppet/data/myhash.yaml')
+  ~~~
+
+The second parameter will be returned if the file was not found or could not be parsed.
+
+For example:
+
+  ~~~
+  $myhash = loadyaml('no-file.yaml', {'default'=>'value'})
+  ~~~
+
+*Type*: rvalue.
+
+#### `loadjson`
+
+Loads a JSON file containing an array, string, or hash, and returns the data in the corresponding native data type.
+
+For example:
+
+  ~~~
+  $myhash = loadjson('/etc/puppet/data/myhash.json')
+  ~~~
+
+The second parameter will be returned if the file was not found or could not be parsed.
+
+For example:
+
+  ~~~
+  $myhash = loadjson('no-file.json', {'default'=>'value'})
+  ~~~
+
+*Type*: rvalue.
+
+#### `load_module_metadata`
+
+Loads the metadata.json of a target module. Can be used to determine module version and authorship for dynamic support of modules.
+
+  ~~~
+  $metadata = load_module_metadata('archive')
+  notify { $metadata['author']: }
+  ~~~
+
+If you do not want to fail the catalog compilation when a module's metadata file is absent:
+
+  ~~~
+  $metadata = load_module_metadata('mysql', true)
+  if empty($metadata) {
+    notify { "This module does not have a metadata.json file.": }
+  }
+  ~~~
+
+*Type*: rvalue.
+
+#### `lstrip`
+
+Strips spaces to the left of a string. *Type*: rvalue.
+
+#### `max`
+
+Returns the highest value of all arguments. Requires at least one argument. *Type*: rvalue.
+
+#### `member`
+
+This function determines if a variable is a member of an array. The variable can be either a string, array, or fixnum. For example, `member(['a','b'], 'b')` and `member(['a','b','c'], ['b','c'])` return 'true', while `member(['a','b'], 'c')` and `member(['a','b','c'], ['c','d'])` return 'false'. *Note*: This function does not support nested arrays. If the first argument contains nested arrays, it will not recurse through them.
+
+*Type*: rvalue.
+
+#### `merge`
+
+Merges two or more hashes together and returns the resulting hash.
+
+*Example*:
+
+  ~~~
+  $hash1 = {'one' => 1, 'two' => 2}
+  $hash2 = {'two' => 'dos', 'three' => 'tres'}
+  $merged_hash = merge($hash1, $hash2)
+  # The resulting hash is equivalent to:
+  # $merged_hash =  {'one' => 1, 'two' => 'dos', 'three' => 'tres'}
+  ~~~
+
+When there is a duplicate key, the key in the rightmost hash "wins." *Type*: rvalue.
+
+#### `min`
+
+Returns the lowest value of all arguments. Requires at least one argument. *Type*: rvalue.
+
+#### `num2bool`
+
+Converts a number or a string representation of a number into a true boolean. Zero or anything non-numeric becomes 'false'. Numbers greater than 0 become 'true'. *Type*: rvalue.
+
+#### `parsejson`
+
+Converts a string of JSON into the correct Puppet structure. *Type*: rvalue. The optional second argument is returned if the data was not correct.
+
+#### `parseyaml`
+
+Converts a string of YAML into the correct Puppet structure. *Type*: rvalue. The optional second argument is returned if the data was not correct.
+
+#### `pick`
+
+From a list of values, returns the first value that is not undefined or an empty string. Takes any number of arguments, and raises an error if all values are undefined or empty.
+
+  ~~~
+  $real_jenkins_version = pick($::jenkins_version, '1.449')
+  ~~~
+
+*Type*: rvalue.
+
+#### `pick_default`
+
+Returns the first value in a list of values. Contrary to the `pick()` function, the `pick_default()` does not fail if all arguments are empty. This allows it to use an empty value as default. *Type*: rvalue.
+
+#### `prefix`
+
+Applies a prefix to all elements in an array, or to the keys in a hash.
+For example:
+* `prefix(['a','b','c'], 'p')` returns ['pa','pb','pc']
+* `prefix({'a'=>'b','b'=>'c','c'=>'d'}, 'p')` returns {'pa'=>'b','pb'=>'c','pc'=>'d'}.
+
+*Type*: rvalue.
+
+#### `assert_private`
+
+Sets the current class or definition as private. Calling the class or definition from outside the current module will fail.
+
+For example, `assert_private()` called in class `foo::bar` outputs the following message if class is called from outside module `foo`:
+
+  ~~~
+  Class foo::bar is private
+  ~~~
+
+  To specify the error message you want to use:
+
+  ~~~
+  assert_private("You're not supposed to do that!")
+  ~~~
+
+*Type*: statement.
+
+#### `pw_hash`
+
+Hashes a password using the crypt function. Provides a hash usable on most POSIX systems.
+
+The first argument to this function is the password to hash. If it is undef or an empty string, this function returns undef.
+
+The second argument to this function is which type of hash to use. It will be converted into the appropriate crypt(3) hash specifier. Valid hash types are:
+
+|Hash type            |Specifier|
+|---------------------|---------|
+|MD5                  |1        |
+|SHA-256              |5        |
+|SHA-512 (recommended)|6        |
+
+The third argument to this function is the salt to use.
+
+*Type*: rvalue.
+
+**Note:** this uses the Puppet master's implementation of crypt(3). If your environment contains several different operating systems, ensure that they are compatible before using this function.
+
+#### `range`
+
+Extrapolates a range as an array when given in the form of '(start, stop)'. For example, `range("0", "9")` returns [0,1,2,3,4,5,6,7,8,9]. Zero-padded strings are converted to integers automatically, so `range("00", "09")` returns [0,1,2,3,4,5,6,7,8,9].
+
+Non-integer strings are accepted; `range("a", "c")` returns ["a","b","c"], and `range("host01", "host10")` returns ["host01", "host02", ..., "host09", "host10"].
+NB Be explicit in including trailing zeros. Otherwise the underlying ruby function will fail.
+
+Passing a third argument will cause the generated range to step by that interval, e.g. `range("0", "9", "2")` returns ["0","2","4","6","8"].
+
+*Type*: rvalue.
+
+#### `regexpescape`
+
+Regexp escape a string or array of strings. Requires either a single string or an array as an input. *Type*: rvalue.
+
+#### `reject`
+
+Searches through an array and rejects all elements that match the provided regular expression. For example, `reject(['aaa','bbb','ccc','aaaddd'], 'aaa')` returns ['bbb','ccc']. *Type*: rvalue.
+
+#### `reverse`
+
+Reverses the order of a string or array. *Type*: rvalue.
+
+#### `rstrip`
+
+Strips spaces to the right of the string. *Type*: rvalue.
+
+#### `seeded_rand`
+
+Takes an integer max value and a string seed value and returns a repeatable random integer smaller than max. Like `fqdn_rand`, but does not add node specific data to the seed.  *Type*: rvalue.
+
+#### `shell_escape`
+
+Escapes a string so that it can be safely used in a Bourne shell command line. Note that the resulting string should be used unquoted and is not intended for use in double quotes nor in single quotes. This function behaves the same as ruby's `Shellwords.shellescape()` function, also see the [ruby documentation](http://ruby-doc.org/stdlib-2.3.0/libdoc/shellwords/rdoc/Shellwords.html#method-c-shellescape).
+
+*Example:*
+~~~
+shell_escape('foo b"ar') => 'foo\ b\"ar'
+~~~
+
+*Type*: rvalue.
+
+#### `shell_join`
+
+Builds a command line string from the given array of strings. Each array item is escaped for Bourne shell. All items are
+then joined together, with a single space in between. This function behaves the same as ruby's `Shellwords.shelljoin()` function, also see the [ruby documentation](http://ruby-doc.org/stdlib-2.3.0/libdoc/shellwords/rdoc/Shellwords.html#method-c-shelljoin).
+
+*Example:*
+~~~
+shell_join(['foo bar', 'ba"z']) => 'foo\ bar ba\"z'
+~~~
+
+*Type*: rvalue.
+
+#### `shell_split`
+
+Splits a string into an array of tokens in the same way the Bourne shell does. This function behaves the same as ruby's `Shellwords.shellsplit()` function, also see the [ruby documentation](http://ruby-doc.org/stdlib-2.3.0/libdoc/shellwords/rdoc/Shellwords.html#method-c-shellsplit).
+
+*Example:*
+~~~
+shell_split('foo\ bar ba\"z') => ['foo bar', 'ba"z']
+~~~
+
+*Type*: rvalue.
+
+#### `shuffle`
+
+Randomizes the order of a string or array elements. *Type*: rvalue.
+
+#### `size`
+
+Returns the number of elements in a string, an array or a hash. *Type*: rvalue.
+
+#### `sort`
+
+Sorts strings and arrays lexically. *Type*: rvalue.
+
+#### `squeeze`
+
+Returns a new string where runs of the same character that occur in this set are replaced by a single character. *Type*: rvalue.
+
+#### `str2bool`
+
+Converts certain strings to a boolean. This attempts to convert strings that contain the values '1', 't', 'y', or 'yes' to true. Strings that contain values '0', 'f', 'n', or 'no', or that are an empty string or undefined are converted to false. Any other value causes an error. *Type*: rvalue.
+
+#### `str2saltedsha512`
+
+Converts a string to a salted-SHA512 password hash, used for OS X versions >= 10.7. Given any string, this function returns a hex version of a salted-SHA512 password hash, which can be inserted into your Puppet
+manifests as a valid password attribute. *Type*: rvalue.
+
+#### `strftime`
+
+Returns formatted time. For example, `strftime("%s")` returns the time since Unix epoch, and `strftime("%Y-%m-%d")` returns the date. *Type*: rvalue.
+
+  *Format:*
+
+    * `%a`: The abbreviated weekday name ('Sun')
+    * `%A`: The full weekday name ('Sunday')
+    * `%b`: The abbreviated month name ('Jan')
+    * `%B`: The full month name ('January')
+    * `%c`: The preferred local date and time representation
+    * `%C`: Century (20 in 2009)
+    * `%d`: Day of the month (01..31)
+    * `%D`: Date (%m/%d/%y)
+    * `%e`: Day of the month, blank-padded ( 1..31)
+    * `%F`: Equivalent to %Y-%m-%d (the ISO 8601 date format)
+    * `%h`: Equivalent to %b
+    * `%H`: Hour of the day, 24-hour clock (00..23)
+    * `%I`: Hour of the day, 12-hour clock (01..12)
+    * `%j`: Day of the year (001..366)
+    * `%k`: Hour, 24-hour clock, blank-padded ( 0..23)
+    * `%l`: Hour, 12-hour clock, blank-padded ( 0..12)
+    * `%L`: Millisecond of the second (000..999)
+    * `%m`: Month of the year (01..12)
+    * `%M`: Minute of the hour (00..59)
+    * `%n`: Newline (\n)
+    * `%N`: Fractional seconds digits, default is 9 digits (nanosecond)
+      * `%3N`: Millisecond (3 digits)
+      * `%6N`: Microsecond (6 digits)
+      * `%9N`: Nanosecond (9 digits)
+    * `%p`: Meridian indicator ('AM' or 'PM')
+    * `%P`: Meridian indicator ('am' or 'pm')
+    * `%r`: Time, 12-hour (same as %I:%M:%S %p)
+    * `%R`: Time, 24-hour (%H:%M)
+    * `%s`: Number of seconds since the Unix epoch, 1970-01-01 00:00:00 UTC.
+    * `%S`: Second of the minute (00..60)
+    * `%t`: Tab character (	)
+    * `%T`: Time, 24-hour (%H:%M:%S)
+    * `%u`: Day of the week as a decimal, Monday being 1. (1..7)
+    * `%U`: Week number of the current year, starting with the first Sunday as the first day of the first week (00..53)
+    * `%v`: VMS date (%e-%b-%Y)
+    * `%V`: Week number of year according to ISO 8601 (01..53)
+    * `%W`: Week number of the current year, starting with the first Monday as the first day of the first week (00..53)
+    * `%w`: Day of the week (Sunday is 0, 0..6)
+    * `%x`: Preferred representation for the date alone, no time
+    * `%X`: Preferred representation for the time alone, no date
+    * `%y`: Year without a century (00..99)
+    * `%Y`: Year with century
+    * `%z`: Time zone as hour offset from UTC (e.g. +0900)
+    * `%Z`: Time zone name
+    * `%%`: Literal '%' character
+
+#### `strip`
+
+Removes leading and trailing whitespace from a string or from every string inside an array. For example, `strip("    aaa   ")` results in "aaa". *Type*: rvalue.
+
+#### `suffix`
+
+Applies a suffix to all elements in an array, or to the keys in a hash.
+For example:
+* `suffix(['a','b','c'], 'p')` returns ['ap','bp','cp']
+* `suffix({'a'=>'b','b'=>'c','c'=>'d'}, 'p')` returns {'ap'=>'b','bp'=>'c','cp'=>'d'}.
+
+*Type*: rvalue.
+
+#### `swapcase`
+
+Swaps the existing case of a string. For example, `swapcase("aBcD")` results in "AbCd". *Type*: rvalue.
+
+#### `time`
+
+Returns the current Unix epoch time as an integer. For example, `time()` returns something like '1311972653'. *Type*: rvalue.
+
+#### `to_bytes`
+
+Converts the argument into bytes, for example "4 kB" becomes "4096". Takes a single string value as an argument. *Type*: rvalue.
+
+#### `try_get_value`
+
+*Type*: rvalue.
+
+DEPRECATED: replaced by `dig()`.
+
+Retrieves a value within multiple layers of hashes and arrays via a string containing a path. The path is a string of hash keys or array indexes starting with zero, separated by the path separator character (default "/"). The function goes through the structure by each path component and tries to return the value at the end of the path.
+
+In addition to the required path argument, the function accepts the default argument. It is returned if the path is not correct, if no value was found, or if any other error has occurred. The last argument can set the path separator character.
+
+~~~ruby
+$data = {
+  'a' => {
+    'b' => [
+      'b1',
+      'b2',
+      'b3',
+    ]
+  }
+}
+
+$value = try_get_value($data, 'a/b/2')
+# $value = 'b3'
+
+# with all possible options
+$value = try_get_value($data, 'a/b/2', 'not_found', '/')
+# $value = 'b3'
+
+# using the default value
+$value = try_get_value($data, 'a/b/c/d', 'not_found')
+# $value = 'not_found'
+
+# using custom separator
+$value = try_get_value($data, 'a|b', [], '|')
+# $value = ['b1','b2','b3']
+~~~
+
+1. **$data** The data structure we are working with.
+2. **'a/b/2'** The path string.
+3. **'not_found'** The default value. It will be returned if nothing is found.
+   (optional, defaults to *undef*)
+4. **'/'** The path separator character.
+   (optional, defaults to *'/'*)
+
+#### `type3x`
+
+Returns a string description of the type when passed a value. Type can be a string, array, hash, float, integer, or boolean. This function will be removed when Puppet 3 support is dropped and the new type system can be used. *Type*: rvalue.
+
+#### `type_of`
+
+Returns the literal type when passed a value. Requires the new parser. Useful for comparison of types with `<=` such as in `if type_of($some_value) <= Array[String] { ... }` (which is equivalent to `if $some_value =~ Array[String] { ... }`) *Type*: rvalue.
+
+#### `union`
+
+Returns a union of two or more arrays, without duplicates. For example, `union(["a","b","c"],["b","c","d"])` returns ["a","b","c","d"]. *Type*: rvalue.
+
+#### `unique`
+
+Removes duplicates from strings and arrays. For example, `unique("aabbcc")` returns 'abc', and `unique(["a","a","b","b","c","c"])` returns ["a","b","c"]. *Type*: rvalue.
+
+#### `unix2dos`
+
+Returns the DOS version of the given string. Very useful when using a File resource with a cross-platform template. *Type*: rvalue.
+
+~~~
+file{$config_file:
+  ensure  => file,
+  content => unix2dos(template('my_module/settings.conf.erb')),
+}
+~~~
+
+See also [dos2unix](#dos2unix).
+
+#### `upcase`
+
+Converts an object, array or hash of objects that respond to upcase to uppercase. For example, `upcase('abcd')` returns 'ABCD'. *Type*: rvalue.
+
+#### `uriescape`
+
+URLEncodes a string or array of strings. Requires either a single string or an array as an input. *Type*: rvalue.
+
+#### `validate_absolute_path`
+
+Validates that a given string represents an absolute path in the filesystem. Works for Windows and Unix style paths.
+
+The following values pass:
+
+~~~
+$my_path = 'C:/Program Files (x86)/Puppet Labs/Puppet'
+validate_absolute_path($my_path)
+$my_path2 = '/var/lib/puppet'
+validate_absolute_path($my_path2)
+$my_path3 = ['C:/Program Files (x86)/Puppet Labs/Puppet','C:/Program Files/Puppet Labs/Puppet']
+validate_absolute_path($my_path3)
+$my_path4 = ['/var/lib/puppet','/usr/share/puppet']
+validate_absolute_path($my_path4)
+~~~
+
+The following values fail, causing compilation to abort:
+
+~~~
+validate_absolute_path(true)
+validate_absolute_path('../var/lib/puppet')
+validate_absolute_path('var/lib/puppet')
+validate_absolute_path([ 'var/lib/puppet', '/var/foo' ])
+validate_absolute_path([ '/var/lib/puppet', 'var/foo' ])
+$undefined = undef
+validate_absolute_path($undefined)
+~~~
+
+*Type*: statement.
+
+#### `validate_array`
+
+Validates that all passed values are array data structures. Aborts catalog compilation if any value fails this check.
+
+The following values pass:
+
+~~~
+$my_array = [ 'one', 'two' ]
+validate_array($my_array)
+~~~
+
+The following values fail, causing compilation to abort:
+
+~~~
+validate_array(true)
+validate_array('some_string')
+$undefined = undef
+validate_array($undefined)
+~~~
+
+*Type*: statement.
+
+#### `validate_augeas`
+
+Performs validation of a string using an Augeas lens. The first argument of this function should be the string to test, and the second argument should be the name of the Augeas lens to use. If Augeas fails to parse the string with the lens, the compilation aborts with a parse error.
+
+A third optional argument lists paths which should **not** be found in the file. The `$file` variable points to the location of the temporary file being tested in the Augeas tree.
+
+For example, to make sure your $passwdcontent never contains user `foo`:
+
+~~~
+validate_augeas($passwdcontent, 'Passwd.lns', ['$file/foo'])
+~~~
+
+To ensure that no users use the '/bin/barsh' shell:
+
+~~~
+validate_augeas($passwdcontent, 'Passwd.lns', ['$file/*[shell="/bin/barsh"]']
+~~~
+
+You can pass a fourth argument as the error message raised and shown to the user:
+
+~~~
+validate_augeas($sudoerscontent, 'Sudoers.lns', [], 'Failed to validate sudoers content with Augeas')
+~~~
+
+*Type*: statement.
+
+#### `validate_bool`
+
+Validates that all passed values are either true or false. Aborts catalog compilation if any value fails this check.
+
+The following values will pass:
+
+~~~
+$iamtrue = true
+validate_bool(true)
+validate_bool(true, true, false, $iamtrue)
+~~~
+
+The following values will fail, causing compilation to abort:
+
+~~~
+$some_array = [ true ]
+validate_bool("false")
+validate_bool("true")
+validate_bool($some_array)
+~~~
+
+*Type*: statement.
+
+#### `validate_cmd`
+
+Performs validation of a string with an external command. The first argument of this function should be a string to test, and the second argument should be a path to a test command taking a % as a placeholder for the file path (will default to the end of the command if no % placeholder given). If the command is launched against a tempfile containing the passed string, or returns a non-null value, compilation will abort with a parse error.
+
+If a third argument is specified, this will be the error message raised and seen by the user.
+
+~~~
+# Defaults to end of path
+validate_cmd($sudoerscontent, '/usr/sbin/visudo -c -f', 'Visudo failed to validate sudoers content')
+~~~
+~~~
+# % as file location
+validate_cmd($haproxycontent, '/usr/sbin/haproxy -f % -c', 'Haproxy failed to validate config content')
+~~~
+
+*Type*: statement.
+
+#### `validate_hash`
+
+Validates that all passed values are hash data structures. Aborts catalog compilation if any value fails this check.
+
+  The following values will pass:
+
+  ~~~
+  $my_hash = { 'one' => 'two' }
+  validate_hash($my_hash)
+  ~~~
+
+  The following values will fail, causing compilation to abort:
+
+  ~~~
+  validate_hash(true)
+  validate_hash('some_string')
+  $undefined = undef
+  validate_hash($undefined)
+  ~~~
+
+*Type*: statement.
+
+#### `validate_integer`
+
+Validates that the first argument is an integer (or an array of integers). Aborts catalog compilation if any of the checks fail.
+
+  The second argument is optional and passes a maximum. (All elements of) the first argument has to be less or equal to this max.
+
+  The third argument is optional and passes a minimum. (All elements of) the first argument has to be greater or equal to this min.
+  If, and only if, a minimum is given, the second argument may be an empty string or undef, which will be handled to just check
+  if (all elements of) the first argument are greater or equal to the given minimum.
+
+  It will fail if the first argument is not an integer or array of integers, and if arg 2 and arg 3 are not convertable to an integer.
+
+  The following values will pass:
+
+  ~~~
+  validate_integer(1)
+  validate_integer(1, 2)
+  validate_integer(1, 1)
+  validate_integer(1, 2, 0)
+  validate_integer(2, 2, 2)
+  validate_integer(2, '', 0)
+  validate_integer(2, undef, 0)
+  $foo = undef
+  validate_integer(2, $foo, 0)
+  validate_integer([1,2,3,4,5], 6)
+  validate_integer([1,2,3,4,5], 6, 0)
+  ~~~
+
+  * Plus all of the above, but any combination of values passed as strings ('1' or "1").
+  * Plus all of the above, but with (correct) combinations of negative integer values.
+
+  The following values will fail, causing compilation to abort:
+
+  ~~~
+  validate_integer(true)
+  validate_integer(false)
+  validate_integer(7.0)
+  validate_integer({ 1 => 2 })
+  $foo = undef
+  validate_integer($foo)
+  validate_integer($foobaridontexist)
+
+  validate_integer(1, 0)
+  validate_integer(1, true)
+  validate_integer(1, '')
+  validate_integer(1, undef)
+  validate_integer(1, , 0)
+  validate_integer(1, 2, 3)
+  validate_integer(1, 3, 2)
+  validate_integer(1, 3, true)
+  ~~~
+
+  * Plus all of the above, but any combination of values passed as strings ('false' or "false").
+  * Plus all of the above, but with incorrect combinations of negative integer values.
+  * Plus all of the above, but with non-integer items in arrays or maximum / minimum argument.
+
+  *Type*: statement.
+
+#### `validate_ip_address`
+
+Validates that the argument is an IP address, regardless of it is an IPv4 or an IPv6
+address. It also validates IP address with netmask. The argument must be given as a string.
+
+The following values will pass:
+
+  ~~~
+  validate_ip_address('0.0.0.0')
+  validate_ip_address('8.8.8.8')
+  validate_ip_address('127.0.0.1')
+  validate_ip_address('194.232.104.150')
+  validate_ip_address('3ffe:0505:0002::')
+  validate_ip_address('::1/64')
+  validate_ip_address('fe80::a00:27ff:fe94:44d6/64')
+  validate_ip_address('8.8.8.8/32')
+  ~~~
+
+The following values will fail, causing compilation to abort:
+
+  ~~~
+  validate_ip_address(1)
+  validate_ip_address(true)
+  validate_ip_address(0.0.0.256)
+  validate_ip_address('::1', {})
+  validate_ip_address('0.0.0.0.0')
+  validate_ip_address('3.3.3')
+  validate_ip_address('23.43.9.22/64')
+  validate_ip_address('260.2.32.43')
+  ~~~
+
+
+#### `validate_legacy`
+
+Validates a value against both a specified type and a deprecated validation function. Silently passes if both pass, errors if only one validation passes, and fails if both validations return false.
+
+Accepts arguments for:
+* the type to check the value against,
+* the full name of the previous validation function,
+* the value to be checked,
+* an unspecified number of arguments needed for the previous validation function.
+
+Example:
+
+```
+validate_legacy("Optional[String]", "validate_re", "Value to be validated", ["."])
+```
+
+This function supports updating modules from Puppet 3 style argument validation (using the stdlib `validate_*` functions) to Puppet 4 data types, without breaking functionality for those depending on Puppet 3 style validation.
+
+> Note: This function relies on internal APIs from Puppet 4.4.0 (PE 2016.1) onwards, and doesn't work on earlier versions.
+
+##### For module users
+
+If you are running Puppet 4 and receiving deprecation warnings about `validate_*` functions, the `validate_legacy` function can help you find and resolve the deprecated code.
+
+In Puppet 3, the `validate_*` functions were the only way to easily check the types of class and defined type arguments. Some of the functions provided additional helpers like [validate_numeric](#validate_numeric), which unintentionally allowed not only numbers, but also arrays of numbers. Puppet 4 allows much better defined type checking using [data types](https://docs.puppet.com/puppet/latest/reference/lang_data.html), without such unintentional effects. The `validate_legacy` function makes these differences visible and makes it easier to move to the clearer Puppet 4 syntax.
+
+Depending on the current state of development of the modules you use and the data you feed those modules, you'll encounter different messages:
+
+* `Notice: Accepting previously invalid value for target type '<type>'`: This message is informational only. You're using values that are allowed by the new type, but would have been invalid by the old validation function.
+* `Warning: This method is deprecated, please use the stdlib validate_legacy function`: The module has not yet upgraded to `validate_legacy`. Use the [deprecation](#deprecation) options to silence warnings for now, or submit a fix with the module's developer. See the information [for module developers](#for-module-developers) below for how to fix the issue.
+* `Warning: validate_legacy(<function>) expected <type> value, got <actual type>_`: Your code passes a value that was accepted by the Puppet 3 style validation, but will not be accepted by the next version of the module. Most often, you can fix this by removing quotes from numbers or booleans.
+* `Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, validate_legacy(<function>) expected <type> value, got <actual type>`: Your code passes a value that is not acceptable to either the new or the old style validation.
+
+##### For module developers
+
+Many `validate_*` functions have surprising holes in their validation. For example, [validate_numeric](#validate_numeric) allows not only numbers, but also arrays of numbers or strings that look like numbers, without giving you any control over the specifics. In contrast, Puppet 4 [data types](https://docs.puppet.com/puppet/latest/reference/lang_data.html) allows you to choose between `Numeric`, `Array[Numeric]`, or `Optional[Numeric]`. The `validate_legacy` function helps you move from Puppet 3 style validation to Puppet 4 validation without breaking functionality your module's users depend on.
+
+For each parameter of your classes and defined types, choose a new Puppet 4 data type to use. In most cases, the new data type allows a different set of values than the original `validate_*` function. The situation then looks like this:
+
+|              | `validate_` pass | `validate_` fail |
+| ------------ | ---------------- | ---------------- |
+| matches type | pass             | pass, notice     |
+| fails type   | pass, deprecated | fail             |
+
+The code after the validation still has to handle all possible values for now, but users of your code can change their manifests to pass only values that match the new type.
+
+For each `validate_*` function in stdlib, there is a matching `Stdlib::Compat::*` type that allows the appropriate set of values. See the documentation in the `types/` directory in the stdlib source code for caveats.
+
+For example, given a class that should accept only numbers, like this:
+
+~~~
+class example($value) {
+  validate_numeric($value)
+~~~
+
+the resulting validation code looks like this:
+
+~~~
+class example(
+  Variant[Stdlib::Compat::Numeric, Numeric] $value
+) {
+  validate_legacy(Numeric, 'validate_numeric', $value)
+~~~
+
+Here, the type of `$value` is defined as `Variant[Stdlib::Compat::Numeric, Numeric]`, which allows any `Numeric` (the new type), as well as all values previously accepted by `validate_numeric` (through `Stdlib::Compat::Numeric`).
+
+The call to `validate_legacy` takes care of triggering the correct log or fail message for you. It requires the new type, the previous validation function name, and all arguments to that function.
+
+If your module still supported Puppet 3, this is a breaking change. Update your `metadata.json` requirements section to indicate that your module no longer supports Puppet 3, and bump the major version of your module. With this change, all existing tests for your module should still pass. Create additional tests for the new possible values.
+
+As a breaking change, this is also a good time to call [`deprecation`](#deprecation) for any parameters you want to get rid of, or to add additional constraints on your parameters.
+
+After releasing this version, you can release another breaking change release where you remove all compat types and all calls to `validate_legacy`. At that time, you can also go through your code and remove any leftovers dealing with the previously possible values.
+
+Always note such changes in your CHANGELOG and README.
+
+#### `validate_numeric`
+
+Validates that the first argument is a numeric value (or an array or string of numeric values). Aborts catalog compilation if any of the checks fail.
+
+  The second argument is optional and passes a maximum. (All elements of) the first argument has to be less or equal to this max.
+
+  The third argument is optional and passes a minimum. (All elements of) the first argument has to be greater or equal to this min.
+  If, and only if, a minimum is given, the second argument may be an empty string or undef, which will be handled to just check
+  if (all elements of) the first argument are greater or equal to the given minimum.
+
+  It will fail if the first argument is not a numeric (Integer or Float) or array of numerics, and if arg 2 and arg 3 are not convertable to a numeric.
+
+  For passing and failing usage, see `validate_integer()`. It is all the same for validate_numeric, yet now floating point values are allowed, too.
+
+*Type*: statement.
+
+#### `validate_re`
+
+Performs simple validation of a string against one or more regular expressions. The first argument of this function should be the string to
+test, and the second argument should be a stringified regular expression (without the // delimiters) or an array of regular expressions. If none of the regular expressions match the string passed in, compilation aborts with a parse error.
+
+  You can pass a third argument as the error message raised and shown to the user.
+
+  The following strings validate against the regular expressions:
+
+  ~~~
+  validate_re('one', '^one$')
+  validate_re('one', [ '^one', '^two' ])
+  ~~~
+
+  The following string fails to validate, causing compilation to abort:
+
+  ~~~
+  validate_re('one', [ '^two', '^three' ])
+  ~~~
+
+  To set the error message:
+
+  ~~~
+  validate_re($::puppetversion, '^2.7', 'The $puppetversion fact value does not match 2.7')
+  ~~~
+
+  Note: Compilation terminates if the first argument is not a string. Always use quotes to force stringification:
+
+  ~~~
+  validate_re("${::operatingsystemmajrelease}", '^[57]$')
+  ~~~
+
+*Type*: statement.
+
+#### `validate_slength`
+
+Validates that the first argument is a string (or an array of strings), and is less than or equal to the length of the second argument. It fails if the first argument is not a string or array of strings, or if the second argument is not convertable to a number.  Optionally, a minimum string length can be given as the third argument.
+
+  The following values pass:
+
+  ~~~
+  validate_slength("discombobulate",17)
+  validate_slength(["discombobulate","moo"],17)
+  validate_slength(["discombobulate","moo"],17,3)
+  ~~~
+
+  The following values fail:
+
+  ~~~
+  validate_slength("discombobulate",1)
+  validate_slength(["discombobulate","thermometer"],5)
+  validate_slength(["discombobulate","moo"],17,10)
+  ~~~
+
+*Type*: statement.
+
+#### `validate_string`
+
+Validates that all passed values are string data structures. Aborts catalog compilation if any value fails this check.
+
+The following values pass:
+
+  ~~~
+  $my_string = "one two"
+  validate_string($my_string, 'three')
+  ~~~
+
+  The following values fail, causing compilation to abort:
+
+  ~~~
+  validate_string(true)
+  validate_string([ 'some', 'array' ])
+  ~~~
+
+*Note:* validate_string(undef) will not fail in this version of the functions API (incl. current and future parser).
+
+Instead, use:
+
+  ~~~
+  if $var == undef {
+    fail('...')
+  }
+  ~~~
+
+*Type*: statement.
+
+#### `validate_x509_rsa_key_pair`
+
+Validates a PEM-formatted X.509 certificate and private key using OpenSSL.
+Verifies that the certficate's signature was created from the supplied key.
+
+Fails catalog compilation if any value fails this check.
+
+Takes two arguments, the first argument must be a X.509 certificate and the
+second must be an RSA private key:
+
+  ~~~
+  validate_x509_rsa_key_pair($cert, $key)
+  ~~~
+
+*Type*: statement.
+
+#### `values`
+
+Returns the values of a given hash. For example, given `$hash = {'a'=1, 'b'=2, 'c'=3} values($hash)` returns [1,2,3].
+
+*Type*: rvalue.
+
+#### `values_at`
+
+Finds values inside an array based on location. The first argument is the array you want to analyze, and the second argument can be a combination of:
+
+  * A single numeric index
+  * A range in the form of 'start-stop' (eg. 4-9)
+  * An array combining the above
+
+  For example, `values_at(['a','b','c'], 2)` returns ['c']; `values_at(['a','b','c'], ["0-1"])` returns ['a','b']; and `values_at(['a','b','c','d','e'], [0, "2-3"])` returns ['a','c','d'].
+
+*Type*: rvalue.
+
+#### `zip`
+
+Takes one element from first array given and merges corresponding elements from second array given. This generates a sequence of n-element arrays, where *n* is one more than the count of arguments. For example, `zip(['1','2','3'],['4','5','6'])` results in ["1", "4"], ["2", "5"], ["3", "6"]. *Type*: rvalue.
+
+## Limitations
+
+As of Puppet Enterprise 3.7, the stdlib module is no longer included in PE. PE users should install the most recent release of stdlib for compatibility with Puppet modules.
+
+###Version Compatibility
+
+Versions | Puppet 2.6 | Puppet 2.7 | Puppet 3.x | Puppet 4.x |
+:---------------|:-----:|:---:|:---:|:----:
+**stdlib 2.x**  | **yes** | **yes** | no | no
+**stdlib 3.x**  | no    | **yes**  | **yes** | no
+**stdlib 4.x**  | no    | **yes**  | **yes** | no
+**stdlib 4.6+**  | no    | **yes**  | **yes** | **yes**
+**stdlib 5.x**  | no    | no  | **yes**  | **yes**
+
+**stdlib 5.x**: When released, stdlib 5.x will drop support for Puppet 2.7.x. Please see [this discussion](https://github.com/puppetlabs/puppetlabs-stdlib/pull/176#issuecomment-30251414).
+
+## Development
+
+Puppet Labs modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. We canât access the huge number of platforms and myriad hardware, software, and deployment configurations that Puppet is intended to serve. We want to keep it as easy as possible to contribute changes so that our modules work in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things. For more information, see our [module contribution guide](https://docs.puppetlabs.com/forge/contributing.html).
+
+To report or research a bug with any part of this module, please go to
+[http://tickets.puppetlabs.com/browse/MODULES](http://tickets.puppetlabs.com/browse/MODULES).
+
+## Contributors
+
+The list of contributors can be found at: [https://github.com/puppetlabs/puppetlabs-stdlib/graphs/contributors](https://github.com/puppetlabs/puppetlabs-stdlib/graphs/contributors).
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/README_DEVELOPER.markdown
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/README_DEVELOPER.markdown	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/README_DEVELOPER.markdown	(revision 30960)
@@ -0,0 +1,35 @@
+Puppet Specific Facts
+=====================
+
+Facter is meant to stand alone and apart from Puppet.  However, Facter often
+runs inside Puppet and all custom facts included in the stdlib module will
+almost always be evaluated in the context of Puppet and Facter working
+together.
+
+Still, we don't want to write custom facts that blow up in the users face if
+Puppet is not loaded in memory.  This is often the case if the user runs
+`facter` without also supplying the `--puppet` flag.
+
+Ah! But Jeff, the custom fact won't be in the `$LOAD_PATH` unless the user
+supplies `--facter`! You might say...
+
+Not (always) true I say!  If the user happens to have a CWD of
+`<modulepath>/stdlib/lib` then the facts will automatically be evaluated and
+blow up.
+
+In any event, it's pretty easy to write a fact that has no value if Puppet is
+not loaded.  Simply do it like this:
+
+    Facter.add(:node_vardir) do
+      setcode do
+        # This will be nil if Puppet is not available.
+        Facter::Util::PuppetSettings.with_puppet do
+          Puppet[:vardir]
+        end
+      end
+    end
+
+The `Facter::Util::PuppetSettings.with_puppet` method accepts a block and
+yields to it only if the Puppet library is loaded.  If the Puppet library is
+not loaded, then the method silently returns `nil` which Facter interprets as
+an undefined fact value.  The net effect is that the fact won't be set.
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/README_SPECS.markdown
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/README_SPECS.markdown	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/README_SPECS.markdown	(revision 30960)
@@ -0,0 +1,7 @@
+NOTE
+====
+
+This project's specs depend on puppet core, and thus they require the
+`puppetlabs_spec_helper` project.  For more information please see the README
+in that project, which can be found here: [puppetlabs spec
+helper](https://github.com/puppetlabs/puppetlabs_spec_helper)
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/RELEASE_PROCESS.markdown
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/RELEASE_PROCESS.markdown	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/RELEASE_PROCESS.markdown	(revision 30960)
@@ -0,0 +1,24 @@
+# Contributing to this module #
+
+ * Work in a topic branch
+ * Submit a github pull request
+ * Address any comments / feeback
+ * Merge into master using --no-ff
+
+# Releasing this module #
+
+ * This module adheres to http://semver.org/
+ * Look for API breaking changes using git diff vX.Y.Z..master
+   * If no API breaking changes, the minor version may be bumped.
+   * If there are API breaking changes, the major version must be bumped.
+   * If there are only small minor changes, the patch version may be bumped.
+ * Update the CHANGELOG
+ * Update the Modulefile
+ * Commit these changes with a message along the lines of "Update CHANGELOG and
+   Modulefile for release"
+ * Create an annotated tag with git tag -a vX.Y.Z -m 'version X.Y.Z' (NOTE the
+   leading v as per semver.org)
+ * Push the tag with git push origin --tags
+ * Build a new package with puppet-module or the rake build task if it exists
+ * Publish the new package to the forge
+ * Bonus points for an announcement to puppet-users.
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/Rakefile
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/Rakefile	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/Rakefile	(revision 30960)
@@ -0,0 +1,38 @@
+require 'puppet_blacksmith/rake_tasks'
+require 'puppet-lint/tasks/puppet-lint'
+require 'puppetlabs_spec_helper/rake_tasks'
+
+PuppetLint.configuration.send('relative')
+PuppetLint.configuration.send('disable_documentation')
+PuppetLint.configuration.send('disable_single_quote_string_with_variables')
+
+desc 'Generate pooler nodesets'
+task :gen_nodeset do
+  require 'beaker-hostgenerator'
+  require 'securerandom'
+  require 'fileutils'
+
+  agent_target = ENV['TEST_TARGET']
+  if ! agent_target
+    STDERR.puts 'TEST_TARGET environment variable is not set'
+    STDERR.puts 'setting to default value of "redhat-64default."'
+    agent_target = 'redhat-64default.'
+  end
+
+  master_target = ENV['MASTER_TEST_TARGET']
+  if ! master_target
+    STDERR.puts 'MASTER_TEST_TARGET environment variable is not set'
+    STDERR.puts 'setting to default value of "redhat7-64mdcl"'
+    master_target = 'redhat7-64mdcl'
+  end
+
+  targets = "#{master_target}-#{agent_target}"
+  cli = BeakerHostGenerator::CLI.new([targets])
+  nodeset_dir = "tmp/nodesets"
+  nodeset = "#{nodeset_dir}/#{targets}-#{SecureRandom.uuid}.yaml"
+  FileUtils.mkdir_p(nodeset_dir)
+  File.open(nodeset, 'w') do |fh|
+    fh.print(cli.execute)
+  end
+  puts nodeset
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/file_line.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/file_line.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/file_line.pp	(revision 30960)
@@ -0,0 +1,9 @@
+# This is a simple smoke test
+# of the file_line resource type.
+file { '/tmp/dansfile':
+  ensure => file,
+} ->
+file_line { 'dans_line':
+  line => 'dan is awesome',
+  path => '/tmp/dansfile',
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/has_interface_with.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/has_interface_with.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/has_interface_with.pp	(revision 30960)
@@ -0,0 +1,9 @@
+include ::stdlib
+info('has_interface_with(\'lo\'):', has_interface_with('lo'))
+info('has_interface_with(\'loX\'):', has_interface_with('loX'))
+info('has_interface_with(\'ipaddress\', \'127.0.0.1\'):', has_interface_with('ipaddress', '127.0.0.1'))
+info('has_interface_with(\'ipaddress\', \'127.0.0.100\'):', has_interface_with('ipaddress', '127.0.0.100'))
+info('has_interface_with(\'network\', \'127.0.0.0\'):', has_interface_with('network', '127.0.0.0'))
+info('has_interface_with(\'network\', \'128.0.0.0\'):', has_interface_with('network', '128.0.0.0'))
+info('has_interface_with(\'netmask\', \'255.0.0.0\'):', has_interface_with('netmask', '255.0.0.0'))
+info('has_interface_with(\'netmask\', \'256.0.0.0\'):', has_interface_with('netmask', '256.0.0.0'))
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/has_ip_address.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/has_ip_address.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/has_ip_address.pp	(revision 30960)
@@ -0,0 +1,3 @@
+include ::stdlib
+info('has_ip_address(\'192.168.1.256\'):', has_ip_address('192.168.1.256'))
+info('has_ip_address(\'127.0.0.1\'):', has_ip_address('127.0.0.1'))
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/has_ip_network.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/has_ip_network.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/has_ip_network.pp	(revision 30960)
@@ -0,0 +1,3 @@
+include ::stdlib
+info('has_ip_network(\'127.0.0.0\'):', has_ip_network('127.0.0.0'))
+info('has_ip_network(\'128.0.0.0\'):', has_ip_network('128.0.0.0'))
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/init.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/init.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/examples/init.pp	(revision 30960)
@@ -0,0 +1,1 @@
+include ::stdlib
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/facter_dot_d.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/facter_dot_d.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/facter_dot_d.rb	(revision 30960)
@@ -0,0 +1,202 @@
+# A Facter plugin that loads facts from /etc/facter/facts.d
+# and /etc/puppetlabs/facter/facts.d.
+#
+# Facts can be in the form of JSON, YAML or Text files
+# and any executable that returns key=value pairs.
+#
+# In the case of scripts you can also create a file that
+# contains a cache TTL.  For foo.sh store the ttl as just
+# a number in foo.sh.ttl
+#
+# The cache is stored in $libdir/facts_dot_d.cache as a mode
+# 600 file and will have the end result of not calling your
+# fact scripts more often than is needed
+
+class Facter::Util::DotD
+  require 'yaml'
+
+  def initialize(dir="/etc/facts.d", cache_file=File.join(Puppet[:libdir], "facts_dot_d.cache"))
+    @dir = dir
+    @cache_file = cache_file
+    @cache = nil
+    @types = {".txt" => :txt, ".json" => :json, ".yaml" => :yaml}
+  end
+
+  def entries
+    Dir.entries(@dir).reject { |f| f =~ /^\.|\.ttl$/ }.sort.map { |f| File.join(@dir, f) }
+  rescue
+    []
+  end
+
+  def fact_type(file)
+    extension = File.extname(file)
+
+    type = @types[extension] || :unknown
+
+    type = :script if type == :unknown && File.executable?(file)
+
+    return type
+  end
+
+  def txt_parser(file)
+    File.readlines(file).each do |line|
+      if line =~ /^([^=]+)=(.+)$/
+        var = $1; val = $2
+
+        Facter.add(var) do
+          setcode { val }
+        end
+      end
+    end
+  rescue StandardError => e
+    Facter.warn("Failed to handle #{file} as text facts: #{e.class}: #{e}")
+  end
+
+  def json_parser(file)
+    begin
+      require 'json'
+    rescue LoadError
+      retry if require 'rubygems'
+      raise
+    end
+
+    JSON.load(File.read(file)).each_pair do |f, v|
+      Facter.add(f) do
+        setcode { v }
+      end
+    end
+  rescue StandardError => e
+    Facter.warn("Failed to handle #{file} as json facts: #{e.class}: #{e}")
+  end
+
+  def yaml_parser(file)
+    require 'yaml'
+
+    YAML.load_file(file).each_pair do |f, v|
+      Facter.add(f) do
+        setcode { v }
+      end
+    end
+  rescue StandardError => e
+    Facter.warn("Failed to handle #{file} as yaml facts: #{e.class}: #{e}")
+  end
+
+  def script_parser(file)
+    result = cache_lookup(file)
+    ttl = cache_time(file)
+
+    unless result
+      result = Facter::Util::Resolution.exec(file)
+
+      if ttl > 0
+        Facter.debug("Updating cache for #{file}")
+        cache_store(file, result)
+        cache_save!
+      end
+    else
+      Facter.debug("Using cached data for #{file}")
+    end
+
+    result.split("\n").each do |line|
+      if line =~ /^(.+)=(.+)$/
+        var = $1; val = $2
+
+        Facter.add(var) do
+          setcode { val }
+        end
+      end
+    end
+  rescue StandardError => e
+    Facter.warn("Failed to handle #{file} as script facts: #{e.class}: #{e}")
+    Facter.debug(e.backtrace.join("\n\t"))
+  end
+
+  def cache_save!
+    cache = load_cache
+    File.open(@cache_file, "w", 0600) { |f| f.write(YAML.dump(cache)) }
+  rescue
+  end
+
+  def cache_store(file, data)
+    load_cache
+
+    @cache[file] = {:data => data, :stored => Time.now.to_i}
+  rescue
+  end
+
+  def cache_lookup(file)
+    cache = load_cache
+
+    return nil if cache.empty?
+
+    ttl = cache_time(file)
+
+    if cache[file]
+      now = Time.now.to_i
+
+      return cache[file][:data] if ttl == -1
+      return cache[file][:data] if (now - cache[file][:stored]) <= ttl
+      return nil
+    else
+      return nil
+    end
+  rescue
+    return nil
+  end
+
+  def cache_time(file)
+    meta = file + ".ttl"
+
+    return File.read(meta).chomp.to_i
+  rescue
+    return 0
+  end
+
+  def load_cache
+    unless @cache
+      if File.exist?(@cache_file)
+        @cache = YAML.load_file(@cache_file)
+      else
+        @cache = {}
+      end
+    end
+
+    return @cache
+  rescue
+    @cache = {}
+    return @cache
+  end
+
+  def create
+    entries.each do |fact|
+      type = fact_type(fact)
+      parser = "#{type}_parser"
+
+      if respond_to?("#{type}_parser")
+        Facter.debug("Parsing #{fact} using #{parser}")
+
+        send(parser, fact)
+      end
+    end
+  end
+end
+
+
+mdata = Facter.version.match(/(\d+)\.(\d+)\.(\d+)/)
+if mdata
+  (major, minor, patch) = mdata.captures.map { |v| v.to_i }
+  if major < 2
+    # Facter 1.7 introduced external facts support directly
+    unless major == 1 and minor > 6
+      Facter::Util::DotD.new("/etc/facter/facts.d").create
+      Facter::Util::DotD.new("/etc/puppetlabs/facter/facts.d").create
+
+      # Windows has a different configuration directory that defaults to a vendor
+      # specific sub directory of the %COMMON_APPDATA% directory.
+      if Dir.const_defined? 'COMMON_APPDATA' then
+        windows_facts_dot_d = File.join(Dir::COMMON_APPDATA, 'PuppetLabs', 'facter', 'facts.d')
+        Facter::Util::DotD.new(windows_facts_dot_d).create
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/package_provider.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/package_provider.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/package_provider.rb	(revision 30960)
@@ -0,0 +1,21 @@
+# Fact: package_provider
+#
+# Purpose: Returns the default provider Puppet will choose to manage packages
+#   on this system
+#
+# Resolution: Instantiates a dummy package resource and return the provider
+#
+# Caveats:
+#
+require 'puppet/type'
+require 'puppet/type/package'
+
+Facter.add(:package_provider) do
+  setcode do
+    if defined? Gem and Gem::Version.new(Facter.value(:puppetversion).split(' ')[0]) >= Gem::Version.new('3.6')
+      Puppet::Type.type(:package).newpackage(:name => 'dummy', :allow_virtual => 'true')[:provider].to_s
+    else
+      Puppet::Type.type(:package).newpackage(:name => 'dummy')[:provider].to_s
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/pe_version.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/pe_version.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/pe_version.rb	(revision 30960)
@@ -0,0 +1,58 @@
+# Fact: is_pe, pe_version, pe_major_version, pe_minor_version, pe_patch_version
+#
+# Purpose: Return various facts about the PE state of the system
+#
+# Resolution: Uses a regex match against puppetversion to determine whether the
+#   machine has Puppet Enterprise installed, and what version (overall, major,
+#   minor, patch) is installed.
+#
+# Caveats:
+#
+Facter.add("pe_version") do
+  setcode do
+    puppet_ver = Facter.value("puppetversion")
+    if puppet_ver != nil
+      pe_ver = puppet_ver.match(/Puppet Enterprise (\d+\.\d+\.\d+)/)
+      pe_ver[1] if pe_ver
+    else
+      nil
+    end
+  end
+end
+
+Facter.add("is_pe") do
+  setcode do
+    if Facter.value(:pe_version).to_s.empty? then
+      false
+    else
+      true
+    end
+  end
+end
+
+Facter.add("pe_major_version") do
+  confine :is_pe => true
+  setcode do
+    if pe_version = Facter.value(:pe_version)
+      pe_version.to_s.split('.')[0]
+    end
+  end
+end
+
+Facter.add("pe_minor_version") do
+  confine :is_pe => true
+  setcode do
+    if pe_version = Facter.value(:pe_version)
+      pe_version.to_s.split('.')[1]
+    end
+  end
+end
+
+Facter.add("pe_patch_version") do
+  confine :is_pe => true
+  setcode do
+    if pe_version = Facter.value(:pe_version)
+      pe_version.to_s.split('.')[2]
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/puppet_settings.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/puppet_settings.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/puppet_settings.rb	(revision 30960)
@@ -0,0 +1,35 @@
+# These facter facts return the value of the Puppet vardir and environment path
+# settings for the node running puppet or puppet agent.  The intent is to
+# enable Puppet modules to automatically have insight into a place where they
+# can place variable data, or for modules running on the puppet master to know
+# where environments are stored.
+#
+# The values should be directly usable in a File resource path attribute.
+#
+begin
+  require 'facter/util/puppet_settings'
+rescue LoadError => e
+  # puppet apply does not add module lib directories to the $LOAD_PATH (See
+  # #4248). It should (in the future) but for the time being we need to be
+  # defensive which is what this rescue block is doing.
+  rb_file = File.join(File.dirname(__FILE__), 'util', 'puppet_settings.rb')
+  load rb_file if File.exists?(rb_file) or raise e
+end
+
+
+# These will be nil if Puppet is not available.
+Facter.add(:puppet_vardir) do
+  setcode do
+    Facter::Util::PuppetSettings.with_puppet do
+      Puppet[:vardir]
+    end
+  end
+end
+
+Facter.add(:puppet_environmentpath) do
+  setcode do
+    Facter::Util::PuppetSettings.with_puppet do
+      Puppet[:environmentpath]
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/root_home.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/root_home.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/root_home.rb	(revision 30960)
@@ -0,0 +1,45 @@
+# A facter fact to determine the root home directory.
+# This varies on PE supported platforms and may be
+# reconfigured by the end user.
+
+module Facter::Util::RootHome
+  class << self
+  def get_root_home
+    root_ent = Facter::Util::Resolution.exec("getent passwd root")
+    # The home directory is the sixth element in the passwd entry
+    # If the platform doesn't have getent, root_ent will be nil and we should
+    # return it straight away.
+    root_ent && root_ent.split(":")[5]
+  end
+  end
+end
+
+Facter.add(:root_home) do
+  setcode { Facter::Util::RootHome.get_root_home }
+end
+
+Facter.add(:root_home) do
+  confine :kernel => :darwin
+  setcode do
+    str = Facter::Util::Resolution.exec("dscacheutil -q user -a name root")
+    hash = {}
+    str.split("\n").each do |pair|
+      key,value = pair.split(/:/)
+      hash[key] = value
+    end
+    hash['dir'].strip
+  end
+end
+
+Facter.add(:root_home) do
+  confine :kernel => :aix
+  root_home = nil
+  setcode do
+    str = Facter::Util::Resolution.exec("lsuser -c -a home root")
+    str && str.split("\n").each do |line|
+      next if line =~ /^#/
+      root_home = line.split(/:/)[1]
+    end
+    root_home
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/service_provider.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/service_provider.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/service_provider.rb	(revision 30960)
@@ -0,0 +1,17 @@
+# Fact: service_provider
+#
+# Purpose: Returns the default provider Puppet will choose to manage services
+#   on this system
+#
+# Resolution: Instantiates a dummy service resource and return the provider
+#
+# Caveats:
+#
+require 'puppet/type'
+require 'puppet/type/service'
+
+Facter.add(:service_provider) do
+  setcode do
+    Puppet::Type.type(:service).newservice(:name => 'dummy')[:provider].to_s
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/util/puppet_settings.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/util/puppet_settings.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/facter/util/puppet_settings.rb	(revision 30960)
@@ -0,0 +1,21 @@
+module Facter
+  module Util
+    module PuppetSettings
+      # This method is intended to provide a convenient way to evaluate a
+      # Facter code block only if Puppet is loaded.  This is to account for the
+      # situation where the fact happens to be in the load path, but Puppet is
+      # not loaded for whatever reason.  Perhaps the user is simply running
+      # facter without the --puppet flag and they happen to be working in a lib
+      # directory of a module.
+      def self.with_puppet
+        begin
+          Module.const_get("Puppet")
+        rescue NameError
+          nil
+        else
+          yield
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/deprecation.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/deprecation.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/deprecation.rb	(revision 30960)
@@ -0,0 +1,23 @@
+# Function to print deprecation warnings, Logs a warning once for a given key. The uniqueness key - can appear once. The msg is the message text including any positional information that is formatted by the user/caller of the method  It is affected by the puppet setting 'strict', which can be set to :error (outputs as an error message), :off (no message / error is displayed) and :warning (default, outputs a warning)  *Type*: String, String.
+#
+
+Puppet::Functions.create_function(:deprecation) do
+  dispatch :deprecation do
+    param 'String', :key
+    param 'String', :message
+  end
+
+  def deprecation(key, message)
+    # depending on configuration setting of strict
+    case Puppet.settings[:strict]
+    when :off
+      # do nothing
+    when :error
+      fail("deprecation. #{key}. #{message}")
+    else
+      unless ENV['STDLIB_LOG_DEPRECATIONS'] == 'false'
+        Puppet.deprecation_warning(message, key)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_a.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_a.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_a.rb	(revision 30960)
@@ -0,0 +1,32 @@
+# Boolean check to determine whether a variable is of a given data type. This is equivalent to the `=~` type checks.
+#
+# @example how to check a data type
+#   # check a data type
+#       foo = 3
+#       $bar = [1,2,3]
+#       $baz = 'A string!'
+#
+#       if $foo.is_a(Integer) {
+#         notify  { 'foo!': }
+#       }
+#       if $bar.is_a(Array) {
+#         notify { 'bar!': }
+#       }
+#       if $baz.is_a(String) {
+#         notify { 'baz!': }
+#       }
+#
+# See the documentation for "The Puppet Type System" for more information about types.
+# See the `assert_type()` function for flexible ways to assert the type of a value.
+#
+Puppet::Functions.create_function(:is_a) do
+  dispatch :is_a do
+    param 'Any', :value
+    param 'Type', :type
+  end
+
+  def is_a(value, type)
+    # See puppet's lib/puppet/pops/evaluator/evaluator_impl.rb eval_MatchExpression
+    Puppet::Pops::Types::TypeCalculator.instance?(type, value)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_absolute_path.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_absolute_path.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_absolute_path.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:is_absolute_path) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'is_absolute_path', "This method is deprecated, please use match expressions with Stdlib::Compat::Absolute_Path instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.")
+    scope.send("function_is_absolute_path", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_array.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_array.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_array.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:is_array) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'is_array', "This method is deprecated, please use match expressions with Stdlib::Compat::Array instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.")
+    scope.send("function_is_array", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_bool.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_bool.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_bool.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:is_bool) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'is_bool', "This method is deprecated, please use match expressions with Stdlib::Compat::Bool instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.")
+    scope.send("function_is_bool", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_float.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_float.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_float.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:is_float) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'is_float', "This method is deprecated, please use match expressions with Stdlib::Compat::Float instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.")
+    scope.send("function_is_float", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_ip_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_ip_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_ip_address.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:is_ip_address) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'is_ip_address', "This method is deprecated, please use match expressions with Stdlib::Compat::Ip_address instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.")
+    scope.send("function_is_ip_address", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_ipv4_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_ipv4_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_ipv4_address.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:is_ipv4_address) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'is_ipv4_address', "This method is deprecated, please use match expressions with Stdlib::Compat::Ipv4 instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.")
+    scope.send("function_is_ipv4_address", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_ipv6_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_ipv6_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_ipv6_address.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:is_ipv6_address) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'is_ipv4_address', "This method is deprecated, please use match expressions with Stdlib::Compat::Ipv6 instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.")
+    scope.send("function_is_ipv6_address", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_numeric.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_numeric.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_numeric.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:is_numeric) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'is_numeric', "This method is deprecated, please use match expressions with Stdlib::Compat::Numeric instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.")
+    scope.send("function_is_numeric", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_string.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_string.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/is_string.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:is_string) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'is_string', "This method is deprecated, please use match expressions with Stdlib::Compat::String instead. They are described at https://docs.puppet.com/puppet/latest/reference/lang_data_type.html#match-expressions.")
+    scope.send("function_is_string", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/type_of.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/type_of.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/type_of.rb	(revision 30960)
@@ -0,0 +1,17 @@
+# Returns the type when passed a value.
+#
+# @example how to compare values' types
+#   # compare the types of two values
+#   if type_of($first_value) != type_of($second_value) { fail("first_value and second_value are different types") }
+# @example how to compare against an abstract type
+#   unless type_of($first_value) <= Numeric { fail("first_value must be Numeric") }
+#   unless type_of{$first_value) <= Collection[1] { fail("first_value must be an Array or Hash, and contain at least one element") }
+#
+# See the documentation for "The Puppet Type System" for more information about types.
+# See the `assert_type()` function for flexible ways to assert the type of a value.
+#
+Puppet::Functions.create_function(:type_of) do
+  def type_of(value)
+    Puppet::Pops::Types::TypeCalculator.infer_set(value)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_absolute_path.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_absolute_path.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_absolute_path.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:validate_absolute_path) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'validate_absolute_path', "This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Absolute_Path. There is further documentation for validate_legacy function in the README.")
+    scope.send("function_validate_absolute_path", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_array.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_array.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_array.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:validate_array) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'validate_array', "This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Array. There is further documentation for validate_legacy function in the README.")
+    scope.send("function_validate_array", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_bool.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_bool.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_bool.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:validate_bool) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'validate_bool', "This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Bool. There is further documentation for validate_legacy function in the README.")
+    scope.send("function_validate_bool", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_hash.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_hash.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_hash.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:validate_hash) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'validate_hash', "This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Hash. There is further documentation for validate_legacy function in the README.")
+    scope.send("function_validate_hash", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_integer.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_integer.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_integer.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:validate_integer) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'validate_integer', "This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Integer. There is further documentation for validate_legacy function in the README.")
+    scope.send("function_validate_integer", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_ip_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_ip_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_ip_address.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:validate_ip_address) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'validate_ip_address', "This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ip_Address. There is further documentation for validate_legacy function in the README.")
+    scope.send("function_validate_ip_address", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_ipv4_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_ipv4_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_ipv4_address.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:validate_ipv4_address) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'validate_ipv4_address', "This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ipv4_Address. There is further documentation for validate_legacy function in the README.")
+    scope.send("function_validate_ipv4_address", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_ipv6_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_ipv6_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_ipv6_address.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:validate_ipv6_address) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'validate_ipv6_address', "This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ipv6_address. There is further documentation for validate_legacy function in the README.")
+    scope.send("function_validate_ipv6_address", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_legacy.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_legacy.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_legacy.rb	(revision 30960)
@@ -0,0 +1,62 @@
+Puppet::Functions.create_function(:validate_legacy) do
+  # The function checks a value against both the target_type (new) and the previous_validation function (old).
+
+  dispatch :validate_legacy do
+    param 'Any', :scope
+    param 'Type', :target_type
+    param 'String', :function_name
+    param 'Any', :value
+    repeated_param 'Any', :args
+  end
+
+  dispatch :validate_legacy_s do
+    param 'Any', :scope
+    param 'String', :type_string
+    param 'String', :function_name
+    param 'Any', :value
+    repeated_param 'Any', :args
+  end
+
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+
+  def validate_legacy_s(scope, type_string, *args)
+    t = Puppet::Pops::Types::TypeParser.new.parse(type_string, scope)
+    validate_legacy(scope, t, *args)
+  end
+
+  def validate_legacy(scope, target_type, function_name, value, *prev_args)
+    if assert_type(target_type, value)
+      if previous_validation(scope, function_name, value, *prev_args)
+        # Silently passes
+      else
+        Puppet.notice("Accepting previously invalid value for target type '#{target_type}'")
+      end
+    else
+      inferred_type = Puppet::Pops::Types::TypeCalculator.infer_set(value)
+      error_msg = Puppet::Pops::Types::TypeMismatchDescriber.new.describe_mismatch("validate_legacy(#{function_name})", target_type, inferred_type)
+      if previous_validation(scope, function_name, value, *prev_args)
+        call_function('deprecation', 'validate_legacy', error_msg)
+      else
+        call_function('fail', error_msg)
+      end
+    end
+  end
+
+  def previous_validation(scope, function_name, value, *prev_args)
+    # Call the previous validation function and catch any errors. Return true if no errors are thrown.
+    begin
+      scope.send("function_#{function_name}".to_s, [value, *prev_args])
+      true
+    rescue Puppet::ParseError
+      false
+    end
+  end
+
+  def assert_type(type, value)
+    Puppet::Pops::Types::TypeCalculator.instance?(type, value)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_numeric.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_numeric.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_numeric.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:validate_numeric) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'validate_numeric', "This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Numeric. There is further documentation for validate_legacy function in the README.")
+    scope.send("function_validate_numeric", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_re.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_re.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_re.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:validate_re) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'validate_re', "This method is deprecated, please use the stdlib validate_legacy function, with Pattern[]. There is further documentation for validate_legacy function in the README.")
+    scope.send("function_validate_re", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_slength.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_slength.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_slength.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:validate_slength) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'validate_slength', "This method is deprecated, please use the stdlib validate_legacy function, with String[]. There is further documentation for validate_legacy function in the README.")
+    scope.send("function_validate_slength", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_string.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_string.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/functions/validate_string.rb	(revision 30960)
@@ -0,0 +1,15 @@
+Puppet::Functions.create_function(:validate_string) do
+  dispatch :deprecation_gen do
+    param 'Any', :scope
+    repeated_param 'Any', :args
+  end
+  # Workaround PUP-4438 (fixed: https://github.com/puppetlabs/puppet/commit/e01c4dc924cd963ff6630008a5200fc6a2023b08#diff-c937cc584953271bb3d3b3c2cb141790R221) to support puppet < 4.1.0 and puppet < 3.8.1.
+  def call(scope, *args)
+    manipulated_args = [scope] + args
+    self.class.dispatcher.dispatch(self, scope, manipulated_args)
+  end
+  def deprecation_gen(scope, *args)
+    call_function('deprecation', 'validate_string', "This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::String. There is further documentation for validate_legacy function in the README.")
+    scope.send("function_validate_string", args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/abs.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/abs.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/abs.rb	(revision 30960)
@@ -0,0 +1,36 @@
+#
+# abs.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:abs, :type => :rvalue, :doc => <<-EOS
+    Returns the absolute value of a number, for example -34.56 becomes
+    34.56. Takes a single integer and float value as an argument.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "abs(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    # Numbers in Puppet are often string-encoded which is troublesome ...
+    if value.is_a?(String)
+      if value.match(/^-?(?:\d+)(?:\.\d+){1}$/)
+        value = value.to_f
+      elsif value.match(/^-?\d+$/)
+        value = value.to_i
+      else
+        raise(Puppet::ParseError, 'abs(): Requires float or ' +
+          'integer to work with')
+      end
+    end
+
+    # We have numeric value to handle ...
+    result = value.abs
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/any2array.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/any2array.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/any2array.rb	(revision 30960)
@@ -0,0 +1,33 @@
+#
+# any2array.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:any2array, :type => :rvalue, :doc => <<-EOS
+This converts any object to an array containing that object. Empty argument
+lists are converted to an empty array. Arrays are left untouched. Hashes are
+converted to arrays of alternating keys and values.
+    EOS
+  ) do |arguments|
+
+    if arguments.empty?
+        return []
+    end
+
+    if arguments.length == 1
+        if arguments[0].kind_of?(Array)
+            return arguments[0]
+        elsif arguments[0].kind_of?(Hash)
+            result = []
+            arguments[0].each do |key, value|
+                result << key << value
+            end
+            return result
+        end
+    end
+
+    return arguments
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/any2bool.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/any2bool.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/any2bool.rb	(revision 30960)
@@ -0,0 +1,55 @@
+#
+# any2bool.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:any2bool, :type => :rvalue, :doc => <<-EOS
+This converts 'anything' to a boolean. In practise it does the following:
+
+* Strings such as Y,y,1,T,t,TRUE,yes,'true' will return true
+* Strings such as 0,F,f,N,n,FALSE,no,'false' will return false
+* Booleans will just return their original value
+* Number (or a string representation of a number) > 0 will return true, otherwise false
+* undef will return false
+* Anything else will return true
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "any2bool(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    # If argument is already Boolean, return it
+    if !!arguments[0] == arguments[0]
+      return arguments[0]
+    end
+
+    arg = arguments[0]
+
+    if arg == nil
+      return false
+    end
+
+    if arg == :undef
+      return false
+    end
+
+    valid_float = !!Float(arg) rescue false
+
+    if arg.is_a?(Numeric)
+      return function_num2bool( [ arguments[0] ] )
+    end
+
+    if arg.is_a?(String)
+      if valid_float
+        return function_num2bool( [ arguments[0] ] )
+      else
+        return function_str2bool( [ arguments[0] ] )
+      end
+    end
+
+    return true
+
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/assert_private.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/assert_private.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/assert_private.rb	(revision 30960)
@@ -0,0 +1,29 @@
+#
+# assert_private.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:assert_private, :doc => <<-'EOS'
+    Sets the current class or definition as private.
+    Calling the class or definition from outside the current module will fail.
+    EOS
+  ) do |args|
+
+    raise(Puppet::ParseError, "assert_private(): Wrong number of arguments "+
+      "given (#{args.size}}) for 0 or 1)") if args.size > 1
+
+    scope = self
+    if scope.lookupvar('module_name') != scope.lookupvar('caller_module_name')
+      message = nil
+      if args[0] and args[0].is_a? String
+        message = args[0]
+      else
+        manifest_name = scope.source.name
+        manifest_type = scope.source.type
+        message = (manifest_type.to_s == 'hostclass') ? 'Class' : 'Definition'
+        message += " #{manifest_name} is private"
+      end
+      raise(Puppet::ParseError, message)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/base64.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/base64.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/base64.rb	(revision 30960)
@@ -0,0 +1,68 @@
+module Puppet::Parser::Functions
+
+  newfunction(:base64, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
+
+    Base64 encode or decode a string based on the command and the string submitted
+
+    Usage:
+
+      $encodestring = base64('encode', 'thestring')
+      $decodestring = base64('decode', 'dGhlc3RyaW5n')
+
+      # explicitly define encode/decode method: default, strict, urlsafe
+      $method = 'default'
+      $encodestring = base64('encode', 'thestring', $method)
+      $decodestring = base64('decode', 'dGhlc3RyaW5n', $method)
+
+    ENDHEREDOC
+
+    require 'base64'
+
+    raise Puppet::ParseError, ("base64(): Wrong number of arguments (#{args.length}; must be >= 2)") unless args.length >= 2
+
+    actions = ['encode','decode']
+
+    unless actions.include?(args[0])
+      raise Puppet::ParseError, ("base64(): the first argument must be one of 'encode' or 'decode'")
+    end
+
+    unless args[1].is_a?(String)
+      raise Puppet::ParseError, ("base64(): the second argument must be a string to base64")
+    end
+
+    method = ['default','strict','urlsafe']
+
+    if args.length <= 2
+      chosenMethod = 'default'
+    else
+      chosenMethod = args[2]
+    end
+
+    unless method.include?(chosenMethod)
+      raise Puppet::ParseError, ("base64(): the third argument must be one of 'default', 'strict', or 'urlsafe'")
+    end
+
+    case args[0]
+      when 'encode'
+        case chosenMethod
+          when 'default'
+            result = Base64.encode64(args[1])
+          when 'strict'
+            result = Base64.strict_encode64(args[1])
+          when 'urlsafe'
+            result = Base64.urlsafe_encode64(args[1])
+        end
+      when 'decode'
+        case chosenMethod
+          when 'default'
+            result = Base64.decode64(args[1])
+          when 'strict'
+            result = Base64.strict_decode64(args[1])
+          when 'urlsafe'
+            result = Base64.urlsafe_decode64(args[1])
+        end
+    end
+
+    return result
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/basename.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/basename.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/basename.rb	(revision 30960)
@@ -0,0 +1,34 @@
+module Puppet::Parser::Functions
+  newfunction(:basename, :type => :rvalue, :doc => <<-EOS
+    Strips directory (and optional suffix) from a filename
+    EOS
+  ) do |arguments|
+
+    if arguments.size < 1 then
+      raise(Puppet::ParseError, "basename(): No arguments given")
+    elsif arguments.size > 2 then
+      raise(Puppet::ParseError, "basename(): Too many arguments given (#{arguments.size})")
+    else
+
+      unless arguments[0].is_a?(String)
+        raise(Puppet::ParseError, 'basename(): Requires string as first argument')
+      end
+
+      if arguments.size == 1 then
+        rv = File.basename(arguments[0])
+      elsif arguments.size == 2 then
+
+        unless arguments[1].is_a?(String)
+          raise(Puppet::ParseError, 'basename(): Requires string as second argument')
+        end
+
+        rv = File.basename(arguments[0], arguments[1])
+      end
+
+    end
+
+    return rv
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/bool2num.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/bool2num.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/bool2num.rb	(revision 30960)
@@ -0,0 +1,26 @@
+#
+# bool2num.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:bool2num, :type => :rvalue, :doc => <<-EOS
+    Converts a boolean to a number. Converts the values:
+      false, f, 0, n, and no to 0
+      true, t, 1, y, and yes to 1
+    Requires a single boolean or string as an input.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "bool2num(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = function_str2bool([arguments[0]])
+
+    # We have real boolean values as well ...
+    result = value ? 1 : 0
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/bool2str.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/bool2str.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/bool2str.rb	(revision 30960)
@@ -0,0 +1,45 @@
+#
+# bool2str.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:bool2str, :type => :rvalue, :doc => <<-EOS
+    Converts a boolean to a string using optionally supplied arguments. The
+    optional second and third arguments represent what true and false will be
+    converted to respectively. If only one argument is given, it will be
+    converted from a boolean to a string containing 'true' or 'false'.
+
+    *Examples:*
+
+    bool2str(true)                    => 'true'
+    bool2str(true, 'yes', 'no')       => 'yes'
+    bool2str(false, 't', 'f')         => 'f'
+
+    Requires a single boolean as an input.
+    EOS
+  ) do |arguments|
+
+    unless arguments.size == 1 or arguments.size == 3
+      raise(Puppet::ParseError, "bool2str(): Wrong number of arguments " +
+                                "given (#{arguments.size} for 3)")
+    end
+
+    value = arguments[0]
+    true_string = arguments[1] || 'true'
+    false_string = arguments[2] || 'false'
+    klass = value.class
+
+    # We can have either true or false, and nothing else
+    unless [FalseClass, TrueClass].include?(klass)
+      raise(Puppet::ParseError, 'bool2str(): Requires a boolean to work with')
+    end
+
+    unless [true_string, false_string].all?{|x| x.kind_of?(String)}
+      raise(Puppet::ParseError, "bool2str(): Requires strings to convert to" )
+    end
+
+    return value ? true_string : false_string
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/camelcase.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/camelcase.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/camelcase.rb	(revision 30960)
@@ -0,0 +1,33 @@
+#
+#  camelcase.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:camelcase, :type => :rvalue, :doc => <<-EOS
+Converts the case of a string or all strings in an array to camel case.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "camelcase(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+    klass = value.class
+
+    unless [Array, String].include?(klass)
+      raise(Puppet::ParseError, 'camelcase(): Requires either ' +
+        'array or string to work with')
+    end
+
+    if value.is_a?(Array)
+      # Numbers in Puppet are often string-encoded which is troublesome ...
+      result = value.collect { |i| i.is_a?(String) ? i.split('_').map{|e| e.capitalize}.join : i }
+    else
+      result = value.split('_').map{|e| e.capitalize}.join
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/capitalize.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/capitalize.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/capitalize.rb	(revision 30960)
@@ -0,0 +1,33 @@
+#
+#  capitalize.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:capitalize, :type => :rvalue, :doc => <<-EOS
+    Capitalizes the first letter of a string or array of strings.
+    Requires either a single string or an array as an input.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "capitalize(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'capitalize(): Requires either ' +
+        'array or string to work with')
+    end
+
+    if value.is_a?(Array)
+      # Numbers in Puppet are often string-encoded which is troublesome ...
+      result = value.collect { |i| i.is_a?(String) ? i.capitalize : i }
+    else
+      result = value.capitalize
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/ceiling.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/ceiling.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/ceiling.rb	(revision 30960)
@@ -0,0 +1,25 @@
+module Puppet::Parser::Functions
+  newfunction(:ceiling, :type => :rvalue, :doc => <<-EOS
+    Returns the smallest integer greater or equal to the argument.
+    Takes a single numeric value as an argument.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "ceiling(): Wrong number of arguments " +
+          "given (#{arguments.size} for 1)") if arguments.size != 1
+
+    begin
+      arg = Float(arguments[0])
+    rescue TypeError, ArgumentError => e
+      raise(Puppet::ParseError, "ceiling(): Wrong argument type " +
+            "given (#{arguments[0]} for Numeric)")
+    end
+
+    raise(Puppet::ParseError, "ceiling(): Wrong argument type " +
+          "given (#{arg.class} for Numeric)") if arg.is_a?(Numeric) == false
+
+    arg.ceil
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/chomp.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/chomp.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/chomp.rb	(revision 30960)
@@ -0,0 +1,34 @@
+#
+#  chomp.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:chomp, :type => :rvalue, :doc => <<-'EOS'
+    Removes the record separator from the end of a string or an array of
+    strings, for example `hello\n` becomes `hello`.
+    Requires a single string or array as an input.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "chomp(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'chomp(): Requires either ' +
+        'array or string to work with')
+    end
+
+    if value.is_a?(Array)
+      # Numbers in Puppet are often string-encoded which is troublesome ...
+      result = value.collect { |i| i.is_a?(String) ? i.chomp : i }
+    else
+      result = value.chomp
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/chop.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/chop.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/chop.rb	(revision 30960)
@@ -0,0 +1,36 @@
+#
+#  chop.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:chop, :type => :rvalue, :doc => <<-'EOS'
+    Returns a new string with the last character removed. If the string ends
+    with `\r\n`, both characters are removed. Applying chop to an empty
+    string returns an empty string. If you wish to merely remove record
+    separators then you should use the `chomp` function.
+    Requires a string or array of strings as input.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "chop(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'chop(): Requires either an ' +
+        'array or string to work with')
+    end
+
+    if value.is_a?(Array)
+      # Numbers in Puppet are often string-encoded which is troublesome ...
+      result = value.collect { |i| i.is_a?(String) ? i.chop : i }
+    else
+      result = value.chop
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/clamp.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/clamp.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/clamp.rb	(revision 30960)
@@ -0,0 +1,30 @@
+#
+# clamp.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:clamp, :type => :rvalue, :arity => -2, :doc => <<-EOS
+    Clamps value to a range.
+    EOS
+  ) do |args|
+
+    args.flatten!
+
+    raise(Puppet::ParseError, 'clamp(): Wrong number of arguments, ' +
+          'need three to clamp') if args.size != 3
+
+    # check values out
+    args.each do |value|
+      case [value.class]
+        when [String]
+          raise(Puppet::ParseError, "clamp(): Required explicit numeric (#{value}:String)") unless value =~ /^\d+$/
+        when [Hash]
+          raise(Puppet::ParseError, "clamp(): The Hash type is not allowed (#{value})")
+      end
+    end
+
+    # convert to numeric each element
+    # then sort them and get a middle value
+    args.map{ |n| n.to_i }.sort[1]
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/concat.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/concat.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/concat.rb	(revision 30960)
@@ -0,0 +1,41 @@
+#
+# concat.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:concat, :type => :rvalue, :doc => <<-EOS
+Appends the contents of multiple arrays into array 1.
+
+*Example:*
+
+    concat(['1','2','3'],['4','5','6'],['7','8','9'])
+
+Would result in:
+
+  ['1','2','3','4','5','6','7','8','9']
+    EOS
+  ) do |arguments|
+
+    # Check that more than 2 arguments have been given ...
+    raise(Puppet::ParseError, "concat(): Wrong number of arguments " +
+      "given (#{arguments.size} for < 2)") if arguments.size < 2
+
+    a = arguments[0]
+
+    # Check that the first parameter is an array
+    unless a.is_a?(Array)
+      raise(Puppet::ParseError, 'concat(): Requires array to work with')
+    end
+
+    result = a
+    arguments.shift
+
+    arguments.each do |x|
+      result = result + (x.is_a?(Array) ? x : [x])
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/convert_base.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/convert_base.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/convert_base.rb	(revision 30960)
@@ -0,0 +1,35 @@
+module Puppet::Parser::Functions
+
+  newfunction(:convert_base, :type => :rvalue, :arity => 2, :doc => <<-'ENDHEREDOC') do |args|
+
+    Converts a given integer or base 10 string representing an integer to a specified base, as a string.
+
+    Usage:
+
+      $binary_repr = convert_base(5, 2)  # $binary_repr is now set to "101"
+      $hex_repr = convert_base("254", "16")  # $hex_repr is now set to "fe"
+
+    ENDHEREDOC
+
+    raise Puppet::ParseError, ("convert_base(): First argument must be either a string or an integer") unless (args[0].is_a?(Integer) or args[0].is_a?(String))
+    raise Puppet::ParseError, ("convert_base(): Second argument must be either a string or an integer") unless (args[1].is_a?(Integer) or args[1].is_a?(String))
+
+    if args[0].is_a?(String)
+      raise Puppet::ParseError, ("convert_base(): First argument must be an integer or a string corresponding to an integer in base 10") unless args[0] =~ /^[0-9]+$/
+    end
+
+    if args[1].is_a?(String)
+      raise Puppet::ParseError, ("convert_base(): First argument must be an integer or a string corresponding to an integer in base 10") unless args[1] =~ /^[0-9]+$/
+    end
+
+    number_to_convert = args[0]
+    new_base = args[1]
+
+    number_to_convert = number_to_convert.to_i()
+    new_base = new_base.to_i()
+
+    raise Puppet::ParseError, ("convert_base(): base must be at least 2 and must not be greater than 36") unless new_base >= 2 and new_base <= 36
+
+    return number_to_convert.to_s(new_base)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/count.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/count.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/count.rb	(revision 30960)
@@ -0,0 +1,22 @@
+module Puppet::Parser::Functions
+  newfunction(:count, :type => :rvalue, :arity => -2, :doc => <<-EOS
+Takes an array as first argument and an optional second argument.
+Count the number of elements in array that matches second argument.
+If called with only an array it counts the number of elements that are not nil/undef.
+    EOS
+  ) do |args|
+
+    if (args.size > 2) then
+      raise(ArgumentError, "count(): Wrong number of arguments "+
+        "given #{args.size} for 1 or 2.")
+    end
+
+    collection, item = args
+
+    if item then
+      collection.count item
+    else
+      collection.count { |obj| obj != nil && obj != :undef && obj != '' }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/deep_merge.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/deep_merge.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/deep_merge.rb	(revision 30960)
@@ -0,0 +1,44 @@
+module Puppet::Parser::Functions
+  newfunction(:deep_merge, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
+    Recursively merges two or more hashes together and returns the resulting hash.
+
+    For example:
+
+        $hash1 = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
+        $hash2 = {'two' => 'dos', 'three' => { 'five' => 5 } }
+        $merged_hash = deep_merge($hash1, $hash2)
+        # The resulting hash is equivalent to:
+        # $merged_hash = { 'one' => 1, 'two' => 'dos', 'three' => { 'four' => 4, 'five' => 5 } }
+
+    When there is a duplicate key that is a hash, they are recursively merged.
+    When there is a duplicate key that is not a hash, the key in the rightmost hash will "win."
+
+    ENDHEREDOC
+
+    if args.length < 2
+      raise Puppet::ParseError, ("deep_merge(): wrong number of arguments (#{args.length}; must be at least 2)")
+    end
+
+    deep_merge = Proc.new do |hash1,hash2|
+      hash1.merge(hash2) do |key,old_value,new_value|
+        if old_value.is_a?(Hash) && new_value.is_a?(Hash)
+          deep_merge.call(old_value, new_value)
+        else
+          new_value
+        end
+      end
+    end
+
+    result = Hash.new
+    args.each do |arg|
+      next if arg.is_a? String and arg.empty? # empty string is synonym for puppet's undef
+      # If the argument was not a hash, skip it.
+      unless arg.is_a?(Hash)
+        raise Puppet::ParseError, "deep_merge: unexpected argument type #{arg.class}, only expects hash arguments"
+      end
+
+      result = deep_merge.call(result, arg)
+    end
+    return( result )
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/defined_with_params.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/defined_with_params.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/defined_with_params.rb	(revision 30960)
@@ -0,0 +1,38 @@
+# Test whether a given class or definition is defined
+require 'puppet/parser/functions'
+
+Puppet::Parser::Functions.newfunction(:defined_with_params,
+                                      :type => :rvalue,
+                                      :doc => <<-'ENDOFDOC'
+Takes a resource reference and an optional hash of attributes.
+
+Returns true if a resource with the specified attributes has already been added
+to the catalog, and false otherwise.
+
+    user { 'dan':
+      ensure => present,
+    }
+
+    if ! defined_with_params(User[dan], {'ensure' => 'present' }) {
+      user { 'dan': ensure => present, }
+    }
+ENDOFDOC
+) do |vals|
+  reference, params = vals
+  raise(ArgumentError, 'Must specify a reference') unless reference
+  if (! params) || params == ''
+    params = {}
+  end
+  ret = false
+  if resource = findresource(reference.to_s)
+    matches = params.collect do |key, value|
+      # eql? avoids bugs caused by monkeypatching in puppet
+      resource_is_undef = resource[key].eql?(:undef) || resource[key].nil?
+      value_is_undef = value.eql?(:undef) || value.nil?
+      (resource_is_undef && value_is_undef) || (resource[key] == value)
+    end
+    ret = params.empty? || !matches.include?(false)
+  end
+  Puppet.debug("Resource #{reference} was not determined to be defined")
+  ret
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete.rb	(revision 30960)
@@ -0,0 +1,45 @@
+#
+# delete.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:delete, :type => :rvalue, :doc => <<-EOS
+Deletes all instances of a given element from an array, substring from a
+string, or key from a hash.
+
+*Examples:*
+
+    delete(['a','b','c','b'], 'b')
+    Would return: ['a','c']
+
+    delete({'a'=>1,'b'=>2,'c'=>3}, 'b')
+    Would return: {'a'=>1,'c'=>3}
+
+    delete({'a'=>1,'b'=>2,'c'=>3}, ['b','c'])
+    Would return: {'a'=>1}
+
+    delete('abracadabra', 'bra')
+    Would return: 'acada'
+  EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "delete(): Wrong number of arguments "+
+                              "given #{arguments.size} for 2") unless arguments.size == 2
+
+    collection = arguments[0].dup
+    Array(arguments[1]).each do |item|
+      case collection
+        when Array, Hash
+          collection.delete item
+        when String
+          collection.gsub! item, ''
+        else
+          raise(TypeError, "delete(): First argument must be an Array, " +
+                             "String, or Hash. Given an argument of class #{collection.class}.")
+      end
+    end
+    collection
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete_at.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete_at.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete_at.rb	(revision 30960)
@@ -0,0 +1,49 @@
+#
+# delete_at.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:delete_at, :type => :rvalue, :doc => <<-EOS
+Deletes a determined indexed value from an array.
+
+*Examples:*
+
+    delete_at(['a','b','c'], 1)
+
+Would return: ['a','c']
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "delete_at(): Wrong number of arguments " +
+      "given (#{arguments.size} for 2)") if arguments.size < 2
+
+    array = arguments[0]
+
+    unless array.is_a?(Array)
+      raise(Puppet::ParseError, 'delete_at(): Requires array to work with')
+    end
+
+    index = arguments[1]
+
+    if index.is_a?(String) and not index.match(/^\d+$/)
+      raise(Puppet::ParseError, 'delete_at(): You must provide ' +
+        'non-negative numeric index')
+    end
+
+    result = array.clone
+
+    # Numbers in Puppet are often string-encoded which is troublesome ...
+    index = index.to_i
+
+    if index > result.size - 1 # First element is at index 0 is it not?
+      raise(Puppet::ParseError, 'delete_at(): Given index ' +
+        'exceeds size of array given')
+    end
+
+    result.delete_at(index) # We ignore the element that got deleted ...
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete_regex.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete_regex.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete_regex.rb	(revision 30960)
@@ -0,0 +1,45 @@
+#
+# delete_regex.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:delete_regex, :type => :rvalue, :doc => <<-EOS
+deletes all instances of a given element that match a regular expression
+from an array or key from a hash. Multiple regular expressions are assumed
+to be matched as an OR.
+
+*Examples:*
+
+    delete_regex(['a','b','c','b'], 'b')
+    Would return: ['a','c']
+    
+    delete_regex(['a','b','c','b'], ['b', 'c'])
+    Would return: ['a']
+
+    delete_regex({'a'=>1,'b'=>2,'c'=>3}, 'b')
+    Would return: {'a'=>1,'c'=>3}
+
+    delete_regex({'a'=>1,'b'=>2,'c'=>3}, '^a$')
+    Would return: {'b'=>2,'c'=>3}
+
+  EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "delete_regex(): Wrong number of arguments "+
+                              "given #{arguments.size} for 2") unless arguments.size == 2
+
+    collection = arguments[0].dup
+    Array(arguments[1]).each do |item|
+      case collection
+        when Array, Hash, String
+          collection.reject! { |coll_item| (coll_item =~ %r{\b#{item}\b}) }
+        else
+          raise(TypeError, "delete_regex(): First argument must be an Array, " +
+                             "Hash, or String. Given an argument of class #{collection.class}.")
+      end
+    end
+    collection
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete_undef_values.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete_undef_values.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete_undef_values.rb	(revision 30960)
@@ -0,0 +1,34 @@
+module Puppet::Parser::Functions
+  newfunction(:delete_undef_values, :type => :rvalue, :doc => <<-EOS
+Returns a copy of input hash or array with all undefs deleted.
+
+*Examples:*
+
+    $hash = delete_undef_values({a=>'A', b=>'', c=>undef, d => false})
+
+Would return: {a => 'A', b => '', d => false}
+
+    $array = delete_undef_values(['A','',undef,false])
+
+Would return: ['A','',false]
+
+      EOS
+    ) do |args|
+
+    raise(Puppet::ParseError,
+          "delete_undef_values(): Wrong number of arguments given " +
+          "(#{args.size})") if args.size < 1
+
+    unless args[0].is_a? Array or args[0].is_a? Hash
+      raise(Puppet::ParseError,
+            "delete_undef_values(): expected an array or hash, got #{args[0]} type  #{args[0].class} ")
+    end
+    result = args[0].dup
+    if result.is_a?(Hash)
+      result.delete_if {|key, val| val.equal? :undef}
+    elsif result.is_a?(Array)
+      result.delete :undef
+    end
+    result
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete_values.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete_values.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/delete_values.rb	(revision 30960)
@@ -0,0 +1,26 @@
+module Puppet::Parser::Functions
+  newfunction(:delete_values, :type => :rvalue, :doc => <<-EOS
+Deletes all instances of a given value from a hash.
+
+*Examples:*
+
+    delete_values({'a'=>'A','b'=>'B','c'=>'C','B'=>'D'}, 'B')
+
+Would return: {'a'=>'A','c'=>'C','B'=>'D'}
+
+      EOS
+    ) do |arguments|
+
+    raise(Puppet::ParseError,
+          "delete_values(): Wrong number of arguments given " +
+          "(#{arguments.size} of 2)") if arguments.size != 2
+
+    hash, item = arguments
+
+    if not hash.is_a?(Hash)
+      raise(TypeError, "delete_values(): First argument must be a Hash. " + \
+                       "Given an argument of class #{hash.class}.")
+    end
+    hash.dup.delete_if { |key, val| item == val }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/deprecation.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/deprecation.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/deprecation.rb	(revision 30960)
@@ -0,0 +1,17 @@
+module Puppet::Parser::Functions
+  newfunction(:deprecation, :type => :rvalue, :doc => <<-EOS
+  Function to print deprecation warnings (this is the 3.X version of it), The uniqueness key - can appear once. The msg is the message text including any positional information that is formatted by the user/caller of the method.).
+EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "deprecation: Wrong number of arguments " +
+      "given (#{arguments.size} for 2)") unless arguments.size == 2
+
+    key = arguments[0]
+    message = arguments[1]
+    
+    if ENV['STDLIB_LOG_DEPRECATIONS'] == "true"
+      warning("deprecation. #{key}. #{message}")
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/difference.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/difference.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/difference.rb	(revision 30960)
@@ -0,0 +1,36 @@
+#
+# difference.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:difference, :type => :rvalue, :doc => <<-EOS
+This function returns the difference between two arrays.
+The returned array is a copy of the original array, removing any items that
+also appear in the second array.
+
+*Examples:*
+
+    difference(["a","b","c"],["b","c","d"])
+
+Would return: ["a"]
+    EOS
+  ) do |arguments|
+
+    # Two arguments are required
+    raise(Puppet::ParseError, "difference(): Wrong number of arguments " +
+      "given (#{arguments.size} for 2)") if arguments.size != 2
+
+    first = arguments[0]
+    second = arguments[1]
+
+    unless first.is_a?(Array) && second.is_a?(Array)
+      raise(Puppet::ParseError, 'difference(): Requires 2 arrays')
+    end
+
+    result = first - second
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/dig.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/dig.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/dig.rb	(revision 30960)
@@ -0,0 +1,16 @@
+#
+# dig.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:dig, :type => :rvalue, :doc => <<-EOS
+    DEPRECATED: This function has been replaced in Puppet 4.5.0, please use dig44() for backwards compatibility or use the new version.
+    EOS
+  ) do |arguments|
+    warning("dig() DEPRECATED: This function has been replaced in Puppet 4.5.0, please use dig44() for backwards compatibility or use the new version.")
+    if ! Puppet::Parser::Functions.autoloader.loaded?(:dig44)
+      Puppet::Parser::Functions.autoloader.load(:dig44)
+    end
+    function_dig44(arguments)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/dig44.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/dig44.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/dig44.rb	(revision 30960)
@@ -0,0 +1,73 @@
+#
+# dig44.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(
+      :dig44,
+      :type => :rvalue,
+      :arity => -2,
+      :doc => <<-eos
+DEPRECATED: This function has been replaced in puppet 4.5.0.
+
+Looks up into a complex structure of arrays and hashes and returns a value
+or the default value if nothing was found.
+
+Key can contain slashes to describe path components. The function will go down
+the structure and try to extract the required value.
+
+$data = {
+  'a' => {
+    'b' => [
+      'b1',
+      'b2',
+      'b3',
+    ]
+  }
+}
+
+$value = dig44($data, ['a', 'b', '2'], 'not_found')
+=> $value = 'b3'
+
+a -> first hash key
+b -> second hash key
+2 -> array index starting with 0
+
+not_found -> (optional) will be returned if there is no value or the path
+did not match. Defaults to nil.
+
+In addition to the required "key" argument, the function accepts a default
+argument. It will be returned if no value was found or a path component is
+missing. And the fourth argument can set a variable path separator.
+  eos
+  ) do |arguments|
+    # Two arguments are required
+    raise(Puppet::ParseError, "dig44(): Wrong number of arguments " +
+                              "given (#{arguments.size} for at least 2)") if arguments.size < 2
+
+    data, path, default = *arguments
+
+    unless data.is_a?(Hash) or data.is_a?(Array)
+      raise(Puppet::ParseError, "dig44(): first argument must be a hash or an array, " <<
+                                "given #{data.class.name}")
+    end
+
+    unless path.is_a? Array
+      raise(Puppet::ParseError, "dig44(): second argument must be an array, " <<
+                                "given #{path.class.name}")
+    end
+
+    value = path.reduce(data) do |structure, key|
+      if structure.is_a? Hash or structure.is_a? Array
+        if structure.is_a? Array
+          key = Integer key rescue break
+        end
+        break if structure[key].nil? or structure[key] == :undef
+        structure[key]
+      else
+        break
+      end
+    end
+    value.nil? ? default : value
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/dirname.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/dirname.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/dirname.rb	(revision 30960)
@@ -0,0 +1,21 @@
+module Puppet::Parser::Functions
+  newfunction(:dirname, :type => :rvalue, :doc => <<-EOS
+    Returns the dirname of a path.
+    EOS
+  ) do |arguments|
+
+    if arguments.size < 1 then
+      raise(Puppet::ParseError, "dirname(): No arguments given")
+    end
+    if arguments.size > 1 then
+      raise(Puppet::ParseError, "dirname(): Too many arguments given (#{arguments.size})")
+    end
+    unless arguments[0].is_a?(String)
+      raise(Puppet::ParseError, 'dirname(): Requires string as argument')
+    end
+
+    return File.dirname(arguments[0])
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/dos2unix.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/dos2unix.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/dos2unix.rb	(revision 30960)
@@ -0,0 +1,15 @@
+# Custom Puppet function to convert dos to unix format
+module Puppet::Parser::Functions
+  newfunction(:dos2unix, :type => :rvalue, :arity => 1, :doc => <<-EOS
+    Returns the Unix version of the given string.
+    Takes a single string argument.
+    EOS
+  ) do |arguments|
+
+    unless arguments[0].is_a?(String)
+      raise(Puppet::ParseError, 'dos2unix(): Requires string as argument')
+    end
+
+    arguments[0].gsub(/\r\n/, "\n")
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/downcase.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/downcase.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/downcase.rb	(revision 30960)
@@ -0,0 +1,32 @@
+#
+#  downcase.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:downcase, :type => :rvalue, :doc => <<-EOS
+Converts the case of a string or all strings in an array to lower case.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "downcase(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'downcase(): Requires either ' +
+        'array or string to work with')
+    end
+
+    if value.is_a?(Array)
+      # Numbers in Puppet are often string-encoded which is troublesome ...
+      result = value.collect { |i| i.is_a?(String) ? i.downcase : i }
+    else
+      result = value.downcase
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/empty.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/empty.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/empty.rb	(revision 30960)
@@ -0,0 +1,31 @@
+#
+# empty.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:empty, :type => :rvalue, :doc => <<-EOS
+Returns true if the variable is empty.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "empty(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(Hash) || value.is_a?(String) || value.is_a?(Numeric)
+      raise(Puppet::ParseError, 'empty(): Requires either ' +
+        'array, hash, string or integer to work with')
+    end
+
+    if value.is_a?(Numeric)
+      return false
+    else
+      result = value.empty?
+
+      return result
+    end
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/enclose_ipv6.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/enclose_ipv6.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/enclose_ipv6.rb	(revision 30960)
@@ -0,0 +1,45 @@
+#
+# enclose_ipv6.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:enclose_ipv6, :type => :rvalue, :doc => <<-EOS
+Takes an array of ip addresses and encloses the ipv6 addresses with square brackets.
+    EOS
+  ) do |arguments|
+
+    require 'ipaddr'
+
+    rescuable_exceptions = [ ArgumentError ]
+    if defined?(IPAddr::InvalidAddressError)
+	    rescuable_exceptions << IPAddr::InvalidAddressError
+    end
+
+    if (arguments.size != 1) then
+      raise(Puppet::ParseError, "enclose_ipv6(): Wrong number of arguments "+
+        "given #{arguments.size} for 1")
+    end
+    unless arguments[0].is_a?(String) or arguments[0].is_a?(Array) then
+      raise(Puppet::ParseError, "enclose_ipv6(): Wrong argument type "+
+        "given #{arguments[0].class} expected String or Array")
+    end
+
+    input = [arguments[0]].flatten.compact
+    result = []
+
+    input.each do |val|
+      unless val == '*'
+        begin
+          ip = IPAddr.new(val)
+        rescue *rescuable_exceptions
+          raise(Puppet::ParseError, "enclose_ipv6(): Wrong argument "+
+                "given #{val} is not an ip address.")
+        end
+        val = "[#{ip.to_s}]" if ip.ipv6?
+      end
+      result << val
+    end
+
+    return result.uniq
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/ensure_packages.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/ensure_packages.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/ensure_packages.rb	(revision 30960)
@@ -0,0 +1,46 @@
+#
+# ensure_packages.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:ensure_packages, :type => :statement, :doc => <<-EOS
+Takes a list of packages and only installs them if they don't already exist.
+It optionally takes a hash as a second parameter that will be passed as the
+third argument to the ensure_resource() function.
+    EOS
+  ) do |arguments|
+
+    if arguments.size > 2 or arguments.size == 0
+      raise(Puppet::ParseError, "ensure_packages(): Wrong number of arguments " +
+        "given (#{arguments.size} for 1 or 2)")
+    elsif arguments.size == 2 and !arguments[1].is_a?(Hash) 
+      raise(Puppet::ParseError, 'ensure_packages(): Requires second argument to be a Hash')
+    end
+
+    if arguments[0].is_a?(Hash)
+      if arguments[1]
+        defaults = { 'ensure' => 'present' }.merge(arguments[1])
+      else
+        defaults = { 'ensure' => 'present' }
+      end
+
+      Puppet::Parser::Functions.function(:ensure_resources)
+      function_ensure_resources(['package', Hash(arguments[0]), defaults ])
+    else
+      packages = Array(arguments[0])
+
+      if arguments[1]
+        defaults = { 'ensure' => 'present' }.merge(arguments[1])
+      else
+        defaults = { 'ensure' => 'present' }
+      end
+
+      Puppet::Parser::Functions.function(:ensure_resource)
+      packages.each { |package_name|
+        function_ensure_resource(['package', package_name, defaults ])
+    }
+    end
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/ensure_resource.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/ensure_resource.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/ensure_resource.rb	(revision 30960)
@@ -0,0 +1,46 @@
+# Test whether a given class or definition is defined
+require 'puppet/parser/functions'
+
+Puppet::Parser::Functions.newfunction(:ensure_resource,
+                                      :type => :statement,
+                                      :doc => <<-'ENDOFDOC'
+Takes a resource type, title, and a list of attributes that describe a
+resource.
+
+    user { 'dan':
+      ensure => present,
+    }
+
+This example only creates the resource if it does not already exist:
+
+    ensure_resource('user', 'dan', {'ensure' => 'present' })
+
+If the resource already exists but does not match the specified parameters,
+this function will attempt to recreate the resource leading to a duplicate
+resource definition error.
+
+An array of resources can also be passed in and each will be created with
+the type and parameters specified if it doesn't already exist.
+
+    ensure_resource('user', ['dan','alex'], {'ensure' => 'present'})
+
+ENDOFDOC
+) do |vals|
+  type, title, params = vals
+  raise(ArgumentError, 'Must specify a type') unless type
+  raise(ArgumentError, 'Must specify a title') unless title
+  params ||= {}
+
+  items = [title].flatten
+
+  items.each do |item|
+    Puppet::Parser::Functions.function(:defined_with_params)
+    if function_defined_with_params(["#{type}[#{item}]", params])
+      Puppet.debug("Resource #{type}[#{item}] with params #{params} not created because it already exists")
+    else
+      Puppet.debug("Create new resource #{type}[#{item}] with params #{params}")
+      Puppet::Parser::Functions.function(:create_resources)
+      function_create_resources([type.capitalize, { item => params }])
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/ensure_resources.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/ensure_resources.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/ensure_resources.rb	(revision 30960)
@@ -0,0 +1,54 @@
+require 'puppet/parser/functions'
+
+Puppet::Parser::Functions.newfunction(:ensure_resources,
+                                      :type => :statement,
+                                      :doc => <<-'ENDOFDOC'
+Takes a resource type, title (only hash), and a list of attributes that describe a
+resource.
+
+    user { 'dan':
+      gid => 'mygroup',
+      ensure => present,
+    }
+
+An hash of resources should be passed in and each will be created with
+the type and parameters specified if it doesn't already exist.
+
+    ensure_resources('user', {'dan' => { gid => 'mygroup', uid => '600' } ,  'alex' => { gid => 'mygroup' }}, {'ensure' => 'present'})
+
+From Hiera Backend:
+
+userlist:
+  dan:
+    gid: 'mygroup'
+ uid: '600'
+  alex:
+ gid: 'mygroup'
+
+Call:
+ensure_resources('user', hiera_hash('userlist'), {'ensure' => 'present'})
+
+ENDOFDOC
+) do |vals|
+  type, title, params = vals
+  raise(ArgumentError, 'Must specify a type') unless type
+  raise(ArgumentError, 'Must specify a title') unless title
+  params ||= {}
+
+  if title.is_a?(Hash)
+    resource_hash = Hash(title)
+    resources = resource_hash.keys
+
+    Puppet::Parser::Functions.function(:ensure_resource)
+    resources.each { |resource_name|
+    if resource_hash[resource_name]
+        params_merged = params.merge(resource_hash[resource_name])
+    else
+        params_merged = params
+    end
+    function_ensure_resource([ type, resource_name, params_merged ])
+    }
+  else
+       raise(Puppet::ParseError, 'ensure_resources(): Requires second argument to be a Hash')
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/flatten.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/flatten.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/flatten.rb	(revision 30960)
@@ -0,0 +1,33 @@
+#
+# flatten.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:flatten, :type => :rvalue, :doc => <<-EOS
+This function flattens any deeply nested arrays and returns a single flat array
+as a result.
+
+*Examples:*
+
+    flatten(['a', ['b', ['c']]])
+
+Would return: ['a','b','c']
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "flatten(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size != 1
+
+    array = arguments[0]
+
+    unless array.is_a?(Array)
+      raise(Puppet::ParseError, 'flatten(): Requires array to work with')
+    end
+
+    result = array.flatten
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/floor.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/floor.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/floor.rb	(revision 30960)
@@ -0,0 +1,25 @@
+module Puppet::Parser::Functions
+  newfunction(:floor, :type => :rvalue, :doc => <<-EOS
+    Returns the largest integer less or equal to the argument.
+    Takes a single numeric value as an argument.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "floor(): Wrong number of arguments " +
+          "given (#{arguments.size} for 1)") if arguments.size != 1
+
+    begin
+      arg = Float(arguments[0])
+    rescue TypeError, ArgumentError => e
+      raise(Puppet::ParseError, "floor(): Wrong argument type " +
+            "given (#{arguments[0]} for Numeric)")
+    end
+
+    raise(Puppet::ParseError, "floor(): Wrong argument type " +
+          "given (#{arg.class} for Numeric)") if arg.is_a?(Numeric) == false
+
+    arg.floor
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/fqdn_rand_string.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/fqdn_rand_string.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/fqdn_rand_string.rb	(revision 30960)
@@ -0,0 +1,34 @@
+Puppet::Parser::Functions::newfunction(
+  :fqdn_rand_string,
+  :arity => -2,
+  :type => :rvalue,
+  :doc => "Usage: `fqdn_rand_string(LENGTH, [CHARSET], [SEED])`. LENGTH is
+  required and must be a positive integer. CHARSET is optional and may be
+  `undef` or a string. SEED is optional and may be any number or string.
+
+  Generates a random string LENGTH characters long using the character set
+  provided by CHARSET, combining the `$fqdn` fact and the value of SEED for
+  repeatable randomness. (That is, each node will get a different random
+  string from this function, but a given node's result will be the same every
+  time unless its hostname changes.) Adding a SEED can be useful if you need
+  more than one unrelated string. CHARSET will default to alphanumeric if
+  `undef` or an empty string.") do |args|
+    raise(ArgumentError, "fqdn_rand_string(): wrong number of arguments (0 for 1)") if args.size == 0
+    Puppet::Parser::Functions.function('is_integer')
+    raise(ArgumentError, "fqdn_rand_string(): first argument must be a positive integer") unless function_is_integer([args[0]]) and args[0].to_i > 0
+    raise(ArgumentError, "fqdn_rand_string(): second argument must be undef or a string") unless args[1].nil? or args[1].is_a? String
+
+    Puppet::Parser::Functions.function('fqdn_rand')
+
+    length = args.shift.to_i
+    charset = args.shift.to_s.chars.to_a
+
+    charset = (0..9).map { |i| i.to_s } + ('A'..'Z').to_a + ('a'..'z').to_a if charset.empty?
+
+    rand_string = ''
+    for current in 1..length
+      rand_string << charset[function_fqdn_rand([charset.size, (args + [current.to_s]).join(':')]).to_i]
+    end
+
+    rand_string
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/fqdn_rotate.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/fqdn_rotate.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/fqdn_rotate.rb	(revision 30960)
@@ -0,0 +1,63 @@
+#
+# fqdn_rotate.rb
+#
+
+Puppet::Parser::Functions.newfunction(
+  :fqdn_rotate,
+  :type => :rvalue,
+  :doc => "Usage: `fqdn_rotate(VALUE, [SEED])`. VALUE is required and
+  must be an array or a string. SEED is optional and may be any number
+  or string.
+
+  Rotates VALUE a random number of times, combining the `$fqdn` fact and
+  the value of SEED for repeatable randomness. (That is, each node will
+  get a different random rotation from this function, but a given node's
+  result will be the same every time unless its hostname changes.) Adding
+  a SEED can be useful if you need more than one unrelated rotation.") do |args|
+
+    raise(Puppet::ParseError, "fqdn_rotate(): Wrong number of arguments " +
+      "given (#{args.size} for 1)") if args.size < 1
+
+    value = args.shift
+    require 'digest/md5'
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'fqdn_rotate(): Requires either ' +
+        'array or string to work with')
+    end
+
+    result = value.clone
+
+    string = value.is_a?(String) ? true : false
+
+    # Check whether it makes sense to rotate ...
+    return result if result.size <= 1
+
+    # We turn any string value into an array to be able to rotate ...
+    result = string ? result.split('') : result
+
+    elements = result.size
+
+    seed = Digest::MD5.hexdigest([lookupvar('::fqdn'),args].join(':')).hex
+    # deterministic_rand() was added in Puppet 3.2.0; reimplement if necessary
+    if Puppet::Util.respond_to?(:deterministic_rand)
+      offset = Puppet::Util.deterministic_rand(seed, elements).to_i
+    else
+      if defined?(Random) == 'constant' && Random.class == Class
+        offset = Random.new(seed).rand(elements)
+      else
+        old_seed = srand(seed)
+        offset = rand(elements)
+        srand(old_seed)
+      end
+    end
+    offset.times {
+       result.push result.shift
+    }
+
+    result = string ? result.join : result
+
+    return result
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/get_module_path.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/get_module_path.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/get_module_path.rb	(revision 30960)
@@ -0,0 +1,17 @@
+module Puppet::Parser::Functions
+  newfunction(:get_module_path, :type =>:rvalue, :doc => <<-EOT
+    Returns the absolute path of the specified module for the current
+    environment.
+
+    Example:
+      $module_path = get_module_path('stdlib')
+  EOT
+  ) do |args|
+    raise(Puppet::ParseError, "get_module_path(): Wrong number of arguments, expects one") unless args.size == 1
+    if module_path = Puppet::Module.find(args[0], compiler.environment.to_s)
+      module_path.path
+    else
+      raise(Puppet::ParseError, "Could not find module #{args[0]} in environment #{compiler.environment}")
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/getparam.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/getparam.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/getparam.rb	(revision 30960)
@@ -0,0 +1,35 @@
+# Test whether a given class or definition is defined
+require 'puppet/parser/functions'
+
+Puppet::Parser::Functions.newfunction(:getparam,
+                                      :type => :rvalue,
+                                      :doc => <<-'ENDOFDOC'
+Takes a resource reference and name of the parameter and
+returns value of resource's parameter.
+
+*Examples:*
+
+    define example_resource($param) {
+    }
+
+    example_resource { "example_resource_instance":
+        param => "param_value"
+    }
+
+    getparam(Example_resource["example_resource_instance"], "param")
+
+Would return: param_value
+ENDOFDOC
+) do |vals|
+  reference, param = vals
+  raise(ArgumentError, 'Must specify a reference') unless reference
+  raise(ArgumentError, 'Must specify name of a parameter') unless param and param.instance_of? String
+
+  return '' if param.empty?
+
+  if resource = findresource(reference.to_s)
+    return resource[param] unless resource[param].nil?
+  end
+
+  return ''
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/getvar.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/getvar.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/getvar.rb	(revision 30960)
@@ -0,0 +1,35 @@
+module Puppet::Parser::Functions
+
+  newfunction(:getvar, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
+    Lookup a variable in a remote namespace.
+
+    For example:
+
+        $foo = getvar('site::data::foo')
+        # Equivalent to $foo = $site::data::foo
+
+    This is useful if the namespace itself is stored in a string:
+
+        $datalocation = 'site::data'
+        $bar = getvar("${datalocation}::bar")
+        # Equivalent to $bar = $site::data::bar
+    ENDHEREDOC
+
+    unless args.length == 1
+      raise Puppet::ParseError, ("getvar(): wrong number of arguments (#{args.length}; must be 1)")
+    end
+
+    begin
+      result = nil
+      catch(:undefined_variable) do
+        result = self.lookupvar("#{args[0]}")
+      end
+
+      # avoid relying on incosistent behaviour around ruby return values from catch
+      result
+    rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
+    end
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/grep.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/grep.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/grep.rb	(revision 30960)
@@ -0,0 +1,33 @@
+#
+# grep.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:grep, :type => :rvalue, :doc => <<-EOS
+This function searches through an array and returns any elements that match
+the provided regular expression.
+
+*Examples:*
+
+    grep(['aaa','bbb','ccc','aaaddd'], 'aaa')
+
+Would return:
+
+    ['aaa','aaaddd']
+    EOS
+  ) do |arguments|
+
+    if (arguments.size != 2) then
+      raise(Puppet::ParseError, "grep(): Wrong number of arguments "+
+        "given #{arguments.size} for 2")
+    end
+
+    a = arguments[0]
+    pattern = Regexp.new(arguments[1])
+
+    a.grep(pattern)
+
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/has_interface_with.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/has_interface_with.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/has_interface_with.rb	(revision 30960)
@@ -0,0 +1,71 @@
+#
+# has_interface_with
+#
+
+module Puppet::Parser::Functions
+  newfunction(:has_interface_with, :type => :rvalue, :doc => <<-EOS
+Returns boolean based on kind and value:
+  * macaddress
+  * netmask
+  * ipaddress
+  * network
+
+has_interface_with("macaddress", "x:x:x:x:x:x")
+has_interface_with("ipaddress", "127.0.0.1")    => true
+etc.
+
+If no "kind" is given, then the presence of the interface is checked:
+has_interface_with("lo")                        => true
+    EOS
+  ) do |args|
+
+    raise(Puppet::ParseError, "has_interface_with(): Wrong number of arguments " +
+          "given (#{args.size} for 1 or 2)") if args.size < 1 or args.size > 2
+
+    interfaces = lookupvar('interfaces')
+
+    # If we do not have any interfaces, then there are no requested attributes
+    return false if (interfaces == :undefined || interfaces.nil?)
+
+    interfaces = interfaces.split(',')
+
+    if args.size == 1
+      return interfaces.member?(args[0])
+    end
+
+    kind, value = args
+
+    # Bug with 3.7.1 - 3.7.3  when using future parser throws :undefined_variable
+    # https://tickets.puppetlabs.com/browse/PUP-3597
+    factval = nil
+    begin
+      catch :undefined_variable do
+        factval = lookupvar(kind)
+      end
+    rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
+    end
+    if factval == value
+      return true
+    end
+
+    result = false
+    interfaces.each do |iface|
+      iface.downcase!
+      factval = nil
+      begin
+        # Bug with 3.7.1 - 3.7.3 when using future parser throws :undefined_variable
+        # https://tickets.puppetlabs.com/browse/PUP-3597
+        catch :undefined_variable do
+          factval = lookupvar("#{kind}_#{iface}")
+        end
+      rescue Puppet::ParseError # Eat the exception if strict_variables = true is set
+      end
+      if value == factval
+        result = true
+        break
+      end
+    end
+
+    result
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/has_ip_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/has_ip_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/has_ip_address.rb	(revision 30960)
@@ -0,0 +1,25 @@
+#
+# has_ip_address
+#
+
+module Puppet::Parser::Functions
+  newfunction(:has_ip_address, :type => :rvalue, :doc => <<-EOS
+Returns true if the client has the requested IP address on some interface.
+
+This function iterates through the 'interfaces' fact and checks the
+'ipaddress_IFACE' facts, performing a simple string comparison.
+    EOS
+  ) do |args|
+
+    raise(Puppet::ParseError, "has_ip_address(): Wrong number of arguments " +
+          "given (#{args.size} for 1)") if args.size != 1
+
+    Puppet::Parser::Functions.autoloader.load(:has_interface_with) \
+      unless Puppet::Parser::Functions.autoloader.loaded?(:has_interface_with)
+
+    function_has_interface_with(['ipaddress', args[0]])
+
+  end
+end
+
+# vim:sts=2 sw=2
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/has_ip_network.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/has_ip_network.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/has_ip_network.rb	(revision 30960)
@@ -0,0 +1,25 @@
+#
+# has_ip_network
+#
+
+module Puppet::Parser::Functions
+  newfunction(:has_ip_network, :type => :rvalue, :doc => <<-EOS
+Returns true if the client has an IP address within the requested network.
+
+This function iterates through the 'interfaces' fact and checks the
+'network_IFACE' facts, performing a simple string comparision.
+    EOS
+  ) do |args|
+
+    raise(Puppet::ParseError, "has_ip_network(): Wrong number of arguments " +
+          "given (#{args.size} for 1)") if args.size != 1
+
+    Puppet::Parser::Functions.autoloader.load(:has_interface_with) \
+      unless Puppet::Parser::Functions.autoloader.loaded?(:has_interface_with)
+
+    function_has_interface_with(['network', args[0]])
+
+  end
+end
+
+# vim:sts=2 sw=2
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/has_key.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/has_key.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/has_key.rb	(revision 30960)
@@ -0,0 +1,28 @@
+module Puppet::Parser::Functions
+
+  newfunction(:has_key, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
+    Determine if a hash has a certain key value.
+
+    Example:
+
+        $my_hash = {'key_one' => 'value_one'}
+        if has_key($my_hash, 'key_two') {
+          notice('we will not reach here')
+        }
+        if has_key($my_hash, 'key_one') {
+          notice('this will be printed')
+        }
+
+    ENDHEREDOC
+
+    unless args.length == 2
+      raise Puppet::ParseError, ("has_key(): wrong number of arguments (#{args.length}; must be 2)")
+    end
+    unless args[0].is_a?(Hash)
+      raise Puppet::ParseError, "has_key(): expects the first argument to be a hash, got #{args[0].inspect} which is of type #{args[0].class}"
+    end
+    args[0].has_key?(args[1])
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/hash.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/hash.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/hash.rb	(revision 30960)
@@ -0,0 +1,41 @@
+#
+# hash.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:hash, :type => :rvalue, :doc => <<-EOS
+This function converts an array into a hash.
+
+*Examples:*
+
+    hash(['a',1,'b',2,'c',3])
+
+Would return: {'a'=>1,'b'=>2,'c'=>3}
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "hash(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    array = arguments[0]
+
+    unless array.is_a?(Array)
+      raise(Puppet::ParseError, 'hash(): Requires array to work with')
+    end
+
+    result = {}
+
+    begin
+      # This is to make it compatible with older version of Ruby ...
+      array  = array.flatten
+      result = Hash[*array]
+    rescue StandardError
+      raise(Puppet::ParseError, 'hash(): Unable to compute ' +
+        'hash from array given')
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/intersection.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/intersection.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/intersection.rb	(revision 30960)
@@ -0,0 +1,34 @@
+#
+# intersection.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:intersection, :type => :rvalue, :doc => <<-EOS
+This function returns an array of the intersection of two.
+
+*Examples:*
+
+    intersection(["a","b","c"],["b","c","d"])  # returns ["b","c"]
+    intersection(["a","b","c"],[1,2,3,4])      # returns [] (true, when evaluated as a Boolean)
+
+    EOS
+  ) do |arguments|
+
+    # Two arguments are required
+    raise(Puppet::ParseError, "intersection(): Wrong number of arguments " +
+      "given (#{arguments.size} for 2)") if arguments.size != 2
+
+    first = arguments[0]
+    second = arguments[1]
+
+    unless first.is_a?(Array) && second.is_a?(Array)
+      raise(Puppet::ParseError, 'intersection(): Requires 2 arrays')
+    end
+
+    result = first & second
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_absolute_path.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_absolute_path.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_absolute_path.rb	(revision 30960)
@@ -0,0 +1,50 @@
+module Puppet::Parser::Functions
+  newfunction(:is_absolute_path, :type => :rvalue, :arity => 1, :doc => <<-'ENDHEREDOC') do |args|
+    Returns boolean true if the string represents an absolute path in the filesystem.  This function works
+    for windows and unix style paths.
+
+    The following values will return true:
+
+        $my_path = 'C:/Program Files (x86)/Puppet Labs/Puppet'
+        is_absolute_path($my_path)
+        $my_path2 = '/var/lib/puppet'
+        is_absolute_path($my_path2)
+        $my_path3 = ['C:/Program Files (x86)/Puppet Labs/Puppet']
+        is_absolute_path($my_path3)
+        $my_path4 = ['/var/lib/puppet']
+        is_absolute_path($my_path4)
+
+    The following values will return false:
+
+        is_absolute_path(true)
+        is_absolute_path('../var/lib/puppet')
+        is_absolute_path('var/lib/puppet')
+        $undefined = undef
+        is_absolute_path($undefined)
+
+  ENDHEREDOC
+    function_deprecation([:is_absolute_path, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Absolute_path. There is further documentation for validate_legacy function in the README.'])
+    require 'puppet/util'
+
+    path = args[0]
+    # This logic was borrowed from
+    # [lib/puppet/file_serving/base.rb](https://github.com/puppetlabs/puppet/blob/master/lib/puppet/file_serving/base.rb)
+    # Puppet 2.7 and beyond will have Puppet::Util.absolute_path? Fall back to a back-ported implementation otherwise.
+    if Puppet::Util.respond_to?(:absolute_path?) then
+      value = (Puppet::Util.absolute_path?(path, :posix) or Puppet::Util.absolute_path?(path, :windows))
+    else
+      # This code back-ported from 2.7.x's lib/puppet/util.rb Puppet::Util.absolute_path?
+      # Determine in a platform-specific way whether a path is absolute. This
+      # defaults to the local platform if none is specified.
+      # Escape once for the string literal, and once for the regex.
+      slash = '[\\\\/]'
+      name = '[^\\\\/]+'
+      regexes = {
+        :windows => %r!^(([A-Z]:#{slash})|(#{slash}#{slash}#{name}#{slash}#{name})|(#{slash}#{slash}\?#{slash}#{name}))!i,
+        :posix => %r!^/!
+      }
+      value = (!!(path =~ regexes[:posix])) || (!!(path =~ regexes[:windows]))
+    end
+    value
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_array.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_array.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_array.rb	(revision 30960)
@@ -0,0 +1,22 @@
+#
+# is_array.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_array, :type => :rvalue, :doc => <<-EOS
+Returns true if the variable passed to this function is an array.
+    EOS
+  ) do |arguments|
+
+    function_deprecation([:is_array, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Array. There is further documentation for validate_legacy function in the README.'])
+
+    raise(Puppet::ParseError, "is_array(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    type = arguments[0]
+
+    result = type.is_a?(Array)
+
+    return result
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_bool.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_bool.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_bool.rb	(revision 30960)
@@ -0,0 +1,22 @@
+#
+# is_bool.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_bool, :type => :rvalue, :doc => <<-EOS
+Returns true if the variable passed to this function is a boolean.
+    EOS
+  ) do |arguments|
+
+    function_deprecation([:is_bool, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Bool. There is further documentation for validate_legacy function in the README.'])
+
+    raise(Puppet::ParseError, "is_bool(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size != 1
+
+    type = arguments[0]
+
+    result = type.is_a?(TrueClass) || type.is_a?(FalseClass)
+
+    return result
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_domain_name.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_domain_name.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_domain_name.rb	(revision 30960)
@@ -0,0 +1,54 @@
+#
+# is_domain_name.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_domain_name, :type => :rvalue, :doc => <<-EOS
+Returns true if the string passed to this function is a syntactically correct domain name.
+    EOS
+  ) do |arguments|
+
+    if (arguments.size != 1) then
+      raise(Puppet::ParseError, "is_domain_name(): Wrong number of arguments "+
+        "given #{arguments.size} for 1")
+    end
+
+    # Only allow string types
+    return false unless arguments[0].is_a?(String)
+
+    domain = arguments[0].dup
+
+    # Limits (rfc1035, 3.1)
+    domain_max_length=255
+    label_min_length=1
+    label_max_length=63
+
+    # Allow ".", it is the top level domain
+    return true if domain == '.'
+
+    # Remove the final dot, if present.
+    domain.chomp!('.')
+
+    # Check the whole domain
+    return false if domain.empty?
+    return false if domain.length > domain_max_length
+
+    # The top level domain must be alphabetic if there are multiple labels.
+    # See rfc1123, 2.1
+    return false if domain.include? '.' and not /\.[A-Za-z]+$/.match(domain)
+
+    # Check each label in the domain
+    labels = domain.split('.')
+    vlabels = labels.each do |label|
+      break if label.length < label_min_length
+      break if label.length > label_max_length
+      break if label[-1..-1] == '-'
+      break if label[0..0] == '-'
+      break unless /^[a-z\d-]+$/i.match(label)
+    end
+    return vlabels == labels
+
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_email_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_email_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_email_address.rb	(revision 30960)
@@ -0,0 +1,21 @@
+#
+# is_email_address.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_email_address, :type => :rvalue, :doc => <<-EOS
+Returns true if the string passed to this function is a valid email address.
+    EOS
+             ) do |arguments|
+    if arguments.size != 1
+      raise(Puppet::ParseError, 'is_email_address(): Wrong number of arguments '\
+        "given #{arguments.size} for 1")
+    end
+
+    # Taken from http://emailregex.com/ (simpler regex)
+    valid_email_regex = %r{\A([\w+\-].?)+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z}
+    return (arguments[0] =~ valid_email_regex) == 0
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_float.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_float.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_float.rb	(revision 30960)
@@ -0,0 +1,32 @@
+#
+# is_float.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_float, :type => :rvalue, :doc => <<-EOS
+Returns true if the variable passed to this function is a float.
+    EOS
+  ) do |arguments|
+
+    function_deprecation([:is_float, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Float. There is further documentation for validate_legacy function in the README.'])
+
+    if (arguments.size != 1) then
+      raise(Puppet::ParseError, "is_float(): Wrong number of arguments "+
+        "given #{arguments.size} for 1")
+    end
+
+    value = arguments[0]
+
+    # Only allow Numeric or String types
+    return false unless value.is_a?(Numeric) or value.is_a?(String)
+
+    if value != value.to_f.to_s and !value.is_a? Float then
+      return false
+    else
+      return true
+    end
+
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_function_available.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_function_available.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_function_available.rb	(revision 30960)
@@ -0,0 +1,26 @@
+#
+# is_function_available.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_function_available, :type => :rvalue, :doc => <<-EOS
+This function accepts a string as an argument, determines whether the
+Puppet runtime has access to a function by that name.  It returns a
+true if the function exists, false if not.
+    EOS
+  ) do |arguments|
+
+    if (arguments.size != 1) then
+      raise(Puppet::ParseError, "is_function_available?(): Wrong number of arguments "+
+        "given #{arguments.size} for 1")
+    end
+
+    # Only allow String types
+    return false unless arguments[0].is_a?(String)
+
+    function = Puppet::Parser::Functions.function(arguments[0].to_sym)
+    function.is_a?(String) and not function.empty?
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_hash.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_hash.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_hash.rb	(revision 30960)
@@ -0,0 +1,22 @@
+#
+# is_hash.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_hash, :type => :rvalue, :doc => <<-EOS
+Returns true if the variable passed to this function is a hash.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "is_hash(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size != 1
+
+    type = arguments[0]
+
+    result = type.is_a?(Hash)
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_integer.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_integer.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_integer.rb	(revision 30960)
@@ -0,0 +1,47 @@
+#
+# is_integer.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_integer, :type => :rvalue, :doc => <<-EOS
+Returns true if the variable passed to this function is an Integer or
+a decimal (base 10) integer in String form. The string may
+start with a '-' (minus). A value of '0' is allowed, but a leading '0' digit may not
+be followed by other digits as this indicates that the value is octal (base 8).
+
+If given any other argument `false` is returned.
+    EOS
+  ) do |arguments|
+
+    function_deprecation([:is_integer, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Integer. There is further documentation for validate_legacy function in the README.'])
+
+    if (arguments.size != 1) then
+      raise(Puppet::ParseError, "is_integer(): Wrong number of arguments "+
+        "given #{arguments.size} for 1")
+    end
+
+    value = arguments[0]
+
+    # Regex is taken from the lexer of puppet
+    # puppet/pops/parser/lexer.rb but modified to match also
+    # negative values and disallow numbers prefixed with multiple
+    # 0's
+    #
+    # TODO these parameter should be a constant but I'm not sure
+    # if there is no risk to declare it inside of the module
+    # Puppet::Parser::Functions
+
+    # Integer numbers like
+    # -1234568981273
+    # 47291
+    numeric = %r{^-?(?:(?:[1-9]\d*)|0)$}
+
+    if value.is_a? Integer or (value.is_a? String and value.match numeric)
+      return true
+    else
+      return false
+    end
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_ip_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_ip_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_ip_address.rb	(revision 30960)
@@ -0,0 +1,34 @@
+#
+# is_ip_address.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_ip_address, :type => :rvalue, :doc => <<-EOS
+Returns true if the string passed to this function is a valid IP address.
+    EOS
+  ) do |arguments|
+
+    require 'ipaddr'
+
+    function_deprecation([:is_ip_address, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ip_address. There is further documentation for validate_legacy function in the README.'])
+
+    if (arguments.size != 1) then
+      raise(Puppet::ParseError, "is_ip_address(): Wrong number of arguments "+
+        "given #{arguments.size} for 1")
+    end
+
+    begin
+      ip = IPAddr.new(arguments[0])
+    rescue ArgumentError
+      return false
+    end
+
+    if ip.ipv4? or ip.ipv6? then
+      return true
+    else
+      return false
+    end
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_ipv4_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_ipv4_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_ipv4_address.rb	(revision 30960)
@@ -0,0 +1,30 @@
+#
+# is_ipv4_address.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_ipv4_address, :type => :rvalue, :doc => <<-EOS
+Returns true if the string passed to this function is a valid IPv4 address.
+    EOS
+  ) do |arguments|
+
+    require 'ipaddr'
+
+    function_deprecation([:is_ipv4_address, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ipv4. There is further documentation for validate_legacy function in the README.'])
+
+    if (arguments.size != 1) then
+      raise(Puppet::ParseError, "is_ipv4_address(): Wrong number of arguments "+
+        "given #{arguments.size} for 1")
+    end
+
+    begin
+      ip = IPAddr.new(arguments[0])
+    rescue ArgumentError
+      return false
+    end
+
+    return ip.ipv4?
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_ipv6_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_ipv6_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_ipv6_address.rb	(revision 30960)
@@ -0,0 +1,30 @@
+#
+# is_ipv6_address.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_ipv6_address, :type => :rvalue, :doc => <<-EOS
+Returns true if the string passed to this function is a valid IPv6 address.
+    EOS
+  ) do |arguments|
+
+    function_deprecation([:is_ipv6_address, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ipv6. There is further documentation for validate_legacy function in the README.'])
+
+    require 'ipaddr'
+
+    if (arguments.size != 1) then
+      raise(Puppet::ParseError, "is_ipv6_address(): Wrong number of arguments "+
+        "given #{arguments.size} for 1")
+    end
+
+    begin
+      ip = IPAddr.new(arguments[0])
+    rescue ArgumentError
+      return false
+    end
+
+    return ip.ipv6?
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_mac_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_mac_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_mac_address.rb	(revision 30960)
@@ -0,0 +1,27 @@
+#
+# is_mac_address.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_mac_address, :type => :rvalue, :doc => <<-EOS
+Returns true if the string passed to this function is a valid mac address.
+    EOS
+  ) do |arguments|
+
+    if (arguments.size != 1) then
+      raise(Puppet::ParseError, "is_mac_address(): Wrong number of arguments "+
+        "given #{arguments.size} for 1")
+    end
+
+    mac = arguments[0]
+
+    if /^[a-f0-9]{1,2}(:[a-f0-9]{1,2}){5}$/i.match(mac) then
+      return true
+    else
+      return false
+    end
+
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_numeric.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_numeric.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_numeric.rb	(revision 30960)
@@ -0,0 +1,75 @@
+#
+# is_numeric.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_numeric, :type => :rvalue, :doc => <<-EOS
+Returns true if the given argument is a Numeric (Integer or Float),
+or a String containing either a valid integer in decimal base 10 form, or
+a valid floating point string representation.
+
+The function recognizes only decimal (base 10) integers and float but not
+integers in hex (base 16) or octal (base 8) form.
+
+The string representation may start with a '-' (minus). If a decimal '.' is used,
+it must be followed by at least one digit.
+
+Valid examples:
+
+  77435
+  10e-12
+  -8475
+  0.2343
+  -23.561e3
+    EOS
+  ) do |arguments|
+
+    function_deprecation([:is_numeric, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Numeric. There is further documentation for validate_legacy function in the README.'])
+
+    if (arguments.size != 1) then
+      raise(Puppet::ParseError, "is_numeric(): Wrong number of arguments "+
+        "given #{arguments.size} for 1")
+    end
+
+    value = arguments[0]
+
+    # Regex is taken from the lexer of puppet
+    # puppet/pops/parser/lexer.rb but modified to match also
+    # negative values and disallow invalid octal numbers or
+    # numbers prefixed with multiple 0's (except in hex numbers)
+    #
+    # TODO these parameters should be constants but I'm not sure
+    # if there is no risk to declare them inside of the module
+    # Puppet::Parser::Functions
+
+    # TODO decide if this should be used
+    # HEX numbers like
+    # 0xaa230F
+    # 0X1234009C
+    # 0x0012
+    # -12FcD
+    #numeric_hex = %r{^-?0[xX][0-9A-Fa-f]+$}
+
+    # TODO decide if this should be used
+    # OCTAL numbers like
+    # 01234567
+    # -045372
+    #numeric_oct = %r{^-?0[1-7][0-7]*$}
+
+    # Integer/Float numbers like
+    # -0.1234568981273
+    # 47291
+    # 42.12345e-12
+    numeric = %r{^-?(?:(?:[1-9]\d*)|0)(?:\.\d+)?(?:[eE]-?\d+)?$}
+
+    if value.is_a? Numeric or (value.is_a? String and (
+      value.match(numeric) #or
+    #  value.match(numeric_hex) or
+    #  value.match(numeric_oct)
+    ))
+      return true
+    else
+      return false
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_string.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_string.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/is_string.rb	(revision 30960)
@@ -0,0 +1,29 @@
+#
+# is_string.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:is_string, :type => :rvalue, :doc => <<-EOS
+Returns true if the variable passed to this function is a string.
+    EOS
+  ) do |arguments|
+
+    function_deprecation([:is_string, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::String. There is further documentation for validate_legacy function in the README.'])
+
+    raise(Puppet::ParseError, "is_string(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    type = arguments[0]
+
+    # when called through the v4 API shim, undef gets translated to nil
+    result = type.is_a?(String) || type.nil?
+
+    if result and (type == type.to_f.to_s or type == type.to_i.to_s) then
+      return false
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/join.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/join.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/join.rb	(revision 30960)
@@ -0,0 +1,41 @@
+#
+# join.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:join, :type => :rvalue, :doc => <<-EOS
+This function joins an array into a string using a separator.
+
+*Examples:*
+
+    join(['a','b','c'], ",")
+
+Would result in: "a,b,c"
+    EOS
+  ) do |arguments|
+
+    # Technically we support two arguments but only first is mandatory ...
+    raise(Puppet::ParseError, "join(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    array = arguments[0]
+
+    unless array.is_a?(Array)
+      raise(Puppet::ParseError, 'join(): Requires array to work with')
+    end
+
+    suffix = arguments[1] if arguments[1]
+
+    if suffix
+      unless suffix.is_a?(String)
+        raise(Puppet::ParseError, 'join(): Requires string to work with')
+      end
+    end
+
+    result = suffix ? array.join(suffix) : array.join
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/join_keys_to_values.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/join_keys_to_values.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/join_keys_to_values.rb	(revision 30960)
@@ -0,0 +1,47 @@
+#
+# join.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:join_keys_to_values, :type => :rvalue, :doc => <<-EOS
+This function joins each key of a hash to that key's corresponding value with a
+separator. Keys and values are cast to strings. The return value is an array in
+which each element is one joined key/value pair.
+
+*Examples:*
+
+    join_keys_to_values({'a'=>1,'b'=>2}, " is ")
+
+Would result in: ["a is 1","b is 2"]
+    EOS
+  ) do |arguments|
+
+    # Validate the number of arguments.
+    if arguments.size != 2
+      raise(Puppet::ParseError, "join_keys_to_values(): Takes exactly two " +
+            "arguments, but #{arguments.size} given.")
+    end
+
+    # Validate the first argument.
+    hash = arguments[0]
+    if not hash.is_a?(Hash)
+      raise(TypeError, "join_keys_to_values(): The first argument must be a " +
+            "hash, but a #{hash.class} was given.")
+    end
+
+    # Validate the second argument.
+    separator = arguments[1]
+    if not separator.is_a?(String)
+      raise(TypeError, "join_keys_to_values(): The second argument must be a " +
+            "string, but a #{separator.class} was given.")
+    end
+
+    # Join the keys to their values.
+    hash.map do |k,v|
+      String(k) + separator + String(v)
+    end
+
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/keys.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/keys.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/keys.rb	(revision 30960)
@@ -0,0 +1,26 @@
+#
+# keys.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:keys, :type => :rvalue, :doc => <<-EOS
+Returns the keys of a hash as an array.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "keys(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    hash = arguments[0]
+
+    unless hash.is_a?(Hash)
+      raise(Puppet::ParseError, 'keys(): Requires hash to work with')
+    end
+
+    result = hash.keys
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/load_module_metadata.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/load_module_metadata.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/load_module_metadata.rb	(revision 30960)
@@ -0,0 +1,24 @@
+module Puppet::Parser::Functions
+  newfunction(:load_module_metadata, :type => :rvalue, :doc => <<-EOT
+  EOT
+  ) do |args|
+    raise(Puppet::ParseError, "load_module_metadata(): Wrong number of arguments, expects one or two") unless [1,2].include?(args.size)
+    mod = args[0]
+    allow_empty_metadata = args[1]
+    module_path = function_get_module_path([mod])
+    metadata_json = File.join(module_path, 'metadata.json')
+
+    metadata_exists = File.exists?(metadata_json)
+    if metadata_exists
+      metadata = PSON.load(File.read(metadata_json))
+    else
+      if allow_empty_metadata
+        metadata = {}
+      else
+        raise(Puppet::ParseError, "load_module_metadata(): No metadata.json file for module #{mod}")
+      end
+    end
+
+    return metadata
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/loadjson.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/loadjson.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/loadjson.rb	(revision 30960)
@@ -0,0 +1,34 @@
+module Puppet::Parser::Functions
+  newfunction(:loadjson, :type => :rvalue, :arity => -2, :doc => <<-'ENDHEREDOC') do |args|
+Load a JSON file containing an array, string, or hash, and return the data
+in the corresponding native data type.
+The second parameter is the default value. It will be returned if the file
+was not found or could not be parsed.
+
+For example:
+
+    $myhash = loadjson('/etc/puppet/data/myhash.json')
+    $myhash = loadjson('no-file.json', {'default' => 'value'})
+  ENDHEREDOC
+
+    raise ArgumentError, 'Wrong number of arguments. 1 or 2 arguments should be provided.' unless args.length >= 1
+
+    if File.exists?(args[0])
+      begin
+        content = File.read(args[0])
+        PSON::load(content) || args[1]
+      rescue Exception => e
+        if args[1]
+          args[1]
+        else
+          raise e
+        end
+      end
+    else
+      warning("Can't load '#{args[0]}' File does not exist!")
+      args[1]
+    end
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/loadyaml.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/loadyaml.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/loadyaml.rb	(revision 30960)
@@ -0,0 +1,34 @@
+module Puppet::Parser::Functions
+  newfunction(:loadyaml, :type => :rvalue, :arity => -2, :doc => <<-'ENDHEREDOC') do |args|
+Load a YAML file containing an array, string, or hash, and return the data
+in the corresponding native data type.
+The second parameter is the default value. It will be returned if the file
+was not found or could not be parsed.
+
+For example:
+
+    $myhash = loadyaml('/etc/puppet/data/myhash.yaml')
+    $myhash = loadyaml('no-file.yaml', {'default' => 'value'})
+  ENDHEREDOC
+
+    raise ArgumentError, 'Wrong number of arguments. 1 or 2 arguments should be provided.' unless args.length >= 1
+    require 'yaml'
+
+    if File.exists?(args[0])
+      begin
+        YAML::load_file(args[0]) || args[1]
+      rescue Exception => e
+        if args[1]
+          args[1]
+        else
+          raise e
+        end
+      end
+    else
+      warning("Can't load '#{args[0]}' File does not exist!")
+      args[1]
+    end
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/lstrip.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/lstrip.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/lstrip.rb	(revision 30960)
@@ -0,0 +1,32 @@
+#
+#  lstrip.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:lstrip, :type => :rvalue, :doc => <<-EOS
+Strips leading spaces to the left of a string.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "lstrip(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'lstrip(): Requires either ' +
+        'array or string to work with')
+    end
+
+    if value.is_a?(Array)
+      # Numbers in Puppet are often string-encoded which is troublesome ...
+      result = value.collect { |i| i.is_a?(String) ? i.lstrip : i }
+    else
+      result = value.lstrip
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/max.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/max.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/max.rb	(revision 30960)
@@ -0,0 +1,21 @@
+module Puppet::Parser::Functions
+  newfunction(:max, :type => :rvalue, :doc => <<-EOS
+    Returns the highest value of all arguments.
+    Requires at least one argument.
+    EOS
+  ) do |args|
+
+    raise(Puppet::ParseError, "max(): Wrong number of arguments " +
+          "need at least one") if args.size == 0
+
+    # Sometimes we get numbers as numerics and sometimes as strings.
+    # We try to compare them as numbers when possible
+    return args.max do |a,b|
+      if a.to_s =~ /\A-?\d+(.\d+)?\z/ and b.to_s =~ /\A-?\d+(.\d+)?\z/ then
+        a.to_f <=> b.to_f
+      else
+        a.to_s <=> b.to_s
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/member.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/member.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/member.rb	(revision 30960)
@@ -0,0 +1,62 @@
+#
+# member.rb
+#
+
+# TODO(Krzysztof Wilczynski): We need to add support for regular expression ...
+# TODO(Krzysztof Wilczynski): Support for strings and hashes too ...
+
+module Puppet::Parser::Functions
+  newfunction(:member, :type => :rvalue, :doc => <<-EOS
+This function determines if a variable is a member of an array.
+The variable can be a string, fixnum, or array.
+
+*Examples:*
+
+    member(['a','b'], 'b')
+
+Would return: true
+
+    member(['a', 'b', 'c'], ['a', 'b'])
+
+would return: true
+
+    member(['a','b'], 'c')
+
+Would return: false
+
+    member(['a', 'b', 'c'], ['d', 'b'])
+
+would return: false
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "member(): Wrong number of arguments " +
+      "given (#{arguments.size} for 2)") if arguments.size < 2
+
+    array = arguments[0]
+
+    unless array.is_a?(Array)
+      raise(Puppet::ParseError, 'member(): Requires array to work with')
+    end
+
+    unless arguments[1].is_a? String or arguments[1].is_a? Fixnum or arguments[1].is_a? Array
+      raise(Puppet::ParseError, 'member(): Item to search for must be a string, fixnum, or array')
+    end
+
+    if arguments[1].is_a? String or arguments[1].is_a? Fixnum
+      item = [arguments[1]]
+    else
+      item = arguments[1]
+    end
+
+
+    raise(Puppet::ParseError, 'member(): You must provide item ' +
+      'to search for within array given') if item.respond_to?('empty?') && item.empty?
+
+    result = (item - array).empty?
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/merge.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/merge.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/merge.rb	(revision 30960)
@@ -0,0 +1,34 @@
+module Puppet::Parser::Functions
+  newfunction(:merge, :type => :rvalue, :doc => <<-'ENDHEREDOC') do |args|
+    Merges two or more hashes together and returns the resulting hash.
+
+    For example:
+
+        $hash1 = {'one' => 1, 'two', => 2}
+        $hash2 = {'two' => 'dos', 'three', => 'tres'}
+        $merged_hash = merge($hash1, $hash2)
+        # The resulting hash is equivalent to:
+        # $merged_hash =  {'one' => 1, 'two' => 'dos', 'three' => 'tres'}
+
+    When there is a duplicate key, the key in the rightmost hash will "win."
+
+    ENDHEREDOC
+
+    if args.length < 2
+      raise Puppet::ParseError, ("merge(): wrong number of arguments (#{args.length}; must be at least 2)")
+    end
+
+    # The hash we accumulate into
+    accumulator = Hash.new
+    # Merge into the accumulator hash
+    args.each do |arg|
+      next if arg.is_a? String and arg.empty? # empty string is synonym for puppet's undef
+      unless arg.is_a?(Hash)
+        raise Puppet::ParseError, "merge: unexpected argument type #{arg.class}, only expects hash arguments"
+      end
+      accumulator.merge!(arg)
+    end
+    # Return the fully merged hash
+    accumulator
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/min.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/min.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/min.rb	(revision 30960)
@@ -0,0 +1,21 @@
+module Puppet::Parser::Functions
+  newfunction(:min, :type => :rvalue, :doc => <<-EOS
+    Returns the lowest value of all arguments.
+    Requires at least one argument.
+    EOS
+  ) do |args|
+
+    raise(Puppet::ParseError, "min(): Wrong number of arguments " +
+          "need at least one") if args.size == 0
+
+    # Sometimes we get numbers as numerics and sometimes as strings.
+    # We try to compare them as numbers when possible
+    return args.min do |a,b|
+      if a.to_s =~ /\A^-?\d+(.\d+)?\z/ and b.to_s =~ /\A-?\d+(.\d+)?\z/ then
+        a.to_f <=> b.to_f
+      else
+        a.to_s <=> b.to_s
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/num2bool.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/num2bool.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/num2bool.rb	(revision 30960)
@@ -0,0 +1,43 @@
+#
+# num2bool.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:num2bool, :type => :rvalue, :doc => <<-EOS
+This function converts a number or a string representation of a number into a
+true boolean. Zero or anything non-numeric becomes false. Numbers higher then 0
+become true.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "num2bool(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size != 1
+
+    number = arguments[0]
+
+    case number
+    when Numeric
+      # Yay, it's a number
+    when String
+      begin
+        number = Float(number)
+      rescue ArgumentError => ex
+        raise(Puppet::ParseError, "num2bool(): '#{number}' does not look like a number: #{ex.message}")
+      end
+    else
+      begin
+        number = number.to_s
+      rescue NoMethodError => ex
+        raise(Puppet::ParseError, "num2bool(): Unable to parse argument: #{ex.message}")
+      end
+    end
+
+    # Truncate Floats
+    number = number.to_i
+
+    # Return true for any positive number and false otherwise
+    return number > 0
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/parsejson.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/parsejson.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/parsejson.rb	(revision 30960)
@@ -0,0 +1,29 @@
+#
+# parsejson.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:parsejson, :type => :rvalue, :doc => <<-EOS
+This function accepts JSON as a string and converts it into the correct
+Puppet structure.
+
+The optional second argument can be used to pass a default value that will
+be returned if the parsing of YAML string have failed.
+  EOS
+  ) do |arguments|
+    raise ArgumentError, 'Wrong number of arguments. 1 or 2 arguments should be provided.' unless arguments.length >= 1
+
+    begin
+      PSON::load(arguments[0]) || arguments[1]
+    rescue StandardError => e
+      if arguments[1]
+        arguments[1]
+      else
+        raise e
+      end
+    end
+
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/parseyaml.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/parseyaml.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/parseyaml.rb	(revision 30960)
@@ -0,0 +1,33 @@
+#
+# parseyaml.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:parseyaml, :type => :rvalue, :doc => <<-EOS
+This function accepts YAML as a string and converts it into the correct
+Puppet structure.
+
+The optional second argument can be used to pass a default value that will
+be returned if the parsing of YAML string have failed.
+  EOS
+  ) do |arguments|
+    raise ArgumentError, 'Wrong number of arguments. 1 or 2 arguments should be provided.' unless arguments.length >= 1
+    require 'yaml'
+
+    begin
+      YAML::load(arguments[0]) || arguments[1]
+      # in ruby 1.9.3 Psych::SyntaxError is a RuntimeException
+      # this still needs to catch that and work also on rubies that
+      # do not have Psych available.
+    rescue StandardError, Psych::SyntaxError => e
+      if arguments[1]
+        arguments[1]
+      else
+        raise e
+      end
+    end
+
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/pick.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/pick.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/pick.rb	(revision 30960)
@@ -0,0 +1,29 @@
+module Puppet::Parser::Functions
+ newfunction(:pick, :type => :rvalue, :doc => <<-EOS
+
+This function is similar to a coalesce function in SQL in that it will return
+the first value in a list of values that is not undefined or an empty string
+(two things in Puppet that will return a boolean false value). Typically,
+this function is used to check for a value in the Puppet Dashboard/Enterprise
+Console, and failover to a default value like the following:
+
+  $real_jenkins_version = pick($::jenkins_version, '1.449')
+
+The value of $real_jenkins_version will first look for a top-scope variable
+called 'jenkins_version' (note that parameters set in the Puppet Dashboard/
+Enterprise Console are brought into Puppet as top-scope variables), and,
+failing that, will use a default value of 1.449.
+
+EOS
+) do |args|
+   args = args.compact
+   args.delete(:undef)
+   args.delete(:undefined)
+   args.delete("")
+   if args[0].to_s.empty? then
+     fail Puppet::ParseError, "pick(): must receive at least one non empty value"
+   else
+     return args[0]
+   end
+ end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/pick_default.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/pick_default.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/pick_default.rb	(revision 30960)
@@ -0,0 +1,35 @@
+module Puppet::Parser::Functions
+ newfunction(:pick_default, :type => :rvalue, :doc => <<-EOS
+
+This function is similar to a coalesce function in SQL in that it will return
+the first value in a list of values that is not undefined or an empty string
+(two things in Puppet that will return a boolean false value). If no value is
+found, it will return the last argument.
+
+Typically, this function is used to check for a value in the Puppet
+Dashboard/Enterprise Console, and failover to a default value like the
+following:
+
+  $real_jenkins_version = pick_default($::jenkins_version, '1.449')
+
+The value of $real_jenkins_version will first look for a top-scope variable
+called 'jenkins_version' (note that parameters set in the Puppet Dashboard/
+Enterprise Console are brought into Puppet as top-scope variables), and,
+failing that, will use a default value of 1.449.
+
+Note that, contrary to the pick() function, the pick_default does not fail if
+all arguments are empty. This allows pick_default to use an empty value as
+default.
+
+EOS
+) do |args|
+   fail "Must receive at least one argument." if args.empty?
+   default = args.last
+   args = args[0..-2].compact
+   args.delete(:undef)
+   args.delete(:undefined)
+   args.delete("")
+   args << default
+   return args[0]
+ end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/prefix.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/prefix.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/prefix.rb	(revision 30960)
@@ -0,0 +1,52 @@
+#
+# prefix.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:prefix, :type => :rvalue, :doc => <<-EOS
+This function applies a prefix to all elements in an array or a hash.
+
+*Examples:*
+
+    prefix(['a','b','c'], 'p')
+
+Will return: ['pa','pb','pc']
+    EOS
+  ) do |arguments|
+
+    # Technically we support two arguments but only first is mandatory ...
+    raise(Puppet::ParseError, "prefix(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    enumerable = arguments[0]
+
+    unless enumerable.is_a?(Array) or enumerable.is_a?(Hash)
+      raise Puppet::ParseError, "prefix(): expected first argument to be an Array or a Hash, got #{enumerable.inspect}"
+    end
+
+    prefix = arguments[1] if arguments[1]
+
+    if prefix
+      unless prefix.is_a?(String)
+        raise Puppet::ParseError, "prefix(): expected second argument to be a String, got #{prefix.inspect}"
+      end
+    end
+
+    if enumerable.is_a?(Array)
+      # Turn everything into string same as join would do ...
+      result = enumerable.collect do |i|
+        i = i.to_s
+        prefix ? prefix + i : i
+      end
+    else
+      result = Hash[enumerable.map do |k,v|
+        k = k.to_s
+        [ prefix ? prefix + k : k, v ]
+      end]
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/private.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/private.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/private.rb	(revision 30960)
@@ -0,0 +1,17 @@
+#
+# private.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:private, :doc => <<-'EOS'
+    DEPRECATED: Sets the current class or definition as private.
+    Calling the class or definition from outside the current module will fail.
+  EOS
+  ) do |args|
+    warning("private() DEPRECATED: This function will cease to function on Puppet 4; please use assert_private() before upgrading to puppet 4 for backwards-compatibility, or migrate to the new parser's typing system.")
+    if !Puppet::Parser::Functions.autoloader.loaded?(:assert_private)
+      Puppet::Parser::Functions.autoloader.load(:assert_private)
+    end
+    function_assert_private([(args[0] unless args.size < 1)])
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/pw_hash.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/pw_hash.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/pw_hash.rb	(revision 30960)
@@ -0,0 +1,56 @@
+Puppet::Parser::Functions::newfunction(
+  :pw_hash,
+  :type => :rvalue,
+  :arity => 3,
+  :doc => "Hashes a password using the crypt function. Provides a hash
+  usable on most POSIX systems.
+
+  The first argument to this function is the password to hash. If it is
+  undef or an empty string, this function returns undef.
+
+  The second argument to this function is which type of hash to use. It
+  will be converted into the appropriate crypt(3) hash specifier. Valid
+  hash types are:
+
+  |Hash type            |Specifier|
+  |---------------------|---------|
+  |MD5                  |1        |
+  |SHA-256              |5        |
+  |SHA-512 (recommended)|6        |
+
+  The third argument to this function is the salt to use.
+
+  Note: this uses the Puppet Master's implementation of crypt(3). If your
+  environment contains several different operating systems, ensure that they
+  are compatible before using this function.") do |args|
+    raise ArgumentError, "pw_hash(): wrong number of arguments (#{args.size} for 3)" if args.size != 3
+    raise ArgumentError, "pw_hash(): first argument must be a string" unless args[0].is_a? String or args[0].nil?
+    raise ArgumentError, "pw_hash(): second argument must be a string" unless args[1].is_a? String
+    hashes = { 'md5'     => '1',
+               'sha-256' => '5',
+               'sha-512' => '6' }
+    hash_type = hashes[args[1].downcase]
+    raise ArgumentError, "pw_hash(): #{args[1]} is not a valid hash type" if hash_type.nil?
+    raise ArgumentError, "pw_hash(): third argument must be a string" unless args[2].is_a? String
+    raise ArgumentError, "pw_hash(): third argument must not be empty" if args[2].empty?
+    raise ArgumentError, "pw_hash(): characters in salt must be in the set [a-zA-Z0-9./]" unless args[2].match(/\A[a-zA-Z0-9.\/]+\z/)
+
+    password = args[0]
+    return nil if password.nil? or password.empty?
+
+    salt = "$#{hash_type}$#{args[2]}"
+
+    # handle weak implementations of String#crypt
+    if 'test'.crypt('$1$1') != '$1$1$Bp8CU9Oujr9SSEw53WV6G.'
+      # JRuby < 1.7.17
+      if RUBY_PLATFORM == 'java'
+        # puppetserver bundles Apache Commons Codec
+        org.apache.commons.codec.digest.Crypt.crypt(password.to_java_bytes, salt)
+      else
+        # MS Windows and other systems that don't support enhanced salts
+        raise Puppet::ParseError, 'system does not support enhanced salts'
+      end
+    else
+      password.crypt(salt)
+    end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/range.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/range.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/range.rb	(revision 30960)
@@ -0,0 +1,87 @@
+#
+# range.rb
+#
+
+# TODO(Krzysztof Wilczynski): We probably need to approach numeric values differently ...
+
+module Puppet::Parser::Functions
+  newfunction(:range, :type => :rvalue, :doc => <<-EOS
+When given range in the form of (start, stop) it will extrapolate a range as
+an array.
+
+*Examples:*
+
+    range("0", "9")
+
+Will return: [0,1,2,3,4,5,6,7,8,9]
+
+    range("00", "09")
+
+Will return: [0,1,2,3,4,5,6,7,8,9] (Zero padded strings are converted to
+integers automatically)
+
+    range("a", "c")
+
+Will return: ["a","b","c"]
+
+    range("host01", "host10")
+Will return: ["host01", "host02", ..., "host09", "host10"]
+NB Be explicit in including trailing zeros. Otherwise the underlying ruby function will fail.
+
+Passing a third argument will cause the generated range to step by that
+interval, e.g.
+
+    range("0", "9", "2")
+
+Will return: [0,2,4,6,8]
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, 'range(): Wrong number of ' +
+      'arguments given (0 for 1)') if arguments.size == 0
+
+    if arguments.size > 1
+      start = arguments[0]
+      stop  = arguments[1]
+      step  = arguments[2].nil? ? 1 : arguments[2].to_i.abs
+
+      type = '..' # Use the simplest type of Range available in Ruby
+
+    else # arguments.size == 1
+      value = arguments[0]
+
+      if m = value.match(/^(\w+)(\.\.\.?|\-)(\w+)$/)
+        start = m[1]
+        stop  = m[3]
+
+        type = m[2]
+        step = 1
+      elsif value.match(/^.+$/)
+        raise(Puppet::ParseError, "range(): Unable to compute range " +
+          "from the value: #{value}")
+      else
+        raise(Puppet::ParseError, "range(): Unknown range format: #{value}")
+      end
+    end
+
+    # If we were given an integer, ensure we work with one
+    if start.to_s.match(/^\d+$/)
+      start = start.to_i
+      stop  = stop.to_i
+    else
+      start = start.to_s
+      stop  = stop.to_s
+    end
+
+    range = case type
+      when /^(\.\.|\-)$/ then (start .. stop)
+      when '...'         then (start ... stop) # Exclusive of last element
+    end
+
+    result = range.step(step).to_a
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/regexpescape.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/regexpescape.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/regexpescape.rb	(revision 30960)
@@ -0,0 +1,31 @@
+#
+#  regexpescape.rb
+#
+module Puppet::Parser::Functions
+  newfunction(:regexpescape, :type => :rvalue, :doc => <<-EOS
+    Regexp escape a string or array of strings.
+    Requires either a single string or an array as an input.
+    EOS
+  ) do |arguments| # rubocop:disable Style/ClosingParenthesisIndentation
+    raise(Puppet::ParseError, 'regexpescape(): Wrong number of arguments ' \
+      "given (#{arguments.size} for 1)") if arguments.empty?
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'regexpescape(): Requires either ' \
+        'array or string to work with')
+    end
+
+    result = if value.is_a?(Array)
+               # Numbers in Puppet are often string-encoded which is troublesome ...
+               value.collect { |i| i.is_a?(String) ? Regexp.escape(i) : i }
+             else
+               Regexp.escape(value)
+             end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/reject.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/reject.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/reject.rb	(revision 30960)
@@ -0,0 +1,31 @@
+#
+# reject.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:reject, :type => :rvalue, :doc => <<-EOS) do |args|
+This function searches through an array and rejects all elements that match
+the provided regular expression.
+
+*Examples:*
+
+    reject(['aaa','bbb','ccc','aaaddd'], 'aaa')
+
+Would return:
+
+    ['bbb','ccc']
+EOS
+
+    if (args.size != 2)
+      raise Puppet::ParseError,
+        "reject(): Wrong number of arguments given #{args.size} for 2"
+    end
+
+    ary = args[0]
+    pattern = Regexp.new(args[1])
+
+    ary.reject { |e| e =~ pattern }
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/reverse.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/reverse.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/reverse.rb	(revision 30960)
@@ -0,0 +1,27 @@
+#
+# reverse.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:reverse, :type => :rvalue, :doc => <<-EOS
+Reverses the order of a string or array.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "reverse(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'reverse(): Requires either ' +
+        'array or string to work with')
+    end
+
+    result = value.reverse
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/rstrip.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/rstrip.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/rstrip.rb	(revision 30960)
@@ -0,0 +1,31 @@
+#
+#  rstrip.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:rstrip, :type => :rvalue, :doc => <<-EOS
+Strips leading spaces to the right of the string.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "rstrip(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'rstrip(): Requires either ' +
+        'array or string to work with')
+    end
+
+    if value.is_a?(Array)
+      result = value.collect { |i| i.is_a?(String) ? i.rstrip : i }
+    else
+      result = value.rstrip
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/seeded_rand.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/seeded_rand.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/seeded_rand.rb	(revision 30960)
@@ -0,0 +1,22 @@
+Puppet::Parser::Functions::newfunction(
+  :seeded_rand,
+  :arity => 2,
+  :type => :rvalue,
+  :doc => <<-EOS
+Usage: `seeded_rand(MAX, SEED)`. MAX must be a positive integer; SEED is any string.
+
+Generates a random whole number greater than or equal to 0 and less
+than MAX, using the value of SEED for repeatable randomness.  If SEED
+starts with "$fqdn:", this is behaves the same as `fqdn_rand`.
+
+EOS
+) do |args|
+  require 'digest/md5'
+
+  raise(ArgumentError, "seeded_rand(): first argument must be a positive integer") unless function_is_integer([args[0]]) and args[0].to_i > 0
+  raise(ArgumentError, "seeded_rand(): second argument must be a string") unless args[1].is_a? String
+
+  max = args[0].to_i
+  seed = Digest::MD5.hexdigest(args[1]).hex
+  Puppet::Util.deterministic_rand(seed,max)
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/shell_escape.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/shell_escape.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/shell_escape.rb	(revision 30960)
@@ -0,0 +1,30 @@
+#
+# shell_escape.rb
+#
+
+require 'shellwords'
+
+module Puppet::Parser::Functions
+  newfunction(:shell_escape, :type => :rvalue, :doc => <<-EOS
+Escapes a string so that it can be safely used in a Bourne shell command line.
+
+Note that the resulting string should be used unquoted and is not intended for use in double quotes nor in single
+quotes.
+
+This function behaves the same as ruby's Shellwords.shellescape() function.
+  EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "shell_escape(): Wrong number of arguments " +
+        "given (#{arguments.size} for 1)") if arguments.size != 1
+
+    # explicit conversion to string is required for ruby 1.9
+    string = arguments[0].to_s
+
+    result = Shellwords.shellescape(string)
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/shell_join.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/shell_join.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/shell_join.rb	(revision 30960)
@@ -0,0 +1,31 @@
+#
+# shell_join.rb
+#
+
+require 'shellwords'
+
+module Puppet::Parser::Functions
+  newfunction(:shell_join, :type => :rvalue, :doc => <<-EOS
+Builds a command line string from the given array of strings. Each array item is escaped for Bourne shell. All items are
+then joined together, with a single space in between.
+
+This function behaves the same as ruby's Shellwords.shelljoin() function
+  EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "shell_join(): Wrong number of arguments " +
+        "given (#{arguments.size} for 1)") if arguments.size != 1
+
+    array = arguments[0]
+
+    raise Puppet::ParseError, ("First argument is not an Array: #{array.inspect}") unless array.is_a?(Array)
+
+    # explicit conversion to string is required for ruby 1.9
+    array = array.map { |item| item.to_s }
+    result = Shellwords.shelljoin(array)
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/shell_split.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/shell_split.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/shell_split.rb	(revision 30960)
@@ -0,0 +1,26 @@
+#
+# shell_split.rb
+#
+
+require 'shellwords'
+
+module Puppet::Parser::Functions
+  newfunction(:shell_split, :type => :rvalue, :doc => <<-EOS
+Splits a string into an array of tokens in the same way the Bourne shell does.
+
+This function behaves the same as ruby's Shellwords.shellsplit() function
+  EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "shell_split(): Wrong number of arguments " +
+        "given (#{arguments.size} for 1)") if arguments.size != 1
+
+    string = arguments[0].to_s
+
+    result = Shellwords.shellsplit(string)
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/shuffle.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/shuffle.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/shuffle.rb	(revision 30960)
@@ -0,0 +1,45 @@
+#
+# shuffle.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:shuffle, :type => :rvalue, :doc => <<-EOS
+Randomizes the order of a string or array elements.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "shuffle(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'shuffle(): Requires either ' +
+        'array or string to work with')
+    end
+
+    result = value.clone
+
+    string = value.is_a?(String) ? true : false
+
+    # Check whether it makes sense to shuffle ...
+    return result if result.size <= 1
+
+    # We turn any string value into an array to be able to shuffle ...
+    result = string ? result.split('') : result
+
+    elements = result.size
+
+    # Simple implementation of FisherâYates in-place shuffle ...
+    elements.times do |i|
+      j = rand(elements - i) + i
+      result[j], result[i] = result[i], result[j]
+    end
+
+    result = string ? result.join : result
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/size.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/size.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/size.rb	(revision 30960)
@@ -0,0 +1,46 @@
+#
+# size.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:size, :type => :rvalue, :doc => <<-EOS
+Returns the number of elements in a string, an array or a hash
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "size(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    item = arguments[0]
+
+    if item.is_a?(String)
+
+      begin
+        #
+        # Check whether your item is a numeric value or not ...
+        # This will take care about positive and/or negative numbers
+        # for both integer and floating-point values ...
+        #
+        # Please note that Puppet has no notion of hexadecimal
+        # nor octal numbers for its DSL at this point in time ...
+        #
+        Float(item)
+
+        raise(Puppet::ParseError, 'size(): Requires either ' +
+          'string, array or hash to work with')
+
+      rescue ArgumentError
+        result = item.size
+      end
+
+    elsif item.is_a?(Array) || item.is_a?(Hash)
+      result = item.size
+    else
+      raise(Puppet::ParseError, 'size(): Unknown type given')
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/sort.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/sort.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/sort.rb	(revision 30960)
@@ -0,0 +1,27 @@
+#
+# sort.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:sort, :type => :rvalue, :doc => <<-EOS
+Sorts strings and arrays lexically.
+    EOS
+  ) do |arguments|
+
+    if (arguments.size != 1) then
+      raise(Puppet::ParseError, "sort(): Wrong number of arguments "+
+        "given #{arguments.size} for 1")
+    end
+
+    value = arguments[0]
+
+    if value.is_a?(Array) then
+      value.sort
+    elsif value.is_a?(String) then
+      value.split("").sort.join("")
+    end
+
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/squeeze.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/squeeze.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/squeeze.rb	(revision 30960)
@@ -0,0 +1,36 @@
+#
+# squeeze.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:squeeze, :type => :rvalue, :doc => <<-EOS
+Returns a new string where runs of the same character that occur in this set are replaced by a single character.
+    EOS
+  ) do |arguments|
+
+    if ((arguments.size != 2) and (arguments.size != 1)) then
+      raise(Puppet::ParseError, "squeeze(): Wrong number of arguments "+
+        "given #{arguments.size} for 2 or 1")
+    end
+
+    item = arguments[0]
+    squeezeval = arguments[1]
+
+    if item.is_a?(Array) then
+      if squeezeval then
+        item.collect { |i| i.squeeze(squeezeval) }
+      else
+        item.collect { |i| i.squeeze }
+      end
+    else
+      if squeezeval then
+        item.squeeze(squeezeval)
+      else
+        item.squeeze
+      end
+    end
+
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/str2bool.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/str2bool.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/str2bool.rb	(revision 30960)
@@ -0,0 +1,46 @@
+#
+# str2bool.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:str2bool, :type => :rvalue, :doc => <<-EOS
+This converts a string to a boolean. This attempt to convert strings that
+contain things like: Y,y, 1, T,t, TRUE,true to 'true' and strings that contain things
+like: 0, F,f, N,n, false, FALSE, no to 'false'.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "str2bool(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    string = arguments[0]
+
+    # If string is already Boolean, return it
+    if !!string == string
+      return string
+    end
+
+    unless string.is_a?(String)
+      raise(Puppet::ParseError, 'str2bool(): Requires ' +
+        'string to work with')
+    end
+
+    # We consider all the yes, no, y, n and so on too ...
+    result = case string
+      #
+      # This is how undef looks like in Puppet ...
+      # We yield false in this case.
+      #
+      when /^$/, '' then false # Empty string will be false ...
+      when /^(1|t|y|true|yes)$/i  then true
+      when /^(0|f|n|false|no)$/i  then false
+      when /^(undef|undefined)$/ then false # This is not likely to happen ...
+      else
+        raise(Puppet::ParseError, 'str2bool(): Unknown type of boolean given')
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/str2saltedsha512.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/str2saltedsha512.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/str2saltedsha512.rb	(revision 30960)
@@ -0,0 +1,32 @@
+#
+# str2saltedsha512.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:str2saltedsha512, :type => :rvalue, :doc => <<-EOS
+This converts a string to a salted-SHA512 password hash (which is used for
+OS X versions >= 10.7). Given any simple string, you will get a hex version
+of a salted-SHA512 password hash that can be inserted into your Puppet
+manifests as a valid password attribute.
+    EOS
+  ) do |arguments|
+    require 'digest/sha2'
+
+    raise(Puppet::ParseError, "str2saltedsha512(): Wrong number of arguments " +
+      "passed (#{arguments.size} but we require 1)") if arguments.size != 1
+
+    password = arguments[0]
+
+    unless password.is_a?(String)
+      raise(Puppet::ParseError, 'str2saltedsha512(): Requires a ' +
+        "String argument, you passed: #{password.class}")
+    end
+
+    seedint    = rand(2**31 - 1)
+    seedstring = Array(seedint).pack("L")
+    saltedpass = Digest::SHA512.digest(seedstring + password)
+    (seedstring + saltedpass).unpack('H*')[0]
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/strftime.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/strftime.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/strftime.rb	(revision 30960)
@@ -0,0 +1,107 @@
+#
+# strftime.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:strftime, :type => :rvalue, :doc => <<-EOS
+This function returns formatted time.
+
+*Examples:*
+
+To return the time since epoch:
+
+    strftime("%s")
+
+To return the date:
+
+    strftime("%Y-%m-%d")
+
+*Format meaning:*
+
+    %a - The abbreviated weekday name (``Sun'')
+    %A - The  full  weekday  name (``Sunday'')
+    %b - The abbreviated month name (``Jan'')
+    %B - The  full  month  name (``January'')
+    %c - The preferred local date and time representation
+    %C - Century (20 in 2009)
+    %d - Day of the month (01..31)
+    %D - Date (%m/%d/%y)
+    %e - Day of the month, blank-padded ( 1..31)
+    %F - Equivalent to %Y-%m-%d (the ISO 8601 date format)
+    %h - Equivalent to %b
+    %H - Hour of the day, 24-hour clock (00..23)
+    %I - Hour of the day, 12-hour clock (01..12)
+    %j - Day of the year (001..366)
+    %k - hour, 24-hour clock, blank-padded ( 0..23)
+    %l - hour, 12-hour clock, blank-padded ( 0..12)
+    %L - Millisecond of the second (000..999)
+    %m - Month of the year (01..12)
+    %M - Minute of the hour (00..59)
+    %n - Newline (\n)
+    %N - Fractional seconds digits, default is 9 digits (nanosecond)
+            %3N  millisecond (3 digits)
+            %6N  microsecond (6 digits)
+            %9N  nanosecond (9 digits)
+    %p - Meridian indicator (``AM''  or  ``PM'')
+    %P - Meridian indicator (``am''  or  ``pm'')
+    %r - time, 12-hour (same as %I:%M:%S %p)
+    %R - time, 24-hour (%H:%M)
+    %s - Number of seconds since 1970-01-01 00:00:00 UTC.
+    %S - Second of the minute (00..60)
+    %t - Tab character (\t)
+    %T - time, 24-hour (%H:%M:%S)
+    %u - Day of the week as a decimal, Monday being 1. (1..7)
+    %U - Week  number  of the current year,
+            starting with the first Sunday as the first
+            day of the first week (00..53)
+    %v - VMS date (%e-%b-%Y)
+    %V - Week number of year according to ISO 8601 (01..53)
+    %W - Week  number  of the current year,
+            starting with the first Monday as the first
+            day of the first week (00..53)
+    %w - Day of the week (Sunday is 0, 0..6)
+    %x - Preferred representation for the date alone, no time
+    %X - Preferred representation for the time alone, no date
+    %y - Year without a century (00..99)
+    %Y - Year with century
+    %z - Time zone as  hour offset from UTC (e.g. +0900)
+    %Z - Time zone name
+    %% - Literal ``%'' character
+    EOS
+  ) do |arguments|
+
+    # Technically we support two arguments but only first is mandatory ...
+    raise(Puppet::ParseError, "strftime(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    format = arguments[0]
+
+    raise(Puppet::ParseError, 'strftime(): You must provide ' +
+      'format for evaluation') if format.empty?
+
+    # The Time Zone argument is optional ...
+    time_zone = arguments[1] if arguments[1]
+
+    time = Time.new
+
+    # There is probably a better way to handle Time Zone ...
+    if time_zone and not time_zone.empty?
+      original_zone = ENV['TZ']
+
+      local_time = time.clone
+      local_time = local_time.utc
+
+      ENV['TZ'] = time_zone
+
+      time = local_time.localtime
+
+      ENV['TZ'] = original_zone
+    end
+
+    result = time.strftime(format)
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/strip.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/strip.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/strip.rb	(revision 30960)
@@ -0,0 +1,38 @@
+#
+#  strip.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:strip, :type => :rvalue, :doc => <<-EOS
+This function removes leading and trailing whitespace from a string or from
+every string inside an array.
+
+*Examples:*
+
+    strip("    aaa   ")
+
+Would result in: "aaa"
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "strip(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'strip(): Requires either ' +
+        'array or string to work with')
+    end
+
+    if value.is_a?(Array)
+      result = value.collect { |i| i.is_a?(String) ? i.strip : i }
+    else
+      result = value.strip
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/suffix.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/suffix.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/suffix.rb	(revision 30960)
@@ -0,0 +1,53 @@
+#
+# suffix.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:suffix, :type => :rvalue, :doc => <<-EOS
+This function applies a suffix to all elements in an array, or to the keys
+in a hash.
+
+*Examples:*
+
+    suffix(['a','b','c'], 'p')
+
+Will return: ['ap','bp','cp']
+    EOS
+  ) do |arguments|
+
+    # Technically we support two arguments but only first is mandatory ...
+    raise(Puppet::ParseError, "suffix(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    enumerable = arguments[0]
+
+    unless enumerable.is_a?(Array) or enumerable.is_a?(Hash)
+      raise Puppet::ParseError, "suffix(): expected first argument to be an Array or a Hash, got #{enumerable.inspect}"
+    end
+
+    suffix = arguments[1] if arguments[1]
+
+    if suffix
+      unless suffix.is_a? String
+        raise Puppet::ParseError, "suffix(): expected second argument to be a String, got #{suffix.inspect}"
+      end
+    end
+
+    if enumerable.is_a?(Array)
+      # Turn everything into string same as join would do ...
+      result = enumerable.collect do |i|
+        i = i.to_s
+        suffix ? i + suffix : i
+      end
+    else
+      result = Hash[enumerable.map do |k,v|
+        k = k.to_s
+        [ suffix ? k + suffix : k, v ]
+      end]
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/swapcase.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/swapcase.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/swapcase.rb	(revision 30960)
@@ -0,0 +1,38 @@
+#
+#  swapcase.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:swapcase, :type => :rvalue, :doc => <<-EOS
+This function will swap the existing case of a string.
+
+*Examples:*
+
+    swapcase("aBcD")
+
+Would result in: "AbCd"
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "swapcase(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'swapcase(): Requires either ' +
+        'array or string to work with')
+    end
+
+    if value.is_a?(Array)
+      # Numbers in Puppet are often string-encoded which is troublesome ...
+      result = value.collect { |i| i.is_a?(String) ? i.swapcase : i }
+    else
+      result = value.swapcase
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/time.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/time.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/time.rb	(revision 30960)
@@ -0,0 +1,50 @@
+#
+# time.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:time, :type => :rvalue, :doc => <<-EOS
+This function will return the current time since epoch as an integer.
+
+*Examples:*
+
+    time()
+
+Will return something like: 1311972653
+    EOS
+  ) do |arguments|
+
+    # The Time Zone argument is optional ...
+    time_zone = arguments[0] if arguments[0]
+
+    if (arguments.size != 0) and (arguments.size != 1) then
+      raise(Puppet::ParseError, "time(): Wrong number of arguments "+
+        "given #{arguments.size} for 0 or 1")
+    end
+
+    time = Time.new
+
+    # There is probably a better way to handle Time Zone ...
+    if time_zone and not time_zone.empty?
+      original_zone = ENV['TZ']
+
+      local_time = time.clone
+      local_time = local_time.utc
+
+      ENV['TZ'] = time_zone
+
+      result = local_time.localtime.strftime('%s')
+
+      ENV['TZ'] = original_zone
+    else
+      result = time.localtime.strftime('%s')
+    end
+
+    # Calling Time#to_i on a receiver changes it.  Trust me I am the Doctor.
+    result = result.to_i
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/to_bytes.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/to_bytes.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/to_bytes.rb	(revision 30960)
@@ -0,0 +1,31 @@
+module Puppet::Parser::Functions
+  newfunction(:to_bytes, :type => :rvalue, :doc => <<-EOS
+    Converts the argument into bytes, for example 4 kB becomes 4096.
+    Takes a single string value as an argument.
+    These conversions reflect a layperson's understanding of
+    1 MB = 1024 KB, when in fact 1 MB = 1000 KB, and 1 MiB = 1024 KiB.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "to_bytes(): Wrong number of arguments " +
+          "given (#{arguments.size} for 1)") if arguments.size != 1
+
+    arg = arguments[0]
+
+    return arg if arg.is_a? Numeric
+
+    value,prefix = */([0-9.e+-]*)\s*([^bB]?)/.match(arg)[1,2]
+
+    value = value.to_f
+    case prefix
+    when '' then return value.to_i
+    when 'k' then return (value*(1<<10)).to_i
+    when 'M' then return (value*(1<<20)).to_i
+    when 'G' then return (value*(1<<30)).to_i
+    when 'T' then return (value*(1<<40)).to_i
+    when 'P' then return (value*(1<<50)).to_i
+    when 'E' then return (value*(1<<60)).to_i
+    else raise Puppet::ParseError, "to_bytes(): Unknown prefix #{prefix}"
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/try_get_value.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/try_get_value.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/try_get_value.rb	(revision 30960)
@@ -0,0 +1,53 @@
+module Puppet::Parser::Functions
+  newfunction(
+      :try_get_value,
+      :type => :rvalue,
+      :arity => -2,
+      :doc => <<-eos
+DEPRECATED: this function is deprecated, please use dig() instead.
+
+Looks up into a complex structure of arrays and hashes and returns a value
+or the default value if nothing was found.
+
+Key can contain slashes to describe path components. The function will go down
+the structure and try to extract the required value.
+
+$data = {
+  'a' => {
+    'b' => [
+      'b1',
+      'b2',
+      'b3',
+    ]
+  }
+}
+
+$value = try_get_value($data, 'a/b/2', 'not_found', '/')
+=> $value = 'b3'
+
+a -> first hash key
+b -> second hash key
+2 -> array index starting with 0
+
+not_found -> (optional) will be returned if there is no value or the path did not match. Defaults to nil.
+/ -> (optional) path delimiter. Defaults to '/'.
+
+In addition to the required "key" argument, "try_get_value" accepts default
+argument. It will be returned if no value was found or a path component is
+missing. And the fourth argument can set a variable path separator.
+  eos
+  ) do |args|
+    warning("try_get_value() DEPRECATED: this function is deprecated, please use dig() instead.")
+    data = args[0]
+    path = args[1] || ''
+    default = args[2]
+
+    if !(data.is_a?(Hash) || data.is_a?(Array)) || path == ''
+      return default || data
+    end
+
+    separator = args[3] || '/'
+    path = path.split(separator).map{ |key| key =~ /^\d+$/ ? key.to_i : key }
+    function_dig([data, path, default])
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/type.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/type.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/type.rb	(revision 30960)
@@ -0,0 +1,19 @@
+#
+# type.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:type, :type => :rvalue, :doc => <<-EOS
+  DEPRECATED: This function will cease to function on Puppet 4; please use type3x() before upgrading to puppet 4 for backwards-compatibility, or migrate to the new parser's typing system.
+    EOS
+  ) do |args|
+
+    warning("type() DEPRECATED: This function will cease to function on Puppet 4; please use type3x() before upgrading to puppet 4 for backwards-compatibility, or migrate to the new parser's typing system.")
+    if ! Puppet::Parser::Functions.autoloader.loaded?(:type3x)
+      Puppet::Parser::Functions.autoloader.load(:type3x)
+    end
+    function_type3x(args + [false])
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/type3x.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/type3x.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/type3x.rb	(revision 30960)
@@ -0,0 +1,51 @@
+#
+# type3x.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:type3x, :type => :rvalue, :doc => <<-EOS
+DEPRECATED: This function will be removed when puppet 3 support is dropped; please migrate to the new parser's typing system.
+
+Returns the type when passed a value. Type can be one of:
+
+* string
+* array
+* hash
+* float
+* integer
+* boolean
+    EOS
+  ) do |args|
+    raise(Puppet::ParseError, "type3x(): Wrong number of arguments " +
+      "given (#{args.size} for 1)") if args.size < 1
+
+    value = args[0]
+
+    klass = value.class
+
+    if not [TrueClass, FalseClass, Array, Bignum, Fixnum, Float, Hash, String].include?(klass)
+      raise(Puppet::ParseError, 'type3x(): Unknown type')
+    end
+
+    klass = klass.to_s # Ugly ...
+
+    # We note that Integer is the parent to Bignum and Fixnum ...
+    result = case klass
+      when /^(?:Big|Fix)num$/ then 'integer'
+      when /^(?:True|False)Class$/ then 'boolean'
+      else klass
+    end
+
+    if result == "String" then
+      if value == value.to_i.to_s then
+        result = "Integer"
+      elsif value == value.to_f.to_s then
+        result = "Float"
+      end
+    end
+
+    return result.downcase
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/union.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/union.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/union.rb	(revision 30960)
@@ -0,0 +1,29 @@
+#
+# union.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:union, :type => :rvalue, :doc => <<-EOS
+This function returns a union of two or more arrays.
+
+*Examples:*
+
+    union(["a","b","c"],["b","c","d"])
+
+Would return: ["a","b","c","d"]
+    EOS
+  ) do |arguments|
+
+    # Check that 2 or more arguments have been given ...
+    raise(Puppet::ParseError, "union(): Wrong number of arguments " +
+      "given (#{arguments.size} for < 2)") if arguments.size < 2
+
+    arguments.each do |argument|
+      raise(Puppet::ParseError, 'union(): Every parameter must be an array') unless argument.is_a?(Array)
+    end
+
+    arguments.reduce(:|)
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/unique.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/unique.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/unique.rb	(revision 30960)
@@ -0,0 +1,50 @@
+#
+# unique.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:unique, :type => :rvalue, :doc => <<-EOS
+This function will remove duplicates from strings and arrays.
+
+*Examples:*
+
+    unique("aabbcc")
+
+Will return:
+
+    abc
+
+You can also use this with arrays:
+
+    unique(["a","a","b","b","c","c"])
+
+This returns:
+
+    ["a","b","c"]
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "unique(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'unique(): Requires either ' +
+        'array or string to work with')
+    end
+
+    result = value.clone
+
+    string = value.is_a?(String) ? true : false
+
+    # We turn any string value into an array to be able to shuffle ...
+    result = string ? result.split('') : result
+    result = result.uniq # Remove duplicates ...
+    result = string ? result.join : result
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/unix2dos.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/unix2dos.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/unix2dos.rb	(revision 30960)
@@ -0,0 +1,15 @@
+# Custom Puppet function to convert unix to dos format
+module Puppet::Parser::Functions
+  newfunction(:unix2dos, :type => :rvalue, :arity => 1, :doc => <<-EOS
+    Returns the DOS version of the given string.
+    Takes a single string argument.
+    EOS
+  ) do |arguments|
+
+    unless arguments[0].is_a?(String)
+      raise(Puppet::ParseError, 'unix2dos(): Requires string as argument')
+    end
+
+    arguments[0].gsub(/\r*\n/, "\r\n")
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/upcase.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/upcase.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/upcase.rb	(revision 30960)
@@ -0,0 +1,45 @@
+#
+# upcase.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:upcase, :type => :rvalue, :doc => <<-EOS
+Converts a string or an array of strings to uppercase.
+
+*Examples:*
+
+    upcase("abcd")
+
+Will return:
+
+    ABCD
+  EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "upcase(): Wrong number of arguments " +
+                                "given (#{arguments.size} for 1)") if arguments.size != 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(Hash) || value.respond_to?(:upcase)
+      raise(Puppet::ParseError, 'upcase(): Requires an ' +
+                                  'array, hash or object that responds to upcase in order to work')
+    end
+
+    if value.is_a?(Array)
+      # Numbers in Puppet are often string-encoded which is troublesome ...
+      result = value.collect { |i| function_upcase([i]) }
+    elsif value.is_a?(Hash)
+      result = {}
+      value.each_pair do |k, v|
+        result[function_upcase([k])] = function_upcase([v])
+      end
+    else
+      result = value.upcase
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/uriescape.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/uriescape.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/uriescape.rb	(revision 30960)
@@ -0,0 +1,34 @@
+#
+#  uriescape.rb
+#
+require 'uri'
+
+module Puppet::Parser::Functions
+  newfunction(:uriescape, :type => :rvalue, :doc => <<-EOS
+    Urlencodes a string or array of strings.
+    Requires either a single string or an array as an input.
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "uriescape(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    value = arguments[0]
+
+    unless value.is_a?(Array) || value.is_a?(String)
+      raise(Puppet::ParseError, 'uriescape(): Requires either ' +
+        'array or string to work with')
+    end
+
+    if value.is_a?(Array)
+      # Numbers in Puppet are often string-encoded which is troublesome ...
+      result = value.collect { |i| i.is_a?(String) ? URI.escape(i) : i }
+    else
+      result = URI.escape(value)
+    end
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_absolute_path.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_absolute_path.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_absolute_path.rb	(revision 30960)
@@ -0,0 +1,54 @@
+module Puppet::Parser::Functions
+  newfunction(:validate_absolute_path, :doc => <<-'ENDHEREDOC') do |args|
+    Validate the string represents an absolute path in the filesystem.  This function works
+    for windows and unix style paths.
+
+    The following values will pass:
+
+        $my_path = 'C:/Program Files (x86)/Puppet Labs/Puppet'
+        validate_absolute_path($my_path)
+        $my_path2 = '/var/lib/puppet'
+        validate_absolute_path($my_path2)
+        $my_path3 = ['C:/Program Files (x86)/Puppet Labs/Puppet','C:/Program Files/Puppet Labs/Puppet']
+        validate_absolute_path($my_path3)
+        $my_path4 = ['/var/lib/puppet','/usr/share/puppet']
+        validate_absolute_path($my_path4)
+
+    The following values will fail, causing compilation to abort:
+
+        validate_absolute_path(true)
+        validate_absolute_path('../var/lib/puppet')
+        validate_absolute_path('var/lib/puppet')
+        validate_absolute_path([ 'var/lib/puppet', '/var/foo' ])
+        validate_absolute_path([ '/var/lib/puppet', 'var/foo' ])
+        $undefined = undef
+        validate_absolute_path($undefined)
+
+    ENDHEREDOC
+
+    # The deprecation function was being called twice, as validate_absolute_path calls is_absolute_path. I have removed it from here so it only calls deprecation once within is_absolute_path.
+    # function_deprecation([:validate_absolute_path, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Absolute_path. There is further documentation for validate_legacy function in the README.'])
+
+    require 'puppet/util'
+
+    unless args.length > 0 then
+      raise Puppet::ParseError, ("validate_absolute_path(): wrong number of arguments (#{args.length}; must be > 0)")
+    end
+
+    args.each do |arg|
+      # put arg to candidate var to be able to replace it
+      candidates = arg
+      # if arg is just a string with a path to test, convert it to an array
+      # to avoid test code duplication
+      unless arg.is_a?(Array) then
+        candidates = Array.new(1,arg)
+      end
+      # iterate over all paths within the candidates array
+      candidates.each do |path|
+        unless function_is_absolute_path([path])
+          raise Puppet::ParseError, ("#{path.inspect} is not an absolute path.")
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_array.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_array.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_array.rb	(revision 30960)
@@ -0,0 +1,35 @@
+module Puppet::Parser::Functions
+
+  newfunction(:validate_array, :doc => <<-'ENDHEREDOC') do |args|
+    Validate that all passed values are array data structures. Abort catalog
+    compilation if any value fails this check.
+
+    The following values will pass:
+
+        $my_array = [ 'one', 'two' ]
+        validate_array($my_array)
+
+    The following values will fail, causing compilation to abort:
+
+        validate_array(true)
+        validate_array('some_string')
+        $undefined = undef
+        validate_array($undefined)
+
+    ENDHEREDOC
+
+    function_deprecation([:validate_array, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Array. There is further documentation for validate_legacy function in the README.'])
+
+    unless args.length > 0 then
+      raise Puppet::ParseError, ("validate_array(): wrong number of arguments (#{args.length}; must be > 0)")
+    end
+
+    args.each do |arg|
+      unless arg.is_a?(Array)
+        raise Puppet::ParseError, ("#{arg.inspect} is not an Array.  It looks to be a #{arg.class}")
+      end
+    end
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_augeas.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_augeas.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_augeas.rb	(revision 30960)
@@ -0,0 +1,83 @@
+require 'tempfile'
+
+module Puppet::Parser::Functions
+  newfunction(:validate_augeas, :doc => <<-'ENDHEREDOC') do |args|
+    Perform validation of a string using an Augeas lens
+    The first argument of this function should be a string to
+    test, and the second argument should be the name of the Augeas lens to use.
+    If Augeas fails to parse the string with the lens, the compilation will
+    abort with a parse error.
+
+    A third argument can be specified, listing paths which should
+    not be found in the file. The `$file` variable points to the location
+    of the temporary file being tested in the Augeas tree.
+
+    For example, if you want to make sure your passwd content never contains
+    a user `foo`, you could write:
+
+        validate_augeas($passwdcontent, 'Passwd.lns', ['$file/foo'])
+
+    Or if you wanted to ensure that no users used the '/bin/barsh' shell,
+    you could use:
+
+        validate_augeas($passwdcontent, 'Passwd.lns', ['$file/*[shell="/bin/barsh"]']
+
+    If a fourth argument is specified, this will be the error message raised and
+    seen by the user.
+
+    A helpful error message can be returned like this:
+
+        validate_augeas($sudoerscontent, 'Sudoers.lns', [], 'Failed to validate sudoers content with Augeas')
+
+    ENDHEREDOC
+    unless Puppet.features.augeas?
+      raise Puppet::ParseError, ("validate_augeas(): this function requires the augeas feature. See http://docs.puppetlabs.com/guides/augeas.html#pre-requisites for how to activate it.")
+    end
+
+    if (args.length < 2) or (args.length > 4) then
+      raise Puppet::ParseError, ("validate_augeas(): wrong number of arguments (#{args.length}; must be 2, 3, or 4)")
+    end
+
+    msg = args[3] || "validate_augeas(): Failed to validate content against #{args[1].inspect}"
+
+    require 'augeas'
+    aug = Augeas::open(nil, nil, Augeas::NO_MODL_AUTOLOAD)
+    begin
+      content = args[0]
+
+      # Test content in a temporary file
+      tmpfile = Tempfile.new("validate_augeas")
+      begin
+        tmpfile.write(content)
+      ensure
+        tmpfile.close
+      end
+
+      # Check for syntax
+      lens = args[1]
+      aug.transform(
+        :lens => lens,
+        :name => 'Validate_augeas',
+        :incl => tmpfile.path
+      )
+      aug.load!
+
+      unless aug.match("/augeas/files#{tmpfile.path}//error").empty?
+        error = aug.get("/augeas/files#{tmpfile.path}//error/message")
+        msg += " with error: #{error}"
+        raise Puppet::ParseError, (msg)
+      end
+
+      # Launch unit tests
+      tests = args[2] || []
+      aug.defvar('file', "/files#{tmpfile.path}")
+      tests.each do |t|
+        msg += " testing path #{t}"
+        raise Puppet::ParseError, (msg) unless aug.match(t).empty?
+      end
+    ensure
+      aug.close
+      tmpfile.unlink
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_bool.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_bool.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_bool.rb	(revision 30960)
@@ -0,0 +1,37 @@
+module Puppet::Parser::Functions
+
+  newfunction(:validate_bool, :doc => <<-'ENDHEREDOC') do |args|
+    Validate that all passed values are either true or false. Abort catalog
+    compilation if any value fails this check.
+
+    The following values will pass:
+
+        $iamtrue = true
+        validate_bool(true)
+        validate_bool(true, true, false, $iamtrue)
+
+    The following values will fail, causing compilation to abort:
+
+        $some_array = [ true ]
+        validate_bool("false")
+        validate_bool("true")
+        validate_bool($some_array)
+
+    ENDHEREDOC
+
+    # The deprecation function was being called twice, as validate_bool calls is_bool. I have removed it from here so it only calls deprecation once within is_bool.
+    # function_deprecation([:validate_bool, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Bool. There is further documentation for validate_legacy function in the README.'])
+
+    unless args.length > 0 then
+      raise Puppet::ParseError, ("validate_bool(): wrong number of arguments (#{args.length}; must be > 0)")
+    end
+
+    args.each do |arg|
+      unless function_is_bool([arg])
+        raise Puppet::ParseError, ("#{arg.inspect} is not a boolean.  It looks to be a #{arg.class}")
+      end
+    end
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_cmd.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_cmd.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_cmd.rb	(revision 30960)
@@ -0,0 +1,63 @@
+require 'puppet/util/execution'
+require 'tempfile'
+
+module Puppet::Parser::Functions
+  newfunction(:validate_cmd, :doc => <<-'ENDHEREDOC') do |args|
+    Perform validation of a string with an external command.
+    The first argument of this function should be a string to
+    test, and the second argument should be a path to a test command
+    taking a % as a placeholder for the file path (will default to the end).
+    If the command, launched against a tempfile containing the passed string,
+    returns a non-null value, compilation will abort with a parse error.
+
+    If a third argument is specified, this will be the error message raised and
+    seen by the user.
+
+    A helpful error message can be returned like this:
+
+    Example:
+
+        # Defaults to end of path
+        validate_cmd($sudoerscontent, '/usr/sbin/visudo -c -f', 'Visudo failed to validate sudoers content')
+
+        # % as file location
+        validate_cmd($haproxycontent, '/usr/sbin/haproxy -f % -c', 'Haproxy failed to validate config content')
+
+    ENDHEREDOC
+    if (args.length < 2) or (args.length > 3) then
+      raise Puppet::ParseError, ("validate_cmd(): wrong number of arguments (#{args.length}; must be 2 or 3)")
+    end
+
+    msg = args[2] || "validate_cmd(): failed to validate content with command #{args[1].inspect}"
+
+    content = args[0]
+    checkscript = args[1]
+
+    # Test content in a temporary file
+    tmpfile = Tempfile.new("validate_cmd")
+    begin
+      tmpfile.write(content)
+      tmpfile.close
+
+      if checkscript =~ /\s%(\s|$)/
+        check_with_correct_location = checkscript.gsub(/%/,tmpfile.path)
+      else
+        check_with_correct_location = "#{checkscript} #{tmpfile.path}"
+      end
+
+      if Puppet::Util::Execution.respond_to?('execute')
+        Puppet::Util::Execution.execute(check_with_correct_location)
+      else
+        Puppet::Util.execute(check_with_correct_location)
+      end
+    rescue Puppet::ExecutionFailure => detail
+      msg += "\n#{detail}"
+      raise Puppet::ParseError, msg
+    rescue StandardError => detail
+      msg += "\n#{detail.class.name} #{detail}"
+      raise Puppet::ParseError, msg
+    ensure
+      tmpfile.unlink
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_email_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_email_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_email_address.rb	(revision 30960)
@@ -0,0 +1,31 @@
+module Puppet::Parser::Functions
+  newfunction(:validate_email_address, :doc => <<-ENDHEREDOC
+    Validate that all values passed are valid email addresses.
+    Fail compilation if any value fails this check.
+    The following values will pass:
+    $my_email = "waldo@gmail.com"
+    validate_email_address($my_email)
+    validate_email_address("bob@gmail.com", "alice@gmail.com", $my_email)
+
+    The following values will fail, causing compilation to abort:
+    $some_array = [ 'bad_email@/d/efdf.com' ]
+    validate_email_address($some_array)
+    ENDHEREDOC
+             ) do |args|
+    rescuable_exceptions = [ArgumentError]
+
+    if args.empty?
+      raise Puppet::ParseError, "validate_email_address(): wrong number of arguments (#{args.length}; must be > 0)"
+    end
+
+    args.each do |arg|
+      raise Puppet::ParseError, "#{arg.inspect} is not a string." unless arg.is_a?(String)
+
+      begin
+        raise Puppet::ParseError, "#{arg.inspect} is not a valid email address" unless function_is_email_address([arg])
+      rescue *rescuable_exceptions
+        raise Puppet::ParseError, "#{arg.inspect} is not a valid email address"
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_hash.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_hash.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_hash.rb	(revision 30960)
@@ -0,0 +1,35 @@
+module Puppet::Parser::Functions
+
+  newfunction(:validate_hash, :doc => <<-'ENDHEREDOC') do |args|
+    Validate that all passed values are hash data structures. Abort catalog
+    compilation if any value fails this check.
+
+    The following values will pass:
+
+        $my_hash = { 'one' => 'two' }
+        validate_hash($my_hash)
+
+    The following values will fail, causing compilation to abort:
+
+        validate_hash(true)
+        validate_hash('some_string')
+        $undefined = undef
+        validate_hash($undefined)
+
+    ENDHEREDOC
+
+    function_deprecation([:validate_hash, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Hash. There is further documentation for validate_legacy function in the README.'])
+
+    unless args.length > 0 then
+      raise Puppet::ParseError, ("validate_hash(): wrong number of arguments (#{args.length}; must be > 0)")
+    end
+
+    args.each do |arg|
+      unless arg.is_a?(Hash)
+        raise Puppet::ParseError, ("#{arg.inspect} is not a Hash.  It looks to be a #{arg.class}")
+      end
+    end
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_integer.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_integer.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_integer.rb	(revision 30960)
@@ -0,0 +1,134 @@
+module Puppet::Parser::Functions
+
+  newfunction(:validate_integer, :doc => <<-'ENDHEREDOC') do |args|
+    Validate that the first argument is an integer (or an array of integers). Abort catalog compilation if any of the checks fail.
+
+    The second argument is optional and passes a maximum. (All elements of) the first argument has to be less or equal to this max.
+
+    The third argument is optional and passes a minimum.  (All elements of) the first argument has to be greater or equal to this min.
+    If, and only if, a minimum is given, the second argument may be an empty string or undef, which will be handled to just check
+    if (all elements of) the first argument are greater or equal to the given minimum.
+
+    It will fail if the first argument is not an integer or array of integers, and if arg 2 and arg 3 are not convertable to an integer.
+
+    The following values will pass:
+
+      validate_integer(1)
+      validate_integer(1, 2)
+      validate_integer(1, 1)
+      validate_integer(1, 2, 0)
+      validate_integer(2, 2, 2)
+      validate_integer(2, '', 0)
+      validate_integer(2, undef, 0)
+      $foo = undef
+      validate_integer(2, $foo, 0)
+      validate_integer([1,2,3,4,5], 6)
+      validate_integer([1,2,3,4,5], 6, 0)
+
+    Plus all of the above, but any combination of values passed as strings ('1' or "1").
+    Plus all of the above, but with (correct) combinations of negative integer values.
+
+    The following values will not:
+
+      validate_integer(true)
+      validate_integer(false)
+      validate_integer(7.0)
+      validate_integer({ 1 => 2 })
+      $foo = undef
+      validate_integer($foo)
+      validate_integer($foobaridontexist)
+
+      validate_integer(1, 0)
+      validate_integer(1, true)
+      validate_integer(1, '')
+      validate_integer(1, undef)
+      validate_integer(1, , 0)
+      validate_integer(1, 2, 3)
+      validate_integer(1, 3, 2)
+      validate_integer(1, 3, true)
+
+    Plus all of the above, but any combination of values passed as strings ('false' or "false").
+    Plus all of the above, but with incorrect combinations of negative integer values.
+    Plus all of the above, but with non-integer items in arrays or maximum / minimum argument.
+
+    ENDHEREDOC
+
+    function_deprecation([:validate_integer, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Integer. There is further documentation for validate_legacy function in the README.'])
+
+    # tell the user we need at least one, and optionally up to two other parameters
+    raise Puppet::ParseError, "validate_integer(): Wrong number of arguments; must be 1, 2 or 3, got #{args.length}" unless args.length > 0 and args.length < 4
+
+    input, max, min = *args
+
+    # check maximum parameter
+    if args.length > 1
+      max = max.to_s
+      # allow max to be empty (or undefined) if we have a minimum set
+      if args.length > 2 and max == ''
+        max = nil
+      else
+        begin
+          max = Integer(max)
+        rescue TypeError, ArgumentError
+          raise Puppet::ParseError, "validate_integer(): Expected second argument to be unset or an Integer, got #{max}:#{max.class}"
+        end
+      end
+    else
+      max = nil
+    end
+
+    # check minimum parameter
+    if args.length > 2
+      begin
+        min = Integer(min.to_s)
+      rescue TypeError, ArgumentError
+        raise Puppet::ParseError, "validate_integer(): Expected third argument to be unset or an Integer, got #{min}:#{min.class}"
+      end
+    else
+      min = nil
+    end
+
+    # ensure that min < max
+    if min and max and min > max
+      raise Puppet::ParseError, "validate_integer(): Expected second argument to be larger than third argument, got #{max} < #{min}"
+    end
+
+    # create lamba validator function
+    validator = lambda do |num|
+      # check input < max
+      if max and num > max
+        raise Puppet::ParseError, "validate_integer(): Expected #{input.inspect} to be smaller or equal to #{max}, got #{input.inspect}."
+      end
+      # check input > min (this will only be checked if no exception has been raised before)
+      if min and num < min
+        raise Puppet::ParseError, "validate_integer(): Expected #{input.inspect} to be greater or equal to #{min}, got #{input.inspect}."
+      end
+    end
+
+    # if this is an array, handle it.
+    case input
+    when Array
+      # check every element of the array
+      input.each_with_index do |arg, pos|
+        begin
+          raise TypeError if arg.is_a?(Hash)
+          arg = Integer(arg.to_s)
+          validator.call(arg)
+        rescue TypeError, ArgumentError
+          raise Puppet::ParseError, "validate_integer(): Expected element at array position #{pos} to be an Integer, got #{arg.class}"
+        end
+      end
+    # for the sake of compatibility with ruby 1.8, we need extra handling of hashes
+    when Hash
+      raise Puppet::ParseError, "validate_integer(): Expected first argument to be an Integer or Array, got #{input.class}"
+    # check the input. this will also fail any stuff other than pure, shiny integers
+    else
+      begin
+        input = Integer(input.to_s)
+        validator.call(input)
+      rescue TypeError, ArgumentError
+        raise Puppet::ParseError, "validate_integer(): Expected first argument to be an Integer or Array, got #{input.class}"
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_ip_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_ip_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_ip_address.rb	(revision 30960)
@@ -0,0 +1,52 @@
+module Puppet::Parser::Functions
+
+  newfunction(:validate_ip_address, :doc => <<-ENDHEREDOC
+    Validate that all values passed are valid IP addresses,
+    regardless they are IPv4 or IPv6
+    Fail compilation if any value fails this check.
+    The following values will pass:
+    $my_ip = "1.2.3.4"
+    validate_ip_address($my_ip)
+    validate_ip_address("8.8.8.8", "172.16.0.1", $my_ip)
+
+    $my_ip = "3ffe:505:2"
+    validate_ip_address(1)
+    validate_ip_address($my_ip)
+    validate_ip_address("fe80::baf6:b1ff:fe19:7507", $my_ip)
+
+    The following values will fail, causing compilation to abort:
+    $some_array = [ 1, true, false, "garbage string", "3ffe:505:2" ]
+    validate_ip_address($some_array)
+    ENDHEREDOC
+  ) do |args|
+
+    require "ipaddr"
+    rescuable_exceptions = [ ArgumentError ]
+
+    function_deprecation([:validate_ip_address, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ip_address. There is further documentation for validate_legacy function in the README.'])
+
+    if defined?(IPAddr::InvalidAddressError)
+      rescuable_exceptions << IPAddr::InvalidAddressError
+    end
+
+    unless args.length > 0 then
+      raise Puppet::ParseError, ("validate_ip_address(): wrong number of arguments (#{args.length}; must be > 0)")
+    end
+
+    args.each do |arg|
+      unless arg.is_a?(String)
+        raise Puppet::ParseError, "#{arg.inspect} is not a string."
+      end
+
+      begin
+        unless IPAddr.new(arg).ipv4? or IPAddr.new(arg).ipv6?
+          raise Puppet::ParseError, "#{arg.inspect} is not a valid IP address."
+        end
+      rescue *rescuable_exceptions
+        raise Puppet::ParseError, "#{arg.inspect} is not a valid IP address."
+      end
+    end
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_ipv4_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_ipv4_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_ipv4_address.rb	(revision 30960)
@@ -0,0 +1,50 @@
+module Puppet::Parser::Functions
+
+  newfunction(:validate_ipv4_address, :doc => <<-ENDHEREDOC
+    Validate that all values passed are valid IPv4 addresses.
+    Fail compilation if any value fails this check.
+
+    The following values will pass:
+
+    $my_ip = "1.2.3.4"
+    validate_ipv4_address($my_ip)
+    validate_ipv4_address("8.8.8.8", "172.16.0.1", $my_ip)
+
+    The following values will fail, causing compilation to abort:
+
+    $some_array = [ 1, true, false, "garbage string", "3ffe:505:2" ]
+    validate_ipv4_address($some_array)
+
+    ENDHEREDOC
+  ) do |args|
+
+    function_deprecation([:validate_ipv4_address, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ipv4. There is further documentation for validate_legacy function in the README.'])
+
+    require "ipaddr"
+    rescuable_exceptions = [ ArgumentError ]
+
+    if defined?(IPAddr::InvalidAddressError)
+      rescuable_exceptions << IPAddr::InvalidAddressError
+    end
+
+    unless args.length > 0 then
+      raise Puppet::ParseError, ("validate_ipv4_address(): wrong number of arguments (#{args.length}; must be > 0)")
+    end
+
+    args.each do |arg|
+      unless arg.is_a?(String)
+        raise Puppet::ParseError, "#{arg.inspect} is not a string."
+      end
+
+      begin
+        unless IPAddr.new(arg).ipv4?
+          raise Puppet::ParseError, "#{arg.inspect} is not a valid IPv4 address."
+        end
+      rescue *rescuable_exceptions
+        raise Puppet::ParseError, "#{arg.inspect} is not a valid IPv4 address."
+      end
+    end
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_ipv6_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_ipv6_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_ipv6_address.rb	(revision 30960)
@@ -0,0 +1,51 @@
+module Puppet::Parser::Functions
+
+  newfunction(:validate_ipv6_address, :doc => <<-ENDHEREDOC
+    Validate that all values passed are valid IPv6 addresses.
+    Fail compilation if any value fails this check.
+
+    The following values will pass:
+
+    $my_ip = "3ffe:505:2"
+    validate_ipv6_address(1)
+    validate_ipv6_address($my_ip)
+    validate_bool("fe80::baf6:b1ff:fe19:7507", $my_ip)
+
+    The following values will fail, causing compilation to abort:
+
+    $some_array = [ true, false, "garbage string", "1.2.3.4" ]
+    validate_ipv6_address($some_array)
+
+    ENDHEREDOC
+  ) do |args|
+
+    function_deprecation([:validate_ipv6_address, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Ipv6. There is further documentation for validate_legacy function in the README.'])
+
+    require "ipaddr"
+    rescuable_exceptions = [ ArgumentError ]
+
+    if defined?(IPAddr::InvalidAddressError)
+      rescuable_exceptions << IPAddr::InvalidAddressError
+    end
+
+    unless args.length > 0 then
+      raise Puppet::ParseError, ("validate_ipv6_address(): wrong number of arguments (#{args.length}; must be > 0)")
+    end
+
+    args.each do |arg|
+      unless arg.is_a?(String)
+        raise Puppet::ParseError, "#{arg.inspect} is not a string."
+      end
+
+      begin
+        unless IPAddr.new(arg).ipv6?
+          raise Puppet::ParseError, "#{arg.inspect} is not a valid IPv6 address."
+        end
+      rescue *rescuable_exceptions
+        raise Puppet::ParseError, "#{arg.inspect} is not a valid IPv6 address."
+      end
+    end
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_numeric.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_numeric.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_numeric.rb	(revision 30960)
@@ -0,0 +1,96 @@
+module Puppet::Parser::Functions
+
+  newfunction(:validate_numeric, :doc => <<-'ENDHEREDOC') do |args|
+    Validate that the first argument is a numeric value (or an array of numeric values). Abort catalog compilation if any of the checks fail.
+
+    The second argument is optional and passes a maximum. (All elements of) the first argument has to be less or equal to this max.
+
+    The third argument is optional and passes a minimum.  (All elements of) the first argument has to be greater or equal to this min.
+    If, and only if, a minimum is given, the second argument may be an empty string or undef, which will be handled to just check
+    if (all elements of) the first argument are greater or equal to the given minimum.
+
+    It will fail if the first argument is not a numeric (Integer or Float) or array of numerics, and if arg 2 and arg 3 are not convertable to a numeric.
+
+    For passing and failing usage, see `validate_integer()`. It is all the same for validate_numeric, yet now floating point values are allowed, too.
+
+    ENDHEREDOC
+
+    function_deprecation([:validate_numeric, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Numeric. There is further documentation for validate_legacy function in the README.'])
+
+    # tell the user we need at least one, and optionally up to two other parameters
+    raise Puppet::ParseError, "validate_numeric(): Wrong number of arguments; must be 1, 2 or 3, got #{args.length}" unless args.length > 0 and args.length < 4
+
+    input, max, min = *args
+
+    # check maximum parameter
+    if args.length > 1
+      max = max.to_s
+      # allow max to be empty (or undefined) if we have a minimum set
+      if args.length > 2 and max == ''
+        max = nil
+      else
+        begin
+          max = Float(max)
+        rescue TypeError, ArgumentError
+          raise Puppet::ParseError, "validate_numeric(): Expected second argument to be unset or a Numeric, got #{max}:#{max.class}"
+        end
+      end
+    else
+      max = nil
+    end
+
+    # check minimum parameter
+    if args.length > 2
+      begin
+        min = Float(min.to_s)
+      rescue TypeError, ArgumentError
+        raise Puppet::ParseError, "validate_numeric(): Expected third argument to be unset or a Numeric, got #{min}:#{min.class}"
+      end
+    else
+      min = nil
+    end
+
+    # ensure that min < max
+    if min and max and min > max
+      raise Puppet::ParseError, "validate_numeric(): Expected second argument to be larger than third argument, got #{max} < #{min}"
+    end
+
+    # create lamba validator function
+    validator = lambda do |num|
+      # check input < max
+      if max and num > max
+        raise Puppet::ParseError, "validate_numeric(): Expected #{input.inspect} to be smaller or equal to #{max}, got #{input.inspect}."
+      end
+      # check input > min (this will only be checked if no exception has been raised before)
+      if min and num < min
+        raise Puppet::ParseError, "validate_numeric(): Expected #{input.inspect} to be greater or equal to #{min}, got #{input.inspect}."
+      end
+    end
+
+    # if this is an array, handle it.
+    case input
+    when Array
+      # check every element of the array
+      input.each_with_index do |arg, pos|
+        begin
+          raise TypeError if arg.is_a?(Hash)
+          arg = Float(arg.to_s)
+          validator.call(arg)
+        rescue TypeError, ArgumentError
+          raise Puppet::ParseError, "validate_numeric(): Expected element at array position #{pos} to be a Numeric, got #{arg.class}"
+        end
+      end
+    # for the sake of compatibility with ruby 1.8, we need extra handling of hashes
+    when Hash
+      raise Puppet::ParseError, "validate_integer(): Expected first argument to be a Numeric or Array, got #{input.class}"
+    # check the input. this will also fail any stuff other than pure, shiny integers
+    else
+      begin
+        input = Float(input.to_s)
+        validator.call(input)
+      rescue TypeError, ArgumentError
+        raise Puppet::ParseError, "validate_numeric(): Expected first argument to be a Numeric or Array, got #{input.class}"
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_re.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_re.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_re.rb	(revision 30960)
@@ -0,0 +1,50 @@
+module Puppet::Parser::Functions
+  newfunction(:validate_re, :doc => <<-'ENDHEREDOC') do |args|
+    Perform simple validation of a string against one or more regular
+    expressions. The first argument of this function should be a string to
+    test, and the second argument should be a stringified regular expression
+    (without the // delimiters) or an array of regular expressions.  If none
+    of the regular expressions match the string passed in, compilation will
+    abort with a parse error.
+
+    If a third argument is specified, this will be the error message raised and
+    seen by the user.
+
+    The following strings will validate against the regular expressions:
+
+        validate_re('one', '^one$')
+        validate_re('one', [ '^one', '^two' ])
+
+    The following strings will fail to validate, causing compilation to abort:
+
+        validate_re('one', [ '^two', '^three' ])
+
+    A helpful error message can be returned like this:
+
+        validate_re($::puppetversion, '^2.7', 'The $puppetversion fact value does not match 2.7')
+
+    Note: Compilation will also abort, if the first argument is not a String. Always use
+    quotes to force stringification:
+
+        validate_re("${::operatingsystemmajrelease}", '^[57]$')
+
+    ENDHEREDOC
+
+    function_deprecation([:validate_re, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::Re. There is further documentation for validate_legacy function in the README.'])
+
+    if (args.length < 2) or (args.length > 3) then
+      raise Puppet::ParseError, "validate_re(): wrong number of arguments (#{args.length}; must be 2 or 3)"
+    end
+
+    raise Puppet::ParseError, "validate_re(): input needs to be a String, not a #{args[0].class}" unless args[0].is_a? String
+
+    msg = args[2] || "validate_re(): #{args[0].inspect} does not match #{args[1].inspect}"
+
+    # We're using a flattened array here because we can't call String#any? in
+    # Ruby 1.9 like we can in Ruby 1.8
+    raise Puppet::ParseError, msg unless [args[1]].flatten.any? do |re_str|
+      args[0] =~ Regexp.compile(re_str)
+    end
+
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_slength.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_slength.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_slength.rb	(revision 30960)
@@ -0,0 +1,71 @@
+module Puppet::Parser::Functions
+
+  newfunction(:validate_slength, :doc => <<-'ENDHEREDOC') do |args|
+    Validate that the first argument is a string (or an array of strings), and
+    less/equal to than the length of the second argument. An optional third
+    parameter can be given the minimum length. It fails if the first
+    argument is not a string or array of strings, and if arg 2 and arg 3 are
+    not convertable to a number.
+
+    The following values will pass:
+
+      validate_slength("discombobulate",17)
+      validate_slength(["discombobulate","moo"],17)
+      validate_slength(["discombobulate","moo"],17,3)
+
+    The following valueis will not:
+
+      validate_slength("discombobulate",1)
+      validate_slength(["discombobulate","thermometer"],5)
+      validate_slength(["discombobulate","moo"],17,10)
+
+    ENDHEREDOC
+
+    function_deprecation([:validate_slength, 'This method is deprecated, please use the stdlib validate_legacy function, with String[]. There is further documentation for validate_legacy function in the README.'])
+
+    raise Puppet::ParseError, "validate_slength(): Wrong number of arguments (#{args.length}; must be 2 or 3)" unless args.length == 2 or args.length == 3
+
+    input, max_length, min_length = *args
+
+    begin
+      max_length = Integer(max_length)
+      raise ArgumentError if max_length <= 0
+    rescue ArgumentError, TypeError
+      raise Puppet::ParseError, "validate_slength(): Expected second argument to be a positive Numeric, got #{max_length}:#{max_length.class}"
+    end
+
+    if min_length
+      begin
+        min_length = Integer(min_length)
+        raise ArgumentError if min_length < 0
+    rescue ArgumentError, TypeError
+        raise Puppet::ParseError, "validate_slength(): Expected third argument to be unset or a positive Numeric, got #{min_length}:#{min_length.class}"
+      end
+    else
+      min_length = 0
+    end
+
+    raise Puppet::ParseError, "validate_slength(): Expected second argument to be equal to or larger than third argument" unless max_length >= min_length
+
+    validator = lambda do |str|
+      unless str.length <= max_length and str.length >= min_length
+        raise Puppet::ParseError, "validate_slength(): Expected length of #{input.inspect} to be between #{min_length} and #{max_length}, was #{input.length}"
+      end
+    end
+
+    case input
+    when String
+      validator.call(input)
+    when Array
+      input.each_with_index do |arg, pos|
+        if arg.is_a? String
+          validator.call(arg)
+        else
+          raise Puppet::ParseError, "validate_slength(): Expected element at array position #{pos} to be a String, got #{arg.class}"
+        end
+      end
+    else
+      raise Puppet::ParseError, "validate_slength(): Expected first argument to be a String or Array, got #{input.class}"
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_string.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_string.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_string.rb	(revision 30960)
@@ -0,0 +1,41 @@
+module Puppet::Parser::Functions
+
+  newfunction(:validate_string, :doc => <<-'ENDHEREDOC') do |args|
+    Validate that all passed values are string data structures. Abort catalog
+    compilation if any value fails this check.
+
+    The following values will pass:
+
+        $my_string = "one two"
+        validate_string($my_string, 'three')
+
+    The following values will fail, causing compilation to abort:
+
+        validate_string(true)
+        validate_string([ 'some', 'array' ])
+
+    Note: validate_string(undef) will not fail in this version of the
+    functions API (incl. current and future parser). Instead, use:
+
+        if $var == undef {
+          fail('...')
+        }
+
+    ENDHEREDOC
+
+    function_deprecation([:validate_string, 'This method is deprecated, please use the stdlib validate_legacy function, with Stdlib::Compat::String. There is further documentation for validate_legacy function in the README.'])
+
+    unless args.length > 0 then
+      raise Puppet::ParseError, ("validate_string(): wrong number of arguments (#{args.length}; must be > 0)")
+    end
+
+    args.each do |arg|
+      # when called through the v4 API shim, undef gets translated to nil
+      unless arg.is_a?(String) || arg.nil?
+        raise Puppet::ParseError, ("#{arg.inspect} is not a string.  It looks to be a #{arg.class}")
+      end
+    end
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_x509_rsa_key_pair.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_x509_rsa_key_pair.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/validate_x509_rsa_key_pair.rb	(revision 30960)
@@ -0,0 +1,47 @@
+module Puppet::Parser::Functions
+
+  newfunction(:validate_x509_rsa_key_pair, :doc => <<-ENDHEREDOC
+    Validates a PEM-formatted X.509 certificate and RSA private key using
+    OpenSSL. Verifies that the certficate's signature was created from the
+    supplied key.
+
+    Fail compilation if any value fails this check.
+
+    validate_x509_rsa_key_pair($cert, $key)
+
+    ENDHEREDOC
+  ) do |args|
+
+    require 'openssl'
+
+    NUM_ARGS = 2 unless defined? NUM_ARGS
+
+    unless args.length == NUM_ARGS then
+      raise Puppet::ParseError,
+        ("validate_x509_rsa_key_pair(): wrong number of arguments (#{args.length}; must be #{NUM_ARGS})")
+    end
+
+    args.each do |arg|
+      unless arg.is_a?(String)
+        raise Puppet::ParseError, "#{arg.inspect} is not a string."
+      end
+    end
+
+    begin
+      cert = OpenSSL::X509::Certificate.new(args[0])
+    rescue OpenSSL::X509::CertificateError => e
+      raise Puppet::ParseError, "Not a valid x509 certificate: #{e}"
+    end
+
+    begin
+      key = OpenSSL::PKey::RSA.new(args[1])
+    rescue OpenSSL::PKey::RSAError => e
+      raise Puppet::ParseError, "Not a valid RSA key: #{e}"
+    end
+
+    unless cert.verify(key)
+      raise Puppet::ParseError, "Certificate signature does not match supplied key"
+    end
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/values.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/values.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/values.rb	(revision 30960)
@@ -0,0 +1,39 @@
+#
+# values.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:values, :type => :rvalue, :doc => <<-EOS
+When given a hash this function will return the values of that hash.
+
+*Examples:*
+
+    $hash = {
+      'a' => 1,
+      'b' => 2,
+      'c' => 3,
+    }
+    values($hash)
+
+This example would return:
+
+    [1,2,3]
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "values(): Wrong number of arguments " +
+      "given (#{arguments.size} for 1)") if arguments.size < 1
+
+    hash = arguments[0]
+
+    unless hash.is_a?(Hash)
+      raise(Puppet::ParseError, 'values(): Requires hash to work with')
+    end
+
+    result = hash.values
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/values_at.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/values_at.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/values_at.rb	(revision 30960)
@@ -0,0 +1,99 @@
+#
+# values_at.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:values_at, :type => :rvalue, :doc => <<-EOS
+Finds value inside an array based on location.
+
+The first argument is the array you want to analyze, and the second element can
+be a combination of:
+
+* A single numeric index
+* A range in the form of 'start-stop' (eg. 4-9)
+* An array combining the above
+
+*Examples*:
+
+    values_at(['a','b','c'], 2)
+
+Would return ['c'].
+
+    values_at(['a','b','c'], ["0-1"])
+
+Would return ['a','b'].
+
+    values_at(['a','b','c','d','e'], [0, "2-3"])
+
+Would return ['a','c','d'].
+    EOS
+  ) do |arguments|
+
+    raise(Puppet::ParseError, "values_at(): Wrong number of " +
+      "arguments given (#{arguments.size} for 2)") if arguments.size < 2
+
+    array = arguments.shift
+
+    unless array.is_a?(Array)
+      raise(Puppet::ParseError, 'values_at(): Requires array to work with')
+    end
+
+    indices = [arguments.shift].flatten() # Get them all ... Pokemon ...
+
+    if not indices or indices.empty?
+      raise(Puppet::ParseError, 'values_at(): You must provide ' +
+        'at least one positive index to collect')
+    end
+
+    result       = []
+    indices_list = []
+
+    indices.each do |i|
+      i = i.to_s
+      if m = i.match(/^(\d+)(\.\.\.?|\-)(\d+)$/)
+        start = m[1].to_i
+        stop  = m[3].to_i
+
+        type = m[2]
+
+        if start > stop
+          raise(Puppet::ParseError, 'values_at(): Stop index in ' +
+            'given indices range is smaller than the start index')
+        elsif stop > array.size - 1 # First element is at index 0 is it not?
+          raise(Puppet::ParseError, 'values_at(): Stop index in ' +
+            'given indices range exceeds array size')
+        end
+
+        range = case type
+          when /^(\.\.|\-)$/ then (start .. stop)
+          when /^(\.\.\.)$/  then (start ... stop) # Exclusive of last element ...
+        end
+
+        range.each { |i| indices_list << i.to_i }
+      else
+        # Only positive numbers allowed in this case ...
+        if not i.match(/^\d+$/)
+          raise(Puppet::ParseError, 'values_at(): Unknown format ' +
+            'of given index')
+        end
+
+        # In Puppet numbers are often string-encoded ...
+        i = i.to_i
+
+        if i > array.size - 1 # Same story.  First element is at index 0 ...
+          raise(Puppet::ParseError, 'values_at(): Given index ' +
+            'exceeds array size')
+        end
+
+        indices_list << i
+      end
+    end
+
+    # We remove nil values as they make no sense in Puppet DSL ...
+    result = indices_list.collect { |i| array[i] }.compact
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/zip.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/zip.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/parser/functions/zip.rb	(revision 30960)
@@ -0,0 +1,39 @@
+#
+# zip.rb
+#
+
+module Puppet::Parser::Functions
+  newfunction(:zip, :type => :rvalue, :doc => <<-EOS
+Takes one element from first array and merges corresponding elements from second array. This generates a sequence of n-element arrays, where n is one more than the count of arguments.
+
+*Example:*
+
+    zip(['1','2','3'],['4','5','6'])
+
+Would result in:
+
+    ["1", "4"], ["2", "5"], ["3", "6"]
+    EOS
+  ) do |arguments|
+
+    # Technically we support three arguments but only first is mandatory ...
+    raise(Puppet::ParseError, "zip(): Wrong number of arguments " +
+      "given (#{arguments.size} for 2)") if arguments.size < 2
+
+    a = arguments[0]
+    b = arguments[1]
+
+    unless a.is_a?(Array) and b.is_a?(Array)
+      raise(Puppet::ParseError, 'zip(): Requires array to work with')
+    end
+
+    flatten = function_str2bool([arguments[2]]) if arguments[2]
+
+    result = a.zip(b)
+    result = flatten ? result.flatten : result
+
+    return result
+  end
+end
+
+# vim: set ts=2 sw=2 et :
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/provider/file_line/ruby.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/provider/file_line/ruby.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/provider/file_line/ruby.rb	(revision 30960)
@@ -0,0 +1,132 @@
+Puppet::Type.type(:file_line).provide(:ruby) do
+  def exists?
+    if resource[:replace].to_s != 'true' and count_matches(match_regex) > 0
+      true
+    else
+      lines.find do |line|
+        if resource[:ensure].to_s == 'absent' and resource[:match_for_absence].to_s == 'true'
+          line.chomp =~ Regexp.new(resource[:match])
+        else
+          line.chomp == resource[:line].chomp
+        end
+      end
+    end
+  end
+
+  def create
+    unless resource[:replace].to_s != 'true' and count_matches(match_regex) > 0
+      if resource[:match]
+        handle_create_with_match
+      elsif resource[:after]
+        handle_create_with_after
+      else
+        append_line
+      end
+    end
+  end
+
+  def destroy
+    if resource[:match_for_absence].to_s == 'true' and resource[:match]
+      handle_destroy_with_match
+    else
+      handle_destroy_line
+    end
+  end
+
+  private
+  def lines
+    # If this type is ever used with very large files, we should
+    #  write this in a different way, using a temp
+    #  file; for now assuming that this type is only used on
+    #  small-ish config files that can fit into memory without
+    #  too much trouble.
+    @lines ||= File.readlines(resource[:path])
+  end
+
+  def match_regex
+    resource[:match] ? Regexp.new(resource[:match]) : nil
+  end
+
+  def handle_create_with_match()
+    regex_after = resource[:after] ? Regexp.new(resource[:after]) : nil
+    match_count = count_matches(match_regex)
+
+    if match_count > 1 && resource[:multiple].to_s != 'true'
+     raise Puppet::Error, "More than one line in file '#{resource[:path]}' matches pattern '#{resource[:match]}'"
+    end
+
+    File.open(resource[:path], 'w') do |fh|
+      lines.each do |l|
+        fh.puts(match_regex.match(l) ? resource[:line] : l)
+        if (match_count == 0 and regex_after)
+          if regex_after.match(l)
+            fh.puts(resource[:line])
+            match_count += 1 #Increment match_count to indicate that the new line has been inserted.
+          end
+        end
+      end
+
+      if (match_count == 0)
+        fh.puts(resource[:line])
+      end
+    end
+  end
+
+  def handle_create_with_after
+    regex = Regexp.new(resource[:after])
+    count = count_matches(regex)
+
+    if count > 1 && resource[:multiple].to_s != 'true'
+      raise Puppet::Error, "#{count} lines match pattern '#{resource[:after]}' in file '#{resource[:path]}'.  One or no line must match the pattern."
+    end
+
+    File.open(resource[:path], 'w') do |fh|
+      lines.each do |l|
+        fh.puts(l)
+        if regex.match(l) then
+          fh.puts(resource[:line])
+        end
+      end
+    end
+
+    if (count == 0) # append the line to the end of the file
+      append_line
+    end
+  end
+
+  def count_matches(regex)
+    lines.select{|l| l.match(regex)}.size
+  end
+
+  def handle_destroy_with_match
+    match_count = count_matches(match_regex)
+    if match_count > 1 && resource[:multiple].to_s != 'true'
+     raise Puppet::Error, "More than one line in file '#{resource[:path]}' matches pattern '#{resource[:match]}'"
+    end
+
+    local_lines = lines
+    File.open(resource[:path],'w') do |fh|
+      fh.write(local_lines.reject{|l| match_regex.match(l) }.join(''))
+    end
+  end
+
+  def handle_destroy_line
+    local_lines = lines
+    File.open(resource[:path],'w') do |fh|
+      fh.write(local_lines.reject{|l| l.chomp == resource[:line] }.join(''))
+    end
+  end
+
+  ##
+  # append the line to the file.
+  #
+  # @api private
+  def append_line
+    File.open(resource[:path], 'w') do |fh|
+      lines.each do |l|
+        fh.puts(l)
+      end
+      fh.puts resource[:line]
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/type/anchor.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/type/anchor.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/type/anchor.rb	(revision 30960)
@@ -0,0 +1,46 @@
+Puppet::Type.newtype(:anchor) do
+  desc <<-'ENDOFDESC'
+  A simple resource type intended to be used as an anchor in a composite class.
+
+  In Puppet 2.6, when a class declares another class, the resources in the
+  interior class are not contained by the exterior class. This interacts badly
+  with the pattern of composing complex modules from smaller classes, as it
+  makes it impossible for end users to specify order relationships between the
+  exterior class and other modules.
+
+  The anchor type lets you work around this. By sandwiching any interior
+  classes between two no-op resources that _are_ contained by the exterior
+  class, you can ensure that all resources in the module are contained.
+
+      class ntp {
+        # These classes will have the correct order relationship with each
+        # other. However, without anchors, they won't have any order
+        # relationship to Class['ntp'].
+        class { 'ntp::package': }
+        -> class { 'ntp::config': }
+        -> class { 'ntp::service': }
+
+        # These two resources "anchor" the composed classes within the ntp
+        # class.
+        anchor { 'ntp::begin': } -> Class['ntp::package']
+        Class['ntp::service']    -> anchor { 'ntp::end': }
+      }
+
+  This allows the end user of the ntp module to establish require and before
+  relationships with Class['ntp']:
+
+      class { 'ntp': } -> class { 'mcollective': }
+      class { 'mcollective': } -> class { 'ntp': }
+
+  ENDOFDESC
+
+  newparam :name do
+    desc "The name of the anchor resource."
+  end
+
+  def refresh
+    # We don't do anything with them, but we need this to
+    #   show that we are "refresh aware" and not break the
+    #   chain of propagation.
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/type/file_line.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/type/file_line.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/lib/puppet/type/file_line.rb	(revision 30960)
@@ -0,0 +1,125 @@
+Puppet::Type.newtype(:file_line) do
+
+  desc <<-EOT
+    Ensures that a given line is contained within a file.  The implementation
+    matches the full line, including whitespace at the beginning and end.  If
+    the line is not contained in the given file, Puppet will append the line to
+    the end of the file to ensure the desired state.  Multiple resources may
+    be declared to manage multiple lines in the same file.
+
+    Example:
+
+        file_line { 'sudo_rule':
+          path => '/etc/sudoers',
+          line => '%sudo ALL=(ALL) ALL',
+        }
+
+        file_line { 'sudo_rule_nopw':
+          path => '/etc/sudoers',
+          line => '%sudonopw ALL=(ALL) NOPASSWD: ALL',
+        }
+
+    In this example, Puppet will ensure both of the specified lines are
+    contained in the file /etc/sudoers.
+
+    Match Example:
+
+        file_line { 'bashrc_proxy':
+          ensure => present,
+          path   => '/etc/bashrc',
+          line   => 'export HTTP_PROXY=http://squid.puppetlabs.vm:3128',
+          match  => '^export\ HTTP_PROXY\=',
+        }
+
+    In this code example match will look for a line beginning with export
+    followed by HTTP_PROXY and replace it with the value in line.
+
+    Match Example With `ensure => absent`:
+
+        file_line { 'bashrc_proxy':
+          ensure            => absent,
+          path              => '/etc/bashrc',
+          line              => 'export HTTP_PROXY=http://squid.puppetlabs.vm:3128',
+          match             => '^export\ HTTP_PROXY\=',
+          match_for_absence => true,
+        }
+
+    In this code example match will look for a line beginning with export
+    followed by HTTP_PROXY and delete it.  If multiple lines match, an
+    error will be raised unless the `multiple => true` parameter is set.
+
+    **Autorequires:** If Puppet is managing the file that will contain the line
+    being managed, the file_line resource will autorequire that file.
+  EOT
+
+  ensurable do
+    defaultvalues
+    defaultto :present
+  end
+
+  newparam(:name, :namevar => true) do
+    desc 'An arbitrary name used as the identity of the resource.'
+  end
+
+  newparam(:match) do
+    desc 'An optional ruby regular expression to run against existing lines in the file.' +
+         ' If a match is found, we replace that line rather than adding a new line.' +
+         ' A regex comparison is performed against the line value and if it does not' +
+         ' match an exception will be raised.'
+  end
+
+  newparam(:match_for_absence) do
+    desc 'An optional value to determine if match should be applied when ensure => absent.' +
+         ' If set to true and match is set, the line that matches match will be deleted.' +
+         ' If set to false (the default), match is ignored when ensure => absent.' +
+         ' When `ensure => present`, match_for_absence is ignored.'
+    newvalues(true, false)
+    defaultto false
+  end
+
+  newparam(:multiple) do
+    desc 'An optional value to determine if match can change multiple lines.' +
+         ' If set to false, an exception will be raised if more than one line matches'
+    newvalues(true, false)
+  end
+
+  newparam(:after) do
+    desc 'An optional value used to specify the line after which we will add any new lines. (Existing lines are added in place)' +
+         ' This is also takes a regex.'
+  end
+
+  newparam(:line) do
+    desc 'The line to be appended to the file or used to replace matches found by the match attribute.'
+  end
+
+  newparam(:path) do
+    desc 'The file Puppet will ensure contains the line specified by the line parameter.'
+    validate do |value|
+      unless Puppet::Util.absolute_path?(value)
+        raise Puppet::Error, "File paths must be fully qualified, not '#{value}'"
+      end
+    end
+  end
+
+  newparam(:replace) do
+    desc 'If true, replace line that matches. If false, do not write line if a match is found'
+    newvalues(true, false)
+    defaultto true
+  end
+
+  # Autorequire the file resource if it's being managed
+  autorequire(:file) do
+    self[:path]
+  end
+
+  validate do
+    unless self[:line]
+      unless (self[:ensure].to_s == 'absent') and (self[:match_for_absence].to_s == 'true') and self[:match]
+        raise(Puppet::Error, "line is a required attribute")
+      end
+    end
+    unless self[:path]
+      raise(Puppet::Error, "path is a required attribute")
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/manifests/init.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/manifests/init.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/manifests/init.pp	(revision 30960)
@@ -0,0 +1,18 @@
+# Class: stdlib
+#
+# This module manages stdlib. Most of stdlib's features are automatically
+# loaded by Puppet, but this class should be declared in order to use the
+# standardized run stages.
+#
+# Parameters: none
+#
+# Actions:
+#
+#   Declares all other classes in the stdlib module. Currently, this consists
+#   of stdlib::stages.
+#
+# Requires: nothing
+#
+class stdlib {
+  include ::stdlib::stages
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/manifests/stages.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/manifests/stages.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/manifests/stages.pp	(revision 30960)
@@ -0,0 +1,43 @@
+# Class: stdlib::stages
+#
+# This class manages a standard set of run stages for Puppet. It is managed by
+# the stdlib class, and should not be declared independently.
+#
+# The high level stages are (in order):
+#
+#  * setup
+#  * main
+#  * runtime
+#  * setup_infra
+#  * deploy_infra
+#  * setup_app
+#  * deploy_app
+#  * deploy
+#
+# Parameters: none
+#
+# Actions:
+#
+#   Declares various run-stages for deploying infrastructure,
+#   language runtimes, and application layers.
+#
+# Requires: nothing
+#
+# Sample Usage:
+#
+#  node default {
+#    include ::stdlib
+#    class { java: stage => 'runtime' }
+#  }
+#
+class stdlib::stages {
+
+  stage { 'setup':  before => Stage['main'] }
+  stage { 'runtime': require => Stage['main'] }
+  -> stage { 'setup_infra': }
+  -> stage { 'deploy_infra': }
+  -> stage { 'setup_app': }
+  -> stage { 'deploy_app': }
+  -> stage { 'deploy': }
+
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/metadata.json
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/metadata.json	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/metadata.json	(revision 30960)
@@ -0,0 +1,111 @@
+{
+  "name": "puppetlabs-stdlib",
+  "version": "4.13.1",
+  "author": "puppetlabs",
+  "summary": "Standard library of resources for Puppet modules.",
+  "license": "Apache-2.0",
+  "source": "https://github.com/puppetlabs/puppetlabs-stdlib",
+  "project_page": "https://github.com/puppetlabs/puppetlabs-stdlib",
+  "issues_url": "https://tickets.puppetlabs.com/browse/MODULES",
+  "operatingsystem_support": [
+    {
+      "operatingsystem": "RedHat",
+      "operatingsystemrelease": [
+        "4",
+        "5",
+        "6",
+        "7"
+      ]
+    },
+    {
+      "operatingsystem": "CentOS",
+      "operatingsystemrelease": [
+        "4",
+        "5",
+        "6",
+        "7"
+      ]
+    },
+    {
+      "operatingsystem": "OracleLinux",
+      "operatingsystemrelease": [
+        "4",
+        "5",
+        "6",
+        "7"
+      ]
+    },
+    {
+      "operatingsystem": "Scientific",
+      "operatingsystemrelease": [
+        "4",
+        "5",
+        "6",
+        "7"
+      ]
+    },
+    {
+      "operatingsystem": "SLES",
+      "operatingsystemrelease": [
+        "10 SP4",
+        "11 SP1",
+        "12"
+      ]
+    },
+    {
+      "operatingsystem": "Debian",
+      "operatingsystemrelease": [
+        "6",
+        "7",
+        "8"
+      ]
+    },
+    {
+      "operatingsystem": "Ubuntu",
+      "operatingsystemrelease": [
+        "10.04",
+        "12.04",
+        "14.04"
+      ]
+    },
+    {
+      "operatingsystem": "Solaris",
+      "operatingsystemrelease": [
+        "10",
+        "11",
+        "12"
+      ]
+    },
+    {
+      "operatingsystem": "Windows",
+      "operatingsystemrelease": [
+        "Server 2003",
+        "Server 2003 R2",
+        "Server 2008",
+        "Server 2008 R2",
+        "Server 2012",
+        "Server 2012 R2",
+        "7",
+        "8"
+      ]
+    },
+    {
+      "operatingsystem": "AIX",
+      "operatingsystemrelease": [
+        "5.3",
+        "6.1",
+        "7.1"
+      ]
+    }
+  ],
+  "requirements": [
+    {
+      "name": "puppet",
+      "version_requirement": ">=2.7.20 <5.0.0"
+    }
+  ],
+  "description": "Standard Library for Puppet Modules",
+  "dependencies": [
+
+  ]
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/abs_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/abs_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/abs_spec.rb	(revision 30960)
@@ -0,0 +1,30 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'abs function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should accept a string' do
+      pp = <<-EOS
+      $input  = '-34.56'
+      $output = abs($input)
+      notify { "$output": }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: 34.56/)
+      end
+    end
+
+    it 'should accept a float' do
+      pp = <<-EOS
+      $input  = -34.56
+      $output = abs($input)
+      notify { "$output": }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: 34.56/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/anchor_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/anchor_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/anchor_spec.rb	(revision 30960)
@@ -0,0 +1,26 @@
+require 'spec_helper_acceptance'
+
+describe 'anchor type', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should effect proper chaining of resources' do
+      pp = <<-EOS
+      class anchored {
+        anchor { 'anchored::begin': }
+        ~> anchor { 'anchored::end': }
+      }
+
+      class anchorrefresh {
+        notify { 'first': }
+        ~> class { 'anchored': }
+        ~> anchor { 'final': }
+      }
+
+      include anchorrefresh
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Anchor\[final\]: Triggered 'refresh'/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/any2array_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/any2array_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/any2array_spec.rb	(revision 30960)
@@ -0,0 +1,49 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'any2array function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should create an empty array' do
+      pp = <<-EOS
+      $input = ''
+      $output = any2array($input)
+      validate_array($output)
+      notify { "Output: ${output}": }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: Output: /)
+      end
+    end
+
+    it 'should leave arrays modified' do
+      pp = <<-EOS
+      $input = ['test', 'array']
+      $output = any2array($input)
+      validate_array($output)
+      notify { "Output: ${output}": }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: Output: (\[|)test(,\s|)array(\]|)/)
+      end
+    end
+
+    it 'should turn a hash into an array' do
+      pp = <<-EOS
+      $input = {'test' => 'array'}
+      $output = any2array($input)
+
+      validate_array($output)
+      # Check each element of the array is a plain string.
+      validate_string($output[0])
+      validate_string($output[1])
+      notify { "Output: ${output}": }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: Output: (\[|)test(,\s|)array(\]|)/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/base64_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/base64_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/base64_spec.rb	(revision 30960)
@@ -0,0 +1,18 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'base64 function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should encode then decode a string' do
+      pp = <<-EOS
+      $encodestring = base64('encode', 'thestring')
+      $decodestring = base64('decode', $encodestring)
+      notify { $decodestring: }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/thestring/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/bool2num_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/bool2num_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/bool2num_spec.rb	(revision 30960)
@@ -0,0 +1,34 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'bool2num function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    ['false', 'f', '0', 'n', 'no'].each do |bool|
+      it "should convert a given boolean, #{bool}, to 0" do
+        pp = <<-EOS
+        $input = "#{bool}"
+        $output = bool2num($input)
+        notify { "$output": }
+        EOS
+
+        apply_manifest(pp, :catch_failures => true) do |r|
+          expect(r.stdout).to match(/Notice: 0/)
+        end
+      end
+    end
+
+    ['true', 't', '1', 'y', 'yes'].each do |bool|
+      it "should convert a given boolean, #{bool}, to 1" do
+        pp = <<-EOS
+        $input = "#{bool}"
+        $output = bool2num($input)
+        notify { "$output": }
+        EOS
+
+        apply_manifest(pp, :catch_failures => true) do |r|
+          expect(r.stdout).to match(/Notice: 1/)
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/build_csv.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/build_csv.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/build_csv.rb	(revision 30960)
@@ -0,0 +1,83 @@
+#!/usr/bin/env ruby
+# vim: set sw=2 sts=2 et tw=80 :
+require 'rspec'
+
+#XXX Super ugly hack to keep from starting beaker nodes
+module Kernel
+  # make an alias of the original require
+  alias_method :original_require, :require
+  # rewrite require
+  def require name
+    original_require name if name != 'spec_helper_acceptance'
+  end
+end
+UNSUPPORTED_PLATFORMS = []
+def fact(*args) [] end
+#XXX End hax
+
+# Get a list of functions for test coverage
+function_list = Dir[File.join(File.dirname(__FILE__),"..","..","lib","puppet","parser","functions","*.rb")].collect do |function_rb|
+  File.basename(function_rb,".rb")
+end
+
+## Configure rspec to parse tests
+options = RSpec::Core::ConfigurationOptions.new(['spec/acceptance'])
+configuration = RSpec::configuration
+world = RSpec::world
+options.parse_options
+options.configure(configuration)
+configuration.load_spec_files
+
+## Collect up tests and example groups into a hash
+def get_tests(children)
+  children.inject({}) do |memo,c|
+    memo[c.description] = Hash.new
+    memo[c.description]["groups"] = get_tests(c.children) unless c.children.empty?
+    memo[c.description]["tests"] = c.examples.collect { |e|
+      e.description unless e.pending?
+    }.compact unless c.examples.empty?
+    memo[c.description]["pending_tests"] = c.examples.collect { |e|
+      e.description if e.pending?
+    }.compact unless c.examples.empty?
+    memo
+  end
+end
+
+def count_test_types_in(type,group)
+  return 0 if group.nil?
+  group.inject(0) do |m,(k,v)|
+    m += v.length if k == type
+    m += count_tests_in(v) if v.is_a?(Hash)
+    m
+  end
+end
+def count_tests_in(group)
+  count_test_types_in('tests',group)
+end
+def count_pending_tests_in(group)
+  count_test_types_in('pending_tests',group)
+end
+
+# Convert tests hash to csv format
+def to_csv(function_list,tests)
+  function_list.collect do |function_name|
+    if v = tests["#{function_name} function"]
+      positive_tests = count_tests_in(v["groups"]["success"])
+      negative_tests = count_tests_in(v["groups"]["failure"])
+      pending_tests  =
+        count_pending_tests_in(v["groups"]["failure"]) +
+        count_pending_tests_in(v["groups"]["failure"])
+    else
+      positive_tests = 0
+      negative_tests = 0
+      pending_tests  = 0
+    end
+    sprintf("%-25s, %-9d, %-9d, %-9d", function_name,positive_tests,negative_tests,pending_tests)
+  end.compact
+end
+
+tests = get_tests(world.example_groups)
+csv = to_csv(function_list,tests)
+percentage_tested = "#{tests.count*100/function_list.count}%"
+printf("%-25s,  %-9s, %-9s, %-9s\n","#{percentage_tested} have tests.","Positive","Negative","Pending")
+puts csv
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/capitalize_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/capitalize_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/capitalize_spec.rb	(revision 30960)
@@ -0,0 +1,33 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'capitalize function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should capitalize the first letter of a string' do
+      pp = <<-EOS
+      $input = 'this is a string'
+      $output = capitalize($input)
+      notify { $output: }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: This is a string/)
+      end
+    end
+
+    it 'should capitalize the first letter of an array of strings' do
+      pp = <<-EOS
+      $input = ['this', 'is', 'a', 'string']
+      $output = capitalize($input)
+      notify { $output: }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: This/)
+        expect(r.stdout).to match(/Notice: Is/)
+        expect(r.stdout).to match(/Notice: A/)
+        expect(r.stdout).to match(/Notice: String/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/ceiling_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/ceiling_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/ceiling_spec.rb	(revision 30960)
@@ -0,0 +1,39 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'ceiling function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'ceilings floats' do
+      pp = <<-EOS
+      $a = 12.8
+      $b = 13
+      $o = ceiling($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'ceilings integers' do
+      pp = <<-EOS
+      $a = 7
+      $b = 7
+      $o = ceiling($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-numbers'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/chomp_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/chomp_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/chomp_spec.rb	(revision 30960)
@@ -0,0 +1,21 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'chomp function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should eat the newline' do
+      pp = <<-EOS
+      $input = "test\n"
+      if size($input) != 5 {
+        fail("Size of ${input} is not 5.")
+      }
+      $output = chomp($input)
+      if size($output) != 4 {
+        fail("Size of ${input} is not 4.")
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/chop_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/chop_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/chop_spec.rb	(revision 30960)
@@ -0,0 +1,45 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'chop function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should eat the last character' do
+      pp = <<-EOS
+      $input = "test"
+      if size($input) != 4 {
+        fail("Size of ${input} is not 4.")
+      }
+      $output = chop($input)
+      if size($output) != 3 {
+        fail("Size of ${input} is not 3.")
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+
+    it 'should eat the last two characters of \r\n' do
+      pp = <<-'EOS'
+      $input = "test\r\n"
+      if size($input) != 6 {
+        fail("Size of ${input} is not 6.")
+      }
+      $output = chop($input)
+      if size($output) != 4 {
+        fail("Size of ${input} is not 4.")
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+
+    it 'should not fail on empty strings' do
+      pp = <<-EOS
+      $input = ""
+      $output = chop($input)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/clamp_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/clamp_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/clamp_spec.rb	(revision 30960)
@@ -0,0 +1,40 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'clamp function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'clamps list of values' do
+      pp = <<-EOS
+      $x = 17
+      $y = 225
+      $z = 155
+      $o = clamp($x, $y, $z)
+      if $o == $z {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'clamps array of values' do
+      pp = <<-EOS
+      $a = [7, 19, 66]
+      $b = 19
+      $o = clamp($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles no arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/concat_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/concat_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/concat_spec.rb	(revision 30960)
@@ -0,0 +1,54 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'concat function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should concat one array to another' do
+      pp = <<-EOS
+      $output = concat(['1','2','3'],['4','5','6'])
+      validate_array($output)
+      if size($output) != 6 {
+        fail("${output} should have 6 elements.")
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'should concat arrays and primitives to array' do
+      pp = <<-EOS
+      $output = concat(['1','2','3'],'4','5','6',['7','8','9'])
+      validate_array($output)
+      if size($output) != 9 {
+        fail("${output} should have 9 elements.")
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'should concat multiple arrays to one' do
+      pp = <<-EOS
+      $output = concat(['1','2','3'],['4','5','6'],['7','8','9'])
+      validate_array($output)
+      if size($output) != 9 {
+        fail("${output} should have 9 elements.")
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'should concat hash arguments' do
+      pp = <<-EOS
+      $output = concat([{"a" => "b"}], {"c" => "d", "e" => "f"})
+      validate_array($output)
+      if size($output) != 2 {
+        fail("${output} should have 2 elements.")
+      }
+      if $output[1] != {"c" => "d", "e" => "f"} {
+        fail("${output} does not have the expected hash for the second element.")
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/count_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/count_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/count_spec.rb	(revision 30960)
@@ -0,0 +1,30 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'count function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should count elements in an array' do
+      pp = <<-EOS
+      $input = [1,2,3,4]
+      $output = count($input)
+      notify { "$output": }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: 4/)
+      end
+    end
+
+    it 'should count elements in an array that match a second argument' do
+      pp = <<-EOS
+      $input = [1,1,1,2]
+      $output = count($input, 1)
+      notify { "$output": }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: 3/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/deep_merge_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/deep_merge_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/deep_merge_spec.rb	(revision 30960)
@@ -0,0 +1,20 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'deep_merge function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should deep merge two hashes' do
+      pp = <<-EOS
+      $hash1 = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
+      $hash2 = {'two' => 'dos', 'three' => { 'five' => 5 } }
+      $merged_hash = deep_merge($hash1, $hash2)
+
+      if $merged_hash != { 'one' => 1, 'two' => 'dos', 'three' => { 'four' => 4, 'five' => 5 } } {
+        fail("Hash was incorrectly merged.")
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/defined_with_params_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/defined_with_params_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/defined_with_params_spec.rb	(revision 30960)
@@ -0,0 +1,22 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'defined_with_params function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should successfully notify' do
+      pp = <<-EOS
+      user { 'dan':
+        ensure => present,
+      }
+
+      if defined_with_params(User[dan], {'ensure' => 'present' }) {
+        notify { 'User defined with ensure=>present': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: User defined with ensure=>present/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/delete_at_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/delete_at_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/delete_at_spec.rb	(revision 30960)
@@ -0,0 +1,19 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'delete_at function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should delete elements of the array' do
+      pp = <<-EOS
+      $output = delete_at(['a','b','c','b'], 1)
+      if $output == ['a','c','b'] {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/delete_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/delete_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/delete_spec.rb	(revision 30960)
@@ -0,0 +1,19 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'delete function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should delete elements of the array' do
+      pp = <<-EOS
+      $output = delete(['a','b','c','b'], 'b')
+      if $output == ['a','c'] {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/delete_undef_values_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/delete_undef_values_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/delete_undef_values_spec.rb	(revision 30960)
@@ -0,0 +1,19 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'delete_undef_values function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should delete elements of the array' do
+      pp = <<-EOS
+      $output = delete_undef_values({a=>'A', b=>'', c=>undef, d => false})
+      if $output == { a => 'A', b => '', d => false } {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/delete_values_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/delete_values_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/delete_values_spec.rb	(revision 30960)
@@ -0,0 +1,25 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'delete_values function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should delete elements of the hash' do
+      pp = <<-EOS
+      $a = { 'a' => 'A', 'b' => 'B', 'B' => 'C', 'd' => 'B' }
+      $b = { 'a' => 'A', 'B' => 'C' }
+      $o = delete_values($a, 'B')
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles non-hash arguments'
+    it 'handles improper argument counts'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/deprecation_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/deprecation_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/deprecation_spec.rb	(revision 30960)
@@ -0,0 +1,85 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'deprecation function' do
+
+  if fact('operatingsystem') == 'windows'
+    test_file = 'C:/deprecation'
+    else
+    test_file = "/tmp/deprecation"
+  end
+
+  # It seems that Windows needs everything to be on one line when using puppet apply -e, otherwise the manifests would be in an easier format
+  add_file_manifest = "\"deprecation('key', 'message') file { '#{test_file}': ensure => present, content => 'test', }\""
+  remove_file_manifest = "file { '#{test_file}': ensure => absent }"
+
+  before :all do
+    apply_manifest(remove_file_manifest)
+  end
+
+  context 'with --strict=error', if: get_puppet_version =~ /^4/ do
+    before :all do
+      @result = on(default, puppet('apply', '--strict=error', '-e', add_file_manifest), acceptable_exit_codes: (0...256))
+    end
+
+    after :all do
+      apply_manifest(remove_file_manifest)
+    end
+
+    it "should return an error" do
+      expect(@result.exit_code).to eq(1)
+    end
+
+    it "should show the error message" do
+      expect(@result.stderr).to match(/deprecation. key. message/)
+    end
+
+    describe file("#{test_file}") do
+      it { is_expected.not_to be_file }
+    end
+  end
+
+  context 'with --strict=warning', if: get_puppet_version =~ /^4/ do
+    before :all do
+      @result = on(default, puppet('apply', '--strict=warning', '-e', add_file_manifest), acceptable_exit_codes: (0...256))
+    end
+
+    after :all do
+      apply_manifest(remove_file_manifest)
+    end
+
+    it "should not return an error" do
+      expect(@result.exit_code).to eq(0)
+    end
+
+    it "should show the error message" do
+      expect(@result.stderr).to match(/Warning: message/)
+    end
+
+    describe file("#{test_file}") do
+      it { is_expected.to be_file }
+    end
+  end
+
+  context 'with --strict=off', if: get_puppet_version =~ /^4/ do
+    before :all do
+      @result = on(default, puppet('apply', '--strict=off', '-e', add_file_manifest), acceptable_exit_codes: (0...256))
+    end
+
+    after :all do
+      apply_manifest(remove_file_manifest)
+    end
+
+    it "should not return an error" do
+      expect(@result.exit_code).to eq(0)
+    end
+
+    it "should not show the error message" do
+      expect(@result.stderr).not_to match(/Warning: message/)
+    end
+
+    describe file("#{test_file}") do
+      it { is_expected.to be_file }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/difference_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/difference_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/difference_spec.rb	(revision 30960)
@@ -0,0 +1,26 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'difference function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'returns non-duplicates in the first array' do
+      pp = <<-EOS
+      $a = ['a','b','c']
+      $b = ['b','c','d']
+      $c = ['a']
+      $o = difference($a, $b)
+      if $o == $c {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles non-array arguments'
+    it 'handles improper argument counts'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/dirname_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/dirname_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/dirname_spec.rb	(revision 30960)
@@ -0,0 +1,42 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'dirname function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    context 'absolute path' do
+      it 'returns the dirname' do
+        pp = <<-EOS
+        $a = '/path/to/a/file.txt'
+        $b = '/path/to/a'
+        $o = dirname($a)
+        if $o == $b {
+          notify { 'output correct': }
+        }
+        EOS
+
+        apply_manifest(pp, :catch_failures => true) do |r|
+          expect(r.stdout).to match(/Notice: output correct/)
+        end
+      end
+    end
+    context 'relative path' do
+      it 'returns the dirname' do
+        pp = <<-EOS
+        $a = 'path/to/a/file.txt'
+        $b = 'path/to/a'
+        $o = dirname($a)
+        if $o == $b {
+          notify { 'output correct': }
+        }
+        EOS
+
+        apply_manifest(pp, :catch_failures => true) do |r|
+          expect(r.stdout).to match(/Notice: output correct/)
+        end
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/downcase_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/downcase_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/downcase_spec.rb	(revision 30960)
@@ -0,0 +1,39 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'downcase function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'returns the downcase' do
+      pp = <<-EOS
+      $a = 'AOEU'
+      $b = 'aoeu'
+      $o = downcase($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'doesn\'t affect lowercase words' do
+      pp = <<-EOS
+      $a = 'aoeu aoeu'
+      $b = 'aoeu aoeu'
+      $o = downcase($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-strings'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/empty_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/empty_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/empty_spec.rb	(revision 30960)
@@ -0,0 +1,53 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'empty function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'recognizes empty strings' do
+      pp = <<-EOS
+      $a = ''
+      $b = true
+      $o = empty($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'recognizes non-empty strings' do
+      pp = <<-EOS
+      $a = 'aoeu'
+      $b = false
+      $o = empty($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'handles numerical values' do
+      pp = <<-EOS
+      $a = 7
+      $b = false
+      $o = empty($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-strings'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/ensure_resource_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/ensure_resource_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/ensure_resource_spec.rb	(revision 30960)
@@ -0,0 +1,30 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'ensure_resource function' do
+  describe 'success' do
+    it 'ensures a resource already declared' do
+      apply_manifest('')
+      pp = <<-EOS
+      notify { "test": loglevel => 'err' }
+      ensure_resource('notify', 'test', { 'loglevel' => 'err' })
+      EOS
+
+      apply_manifest(pp, :expect_changes => true)
+    end
+
+    it 'ensures a undeclared resource' do
+      apply_manifest('')
+      pp = <<-EOS
+      ensure_resource('notify', 'test', { 'loglevel' => 'err' })
+      EOS
+
+      apply_manifest(pp, :expect_changes => true)
+    end
+    it 'takes defaults arguments'
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/flatten_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/flatten_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/flatten_spec.rb	(revision 30960)
@@ -0,0 +1,39 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'flatten function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'flattens arrays' do
+      pp = <<-EOS
+      $a = ["a","b",["c",["d","e"],"f","g"]]
+      $b = ["a","b","c","d","e","f","g"]
+      $o = flatten($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'does not affect flat arrays' do
+      pp = <<-EOS
+      $a = ["a","b","c","d","e","f","g"]
+      $b = ["a","b","c","d","e","f","g"]
+      $o = flatten($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-strings'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/floor_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/floor_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/floor_spec.rb	(revision 30960)
@@ -0,0 +1,39 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'floor function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'floors floats' do
+      pp = <<-EOS
+      $a = 12.8
+      $b = 12
+      $o = floor($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'floors integers' do
+      pp = <<-EOS
+      $a = 7
+      $b = 7
+      $o = floor($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-numbers'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/fqdn_rand_string_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/fqdn_rand_string_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/fqdn_rand_string_spec.rb	(revision 30960)
@@ -0,0 +1,66 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'fqdn_rand_string function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    include_context "with faked facts"
+    context "when the FQDN is 'fakehost.localdomain'" do
+      before :each do
+        fake_fact("fqdn", "fakehost.localdomain")
+      end
+
+      it 'generates random alphanumeric strings' do
+        pp = <<-eos
+        $l = 10
+        $o = fqdn_rand_string($l)
+        notice(inline_template('fqdn_rand_string is <%= @o.inspect %>'))
+        eos
+
+        apply_manifest(pp, :catch_failures => true) do |r|
+          expect(r.stdout).to match(/fqdn_rand_string is "(7oDp0KOr1b|9Acvnhkt4J)"/)
+        end
+      end
+      it 'generates random alphanumeric strings with custom charsets' do
+        pp = <<-eos
+        $l = 10
+        $c = '0123456789'
+        $o = fqdn_rand_string($l, $c)
+        notice(inline_template('fqdn_rand_string is <%= @o.inspect %>'))
+        eos
+
+        apply_manifest(pp, :catch_failures => true) do |r|
+          expect(r.stdout).to match(/fqdn_rand_string is "(7203048515|2383756694)"/)
+        end
+      end
+      it 'generates random alphanumeric strings with custom seeds' do
+        pp = <<-eos
+        $l = 10
+        $s = 'seed'
+        $o = fqdn_rand_string($l, undef, $s)
+        notice(inline_template('fqdn_rand_string is <%= @o.inspect %>'))
+        eos
+
+        apply_manifest(pp, :catch_failures => true) do |r|
+          expect(r.stdout).to match(/fqdn_rand_string is "(3HS4mbuI3E|1jJtAMs94d)"/)
+        end
+      end
+      it 'generates random alphanumeric strings with custom charsets and seeds' do
+        pp = <<-eos
+        $l = 10
+        $c = '0123456789'
+        $s = 'seed'
+        $o = fqdn_rand_string($l, $c, $s)
+        notice(inline_template('fqdn_rand_string is <%= @o.inspect %>'))
+        eos
+
+        apply_manifest(pp, :catch_failures => true) do |r|
+          expect(r.stdout).to match(/fqdn_rand_string is "(3104058232|7100592312)"/)
+        end
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-numbers for length argument'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/fqdn_rotate_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/fqdn_rotate_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/fqdn_rotate_spec.rb	(revision 30960)
@@ -0,0 +1,64 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'fqdn_rotate function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    include_context "with faked facts"
+    context "when the FQDN is 'fakehost.localdomain'" do
+      before :each do
+        fake_fact("fqdn", "fakehost.localdomain")
+      end
+
+      it 'rotates arrays' do
+        pp = <<-EOS
+        $a = ['a','b','c','d']
+        $o = fqdn_rotate($a)
+        notice(inline_template('fqdn_rotate is <%= @o.inspect %>'))
+        EOS
+
+        apply_manifest(pp, :catch_failures => true) do |r|
+          expect(r.stdout).to match(/fqdn_rotate is \["d", "a", "b", "c"\]/)
+        end
+      end
+      it 'rotates arrays with custom seeds' do
+        pp = <<-EOS
+        $a = ['a','b','c','d']
+        $s = 'seed'
+        $o = fqdn_rotate($a, $s)
+        notice(inline_template('fqdn_rotate is <%= @o.inspect %>'))
+        EOS
+
+        apply_manifest(pp, :catch_failures => true) do |r|
+          expect(r.stdout).to match(/fqdn_rotate is \["c", "d", "a", "b"\]/)
+        end
+      end
+      it 'rotates strings' do
+        pp = <<-EOS
+        $a = 'abcd'
+        $o = fqdn_rotate($a)
+        notice(inline_template('fqdn_rotate is <%= @o.inspect %>'))
+        EOS
+
+        apply_manifest(pp, :catch_failures => true) do |r|
+          expect(r.stdout).to match(/fqdn_rotate is "dabc"/)
+        end
+      end
+      it 'rotates strings with custom seeds' do
+        pp = <<-EOS
+        $a = 'abcd'
+        $s = 'seed'
+        $o = fqdn_rotate($a, $s)
+        notice(inline_template('fqdn_rotate is <%= @o.inspect %>'))
+        EOS
+
+        apply_manifest(pp, :catch_failures => true) do |r|
+          expect(r.stdout).to match(/fqdn_rotate is "cdab"/)
+        end
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles invalid arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/get_module_path_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/get_module_path_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/get_module_path_spec.rb	(revision 30960)
@@ -0,0 +1,27 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'get_module_path function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'get_module_paths dne' do
+      pp = <<-EOS
+      $a = $::is_pe ? {
+        'true'  => '/etc/puppetlabs/puppet/modules/dne',
+        'false' => '/etc/puppet/modules/dne',
+      }
+      $o = get_module_path('dne')
+      if $o == $a {
+        notify { 'output correct': }
+      } else {
+        notify { "failed; module path is '$o'": }
+      }
+      EOS
+
+      apply_manifest(pp, :expect_failures => true)
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-numbers'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/getparam_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/getparam_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/getparam_spec.rb	(revision 30960)
@@ -0,0 +1,24 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'getparam function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'getparam a notify' do
+      pp = <<-EOS
+      notify { 'rspec':
+        message => 'custom rspec message',
+      }
+      $o = getparam(Notify['rspec'], 'message')
+      notice(inline_template('getparam is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/getparam is "custom rspec message"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/getvar_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/getvar_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/getvar_spec.rb	(revision 30960)
@@ -0,0 +1,26 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'getvar function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'getvars from classes' do
+      pp = <<-EOS
+      class a::data { $foo = 'aoeu' }
+      include a::data
+      $b = 'aoeu'
+      $o = getvar("a::data::foo")
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-numbers'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/grep_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/grep_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/grep_spec.rb	(revision 30960)
@@ -0,0 +1,26 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'grep function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'greps arrays' do
+      pp = <<-EOS
+      $a = ['aaabbb','bbbccc','dddeee']
+      $b = 'bbb'
+      $c = ['aaabbb','bbbccc']
+      $o = grep($a,$b)
+      if $o == $c {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/has_interface_with_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/has_interface_with_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/has_interface_with_spec.rb	(revision 30960)
@@ -0,0 +1,54 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'has_interface_with function', :unless => ((UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem'))) or (fact('osfamily') == 'windows') or (fact('osfamily') == 'AIX')) do
+  describe 'success' do
+    it 'has_interface_with existing ipaddress' do
+      pp = <<-EOS
+      $a = $::ipaddress
+      $o = has_interface_with('ipaddress', $a)
+      notice(inline_template('has_interface_with is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/has_interface_with is true/)
+      end
+    end
+    it 'has_interface_with absent ipaddress' do
+      pp = <<-EOS
+      $a = '128.0.0.1'
+      $o = has_interface_with('ipaddress', $a)
+      notice(inline_template('has_interface_with is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/has_interface_with is false/)
+      end
+    end
+    it 'has_interface_with existing interface' do
+      pp = <<-EOS
+      if $osfamily == 'Solaris' or $osfamily == 'Darwin' {
+        $a = 'lo0'
+      }elsif $osfamily == 'windows' {
+        $a = $::kernelmajversion ? {
+          /6\.(2|3|4)/ => 'Ethernet0',
+          /6\.(0|1)/ => 'Local_Area_Connection',
+          /5\.(1|2)/  => undef, #Broken current in facter
+        }
+      }else {
+        $a = 'lo'
+      }
+      $o = has_interface_with($a)
+      notice(inline_template('has_interface_with is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/has_interface_with is true/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/has_ip_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/has_ip_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/has_ip_address_spec.rb	(revision 30960)
@@ -0,0 +1,33 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'has_ip_address function', :unless => ((UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem'))) or (fact('osfamily') == 'windows') or (fact('osfamily') == 'AIX')) do
+  describe 'success' do
+    it 'has_ip_address existing ipaddress' do
+      pp = <<-EOS
+      $a = '127.0.0.1'
+      $o = has_ip_address($a)
+      notice(inline_template('has_ip_address is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/has_ip_address is true/)
+      end
+    end
+    it 'has_ip_address absent ipaddress' do
+      pp = <<-EOS
+      $a = '128.0.0.1'
+      $o = has_ip_address($a)
+      notice(inline_template('has_ip_address is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/has_ip_address is false/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/has_ip_network_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/has_ip_network_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/has_ip_network_spec.rb	(revision 30960)
@@ -0,0 +1,33 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'has_ip_network function', :unless => ((UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem'))) or (fact('osfamily') == 'windows') or (fact('osfamily') == 'AIX')) do
+  describe 'success' do
+    it 'has_ip_network existing ipaddress' do
+      pp = <<-EOS
+      $a = '127.0.0.0'
+      $o = has_ip_network($a)
+      notice(inline_template('has_ip_network is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/has_ip_network is true/)
+      end
+    end
+    it 'has_ip_network absent ipaddress' do
+      pp = <<-EOS
+      $a = '128.0.0.0'
+      $o = has_ip_network($a)
+      notice(inline_template('has_ip_network is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/has_ip_network is false/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/has_key_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/has_key_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/has_key_spec.rb	(revision 30960)
@@ -0,0 +1,41 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'has_key function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'has_keys in hashes' do
+      pp = <<-EOS
+      $a = { 'aaa' => 'bbb','bbb' => 'ccc','ddd' => 'eee' }
+      $b = 'bbb'
+      $c = true
+      $o = has_key($a,$b)
+      if $o == $c {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'has_keys not in hashes' do
+      pp = <<-EOS
+      $a = { 'aaa' => 'bbb','bbb' => 'ccc','ddd' => 'eee' }
+      $b = 'ccc'
+      $c = false
+      $o = has_key($a,$b)
+      if $o == $c {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-hashes'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/hash_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/hash_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/hash_spec.rb	(revision 30960)
@@ -0,0 +1,26 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'hash function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'hashs arrays' do
+      pp = <<-EOS
+      $a = ['aaa','bbb','bbb','ccc','ddd','eee']
+      $b = { 'aaa' => 'bbb', 'bbb' => 'ccc', 'ddd' => 'eee' }
+      $o = hash($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'handles odd-length arrays'
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/intersection_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/intersection_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/intersection_spec.rb	(revision 30960)
@@ -0,0 +1,27 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'intersection function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'intersections arrays' do
+      pp = <<-EOS
+      $a = ['aaa','bbb','ccc']
+      $b = ['bbb','ccc','ddd','eee']
+      $c = ['bbb','ccc']
+      $o = intersection($a,$b)
+      if $o == $c {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'intersections empty arrays'
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_a_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_a_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_a_spec.rb	(revision 30960)
@@ -0,0 +1,30 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+if get_puppet_version =~ /^4/
+  describe 'is_a function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+    it 'should match a string' do
+      pp = <<-EOS
+      if 'hello world'.is_a(String) {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+
+    it 'should not match a integer as string' do
+      pp = <<-EOS
+      if 5.is_a(String) {
+        notify { 'output wrong': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).not_to match(/Notice: output wrong/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_array_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_array_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_array_spec.rb	(revision 30960)
@@ -0,0 +1,67 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'is_array function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'is_arrays arrays' do
+      pp = <<-EOS
+      $a = ['aaa','bbb','ccc']
+      $b = true
+      $o = is_array($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_arrays empty arrays' do
+      pp = <<-EOS
+      $a = []
+      $b = true
+      $o = is_array($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_arrays strings' do
+      pp = <<-EOS
+      $a = "aoeu"
+      $b = false
+      $o = is_array($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_arrays hashes' do
+      pp = <<-EOS
+      $a = {'aaa'=>'bbb'}
+      $b = false
+      $o = is_array($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_bool_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_bool_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_bool_spec.rb	(revision 30960)
@@ -0,0 +1,81 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'is_bool function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'is_bools arrays' do
+      pp = <<-EOS
+      $a = ['aaa','bbb','ccc']
+      $b = false
+      $o = is_bool($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_bools true' do
+      pp = <<-EOS
+      $a = true
+      $b = true
+      $o = is_bool($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_bools false' do
+      pp = <<-EOS
+      $a = false
+      $b = true
+      $o = is_bool($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_bools strings' do
+      pp = <<-EOS
+      $a = "true"
+      $b = false
+      $o = is_bool($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_bools hashes' do
+      pp = <<-EOS
+      $a = {'aaa'=>'bbb'}
+      $b = false
+      $o = is_bool($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_domain_name_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_domain_name_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_domain_name_spec.rb	(revision 30960)
@@ -0,0 +1,83 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'is_domain_name function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'is_domain_names arrays' do
+      pp = <<-EOS
+      $a = ['aaa.com','bbb','ccc']
+      $o = is_domain_name($a)
+      notice(inline_template('is_domain_name is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_domain_name is false/)
+      end
+    end
+    it 'is_domain_names true' do
+      pp = <<-EOS
+      $a = true
+      $o = is_domain_name($a)
+      notice(inline_template('is_domain_name is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_domain_name is false/)
+      end
+    end
+    it 'is_domain_names false' do
+      pp = <<-EOS
+      $a = false
+      $o = is_domain_name($a)
+      notice(inline_template('is_domain_name is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_domain_name is false/)
+      end
+    end
+    it 'is_domain_names strings with hyphens' do
+      pp = <<-EOS
+      $a = "3foo-bar.2bar-fuzz.com"
+      $b = true
+      $o = is_domain_name($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_domain_names strings beginning with hyphens' do
+      pp = <<-EOS
+      $a = "-bar.2bar-fuzz.com"
+      $b = false
+      $o = is_domain_name($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_domain_names hashes' do
+      pp = <<-EOS
+      $a = {'aaa'=>'www.com'}
+      $o = is_domain_name($a)
+      notice(inline_template('is_domain_name is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_domain_name is false/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_float_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_float_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_float_spec.rb	(revision 30960)
@@ -0,0 +1,86 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'is_float function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'is_floats arrays' do
+      pp = <<-EOS
+      $a = ['aaa.com','bbb','ccc']
+      $o = is_float($a)
+      notice(inline_template('is_float is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_float is false/)
+      end
+    end
+    it 'is_floats true' do
+      pp = <<-EOS
+      $a = true
+      $o = is_float($a)
+      notice(inline_template('is_float is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_float is false/)
+      end
+    end
+    it 'is_floats strings' do
+      pp = <<-EOS
+      $a = "3.5"
+      $b = true
+      $o = is_float($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_floats floats' do
+      pp = <<-EOS
+      $a = 3.5
+      $b = true
+      $o = is_float($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_floats integers' do
+      pp = <<-EOS
+      $a = 3
+      $b = false
+      $o = is_float($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_floats hashes' do
+      pp = <<-EOS
+      $a = {'aaa'=>'www.com'}
+      $o = is_float($a)
+      notice(inline_template('is_float is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_float is false/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_function_available_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_function_available_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_function_available_spec.rb	(revision 30960)
@@ -0,0 +1,58 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'is_function_available function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'is_function_availables arrays' do
+      pp = <<-EOS
+      $a = ['fail','include','require']
+      $o = is_function_available($a)
+      notice(inline_template('is_function_available is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_function_available is false/)
+      end
+    end
+    it 'is_function_availables true' do
+      pp = <<-EOS
+      $a = true
+      $o = is_function_available($a)
+      notice(inline_template('is_function_available is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_function_available is false/)
+      end
+    end
+    it 'is_function_availables strings' do
+      pp = <<-EOS
+      $a = "fail"
+      $b = true
+      $o = is_function_available($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_function_availables function_availables' do
+      pp = <<-EOS
+      $a = "is_function_available"
+      $o = is_function_available($a)
+      notice(inline_template('is_function_available is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_function_available is true/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_hash_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_hash_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_hash_spec.rb	(revision 30960)
@@ -0,0 +1,63 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'is_hash function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'is_hashs arrays' do
+      pp = <<-EOS
+      $a = ['aaa','bbb','ccc']
+      $o = is_hash($a)
+      notice(inline_template('is_hash is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_hash is false/)
+      end
+    end
+    it 'is_hashs empty hashs' do
+      pp = <<-EOS
+      $a = {}
+      $b = true
+      $o = is_hash($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_hashs strings' do
+      pp = <<-EOS
+      $a = "aoeu"
+      $b = false
+      $o = is_hash($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_hashs hashes' do
+      pp = <<-EOS
+      $a = {'aaa'=>'bbb'}
+      $b = true
+      $o = is_hash($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_integer_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_integer_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_integer_spec.rb	(revision 30960)
@@ -0,0 +1,95 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'is_integer function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'is_integers arrays' do
+      pp = <<-EOS
+      $a = ['aaa.com','bbb','ccc']
+      $b = false
+      $o = is_integer($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_integers true' do
+      pp = <<-EOS
+      $a = true
+      $b = false
+      $o = is_integer($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_integers strings' do
+      pp = <<-EOS
+      $a = "3"
+      $b = true
+      $o = is_integer($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_integers floats' do
+      pp = <<-EOS
+      $a = 3.5
+      $b = false
+      $o = is_integer($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_integers integers' do
+      pp = <<-EOS
+      $a = 3
+      $b = true
+      $o = is_integer($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_integers hashes' do
+      pp = <<-EOS
+      $a = {'aaa'=>'www.com'}
+      $b = false
+      $o = is_integer($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_ip_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_ip_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_ip_address_spec.rb	(revision 30960)
@@ -0,0 +1,80 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'is_ip_address function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'is_ip_addresss ipv4' do
+      pp = <<-EOS
+      $a = '1.2.3.4'
+      $b = true
+      $o = is_ip_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_ip_addresss ipv6' do
+      pp = <<-EOS
+      $a = "fe80:0000:cd12:d123:e2f8:47ff:fe09:dd74"
+      $b = true
+      $o = is_ip_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_ip_addresss ipv6 compressed' do
+      pp = <<-EOS
+      $a = "fe00::1"
+      $b = true
+      $o = is_ip_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_ip_addresss strings' do
+      pp = <<-EOS
+      $a = "aoeu"
+      $b = false
+      $o = is_ip_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_ip_addresss ipv4 out of range' do
+      pp = <<-EOS
+      $a = '1.2.3.400'
+      $b = false
+      $o = is_ip_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_ipv4_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_ipv4_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_ipv4_address_spec.rb	(revision 30960)
@@ -0,0 +1,52 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'is_ipv4_address function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'is_ipv4_addresss' do
+      pp = <<-EOS
+      $a = '1.2.3.4'
+      $b = true
+      $o = is_ipv4_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_ipv4_addresss strings' do
+      pp = <<-EOS
+      $a = "aoeu"
+      $b = false
+      $o = is_ipv4_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_ipv4_addresss ipv4 out of range' do
+      pp = <<-EOS
+      $a = '1.2.3.400'
+      $b = false
+      $o = is_ipv4_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_ipv6_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_ipv6_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_ipv6_address_spec.rb	(revision 30960)
@@ -0,0 +1,66 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'is_ipv6_address function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'is_ipv6_addresss' do
+      pp = <<-EOS
+      $a = "fe80:0000:cd12:d123:e2f8:47ff:fe09:dd74"
+      $b = true
+      $o = is_ipv6_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_ipv6_addresss ipv6 compressed' do
+      pp = <<-EOS
+      $a = "fe00::1"
+      $b = true
+      $o = is_ipv6_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_ipv6_addresss strings' do
+      pp = <<-EOS
+      $a = "aoeu"
+      $b = false
+      $o = is_ipv6_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_ipv6_addresss ip out of range' do
+      pp = <<-EOS
+      $a = 'fe80:0000:cd12:d123:e2f8:47ff:fe09:gggg'
+      $b = false
+      $o = is_ipv6_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_mac_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_mac_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_mac_address_spec.rb	(revision 30960)
@@ -0,0 +1,38 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'is_mac_address function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'is_mac_addresss a mac' do
+      pp = <<-EOS
+      $a = '00:a0:1f:12:7f:a0'
+      $b = true
+      $o = is_mac_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_mac_addresss a mac out of range' do
+      pp = <<-EOS
+      $a = '00:a0:1f:12:7f:g0'
+      $b = false
+      $o = is_mac_address($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_numeric_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_numeric_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_numeric_spec.rb	(revision 30960)
@@ -0,0 +1,95 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'is_numeric function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'is_numerics arrays' do
+      pp = <<-EOS
+      $a = ['aaa.com','bbb','ccc']
+      $b = false
+      $o = is_numeric($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_numerics true' do
+      pp = <<-EOS
+      $a = true
+      $b = false
+      $o = is_numeric($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_numerics strings' do
+      pp = <<-EOS
+      $a = "3"
+      $b = true
+      $o = is_numeric($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_numerics floats' do
+      pp = <<-EOS
+      $a = 3.5
+      $b = true
+      $o = is_numeric($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_numerics integers' do
+      pp = <<-EOS
+      $a = 3
+      $b = true
+      $o = is_numeric($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_numerics hashes' do
+      pp = <<-EOS
+      $a = {'aaa'=>'www.com'}
+      $b = false
+      $o = is_numeric($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+    it 'handles non-arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_string_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_string_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/is_string_spec.rb	(revision 30960)
@@ -0,0 +1,113 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'is_string function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'is_strings arrays' do
+      pp = <<-EOS
+      $a = ['aaa.com','bbb','ccc']
+      $b = false
+      $o = is_string($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_strings true' do
+      pp = <<-EOS
+      $a = true
+      $b = false
+      $o = is_string($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_strings strings' do
+      pp = <<-EOS
+      $a = "aoeu"
+      $o = is_string($a)
+      notice(inline_template('is_string is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_string is true/)
+      end
+    end
+    it 'is_strings number strings' do
+      pp = <<-EOS
+      $a = "3"
+      $o = is_string($a)
+      notice(inline_template('is_string is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_string is false/)
+      end
+    end
+    it 'is_strings floats' do
+      pp = <<-EOS
+      $a = 3.5
+      $b = false
+      $o = is_string($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_strings integers' do
+      pp = <<-EOS
+      $a = 3
+      $b = false
+      $o = is_string($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_strings hashes' do
+      pp = <<-EOS
+      $a = {'aaa'=>'www.com'}
+      $b = false
+      $o = is_string($a)
+      if $o == $b {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'is_strings undef' do
+      pp = <<-EOS
+      $a = undef
+      $o = is_string($a)
+      notice(inline_template('is_string is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/is_string is true/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/join_keys_to_values_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/join_keys_to_values_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/join_keys_to_values_spec.rb	(revision 30960)
@@ -0,0 +1,24 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'join_keys_to_values function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'join_keys_to_valuess hashes' do
+      pp = <<-EOS
+      $a = {'aaa'=>'bbb','ccc'=>'ddd'}
+      $b = ':'
+      $o = join_keys_to_values($a,$b)
+      notice(inline_template('join_keys_to_values is <%= @o.sort.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/join_keys_to_values is \["aaa:bbb", "ccc:ddd"\]/)
+      end
+    end
+    it 'handles non hashes'
+    it 'handles empty hashes'
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/join_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/join_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/join_spec.rb	(revision 30960)
@@ -0,0 +1,26 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'join function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'joins arrays' do
+      pp = <<-EOS
+      $a = ['aaa','bbb','ccc']
+      $b = ':'
+      $c = 'aaa:bbb:ccc'
+      $o = join($a,$b)
+      if $o == $c {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    it 'handles non arrays'
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/keys_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/keys_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/keys_spec.rb	(revision 30960)
@@ -0,0 +1,23 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'keys function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'keyss hashes' do
+      pp = <<-EOS
+      $a = {'aaa'=>'bbb','ccc'=>'ddd'}
+      $o = keys($a)
+      notice(inline_template('keys is <%= @o.sort.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/keys is \["aaa", "ccc"\]/)
+      end
+    end
+    it 'handles non hashes'
+    it 'handles empty hashes'
+  end
+  describe 'failure' do
+    it 'handles improper argument counts'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/loadjson_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/loadjson_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/loadjson_spec.rb	(revision 30960)
@@ -0,0 +1,52 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+tmpdir = default.tmpdir('stdlib')
+
+describe 'loadjson function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'loadjsons array of values' do
+      shell("echo '{\"aaa\":1,\"bbb\":2,\"ccc\":3,\"ddd\":4}' > #{tmpdir}/testjson.json")
+      pp = <<-EOS
+      $o = loadjson('#{tmpdir}/testjson.json')
+      notice(inline_template('loadjson[aaa] is <%= @o["aaa"].inspect %>'))
+      notice(inline_template('loadjson[bbb] is <%= @o["bbb"].inspect %>'))
+      notice(inline_template('loadjson[ccc] is <%= @o["ccc"].inspect %>'))
+      notice(inline_template('loadjson[ddd] is <%= @o["ddd"].inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/loadjson\[aaa\] is 1/)
+        expect(r.stdout).to match(/loadjson\[bbb\] is 2/)
+        expect(r.stdout).to match(/loadjson\[ccc\] is 3/)
+        expect(r.stdout).to match(/loadjson\[ddd\] is 4/)
+      end
+    end
+
+    it 'returns the default value if there is no file to load' do
+      pp = <<-EOS
+      $o = loadjson('#{tmpdir}/no-file.json', {'default' => 'value'})
+      notice(inline_template('loadjson[default] is <%= @o["default"].inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/loadjson\[default\] is "value"/)
+      end
+    end
+
+    it 'returns the default value if the file was parsed with an error' do
+      shell("echo '!' > #{tmpdir}/testjson.json")
+      pp = <<-EOS
+      $o = loadjson('#{tmpdir}/testjson.json', {'default' => 'value'})
+      notice(inline_template('loadjson[default] is <%= @o["default"].inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/loadjson\[default\] is "value"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'fails with no arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/loadyaml_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/loadyaml_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/loadyaml_spec.rb	(revision 30960)
@@ -0,0 +1,56 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+tmpdir = default.tmpdir('stdlib')
+
+describe 'loadyaml function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'loadyamls array of values' do
+      shell("echo '---
+      aaa: 1
+      bbb: 2
+      ccc: 3
+      ddd: 4' > #{tmpdir}/testyaml.yaml")
+      pp = <<-EOS
+      $o = loadyaml('#{tmpdir}/testyaml.yaml')
+      notice(inline_template('loadyaml[aaa] is <%= @o["aaa"].inspect %>'))
+      notice(inline_template('loadyaml[bbb] is <%= @o["bbb"].inspect %>'))
+      notice(inline_template('loadyaml[ccc] is <%= @o["ccc"].inspect %>'))
+      notice(inline_template('loadyaml[ddd] is <%= @o["ddd"].inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/loadyaml\[aaa\] is 1/)
+        expect(r.stdout).to match(/loadyaml\[bbb\] is 2/)
+        expect(r.stdout).to match(/loadyaml\[ccc\] is 3/)
+        expect(r.stdout).to match(/loadyaml\[ddd\] is 4/)
+      end
+    end
+
+    it 'returns the default value if there is no file to load' do
+      pp = <<-EOS
+      $o = loadyaml('#{tmpdir}/no-file.yaml', {'default' => 'value'})
+      notice(inline_template('loadyaml[default] is <%= @o["default"].inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/loadyaml\[default\] is "value"/)
+      end
+    end
+
+    it 'returns the default value if the file was parsed with an error' do
+      shell("echo '!' > #{tmpdir}/testyaml.yaml")
+      pp = <<-EOS
+      $o = loadyaml('#{tmpdir}/testyaml.yaml', {'default' => 'value'})
+      notice(inline_template('loadyaml[default] is <%= @o["default"].inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/loadyaml\[default\] is "value"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'fails with no arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/lstrip_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/lstrip_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/lstrip_spec.rb	(revision 30960)
@@ -0,0 +1,34 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'lstrip function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'lstrips arrays' do
+      pp = <<-EOS
+      $a = ["  the   ","   public   ","   art","galleries   "]
+      # Anagram: Large picture halls, I bet
+      $o = lstrip($a)
+      notice(inline_template('lstrip is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/lstrip is \["the   ", "public   ", "art", "galleries   "\]/)
+      end
+    end
+    it 'lstrips strings' do
+      pp = <<-EOS
+      $a = "   blowzy night-frumps vex'd jack q   "
+      $o = lstrip($a)
+      notice(inline_template('lstrip is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/lstrip is "blowzy night-frumps vex'd jack q   "/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings or arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/max_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/max_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/max_spec.rb	(revision 30960)
@@ -0,0 +1,20 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'max function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'maxs arrays' do
+      pp = <<-EOS
+      $o = max("the","public","art","galleries")
+      notice(inline_template('max is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/max is "the"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/member_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/member_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/member_spec.rb	(revision 30960)
@@ -0,0 +1,54 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'member function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  shared_examples 'item found' do
+    it 'should output correctly' do
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+  end
+  describe 'success' do
+    it 'members arrays' do
+      pp = <<-EOS
+      $a = ['aaa','bbb','ccc']
+      $b = 'ccc'
+      $c = true
+      $o = member($a,$b)
+      if $o == $c {
+        notify { 'output correct': }
+      }
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/Notice: output correct/)
+      end
+    end
+    describe 'members array of integers' do
+      it_should_behave_like 'item found' do
+        let(:pp) { <<-EOS
+      if member( [1,2,3,4], 4 ){
+        notify { 'output correct': }
+      }
+        EOS
+        }
+      end
+    end
+    describe 'members of mixed array' do
+      it_should_behave_like 'item found' do
+        let(:pp) { <<-EOS
+      if member( ['a','4',3], 'a' ){
+        notify { 'output correct': }
+}
+        EOS
+        }
+      end
+    end
+    it 'members arrays without members'
+  end
+
+  describe 'failure' do
+    it 'handles improper argument counts'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/merge_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/merge_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/merge_spec.rb	(revision 30960)
@@ -0,0 +1,23 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'merge function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'should merge two hashes' do
+      pp = <<-EOS
+      $a = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
+      $b = {'two' => 'dos', 'three' => { 'five' => 5 } }
+      $o = merge($a, $b)
+      notice(inline_template('merge[one]   is <%= @o["one"].inspect %>'))
+      notice(inline_template('merge[two]   is <%= @o["two"].inspect %>'))
+      notice(inline_template('merge[three] is <%= @o["three"].inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/merge\[one\]   is ("1"|1)/)
+        expect(r.stdout).to match(/merge\[two\]   is "dos"/)
+        expect(r.stdout).to match(/merge\[three\] is {"five"=>("5"|5)}/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/min_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/min_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/min_spec.rb	(revision 30960)
@@ -0,0 +1,20 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'min function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'mins arrays' do
+      pp = <<-EOS
+      $o = min("the","public","art","galleries")
+      notice(inline_template('min is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/min is "art"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/centos-7-x64.yml
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/centos-7-x64.yml	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/centos-7-x64.yml	(revision 30960)
@@ -0,0 +1,10 @@
+HOSTS:
+  centos-7-x64:
+    roles:
+      - agent
+      - default
+    platform: el-7-x86_64
+    hypervisor: vagrant
+    box: puppetlabs/centos-7.2-64-nocm
+CONFIG:
+  type: foss
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/debian-8-x64.yml
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/debian-8-x64.yml	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/debian-8-x64.yml	(revision 30960)
@@ -0,0 +1,10 @@
+HOSTS:
+  debian-8-x64:
+    roles:
+      - agent
+      - default
+    platform: debian-8-amd64
+    hypervisor: vagrant
+    box: puppetlabs/debian-8.2-64-nocm
+CONFIG:
+  type: foss
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/default.yml
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/default.yml	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/default.yml	(revision 30960)
@@ -0,0 +1,10 @@
+HOSTS:
+  ubuntu-1404-x64:
+    roles:
+      - agent
+      - default
+    platform: ubuntu-14.04-amd64
+    hypervisor: vagrant
+    box: puppetlabs/ubuntu-14.04-64-nocm
+CONFIG:
+  type: foss
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/docker/centos-7.yml
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/docker/centos-7.yml	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/docker/centos-7.yml	(revision 30960)
@@ -0,0 +1,12 @@
+HOSTS:
+  centos-7-x64:
+    platform: el-7-x86_64
+    hypervisor: docker
+    image: centos:7
+    docker_preserve_image: true
+    docker_cmd: '["/usr/sbin/init"]'
+    # install various tools required to get the image up to usable levels
+    docker_image_commands:
+      - 'yum install -y crontabs tar wget openssl sysvinit-tools iproute which initscripts'
+CONFIG:
+  trace_limit: 200
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/docker/debian-8.yml
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/docker/debian-8.yml	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/docker/debian-8.yml	(revision 30960)
@@ -0,0 +1,11 @@
+HOSTS:
+  debian-8-x64:
+    platform: debian-8-amd64
+    hypervisor: docker
+    image: debian:8
+    docker_preserve_image: true
+    docker_cmd: '["/sbin/init"]'
+    docker_image_commands:
+      - 'apt-get update && apt-get install -y net-tools wget locales strace lsof && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen'
+CONFIG:
+  trace_limit: 200
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/docker/ubuntu-14.04.yml
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/docker/ubuntu-14.04.yml	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/nodesets/docker/ubuntu-14.04.yml	(revision 30960)
@@ -0,0 +1,12 @@
+HOSTS:
+  ubuntu-1404-x64:
+    platform: ubuntu-14.04-amd64
+    hypervisor: docker
+    image: ubuntu:14.04
+    docker_preserve_image: true
+    docker_cmd: '["/sbin/init"]'
+    docker_image_commands:
+      # ensure that upstart is booting correctly in the container
+      - 'rm /usr/sbin/policy-rc.d && rm /sbin/initctl && dpkg-divert --rename --remove /sbin/initctl && apt-get update && apt-get install -y net-tools wget && locale-gen en_US.UTF-8'
+CONFIG:
+  trace_limit: 200
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/num2bool_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/num2bool_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/num2bool_spec.rb	(revision 30960)
@@ -0,0 +1,76 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'num2bool function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'bools positive numbers and numeric strings as true' do
+      pp = <<-EOS
+      $a = 1
+      $b = "1"
+      $c = "50"
+      $ao = num2bool($a)
+      $bo = num2bool($b)
+      $co = num2bool($c)
+      notice(inline_template('a is <%= @ao.inspect %>'))
+      notice(inline_template('b is <%= @bo.inspect %>'))
+      notice(inline_template('c is <%= @co.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/a is true/)
+        expect(r.stdout).to match(/b is true/)
+        expect(r.stdout).to match(/c is true/)
+      end
+    end
+    it 'bools negative numbers as false' do
+      pp = <<-EOS
+      $a = 0
+      $b = -0.1
+      $c = ["-50","1"]
+      $ao = num2bool($a)
+      $bo = num2bool($b)
+      $co = num2bool($c)
+      notice(inline_template('a is <%= @ao.inspect %>'))
+      notice(inline_template('b is <%= @bo.inspect %>'))
+      notice(inline_template('c is <%= @co.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/a is false/)
+        expect(r.stdout).to match(/b is false/)
+        expect(r.stdout).to match(/c is false/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'fails on words' do
+      pp = <<-EOS
+      $a = "a"
+      $ao = num2bool($a)
+      notice(inline_template('a is <%= @ao.inspect %>'))
+      EOS
+      expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/not look like a number/)
+    end
+
+    it 'fails on numberwords' do
+      pp = <<-EOS
+      $b = "1b"
+      $bo = num2bool($b)
+      notice(inline_template('b is <%= @bo.inspect %>'))
+      EOS
+      expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/not look like a number/)
+
+    end
+
+    it 'fails on non-numeric/strings' do
+      pending "The function will call .to_s.to_i on anything not a Numeric or
+      String, and results in 0. Is this intended?"
+      pp = <<-EOS
+      $c = {"c" => "-50"}
+      $co = num2bool($c)
+      notice(inline_template('c is <%= @co.inspect %>'))
+      EOS
+      expect(apply_manifest(ppc :expect_failures => true).stderr).to match(/Unable to parse/)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/parsejson_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/parsejson_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/parsejson_spec.rb	(revision 30960)
@@ -0,0 +1,55 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'parsejson function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'parses valid json' do
+      pp = <<-EOS
+      $a = '{"hunter": "washere", "tests": "passing"}'
+      $ao = parsejson($a)
+      $tests = $ao['tests']
+      notice(inline_template('tests are <%= @tests.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/tests are "passing"/)
+      end
+    end
+  end
+
+  describe 'failure' do
+    it 'raises error on incorrect json' do
+      pp = <<-EOS
+      $a = '{"hunter": "washere", "tests": "passing",}'
+      $ao = parsejson($a, 'tests are using the default value')
+      notice(inline_template('a is <%= @ao.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/tests are using the default value/)
+      end
+    end
+
+    it 'raises error on incorrect json' do
+      pp = <<-EOS
+      $a = '{"hunter": "washere", "tests": "passing",}'
+      $ao = parsejson($a)
+      notice(inline_template('a is <%= @ao.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :expect_failures => true) do |r|
+        expect(r.stderr).to match(/expected next name/)
+      end
+    end
+
+    it 'raises error on incorrect number of arguments' do
+      pp = <<-EOS
+      $o = parsejson()
+      EOS
+
+      apply_manifest(pp, :expect_failures => true) do |r|
+        expect(r.stderr).to match(/wrong number of arguments/i)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/parseyaml_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/parseyaml_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/parseyaml_spec.rb	(revision 30960)
@@ -0,0 +1,58 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'parseyaml function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'parses valid yaml' do
+      pp = <<-EOS
+      $a = "---\nhunter: washere\ntests: passing\n"
+      $o = parseyaml($a)
+      $tests = $o['tests']
+      notice(inline_template('tests are <%= @tests.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/tests are "passing"/)
+      end
+    end
+  end
+
+  describe 'failure' do
+    it 'returns the default value on incorrect yaml' do
+      pp = <<-EOS
+      $a = "---\nhunter: washere\ntests: passing\n:"
+      $o = parseyaml($a, {'tests' => 'using the default value'})
+      $tests = $o['tests']
+      notice(inline_template('tests are <%= @tests.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/tests are "using the default value"/)
+      end
+    end
+
+    it 'raises error on incorrect yaml' do
+      pp = <<-EOS
+      $a = "---\nhunter: washere\ntests: passing\n:"
+      $o = parseyaml($a)
+      $tests = $o['tests']
+      notice(inline_template('tests are <%= @tests.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :expect_failures => true) do |r|
+        expect(r.stderr).to match(/(syntax error|did not find expected key)/)
+      end
+    end
+
+
+    it 'raises error on incorrect number of arguments' do
+      pp = <<-EOS
+      $o = parseyaml()
+      EOS
+
+      apply_manifest(pp, :expect_failures => true) do |r|
+        expect(r.stderr).to match(/wrong number of arguments/i)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/pick_default_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/pick_default_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/pick_default_spec.rb	(revision 30960)
@@ -0,0 +1,54 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'pick_default function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'pick_defaults a default value' do
+      pp = <<-EOS
+      $a = undef
+      $o = pick_default($a, 'default')
+      notice(inline_template('picked is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/picked is "default"/)
+      end
+    end
+    it 'pick_defaults with no value' do
+      pp = <<-EOS
+      $a = undef
+      $b = undef
+      $o = pick_default($a,$b)
+      notice(inline_template('picked is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/picked is ""/)
+      end
+    end
+    it 'pick_defaults the first set value' do
+      pp = <<-EOS
+      $a = "something"
+      $b = "long"
+      $o = pick_default($a, $b, 'default')
+      notice(inline_template('picked is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/picked is "something"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'raises error with no values' do
+      pp = <<-EOS
+      $o = pick_default()
+      notice(inline_template('picked is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :expect_failures => true) do |r|
+        expect(r.stderr).to match(/Must receive at least one argument/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/pick_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/pick_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/pick_spec.rb	(revision 30960)
@@ -0,0 +1,44 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'pick function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'picks a default value' do
+      pp = <<-EOS
+      $a = undef
+      $o = pick($a, 'default')
+      notice(inline_template('picked is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/picked is "default"/)
+      end
+    end
+    it 'picks the first set value' do
+      pp = <<-EOS
+      $a = "something"
+      $b = "long"
+      $o = pick($a, $b, 'default')
+      notice(inline_template('picked is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/picked is "something"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'raises error with all undef values' do
+      pp = <<-EOS
+      $a = undef
+      $b = undef
+      $o = pick($a, $b)
+      notice(inline_template('picked is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :expect_failures => true) do |r|
+        expect(r.stderr).to match(/must receive at least one non empty value/)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/prefix_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/prefix_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/prefix_spec.rb	(revision 30960)
@@ -0,0 +1,42 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'prefix function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'prefixes array of values' do
+      pp = <<-EOS
+      $o = prefix(['a','b','c'],'p')
+      notice(inline_template('prefix is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/prefix is \["pa", "pb", "pc"\]/)
+      end
+    end
+    it 'prefixs with empty array' do
+      pp = <<-EOS
+      $o = prefix([],'p')
+      notice(inline_template('prefix is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/prefix is \[\]/)
+      end
+    end
+    it 'prefixs array of values with undef' do
+      pp = <<-EOS
+      $o = prefix(['a','b','c'], undef)
+      notice(inline_template('prefix is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/prefix is \["a", "b", "c"\]/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'fails with no arguments'
+    it 'fails when first argument is not array'
+    it 'fails when second argument is not string'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/pw_hash_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/pw_hash_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/pw_hash_spec.rb	(revision 30960)
@@ -0,0 +1,34 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+# Windows and OS X do not have useful implementations of crypt(3)
+describe 'pw_hash function', :unless => (UNSUPPORTED_PLATFORMS + ['windows', 'Darwin', 'SLES']).include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'hashes passwords' do
+      pp = <<-EOS
+      $o = pw_hash('password', 'sha-512', 'salt')
+      notice(inline_template('pw_hash is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/pw_hash is "\$6\$salt\$IxDD3jeSOb5eB1CX5LBsqZFVkJdido3OUILO5Ifz5iwMuTS4XMS130MTSuDDl3aCI6WouIL9AjRbLCelDCy\.g\."/)
+      end
+    end
+
+    it 'returns nil if no password is provided' do
+      pp = <<-EOS
+      $o = pw_hash('', 'sha-512', 'salt')
+      notice(inline_template('pw_hash is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/pw_hash is nil/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles less than three arguments'
+    it 'handles more than three arguments'
+    it 'handles non strings'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/range_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/range_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/range_spec.rb	(revision 30960)
@@ -0,0 +1,36 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'range function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'ranges letters' do
+      pp = <<-EOS
+      $o = range('a','d')
+      notice(inline_template('range is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/range is \["a", "b", "c", "d"\]/)
+      end
+    end
+    it 'ranges letters with a step' do
+      pp = <<-EOS
+      $o = range('a','d', '2')
+      notice(inline_template('range is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/range is \["a", "c"\]/)
+      end
+    end
+    it 'ranges letters with a negative step'
+    it 'ranges numbers'
+    it 'ranges numbers with a step'
+    it 'ranges numbers with a negative step'
+    it 'ranges numeric strings'
+    it 'ranges zero padded numbers'
+  end
+  describe 'failure' do
+    it 'fails with no arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/reject_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/reject_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/reject_spec.rb	(revision 30960)
@@ -0,0 +1,42 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'reject function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'rejects array of values' do
+      pp = <<-EOS
+      $o = reject(['aaa','bbb','ccc','aaaddd'], 'aaa')
+      notice(inline_template('reject is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/reject is \["bbb", "ccc"\]/)
+      end
+    end
+    it 'rejects with empty array' do
+      pp = <<-EOS
+      $o = reject([],'aaa')
+      notice(inline_template('reject is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/reject is \[\]/)
+      end
+    end
+    it 'rejects array of values with undef' do
+      pp = <<-EOS
+      $o = reject(['aaa','bbb','ccc','aaaddd'], undef)
+      notice(inline_template('reject is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/reject is \[\]/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'fails with no arguments'
+    it 'fails when first argument is not array'
+    it 'fails when second argument is not string'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/reverse_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/reverse_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/reverse_spec.rb	(revision 30960)
@@ -0,0 +1,23 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'reverse function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'reverses strings' do
+      pp = <<-EOS
+      $a = "the public art galleries"
+      # Anagram: Large picture halls, I bet
+      $o = reverse($a)
+      notice(inline_template('reverse is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/reverse is "seirellag tra cilbup eht"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings or arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/rstrip_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/rstrip_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/rstrip_spec.rb	(revision 30960)
@@ -0,0 +1,34 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'rstrip function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'rstrips arrays' do
+      pp = <<-EOS
+      $a = ["  the   ","   public   ","   art","galleries   "]
+      # Anagram: Large picture halls, I bet
+      $o = rstrip($a)
+      notice(inline_template('rstrip is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/rstrip is \["  the", "   public", "   art", "galleries"\]/)
+      end
+    end
+    it 'rstrips strings' do
+      pp = <<-EOS
+      $a = "   blowzy night-frumps vex'd jack q   "
+      $o = rstrip($a)
+      notice(inline_template('rstrip is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/rstrip is "   blowzy night-frumps vex'd jack q"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings or arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/shuffle_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/shuffle_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/shuffle_spec.rb	(revision 30960)
@@ -0,0 +1,34 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'shuffle function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'shuffles arrays' do
+      pp = <<-EOS
+      $a = ["1", "2", "3", "4", "5", "6", "7", "8", "the","public","art","galleries"]
+      # Anagram: Large picture halls, I bet
+      $o = shuffle($a)
+      notice(inline_template('shuffle is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to_not match(/shuffle is \["1", "2", "3", "4", "5", "6", "7", "8", "the", "public", "art", "galleries"\]/)
+      end
+    end
+    it 'shuffles strings' do
+      pp = <<-EOS
+      $a = "blowzy night-frumps vex'd jack q"
+      $o = shuffle($a)
+      notice(inline_template('shuffle is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to_not match(/shuffle is "blowzy night-frumps vex'd jack q"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings or arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/size_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/size_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/size_spec.rb	(revision 30960)
@@ -0,0 +1,55 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'size function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'single string size' do
+      pp = <<-EOS
+      $a = 'discombobulate'
+      $o = size($a)
+      notice(inline_template('size is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/size is 14/)
+      end
+    end
+    it 'with empty string' do
+      pp = <<-EOS
+      $a = ''
+      $o = size($a)
+      notice(inline_template('size is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/size is 0/)
+      end
+    end
+    it 'with undef' do
+      pp = <<-EOS
+      $a = undef
+      $o = size($a)
+      notice(inline_template('size is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/size is 0/)
+      end
+    end
+    it 'strings in array' do
+      pp = <<-EOS
+      $a = ['discombobulate', 'moo']
+      $o = size($a)
+      notice(inline_template('size is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/size is 2/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings or arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/sort_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/sort_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/sort_spec.rb	(revision 30960)
@@ -0,0 +1,34 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'sort function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'sorts arrays' do
+      pp = <<-EOS
+      $a = ["the","public","art","galleries"]
+      # Anagram: Large picture halls, I bet
+      $o = sort($a)
+      notice(inline_template('sort is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/sort is \["art", "galleries", "public", "the"\]/)
+      end
+    end
+    it 'sorts strings' do
+      pp = <<-EOS
+      $a = "blowzy night-frumps vex'd jack q"
+      $o = sort($a)
+      notice(inline_template('sort is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/sort is "    '-abcdefghijklmnopqrstuvwxyz"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings or arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/squeeze_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/squeeze_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/squeeze_spec.rb	(revision 30960)
@@ -0,0 +1,47 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'squeeze function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'squeezes arrays' do
+      pp = <<-EOS
+      # Real words!
+      $a = ["wallless", "laparohysterosalpingooophorectomy", "brrr", "goddessship"]
+      $o = squeeze($a)
+      notice(inline_template('squeeze is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/squeeze is \["wales", "laparohysterosalpingophorectomy", "br", "godeship"\]/)
+      end
+    end
+    it 'squeezez arrays with an argument'
+    it 'squeezes strings' do
+      pp = <<-EOS
+      $a = "wallless laparohysterosalpingooophorectomy brrr goddessship"
+      $o = squeeze($a)
+      notice(inline_template('squeeze is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/squeeze is "wales laparohysterosalpingophorectomy br godeship"/)
+      end
+    end
+
+    it 'squeezes strings with an argument' do
+      pp = <<-EOS
+      $a = "countessship duchessship governessship hostessship"
+      $o = squeeze($a, 's')
+      notice(inline_template('squeeze is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/squeeze is "counteship ducheship governeship hosteship"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings or arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/str2bool_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/str2bool_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/str2bool_spec.rb	(revision 30960)
@@ -0,0 +1,31 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'str2bool function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'works with "y"' do
+      pp = <<-EOS
+      $o = str2bool('y')
+      notice(inline_template('str2bool is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/str2bool is true/)
+      end
+    end
+    it 'works with "Y"'
+    it 'works with "yes"'
+    it 'works with "1"'
+    it 'works with "true"'
+    it 'works with "n"'
+    it 'works with "N"'
+    it 'works with "no"'
+    it 'works with "0"'
+    it 'works with "false"'
+    it 'works with undef'
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non arrays or strings'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/str2saltedsha512_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/str2saltedsha512_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/str2saltedsha512_spec.rb	(revision 30960)
@@ -0,0 +1,22 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'str2saltedsha512 function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'works with "y"' do
+      pp = <<-EOS
+      $o = str2saltedsha512('password')
+      notice(inline_template('str2saltedsha512 is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/str2saltedsha512 is "[a-f0-9]{136}"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles more than one argument'
+    it 'handles non strings'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/strftime_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/strftime_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/strftime_spec.rb	(revision 30960)
@@ -0,0 +1,22 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'strftime function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'gives the Century' do
+      pp = <<-EOS
+      $o = strftime('%C')
+      notice(inline_template('strftime is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/strftime is "20"/)
+      end
+    end
+    it 'takes a timezone argument'
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles invalid format strings'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/strip_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/strip_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/strip_spec.rb	(revision 30960)
@@ -0,0 +1,34 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'strip function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'strips arrays' do
+      pp = <<-EOS
+      $a = ["  the   ","   public   ","   art","galleries   "]
+      # Anagram: Large picture halls, I bet
+      $o = strip($a)
+      notice(inline_template('strip is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/strip is \["the", "public", "art", "galleries"\]/)
+      end
+    end
+    it 'strips strings' do
+      pp = <<-EOS
+      $a = "   blowzy night-frumps vex'd jack q   "
+      $o = strip($a)
+      notice(inline_template('strip is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/strip is "blowzy night-frumps vex'd jack q"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings or arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/suffix_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/suffix_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/suffix_spec.rb	(revision 30960)
@@ -0,0 +1,42 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'suffix function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'suffixes array of values' do
+      pp = <<-EOS
+      $o = suffix(['a','b','c'],'p')
+      notice(inline_template('suffix is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/suffix is \["ap", "bp", "cp"\]/)
+      end
+    end
+    it 'suffixs with empty array' do
+      pp = <<-EOS
+      $o = suffix([],'p')
+      notice(inline_template('suffix is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/suffix is \[\]/)
+      end
+    end
+    it 'suffixs array of values with undef' do
+      pp = <<-EOS
+      $o = suffix(['a','b','c'], undef)
+      notice(inline_template('suffix is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/suffix is \["a", "b", "c"\]/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'fails with no arguments'
+    it 'fails when first argument is not array'
+    it 'fails when second argument is not string'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/swapcase_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/swapcase_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/swapcase_spec.rb	(revision 30960)
@@ -0,0 +1,22 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'swapcase function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'works with strings' do
+      pp = <<-EOS
+      $o = swapcase('aBcD')
+      notice(inline_template('swapcase is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/swapcase is "AbCd"/)
+      end
+    end
+    it 'works with arrays'
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non arrays or strings'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/time_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/time_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/time_spec.rb	(revision 30960)
@@ -0,0 +1,36 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'time function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'gives the time' do
+      pp = <<-EOS
+      $o = time()
+      notice(inline_template('time is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        m = r.stdout.match(/time is (\d+)\D/)
+
+        # When I wrote this test
+        expect(Integer(m[1])).to be > 1398894170
+      end
+    end
+    it 'takes a timezone argument' do
+      pp = <<-EOS
+      $o = time('UTC')
+      notice(inline_template('time is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        m = r.stdout.match(/time is (\d+)\D/)
+
+        expect(Integer(m[1])).to be > 1398894170
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles more arguments'
+    it 'handles invalid timezones'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/to_bytes_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/to_bytes_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/to_bytes_spec.rb	(revision 30960)
@@ -0,0 +1,27 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'to_bytes function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'converts kB to B' do
+      pp = <<-EOS
+      $o = to_bytes('4 kB')
+      notice(inline_template('to_bytes is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        m = r.stdout.match(/to_bytes is (\d+)\D/)
+        expect(m[1]).to eq("4096")
+      end
+    end
+    it 'works without the B in unit'
+    it 'works without a space before unit'
+    it 'works without a unit'
+    it 'converts fractions'
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non integer arguments'
+    it 'handles unknown units like uB'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/try_get_value_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/try_get_value_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/try_get_value_spec.rb	(revision 30960)
@@ -0,0 +1,47 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'try_get_value function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'gets a value' do
+      pp = <<-EOS
+      $data = {
+        'a' => { 'b' => 'passing'}
+      }
+
+      $tests = try_get_value($data, 'a/b')
+      notice(inline_template('tests are <%= @tests.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/tests are "passing"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'uses a default value' do
+      pp = <<-EOS
+      $data = {
+        'a' => { 'b' => 'passing'}
+      }
+
+      $tests = try_get_value($data, 'c/d', 'using the default value')
+      notice(inline_template('tests are <%= @tests.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/using the default value/)
+      end
+    end
+
+    it 'raises error on incorrect number of arguments' do
+      pp = <<-EOS
+      $o = try_get_value()
+      EOS
+
+      apply_manifest(pp, :expect_failures => true) do |r|
+        expect(r.stderr).to match(/wrong number of arguments/i)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/type_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/type_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/type_spec.rb	(revision 30960)
@@ -0,0 +1,37 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'type function', :unless => (UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) || is_future_parser_enabled?) do
+  describe 'success' do
+    it 'types arrays' do
+      pp = <<-EOS
+      $a = ["the","public","art","galleries"]
+      # Anagram: Large picture halls, I bet
+      $o = type($a)
+      notice(inline_template('type is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/type is "array"/)
+      end
+    end
+    it 'types strings' do
+      pp = <<-EOS
+      $a = "blowzy night-frumps vex'd jack q"
+      $o = type($a)
+      notice(inline_template('type is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/type is "string"/)
+      end
+    end
+    it 'types hashes'
+    it 'types integers'
+    it 'types floats'
+    it 'types booleans'
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/union_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/union_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/union_spec.rb	(revision 30960)
@@ -0,0 +1,25 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'union function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'unions arrays' do
+      pp = <<-EOS
+      $a = ["the","public"]
+      $b = ["art"]
+      $c = ["galleries"]
+      # Anagram: Large picture halls, I bet
+      $o = union($a,$b,$c)
+      notice(inline_template('union is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/union is \["the", "public", "art", "galleries"\]/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/unique_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/unique_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/unique_spec.rb	(revision 30960)
@@ -0,0 +1,33 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'unique function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'uniques arrays' do
+      pp = <<-EOS
+      $a = ["wallless", "wallless", "brrr", "goddessship"]
+      $o = unique($a)
+      notice(inline_template('unique is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/unique is \["wallless", "brrr", "goddessship"\]/)
+      end
+    end
+    it 'uniques strings' do
+      pp = <<-EOS
+      $a = "wallless laparohysterosalpingooophorectomy brrr goddessship"
+      $o = unique($a)
+      notice(inline_template('unique is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/unique is "wales prohytingcmbd"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings or arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/unsupported_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/unsupported_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/unsupported_spec.rb	(revision 30960)
@@ -0,0 +1,11 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'unsupported distributions and OSes', :if => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  it 'should fail' do
+    pp = <<-EOS
+    class { 'mysql::server': }
+    EOS
+    expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/unsupported osfamily/i)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/upcase_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/upcase_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/upcase_spec.rb	(revision 30960)
@@ -0,0 +1,33 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'upcase function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'upcases arrays' do
+      pp = <<-EOS
+      $a = ["wallless", "laparohysterosalpingooophorectomy", "brrr", "goddessship"]
+      $o = upcase($a)
+      notice(inline_template('upcase is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/upcase is \["WALLLESS", "LAPAROHYSTEROSALPINGOOOPHORECTOMY", "BRRR", "GODDESSSHIP"\]/)
+      end
+    end
+    it 'upcases strings' do
+      pp = <<-EOS
+      $a = "wallless laparohysterosalpingooophorectomy brrr goddessship"
+      $o = upcase($a)
+      notice(inline_template('upcase is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/upcase is "WALLLESS LAPAROHYSTEROSALPINGOOOPHORECTOMY BRRR GODDESSSHIP"/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings or arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/uriescape_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/uriescape_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/uriescape_spec.rb	(revision 30960)
@@ -0,0 +1,23 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'uriescape function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'uriescape strings' do
+      pp = <<-EOS
+      $a = ":/?#[]@!$&'()*+,;= \\\"{}"
+      $o = uriescape($a)
+      notice(inline_template('uriescape is <%= @o.inspect %>'))
+      EOS
+
+      apply_manifest(pp, :catch_failures => true) do |r|
+        expect(r.stdout).to match(/uriescape is ":\/\?%23\[\]@!\$&'\(\)\*\+,;=%20%22%7B%7D"/)
+      end
+    end
+    it 'does nothing if a string is already safe'
+  end
+  describe 'failure' do
+    it 'handles no arguments'
+    it 'handles non strings or arrays'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_absolute_path_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_absolute_path_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_absolute_path_spec.rb	(revision 30960)
@@ -0,0 +1,31 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'validate_absolute_path function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    %w{
+      C:/
+      C:\\\\
+      C:\\\\WINDOWS\\\\System32
+      C:/windows/system32
+      X:/foo/bar
+      X:\\\\foo\\\\bar
+      /var/tmp
+      /var/lib/puppet
+      /var/opt/../lib/puppet
+    }.each do |path|
+      it "validates a single argument #{path}" do
+        pp = <<-EOS
+        $one = '#{path}'
+        validate_absolute_path($one)
+        EOS
+
+        apply_manifest(pp, :catch_failures => true)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper number of arguments'
+    it 'handles relative paths'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_array_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_array_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_array_spec.rb	(revision 30960)
@@ -0,0 +1,37 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'validate_array function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'validates a single argument' do
+      pp = <<-EOS
+      $one = ['a', 'b']
+      validate_array($one)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates an multiple arguments' do
+      pp = <<-EOS
+      $one = ['a', 'b']
+      $two = [['c'], 'd']
+      validate_array($one,$two)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    [
+      %{validate_array({'a' => 'hash' })},
+      %{validate_array('string')},
+      %{validate_array(false)},
+      %{validate_array(undef)}
+    ].each do |pp|
+      it "rejects #{pp.inspect}" do
+        expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/is not an Array\.  It looks to be a/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper number of arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_augeas_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_augeas_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_augeas_spec.rb	(revision 30960)
@@ -0,0 +1,63 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'validate_augeas function', :unless => ((UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem'))) or (fact('osfamily') == 'windows')) do
+  describe 'prep' do
+    it 'installs augeas for tests'
+  end
+  describe 'success' do
+    context 'valid inputs with no 3rd argument' do
+      {
+        'root:x:0:0:root:/root:/bin/bash\n'                        => 'Passwd.lns',
+        'proc /proc   proc    nodev,noexec,nosuid     0       0\n' => 'Fstab.lns'
+      }.each do |line,lens|
+        it "validates a single argument for #{lens}" do
+          pp = <<-EOS
+          $line = "#{line}"
+          $lens = "#{lens}"
+          validate_augeas($line, $lens)
+          EOS
+
+          apply_manifest(pp, :catch_failures => true)
+        end
+      end
+    end
+    context 'valid inputs with 3rd and 4th arguments' do
+      it "validates a restricted value" do
+        line        = 'root:x:0:0:root:/root:/bin/barsh\n'
+        lens        = 'Passwd.lns'
+        restriction = '$file/*[shell="/bin/barsh"]'
+        pp = <<-EOS
+        $line        = "#{line}"
+        $lens        = "#{lens}"
+        $restriction = ['#{restriction}']
+        validate_augeas($line, $lens, $restriction, "my custom failure message")
+        EOS
+
+        expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/my custom failure message/)
+      end
+    end
+    context 'invalid inputs' do
+      {
+        'root:x:0:0:root' => 'Passwd.lns',
+        '127.0.1.1'       => 'Hosts.lns'
+      }.each do |line,lens|
+        it "validates a single argument for #{lens}" do
+          pp = <<-EOS
+          $line = "#{line}"
+          $lens = "#{lens}"
+          validate_augeas($line, $lens)
+          EOS
+
+          apply_manifest(pp, :expect_failures => true)
+        end
+      end
+    end
+    context 'garbage inputs' do
+      it 'raises an error on invalid inputs'
+    end
+  end
+  describe 'failure' do
+    it 'handles improper number of arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_bool_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_bool_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_bool_spec.rb	(revision 30960)
@@ -0,0 +1,37 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'validate_bool function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'validates a single argument' do
+      pp = <<-EOS
+      $one = true
+      validate_bool($one)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates an multiple arguments' do
+      pp = <<-EOS
+      $one = true
+      $two = false
+      validate_bool($one,$two)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    [
+      %{validate_bool('true')},
+      %{validate_bool('false')},
+      %{validate_bool([true])},
+      %{validate_bool(undef)}
+    ].each do |pp|
+      it "rejects #{pp.inspect}" do
+        expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/is not a boolean\.  It looks to be a/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper number of arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_cmd_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_cmd_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_cmd_spec.rb	(revision 30960)
@@ -0,0 +1,52 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'validate_cmd function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'validates a true command' do
+      pp = <<-EOS
+      $one = 'foo'
+      if $::osfamily == 'windows' {
+        $two = 'echo' #shell built-in
+      } else {
+        $two = '/bin/echo'
+      }
+      validate_cmd($one,$two)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates a fail command' do
+      pp = <<-EOS
+      $one = 'foo'
+      if $::osfamily == 'windows' {
+        $two = 'C:/aoeu'
+      } else {
+        $two = '/bin/aoeu'
+      }
+      validate_cmd($one,$two)
+      EOS
+
+      apply_manifest(pp, :expect_failures => true)
+    end
+    it 'validates a fail command with a custom error message' do
+      pp = <<-EOS
+      $one = 'foo'
+      if $::osfamily == 'windows' {
+        $two = 'C:/aoeu'
+      } else {
+        $two = '/bin/aoeu'
+      }
+      validate_cmd($one,$two,"aoeu is dvorak")
+      EOS
+
+      apply_manifest(pp, :expect_failures => true) do |output|
+        expect(output.stderr).to match(/aoeu is dvorak/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper number of arguments'
+    it 'handles improper argument types'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_hash_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_hash_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_hash_spec.rb	(revision 30960)
@@ -0,0 +1,37 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'validate_hash function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'validates a single argument' do
+      pp = <<-EOS
+      $one = { 'a' => 1 }
+      validate_hash($one)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates an multiple arguments' do
+      pp = <<-EOS
+      $one = { 'a' => 1 }
+      $two = { 'b' => 2 }
+      validate_hash($one,$two)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    [
+      %{validate_hash('{ "not" => "hash" }')},
+      %{validate_hash('string')},
+      %{validate_hash(["array"])},
+      %{validate_hash(undef)}
+    ].each do |pp|
+      it "rejects #{pp.inspect}" do
+        expect(apply_manifest(pp, :expect_failures => true).stderr).to match(//)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper number of arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_ipv4_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_ipv4_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_ipv4_address_spec.rb	(revision 30960)
@@ -0,0 +1,31 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'validate_ipv4_address function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'validates a single argument' do
+      pp = <<-EOS
+      $one = '1.2.3.4'
+      validate_ipv4_address($one)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates an multiple arguments' do
+      pp = <<-EOS
+      $one = '1.2.3.4'
+      $two = '5.6.7.8'
+      validate_ipv4_address($one,$two)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+  end
+  describe 'failure' do
+    it 'handles improper number of arguments'
+    it 'handles ipv6 addresses'
+    it 'handles non-ipv4 strings'
+    it 'handles numbers'
+    it 'handles no arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_ipv6_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_ipv6_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_ipv6_address_spec.rb	(revision 30960)
@@ -0,0 +1,31 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'validate_ipv6_address function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'validates a single argument' do
+      pp = <<-EOS
+      $one = '3ffe:0505:0002::'
+      validate_ipv6_address($one)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates an multiple arguments' do
+      pp = <<-EOS
+      $one = '3ffe:0505:0002::'
+      $two = '3ffe:0505:0001::'
+      validate_ipv6_address($one,$two)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+  end
+  describe 'failure' do
+    it 'handles improper number of arguments'
+    it 'handles ipv6 addresses'
+    it 'handles non-ipv6 strings'
+    it 'handles numbers'
+    it 'handles no arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_re_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_re_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_re_spec.rb	(revision 30960)
@@ -0,0 +1,47 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'validate_re function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'validates a string' do
+      pp = <<-EOS
+      $one = 'one'
+      $two = '^one$'
+      validate_re($one,$two)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates an array' do
+      pp = <<-EOS
+      $one = 'one'
+      $two = ['^one$', '^two']
+      validate_re($one,$two)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates a failed array' do
+      pp = <<-EOS
+      $one = 'one'
+      $two = ['^two$', '^three']
+      validate_re($one,$two)
+      EOS
+
+      apply_manifest(pp, :expect_failures => true)
+    end
+    it 'validates a failed array with a custom error message' do
+      pp = <<-EOS
+      $one = '3.4.3'
+      $two = '^2.7'
+      validate_re($one,$two,"The $puppetversion fact does not match 2.7")
+      EOS
+
+      expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/does not match/)
+    end
+  end
+  describe 'failure' do
+    it 'handles improper number of arguments'
+    it 'handles improper argument types'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_slength_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_slength_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_slength_spec.rb	(revision 30960)
@@ -0,0 +1,72 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'validate_slength function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'validates a single string max' do
+      pp = <<-EOS
+      $one = 'discombobulate'
+      $two = 17
+      validate_slength($one,$two)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates multiple string maxes' do
+      pp = <<-EOS
+      $one = ['discombobulate', 'moo']
+      $two = 17
+      validate_slength($one,$two)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates min/max of  strings in array' do
+      pp = <<-EOS
+      $one = ['discombobulate', 'moo']
+      $two = 17
+      $three = 3
+      validate_slength($one,$two,$three)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates a single string max of incorrect length' do
+      pp = <<-EOS
+      $one = 'discombobulate'
+      $two = 1
+      validate_slength($one,$two)
+      EOS
+
+      apply_manifest(pp, :expect_failures => true)
+    end
+    it 'validates multiple string maxes of incorrect length' do
+      pp = <<-EOS
+      $one = ['discombobulate', 'moo']
+      $two = 3
+      validate_slength($one,$two)
+      EOS
+
+      apply_manifest(pp, :expect_failures => true)
+    end
+    it 'validates multiple strings min/maxes of incorrect length' do
+      pp = <<-EOS
+      $one = ['discombobulate', 'moo']
+      $two = 17
+      $three = 10
+      validate_slength($one,$two,$three)
+      EOS
+
+      apply_manifest(pp, :expect_failures => true)
+    end
+  end
+  describe 'failure' do
+    it 'handles improper number of arguments'
+    it 'handles improper first argument type'
+    it 'handles non-strings in array of first argument'
+    it 'handles improper second argument type'
+    it 'handles improper third argument type'
+    it 'handles negative ranges'
+    it 'handles improper ranges'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_string_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_string_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/validate_string_spec.rb	(revision 30960)
@@ -0,0 +1,43 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'validate_string function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'validates a single argument' do
+      pp = <<-EOS
+      $one = 'string'
+      validate_string($one)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates an multiple arguments' do
+      pp = <<-EOS
+      $one = 'string'
+      $two = 'also string'
+      validate_string($one,$two)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates undef' do
+      pp = <<-EOS
+      validate_string(undef)
+      EOS
+
+      apply_manifest(pp, :catch_failures => true)
+    end
+    it 'validates a non-string' do
+      {
+        %{validate_string({ 'a' => 'hash' })} => "Hash",
+        %{validate_string(['array'])}         => "Array",
+        %{validate_string(false)}             => "FalseClass",
+      }.each do |pp,type|
+        expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/a #{type}/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper number of arguments'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/values_at_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/values_at_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/values_at_spec.rb	(revision 30960)
@@ -0,0 +1,73 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'values_at function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'returns a specific value' do
+      pp = <<-EOS
+      $one = ['a','b','c','d','e']
+      $two = 1
+      $output = values_at($one,$two)
+      notice(inline_template('<%= @output.inspect %>'))
+      EOS
+
+      expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\["b"\]/)
+    end
+    it 'returns a specific negative index value' do
+      pending("negative numbers don't work")
+      pp = <<-EOS
+      $one = ['a','b','c','d','e']
+      $two = -1
+      $output = values_at($one,$two)
+      notice(inline_template('<%= @output.inspect %>'))
+      EOS
+
+      expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\["e"\]/)
+    end
+    it 'returns a range of values' do
+      pp = <<-EOS
+      $one = ['a','b','c','d','e']
+      $two = "1-3"
+      $output = values_at($one,$two)
+      notice(inline_template('<%= @output.inspect %>'))
+      EOS
+
+      expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\["b", "c", "d"\]/)
+    end
+    it 'returns a negative specific value and range of values' do
+      pp = <<-EOS
+      $one = ['a','b','c','d','e']
+      $two = ["1-3",0]
+      $output = values_at($one,$two)
+      notice(inline_template('<%= @output.inspect %>'))
+      EOS
+
+      expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\["b", "c", "d", "a"\]/)
+    end
+  end
+  describe 'failure' do
+    it 'handles improper number of arguments' do
+      pp = <<-EOS
+      $one = ['a','b','c','d','e']
+      $output = values_at($one)
+      notice(inline_template('<%= @output.inspect %>'))
+      EOS
+
+      expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/Wrong number of arguments/)
+    end
+    it 'handles non-indicies arguments' do
+      pp = <<-EOS
+      $one = ['a','b','c','d','e']
+      $two = []
+      $output = values_at($one,$two)
+      notice(inline_template('<%= @output.inspect %>'))
+      EOS
+
+      expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/at least one positive index/)
+    end
+
+    it 'detects index ranges smaller than the start range'
+    it 'handles index ranges larger than array'
+    it 'handles non-integer indicies'
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/values_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/values_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/values_spec.rb	(revision 30960)
@@ -0,0 +1,35 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+
+describe 'values function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'returns an array of values' do
+      pp = <<-EOS
+      $arg = {
+        'a' => 1,
+        'b' => 2,
+        'c' => 3,
+      }
+      $output = values($arg)
+      notice(inline_template('<%= @output.sort.inspect %>'))
+      EOS
+      if is_future_parser_enabled?
+        expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[1, 2, 3\]/)
+      else
+        expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\["1", "2", "3"\]/)
+      end
+
+    end
+  end
+  describe 'failure' do
+    it 'handles non-hash arguments' do
+      pp = <<-EOS
+      $arg = "foo"
+      $output = values($arg)
+      notice(inline_template('<%= @output.inspect %>'))
+      EOS
+
+      expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/Requires hash/)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/zip_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/zip_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/zip_spec.rb	(revision 30960)
@@ -0,0 +1,86 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper_acceptance'
+require 'puppet'
+
+describe 'zip function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
+  describe 'success' do
+    it 'zips two arrays of numbers together' do
+      pp = <<-EOS
+      $one = [1,2,3,4]
+      $two = [5,6,7,8]
+      $output = zip($one,$two)
+      notice(inline_template('<%= @output.inspect %>'))
+      EOS
+      if is_future_parser_enabled?
+        expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\[1, 5\], \[2, 6\], \[3, 7\], \[4, 8\]\]/)
+      else
+        expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\["1", "5"\], \["2", "6"\], \["3", "7"\], \["4", "8"\]\]/)
+      end
+    end
+    it 'zips two arrays of numbers & bools together' do
+      pp = <<-EOS
+      $one = [1,2,"three",4]
+      $two = [true,true,false,false]
+      $output = zip($one,$two)
+      notice(inline_template('<%= @output.inspect %>'))
+      EOS
+      if is_future_parser_enabled?
+        expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\[1, true\], \[2, true\], \["three", false\], \[4, false\]\]/)
+      else
+        expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\["1", true\], \["2", true\], \["three", false\], \["4", false\]\]/)
+      end
+    end
+    it 'zips two arrays of numbers together and flattens them' do
+      # XXX This only tests the argument `true`, even though the following are valid:
+      # 1 t y true yes
+      # 0 f n false no
+      # undef undefined
+      pp = <<-EOS
+      $one = [1,2,3,4]
+      $two = [5,6,7,8]
+      $output = zip($one,$two,true)
+      notice(inline_template('<%= @output.inspect %>'))
+      EOS
+      if is_future_parser_enabled?
+        expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[1, 5, 2, 6, 3, 7, 4, 8\]/)
+      else
+        expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\["1", "5", "2", "6", "3", "7", "4", "8"\]/)
+      end
+    end
+    it 'handles unmatched length' do
+      # XXX Is this expected behavior?
+      pp = <<-EOS
+      $one = [1,2]
+      $two = [5,6,7,8]
+      $output = zip($one,$two)
+      notice(inline_template('<%= @output.inspect %>'))
+      EOS
+      if is_future_parser_enabled?
+        expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\[1, 5\], \[2, 6\]\]/)
+      else
+        expect(apply_manifest(pp, :catch_failures => true).stdout).to match(/\[\["1", "5"\], \["2", "6"\]\]/)
+      end
+    end
+  end
+  describe 'failure' do
+    it 'handles improper number of arguments' do
+      pp = <<-EOS
+      $one = [1,2]
+      $output = zip($one)
+      notice(inline_template('<%= @output.inspect %>'))
+      EOS
+
+      expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/Wrong number of arguments/)
+    end
+    it 'handles improper argument types' do
+      pp = <<-EOS
+      $one = "a string"
+      $two = [5,6,7,8]
+      $output = zip($one,$two)
+      notice(inline_template('<%= @output.inspect %>'))
+      EOS
+
+      expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/Requires array/)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/absolute_path_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/absolute_path_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/absolute_path_spec.rb	(revision 30960)
@@ -0,0 +1,62 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::absolute_path', type: :class do
+    describe 'valid paths handling' do
+      %w{
+        C:/
+        C:\\
+        C:\\WINDOWS\\System32
+        C:/windows/system32
+        X:/foo/bar
+        X:\\foo\\bar
+        \\\\host\\windows
+        //host/windows
+        /
+        /var/tmp
+        /var/opt/../lib/puppet
+      }.each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+
+    describe 'invalid path handling' do
+      context 'garbage inputs' do
+        [
+          nil,
+          [ nil ],
+          [ nil, nil ],
+          { 'foo' => 'bar' },
+          { },
+          '',
+        ].each do |value|
+          describe value.inspect do
+            let(:params) {{ value: value }}
+            it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for Stdlib::Compat::Absolute_path/) }
+          end
+        end
+      end
+
+      context 'relative paths' do
+        %w{
+          relative1
+          .
+          ..
+          ./foo
+          ../foo
+          etc/puppetlabs/puppet
+          opt/puppet/bin
+          relative\\windows
+        }.each do |value|
+          describe value.inspect do
+            let(:params) {{ value: value }}
+            it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for Stdlib::Compat::Absolute_path/) }
+          end
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/absolutepath_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/absolutepath_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/absolutepath_spec.rb	(revision 30960)
@@ -0,0 +1,49 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::absolutepath', type: :class do
+    describe 'valid handling' do
+      %w{
+        /usr2/username/bin:/usr/local/bin:/usr/bin:.
+        C:/
+        C:\\
+        C:\\WINDOWS\\System32
+        C:/windows/system32
+        X:/foo/bar
+        X:\\foo\\bar
+        \\\\host\\windows
+        //host/windows
+        /var/tmp
+        /var/opt/../lib/puppet
+      }.each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+
+    describe 'invalid path handling' do
+      context 'garbage inputs' do
+        [
+          nil,
+          [ nil ],
+          [ nil, nil ],
+          { 'foo' => 'bar' },
+          { },
+          '',
+          "*/Users//nope",
+          "\\Users/hc/wksp/stdlib",
+          "C:noslashes",
+          "\\var\\tmp"
+        ].each do |value|
+          describe value.inspect do
+            let(:params) {{ value: value }}
+            it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for Variant/) }
+          end
+        end
+      end
+
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/array_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/array_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/array_spec.rb	(revision 30960)
@@ -0,0 +1,34 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::array', type: :class do
+    describe 'accepts arrays' do
+      [
+        [],
+        ['one'],
+        [1],
+        [{}],
+        [[]],
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+
+    describe 'rejects other values' do
+      [
+        '',
+        'one',
+        '1',
+        {},
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile.and_raise_error(/parameter 'value' expects a Stdlib::Compat::Array/) }
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/bool_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/bool_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/bool_spec.rb	(revision 30960)
@@ -0,0 +1,32 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::bool', type: :class do
+    describe 'accepts booleans' do
+      [
+        true,
+        false,
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+
+    describe 'rejects other values' do
+      [
+        [1],
+        [{}],
+        [true],
+        'true',
+        'false',
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile.and_raise_error(/parameter 'value' expects a Stdlib::Compat::Bool/) }
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/float_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/float_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/float_spec.rb	(revision 30960)
@@ -0,0 +1,28 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::float', type: :class do
+    describe 'accepts floats' do
+      [
+        3.7,
+        '3.7',
+        -3.7,
+        '-342.2315e-12',
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+
+    describe 'rejects other values' do
+      [ true, 'true', false, 'false', 'iAmAString', '1test', '1 test', 'test 1', 'test 1 test', {}, { 'key' => 'value' }, { 1=> 2 }, '', :undef , 'x', 3, '3', -3, '-3'].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile.and_raise_error(/parameter 'value' expects a value of type Float or Pattern(\[.*\]+)?/) }
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/httpsurl_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/httpsurl_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/httpsurl_spec.rb	(revision 30960)
@@ -0,0 +1,40 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::httpsurl', type: :class do
+    describe 'valid handling' do
+      %w{
+        https://hello.com
+        https://notcreative.org
+        https://notexciting.co.uk
+      }.each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+
+    describe 'invalid path handling' do
+      context 'garbage inputs' do
+        [
+          nil,
+          [ nil ],
+          [ nil, nil ],
+          { 'foo' => 'bar' },
+          { },
+          '',
+          "httds://notquiteright.org",
+          "hptts:/nah",
+          "https;//notrightbutclose.org"
+        ].each do |value|
+          describe value.inspect do
+            let(:params) {{ value: value }}
+            it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for Stdlib::HTTPSUrl/) }
+          end
+        end
+      end
+
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/httpurl_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/httpurl_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/httpurl_spec.rb	(revision 30960)
@@ -0,0 +1,43 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::httpurl', type: :class do
+    describe 'valid handling' do
+      %w{
+        https://hello.com
+        https://notcreative.org
+        https://canstillaccepthttps.co.uk
+        http://anhttp.com
+        http://runningoutofideas.gov
+        http://
+      }.each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+
+    describe 'invalid path handling' do
+      context 'garbage inputs' do
+        [
+          nil,
+          [ nil ],
+          [ nil, nil ],
+          { 'foo' => 'bar' },
+          { },
+          '',
+          "httds://notquiteright.org",
+          "hptts:/nah",
+          "https;//notrightbutclose.org"
+        ].each do |value|
+          describe value.inspect do
+            let(:params) {{ value: value }}
+            it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for Stdlib::HTTPUrl/) }
+          end
+        end
+      end
+
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/integer_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/integer_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/integer_spec.rb	(revision 30960)
@@ -0,0 +1,28 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::integer', type: :class do
+    describe 'accepts integers' do
+      [
+        3,
+        '3',
+        -3,
+        '-3',
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+
+    describe 'rejects other values' do
+      [ true, 'true', false, 'false', 'iAmAString', '1test', '1 test', 'test 1', 'test 1 test', {}, { 'key' => 'value' }, { 1=> 2 }, '', :undef , 'x', 3.7, '3.7',-3.7, '-342.2315e-12' ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile.and_raise_error(/parameter 'value' expects a value of type Integer, Pattern(\[.*\]+)?, or Array/) }
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/ip_address.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/ip_address.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/ip_address.rb	(revision 30960)
@@ -0,0 +1,34 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::ip_address', type: :class do
+    describe 'accepts ipv4 and ipv6 addresses' do
+      [
+        '224.0.0.0',
+        '255.255.255.255',
+        '0.0.0.0',
+        '192.88.99.0',
+        '2001:0db8:85a3:0000:0000:8a2e:0370:7334',
+        'fa76:8765:34ac:0823:ab76:eee9:0987:1111'
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+    describe 'rejects other values' do
+      [
+        'nope',
+        '77',
+        '4.4.4',
+        '2001:0db8:85a3:000000:0000:8a2e:0370:7334'
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for/) }
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/ipv4_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/ipv4_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/ipv4_spec.rb	(revision 30960)
@@ -0,0 +1,32 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::ipv4', type: :class do
+    describe 'accepts ipv4 addresses' do
+      [
+        '224.0.0.0',
+        '255.255.255.255',
+        '0.0.0.0',
+        '192.88.99.0'
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+    describe 'rejects other values' do
+      [
+        'nope',
+        '77',
+        '4.4.4',
+        '2001:0db8:85a3:0000:0000:8a2e:0370:73342001:0db8:85a3:0000:0000:8a2e:0370:7334'
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for Stdlib::Compat::Ipv4/) }
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/ipv6_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/ipv6_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/ipv6_spec.rb	(revision 30960)
@@ -0,0 +1,30 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::ipv6', type: :class do
+    describe 'accepts ipv6 addresses' do
+      [
+        '2001:0db8:85a3:0000:0000:8a2e:0370:7334',
+        'fa76:8765:34ac:0823:ab76:eee9:0987:1111'
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+    describe 'rejects other values' do
+      [
+        'nope',
+        '77',
+        '4.4.4',
+        '2000:7334'
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for Stdlib::Compat::Ipv6/) }
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/numeric_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/numeric_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/numeric_spec.rb	(revision 30960)
@@ -0,0 +1,32 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::numeric', type: :class do
+    describe 'accepts numerics' do
+      [
+        3,
+        '3',
+        -3,
+        '-3',
+        3.7,
+        '3.7',
+        -3.7,
+        '-342.2315e-12',
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+
+    describe 'rejects other values' do
+      [ true, 'true', false, 'false', 'iAmAString', '1test', '1 test', 'test 1', 'test 1 test', {}, { 'key' => 'value' }, { 1=> 2 }, '', :undef , 'x' ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile.and_raise_error(/parameter 'value' expects a value of type Numeric, Pattern(\[.*\]+)?, or Array/) }
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/string_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/string_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/string_spec.rb	(revision 30960)
@@ -0,0 +1,32 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::string', type: :class do
+    describe 'accepts strings' do
+      [
+        '',
+        'one',
+        nil,
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+
+    describe 'rejects other values' do
+      [
+        [],
+        {},
+        1,
+        true,
+      ].each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile.and_raise_error(/parameter 'value' expects a String/) }
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/unixpath_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/unixpath_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/unixpath_spec.rb	(revision 30960)
@@ -0,0 +1,41 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::unixpath', type: :class do
+    describe 'valid handling' do
+      %w{
+        /usr2/username/bin:/usr/local/bin:/usr/bin:.
+        /var/tmp
+        /Users/helencampbell/workspace/puppetlabs-stdlib
+      }.each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+
+    describe 'invalid path handling' do
+      context 'garbage inputs' do
+        [
+          nil,
+          [ nil ],
+          [ nil, nil ],
+          { 'foo' => 'bar' },
+          { },
+          '',
+          "C:/whatever",
+          "\\var\\tmp",
+          "\\Users/hc/wksp/stdlib",
+          "*/Users//nope"
+        ].each do |value|
+          describe value.inspect do
+            let(:params) {{ value: value }}
+            it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for Stdlib::Unixpath/) }
+          end
+        end
+      end
+
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/windowspath_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/windowspath_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/aliases/windowspath_spec.rb	(revision 30960)
@@ -0,0 +1,44 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.5
+  describe 'test::windowspath', type: :class do
+    describe 'valid handling' do
+      %w{
+        C:\\
+        C:\\WINDOWS\\System32
+        C:/windows/system32
+        X:/foo/bar
+        X:\\foo\\bar
+        \\\\host\\windows
+      }.each do |value|
+        describe value.inspect do
+          let(:params) {{ value: value }}
+          it { is_expected.to compile }
+        end
+      end
+    end
+
+    describe 'invalid path handling' do
+      context 'garbage inputs' do
+        [
+          nil,
+          [ nil ],
+          [ nil, nil ],
+          { 'foo' => 'bar' },
+          { },
+          '',
+          "httds://notquiteright.org",
+          "/usr2/username/bin:/usr/local/bin:/usr/bin:.",
+          "C;//notright/here",
+          "C:noslashes"
+        ].each do |value|
+          describe value.inspect do
+            let(:params) {{ value: value }}
+            it { is_expected.to compile.and_raise_error(/parameter 'value' expects a match for Stdlib::Windowspath/) }
+          end
+        end
+      end
+
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/dscacheutil/root
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/dscacheutil/root	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/dscacheutil/root	(revision 30960)
@@ -0,0 +1,8 @@
+name: root
+password: *
+uid: 0
+gid: 0
+dir: /var/root
+shell: /bin/bash
+gecos: rawr Root
+
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/lsuser/root
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/lsuser/root	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/lsuser/root	(revision 30960)
@@ -0,0 +1,2 @@
+#name:home
+root:/root
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/absolute_path.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/absolute_path.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/absolute_path.pp	(revision 30960)
@@ -0,0 +1,6 @@
+# Class to test the Stdlib::Compat::Absolute_path type alias
+class test::absolute_path(
+  Stdlib::Compat::Absolute_path $value,
+  ) {
+    notice("Success")
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/absolutepath.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/absolutepath.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/absolutepath.pp	(revision 30960)
@@ -0,0 +1,6 @@
+# Class to test the Stdlib::Absolutepath type. Not to be confused with Stdlib::Compat::Absolute_path.
+class test::absolutepath(
+    Stdlib::Absolutepath $value,
+    ) {
+  notice("Success")
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/array.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/array.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/array.pp	(revision 30960)
@@ -0,0 +1,8 @@
+# Class to test the Stdlib::Compat::Array type alias
+class test::array(
+  Stdlib::Compat::Array $value,
+  ) {
+
+    notice("Success")
+
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/bool.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/bool.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/bool.pp	(revision 30960)
@@ -0,0 +1,8 @@
+# Class to test the Stdlib::Compat::Bool type alias
+class test::bool(
+  Stdlib::Compat::Bool $value,
+  ) {
+
+    notice("Success")
+
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/float.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/float.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/float.pp	(revision 30960)
@@ -0,0 +1,8 @@
+# Class to test the Stdlib::Compat::Float type alias
+class test::float(
+  Stdlib::Compat::Float $value,
+  ) {
+
+    notice("Success")
+
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/httpsurl.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/httpsurl.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/httpsurl.pp	(revision 30960)
@@ -0,0 +1,6 @@
+# Class to test the Stdlib::HTTPSUrl type alias
+class test::httpsurl(
+    Stdlib::HTTPSUrl $value,
+    ) {
+  notice("Success")
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/httpurl.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/httpurl.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/httpurl.pp	(revision 30960)
@@ -0,0 +1,6 @@
+# Class to test the Stdlib::HTTPUrl type alias
+class test::httpurl(
+    Stdlib::HTTPUrl $value,
+    ) {
+  notice("Success")
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/integer.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/integer.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/integer.pp	(revision 30960)
@@ -0,0 +1,8 @@
+# Class to test the Stdlib::Compat::Integer type alias
+class test::integer(
+  Stdlib::Compat::Integer $value,
+  ) {
+
+    notice("Success")
+
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/ip_address.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/ip_address.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/ip_address.pp	(revision 30960)
@@ -0,0 +1,6 @@
+# Class to test the Stdlib::Compat::Ip_address type alias
+class test::ip_address(
+  Stdlib::Compat::Ip_address $value,
+  ) {
+    notice("Success")
+  }
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/ipv4.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/ipv4.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/ipv4.pp	(revision 30960)
@@ -0,0 +1,6 @@
+# Class to test the Stdlib::Compat::Ipv4 type alias
+class test::ipv4(
+  Stdlib::Compat::Ipv4 $value,
+  ) {
+    notice("Success")
+  }
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/ipv6.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/ipv6.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/ipv6.pp	(revision 30960)
@@ -0,0 +1,6 @@
+# Class to test the Stdlib::Compat::Ipv6 type alias
+class test::ipv6(
+  Stdlib::Compat::Ipv6 $value,
+  ) {
+  notice("Success")
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/numeric.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/numeric.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/numeric.pp	(revision 30960)
@@ -0,0 +1,8 @@
+# Class to test the Stdlib::Compat::Numeric type alias
+class test::numeric(
+  Stdlib::Compat::Numeric $value,
+  ) {
+
+    notice("Success")
+
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/string.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/string.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/string.pp	(revision 30960)
@@ -0,0 +1,8 @@
+# Class to test the Stdlib::Compat::String type alias
+class test::string(
+  Stdlib::Compat::String $value,
+  ) {
+
+    notice("Success")
+
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/unixpath.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/unixpath.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/unixpath.pp	(revision 30960)
@@ -0,0 +1,6 @@
+# Class to test the Stdlib::Unixpath type alias
+class test::unixpath(
+    Stdlib::Unixpath $value,
+    ) {
+  notice("Success")
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/windowspath.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/windowspath.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/fixtures/test/manifests/windowspath.pp	(revision 30960)
@@ -0,0 +1,6 @@
+# Class to test the Stdlib::Windowspath type alias
+class test::windowspath(
+    Stdlib::Windowspath $value,
+    ) {
+  notice("Success")
+}
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/abs_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/abs_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/abs_spec.rb	(revision 30960)
@@ -0,0 +1,30 @@
+require 'spec_helper'
+
+describe 'abs' do
+  it { is_expected.not_to eq(nil) }
+
+  describe 'signature validation in puppet3', :unless => RSpec.configuration.puppet_future do
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it {
+      pending("Current implementation ignores parameters after the first.")
+      is_expected.to run.with_params(1, 2).and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+    }
+  end
+
+  describe 'signature validation in puppet4', :if => RSpec.configuration.puppet_future do
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params().and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params(1, 2).and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params([]).and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params({}).and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params(true).and_raise_error(ArgumentError) }
+  end
+
+  it { is_expected.to run.with_params(-34).and_return(34) }
+  it { is_expected.to run.with_params("-34").and_return(34) }
+  it { is_expected.to run.with_params(34).and_return(34) }
+  it { is_expected.to run.with_params("34").and_return(34) }
+  it { is_expected.to run.with_params(-34.5).and_return(34.5) }
+  it { is_expected.to run.with_params("-34.5").and_return(34.5) }
+  it { is_expected.to run.with_params(34.5).and_return(34.5) }
+  it { is_expected.to run.with_params("34.5").and_return(34.5) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/any2array_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/any2array_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/any2array_spec.rb	(revision 30960)
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe "any2array" do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_return([]) }
+  it { is_expected.to run.with_params(true).and_return([true]) }
+  it { is_expected.to run.with_params('one').and_return(['one']) }
+  it { is_expected.to run.with_params('one', 'two').and_return(['one', 'two']) }
+  it { is_expected.to run.with_params([]).and_return([]) }
+  it { is_expected.to run.with_params(['one']).and_return(['one']) }
+  it { is_expected.to run.with_params(['one', 'two']).and_return(['one', 'two']) }
+  it { is_expected.to run.with_params({}).and_return([]) }
+  it { is_expected.to run.with_params({ 'key' => 'value' }).and_return(['key', 'value']) }
+  it { is_expected.to run.with_params({ 'key' => 'value' }).and_return(['key', 'value']) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/any2bool_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/any2bool_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/any2bool_spec.rb	(revision 30960)
@@ -0,0 +1,42 @@
+require 'spec_helper'
+
+describe 'any2bool' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+  it { is_expected.to run.with_params(true).and_return(true) }
+  it { is_expected.to run.with_params(false).and_return(false) }
+
+  it { is_expected.to run.with_params('1.5').and_return(true) }
+
+  describe 'when testing stringy values that mean "true"' do
+    [ 'TRUE','1', 't', 'y', 'true', 'yes'].each do |value|
+      it { is_expected.to run.with_params(value).and_return(true) }
+    end
+  end
+
+  describe 'when testing stringy values that mean "false"' do
+    [ 'FALSE','', '0', 'f', 'n', 'false', 'no', 'undef', 'undefined', nil, :undef ].each do |value|
+      it { is_expected.to run.with_params(value).and_return(false) }
+    end
+  end
+
+  describe 'when testing numeric values that mean "true"' do
+    [ 1,'1',1.5, '1.5'].each do |value|
+      it { is_expected.to run.with_params(value).and_return(true) }
+    end
+  end
+
+  describe 'when testing numeric that mean "false"' do
+    [ -1, '-1', -1.5, '-1.5', '0', 0 ].each do |value|
+      it { is_expected.to run.with_params(value).and_return(false) }
+    end
+  end
+
+  describe 'everything else returns true' do
+    [ [], {}, ['1'], [1], {:one => 1} ].each do |value|
+      it { is_expected.to run.with_params(value).and_return(true) }
+    end
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/assert_private_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/assert_private_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/assert_private_spec.rb	(revision 30960)
@@ -0,0 +1,41 @@
+require 'spec_helper'
+
+describe 'assert_private' do
+  context 'when called from inside module' do
+    it "should not fail" do
+      scope.expects(:lookupvar).with('module_name').returns('foo')
+      scope.expects(:lookupvar).with('caller_module_name').returns('foo')
+
+      is_expected.to run.with_params()
+    end
+  end
+
+  context "when called from private class" do
+    before :each do
+      scope.expects(:lookupvar).with('module_name').returns('foo')
+      scope.expects(:lookupvar).with('caller_module_name').returns('bar')
+    end
+
+    it "should fail with a class error message" do
+      scope.source.expects(:name).returns('foo::baz')
+      scope.source.expects(:type).returns('hostclass')
+
+      is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /Class foo::baz is private/)
+    end
+
+    context "with an explicit failure message" do
+      it { is_expected.to run.with_params('failure message!').and_raise_error(Puppet::ParseError, /failure message!/) }
+    end
+  end
+
+  context "when called from private definition" do
+    it "should fail with a class error message" do
+      scope.expects(:lookupvar).with('module_name').returns('foo')
+      scope.expects(:lookupvar).with('caller_module_name').returns('bar')
+      scope.source.expects(:name).returns('foo::baz')
+      scope.source.expects(:type).returns('definition')
+
+      is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /Definition foo::baz is private/)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/base64_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/base64_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/base64_spec.rb	(revision 30960)
@@ -0,0 +1,37 @@
+require 'spec_helper'
+
+describe 'base64' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params("one").and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params("one", "two").and_raise_error(Puppet::ParseError, /first argument must be one of/) }
+  it { is_expected.to run.with_params("encode", ["two"]).and_raise_error(Puppet::ParseError, /second argument must be a string/) }
+  it { is_expected.to run.with_params("encode", 2).and_raise_error(Puppet::ParseError, /second argument must be a string/) }
+  it { is_expected.to run.with_params("encode", "thestring", "three").and_raise_error(Puppet::ParseError, /third argument must be one of/) }
+  it { is_expected.to run.with_params("decode", "dGhlc3RyaW5n\n", "strict").and_raise_error(ArgumentError) }
+
+  it { is_expected.to run.with_params("encode", "thestring").and_return("dGhlc3RyaW5n\n") }
+  it { is_expected.to run.with_params("decode", "dGhlc3RyaW5n").and_return("thestring") }
+  it { is_expected.to run.with_params("decode", "dGhlc3RyaW5n\n").and_return("thestring") }
+
+  it { is_expected.to run.with_params("encode", "thestring", "default").and_return("dGhlc3RyaW5n\n") }
+  it { is_expected.to run.with_params("decode", "dGhlc3RyaW5n", "default").and_return("thestring") }
+  it { is_expected.to run.with_params("decode", "dGhlc3RyaW5n\n", "default").and_return("thestring") }
+
+  it { is_expected.to run.with_params("encode", "thestring", "strict").and_return("dGhlc3RyaW5n") }
+  it { is_expected.to run.with_params("decode", "dGhlc3RyaW5n", "strict").and_return("thestring") }
+
+  it { is_expected.to run.with_params("encode", "a very long string that will cause the base64 encoder to produce output with multiple lines").and_return("YSB2ZXJ5IGxvbmcgc3RyaW5nIHRoYXQgd2lsbCBjYXVzZSB0aGUgYmFzZTY0\nIGVuY29kZXIgdG8gcHJvZHVjZSBvdXRwdXQgd2l0aCBtdWx0aXBsZSBsaW5l\ncw==\n") }
+  it { is_expected.to run.with_params("decode", "YSB2ZXJ5IGxvbmcgc3RyaW5nIHRoYXQgd2lsbCBjYXVzZSB0aGUgYmFzZTY0\nIGVuY29kZXIgdG8gcHJvZHVjZSBvdXRwdXQgd2l0aCBtdWx0aXBsZSBsaW5l\ncw==\n").and_return("a very long string that will cause the base64 encoder to produce output with multiple lines") }
+  it { is_expected.to run.with_params("decode", "YSB2ZXJ5IGxvbmcgc3RyaW5nIHRoYXQgd2lsbCBjYXVzZSB0aGUgYmFzZTY0IGVuY29kZXIgdG8gcHJvZHVjZSBvdXRwdXQgd2l0aCBtdWx0aXBsZSBsaW5lcw==").and_return("a very long string that will cause the base64 encoder to produce output with multiple lines") }
+
+  it { is_expected.to run.with_params("encode", "a very long string that will cause the base64 encoder to produce output with multiple lines", "strict").and_return("YSB2ZXJ5IGxvbmcgc3RyaW5nIHRoYXQgd2lsbCBjYXVzZSB0aGUgYmFzZTY0IGVuY29kZXIgdG8gcHJvZHVjZSBvdXRwdXQgd2l0aCBtdWx0aXBsZSBsaW5lcw==") }
+  it { is_expected.to run.with_params("decode", "YSB2ZXJ5IGxvbmcgc3RyaW5nIHRoYXQgd2lsbCBjYXVzZSB0aGUgYmFzZTY0IGVuY29kZXIgdG8gcHJvZHVjZSBvdXRwdXQgd2l0aCBtdWx0aXBsZSBsaW5lcw==").and_return("a very long string that will cause the base64 encoder to produce output with multiple lines") }
+  it { is_expected.to run.with_params("decode", "YSB2ZXJ5IGxvbmcgc3RyaW5nIHRoYXQgd2lsbCBjYXVzZSB0aGUgYmFzZTY0IGVuY29kZXIgdG8gcHJvZHVjZSBvdXRwdXQgd2l0aCBtdWx0aXBsZSBsaW5lcw==", "strict").and_return("a very long string that will cause the base64 encoder to produce output with multiple lines") }
+
+  it { is_expected.to run.with_params("encode", "https://www.google.com.tw/?gws_rd=ssl#q=hello+world", "urlsafe").and_return("aHR0cHM6Ly93d3cuZ29vZ2xlLmNvbS50dy8_Z3dzX3JkPXNzbCNxPWhlbGxvK3dvcmxk") }
+  it { is_expected.to run.with_params("decode", "aHR0cHM6Ly93d3cuZ29vZ2xlLmNvbS50dy8_Z3dzX3JkPXNzbCNxPWhlbGxvK3dvcmxk", "urlsafe").and_return("https://www.google.com.tw/?gws_rd=ssl#q=hello+world") }
+
+  it { is_expected.to run.with_params("encode", "https://github.com/puppetlabs/puppetlabs-stdlib/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+Add", "urlsafe").and_return("aHR0cHM6Ly9naXRodWIuY29tL3B1cHBldGxhYnMvcHVwcGV0bGFicy1zdGRsaWIvcHVsbHM_dXRmOD0lRTIlOUMlOTMmcT1pcyUzQXByK2lzJTNBb3BlbitBZGQ=") }
+  it { is_expected.to run.with_params("decode", "aHR0cHM6Ly9naXRodWIuY29tL3B1cHBldGxhYnMvcHVwcGV0bGFicy1zdGRsaWIvcHVsbHM_dXRmOD0lRTIlOUMlOTMmcT1pcyUzQXByK2lzJTNBb3BlbitBZGQ=", "urlsafe").and_return("https://github.com/puppetlabs/puppetlabs-stdlib/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+Add") }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/basename_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/basename_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/basename_spec.rb	(revision 30960)
@@ -0,0 +1,14 @@
+require 'spec_helper'
+
+describe 'basename' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one', 'two', 'three').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('/path/to/a/file.ext', []).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('/path/to/a/file.ext').and_return('file.ext') }
+  it { is_expected.to run.with_params('relative_path/to/a/file.ext').and_return('file.ext') }
+  it { is_expected.to run.with_params('/path/to/a/file.ext', '.ext').and_return('file') }
+  it { is_expected.to run.with_params('relative_path/to/a/file.ext', '.ext').and_return('file') }
+  it { is_expected.to run.with_params('scheme:///path/to/a/file.ext').and_return('file.ext') }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/bool2num_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/bool2num_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/bool2num_spec.rb	(revision 30960)
@@ -0,0 +1,14 @@
+require 'spec_helper'
+
+describe 'bool2num' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+
+  [ true, 'true', AlsoString.new('true') ].each do |truthy|
+    it { is_expected.to run.with_params(truthy).and_return(1) }
+  end
+
+  [ false, 'false', AlsoString.new('false') ].each do |falsey|
+    it { is_expected.to run.with_params(falsey).and_return(0) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/bool2str_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/bool2str_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/bool2str_spec.rb	(revision 30960)
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+describe 'bool2str' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  [ 'true', 'false', nil, :undef, ''].each do |invalid|
+    it { is_expected.to run.with_params(invalid).and_raise_error(Puppet::ParseError) }
+  end
+  it { is_expected.to run.with_params(true, 'yes', 'no', 'maybe').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(true, 'maybe').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(true, 0, 1).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(true).and_return("true") }
+  it { is_expected.to run.with_params(false).and_return("false") }
+  it { is_expected.to run.with_params(true, 'yes', 'no').and_return("yes") }
+  it { is_expected.to run.with_params(false, 'yes', 'no').and_return("no") }
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/camelcase_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/camelcase_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/camelcase_spec.rb	(revision 30960)
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+describe 'camelcase' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(100).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params("abc").and_return("Abc") }
+  it { is_expected.to run.with_params("aa_bb_cc").and_return("AaBbCc") }
+  it { is_expected.to run.with_params("_aa__bb__cc_").and_return("AaBbCc") }
+  it { is_expected.to run.with_params("100").and_return("100") }
+  it { is_expected.to run.with_params("1_00").and_return("100") }
+  it { is_expected.to run.with_params("_").and_return("") }
+  it { is_expected.to run.with_params("").and_return("") }
+  it { is_expected.to run.with_params([]).and_return([]) }
+  it { is_expected.to run.with_params(["abc", "aa_bb_cc"]).and_return(["Abc", "AaBbCc"]) }
+  it { is_expected.to run.with_params(["abc", 1, "aa_bb_cc"]).and_return(["Abc", 1, "AaBbCc"]) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/capitalize_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/capitalize_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/capitalize_spec.rb	(revision 30960)
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe 'capitalize' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(100).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params("one").and_return("One") }
+  it { is_expected.to run.with_params("one two").and_return("One two") }
+  it { is_expected.to run.with_params("ONE TWO").and_return("One two") }
+
+  it { is_expected.to run.with_params(AlsoString.new("one")).and_return("One") }
+  it { is_expected.to run.with_params([]).and_return([]) }
+  it { is_expected.to run.with_params(["one", "two"]).and_return(["One", "Two"]) }
+  it { is_expected.to run.with_params(["one", 1, "two"]).and_return(["One", 1, "Two"]) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/ceiling_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/ceiling_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/ceiling_spec.rb	(revision 30960)
@@ -0,0 +1,13 @@
+require 'spec_helper'
+
+describe 'ceiling' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params("foo").and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(34).and_return(34) }
+  it { is_expected.to run.with_params(-34).and_return(-34) }
+  it { is_expected.to run.with_params(33.1).and_return(34) }
+  it { is_expected.to run.with_params(-33.1).and_return(-33) }
+end
+
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/chomp_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/chomp_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/chomp_spec.rb	(revision 30960)
@@ -0,0 +1,20 @@
+require 'spec_helper'
+
+describe 'chomp' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params("a", "b").and_raise_error(Puppet::ParseError)
+  }
+  it { is_expected.to run.with_params("one").and_return("one") }
+  it { is_expected.to run.with_params("one\n").and_return("one") }
+  it { is_expected.to run.with_params("one\n\n").and_return("one\n") }
+  it { is_expected.to run.with_params(["one\n", "two", "three\n"]).and_return(["one", "two", "three"]) }
+
+  it { is_expected.to run.with_params(AlsoString.new("one")).and_return("one") }
+  it { is_expected.to run.with_params(AlsoString.new("one\n")).and_return("one") }
+  it { is_expected.to run.with_params(AlsoString.new("one\n\n")).and_return("one\n") }
+  it { is_expected.to run.with_params([AlsoString.new("one\n"), AlsoString.new("two"), "three\n"]).and_return(["one", "two", "three"]) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/chop_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/chop_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/chop_spec.rb	(revision 30960)
@@ -0,0 +1,20 @@
+require 'spec_helper'
+
+describe 'chop' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params("a", "b").and_raise_error(Puppet::ParseError)
+  }
+  it { is_expected.to run.with_params("one").and_return("on") }
+  it { is_expected.to run.with_params("one\n").and_return("one") }
+  it { is_expected.to run.with_params("one\n\n").and_return("one\n") }
+  it { is_expected.to run.with_params(["one\n", "two", "three\n"]).and_return(["one", "tw", "three"]) }
+
+  it { is_expected.to run.with_params(AlsoString.new("one")).and_return("on") }
+  it { is_expected.to run.with_params(AlsoString.new("one\n")).and_return("one") }
+  it { is_expected.to run.with_params(AlsoString.new("one\n\n")).and_return("one\n") }
+  it { is_expected.to run.with_params([AlsoString.new("one\n"), AlsoString.new("two"), "three\n"]).and_return(["one", "tw", "three"]) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/clamp_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/clamp_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/clamp_spec.rb	(revision 30960)
@@ -0,0 +1,16 @@
+require 'spec_helper'
+
+describe 'clamp' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(ArgumentError) }
+  it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(12, 88, 71, 190).and_raise_error(Puppet::ParseError, /Wrong number of arguments, need three to clamp/) }
+  it { is_expected.to run.with_params('12string', 88, 15).and_raise_error(Puppet::ParseError, /Required explicit numeric/) }
+  it { is_expected.to run.with_params(1, 2, {'a' => 55}).and_raise_error(Puppet::ParseError, /The Hash type is not allowed/) }
+  it { is_expected.to run.with_params('24', [575, 187]).and_return(187) }
+  it { is_expected.to run.with_params([4, 3, '99']).and_return(4) }
+  it { is_expected.to run.with_params(16, 750, 88).and_return(88) }
+  it { is_expected.to run.with_params([3, 873], 73).and_return(73) }
+  it { is_expected.to run.with_params([4], 8, 75).and_return(8) }
+  it { is_expected.to run.with_params([6], [31], 9911).and_return(31) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/concat_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/concat_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/concat_spec.rb	(revision 30960)
@@ -0,0 +1,25 @@
+require 'spec_helper'
+
+describe 'concat' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([1]).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(1, [2]).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([1], [2], [3]).and_return([1, 2, 3]) }
+  it { is_expected.to run.with_params(['1','2','3'],['4','5','6']).and_return(['1','2','3','4','5','6']) }
+  it { is_expected.to run.with_params(['1','2','3'],'4').and_return(['1','2','3','4']) }
+  it { is_expected.to run.with_params(['1','2','3'],[['4','5'],'6']).and_return(['1','2','3',['4','5'],'6']) }
+  it { is_expected.to run.with_params(['1','2'],['3','4'],['5','6']).and_return(['1','2','3','4','5','6']) }
+  it { is_expected.to run.with_params(['1','2'],'3','4',['5','6']).and_return(['1','2','3','4','5','6']) }
+  it { is_expected.to run.with_params([{"a" => "b"}], {"c" => "d", "e" => "f"}).and_return([{"a" => "b"}, {"c" => "d", "e" => "f"}]) }
+
+  it "should leave the original array intact" do
+    argument1 = ['1','2','3']
+    original1 = argument1.dup
+    argument2 = ['4','5','6']
+    original2 = argument2.dup
+    result = subject.call([argument1,argument2])
+    expect(argument1).to eq(original1)
+    expect(argument2).to eq(original2)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/convert_base_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/convert_base_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/convert_base_spec.rb	(revision 30960)
@@ -0,0 +1,24 @@
+require 'spec_helper'
+
+describe 'convert_base' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(ArgumentError) }
+  it { is_expected.to run.with_params("asdf").and_raise_error(ArgumentError) }
+  it { is_expected.to run.with_params("asdf","moo","cow").and_raise_error(ArgumentError) }
+  it { is_expected.to run.with_params(["1"],"2").and_raise_error(Puppet::ParseError, /argument must be either a string or an integer/) }
+  it { is_expected.to run.with_params("1",["2"]).and_raise_error(Puppet::ParseError, /argument must be either a string or an integer/) }
+  it { is_expected.to run.with_params("1",1).and_raise_error(Puppet::ParseError, /base must be at least 2 and must not be greater than 36/) }
+  it { is_expected.to run.with_params("1",37).and_raise_error(Puppet::ParseError, /base must be at least 2 and must not be greater than 36/) }
+
+  it "should raise a ParseError if argument 1 is a string that does not correspond to an integer in base 10" do
+    is_expected.to run.with_params("ten",6).and_raise_error(Puppet::ParseError, /argument must be an integer or a string corresponding to an integer in base 10/)
+  end
+
+  it "should raise a ParseError if argument 2 is a string and does not correspond to an integer in base 10" do
+    is_expected.to run.with_params(100,"hex").and_raise_error(Puppet::ParseError, /argument must be an integer or a string corresponding to an integer in base 10/)
+  end
+
+  it { is_expected.to run.with_params("11",'16').and_return('b') }
+  it { is_expected.to run.with_params("35",'36').and_return('z') }
+  it { is_expected.to run.with_params(5, 2).and_return('101') }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/count_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/count_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/count_spec.rb	(revision 30960)
@@ -0,0 +1,18 @@
+require 'spec_helper'
+
+describe 'count' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(ArgumentError) }
+  it { is_expected.to run.with_params("one").and_raise_error(ArgumentError) }
+  it { is_expected.to run.with_params("one", "two").and_return(1) }
+  it {
+    pending("should actually be like this, and not like above")
+    is_expected.to run.with_params("one", "two").and_raise_error(ArgumentError)
+  }
+  it { is_expected.to run.with_params("one", "two", "three").and_raise_error(ArgumentError) }
+  it { is_expected.to run.with_params(["one", "two", "three"]).and_return(3) }
+  it { is_expected.to run.with_params(["one", "two", "two"], "two").and_return(2) }
+  it { is_expected.to run.with_params(["one", nil, "two"]).and_return(2) }
+  it { is_expected.to run.with_params(["one", "", "two"]).and_return(2) }
+  it { is_expected.to run.with_params(["one", :undef, "two"]).and_return(2) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/deep_merge_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/deep_merge_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/deep_merge_spec.rb	(revision 30960)
@@ -0,0 +1,55 @@
+require 'spec_helper'
+
+describe 'deep_merge' do
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params({ 'key' => 'value' }).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params({}, '2').and_raise_error(Puppet::ParseError, /unexpected argument type String/) }
+  it { is_expected.to run.with_params({}, 2).and_raise_error(Puppet::ParseError, /unexpected argument type Fixnum/) }
+  it { is_expected.to run.with_params({}, '').and_return({}) }
+  it { is_expected.to run.with_params({}, {}).and_return({}) }
+  it { is_expected.to run.with_params({}, {}, {}).and_return({}) }
+  it { is_expected.to run.with_params({}, {}, {}, {}).and_return({}) }
+  it { is_expected.to run.with_params({'key' => 'value'}, '').and_return({'key' => 'value'}) }
+  it { is_expected.to run.with_params({'key1' => 'value1'}, {'key2' => 'value2' }).and_return({'key1' => 'value1', 'key2' => 'value2'}) }
+
+  describe 'when arguments have key collisions' do
+    it 'should prefer values from the last hash' do
+      is_expected.to run \
+        .with_params(
+          {'key1' => 'value1', 'key2' => 'value2' },
+          {'key2' => 'replacement_value', 'key3' => 'value3'}) \
+        .and_return(
+          {'key1' => 'value1', 'key2' => 'replacement_value', 'key3' => 'value3'})
+    end
+    it { is_expected.to run \
+      .with_params({'key1' => 'value1'}, {'key1' => 'value2'}, {'key1' => 'value3'}) \
+      .and_return({'key1' => 'value3' })
+    }
+  end
+
+  describe 'when arguments have subhashes' do
+    it { is_expected.to run \
+      .with_params({'key1' => 'value1'}, {'key2' => 'value2', 'key3' => {'subkey1' => 'value4'}}) \
+      .and_return( {'key1' => 'value1', 'key2' => 'value2', 'key3' => {'subkey1' => 'value4'}})
+    }
+    it { is_expected.to run \
+      .with_params({'key1' => {'subkey1' => 'value1'}}, {'key1' => {'subkey2' => 'value2'}}) \
+      .and_return( {'key1' => {'subkey1' => 'value1', 'subkey2' => 'value2'}})
+    }
+    it { is_expected.to run \
+      .with_params({'key1' => {'subkey1' => {'subsubkey1' => 'value1'}}}, {'key1' => {'subkey1' => {'subsubkey1' => 'value2'}}}) \
+      .and_return( {'key1' => {'subkey1' => {'subsubkey1' => 'value2'}}})
+    }
+  end
+
+  it 'should not change the original hashes' do
+    argument1 = { 'key1' => 'value1' }
+    original1 = argument1.dup
+    argument2 = { 'key2' => 'value2' }
+    original2 = argument2.dup
+
+    subject.call([argument1, argument2])
+    expect(argument1).to eq(original1)
+    expect(argument2).to eq(original2)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/defined_with_params_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/defined_with_params_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/defined_with_params_spec.rb	(revision 30960)
@@ -0,0 +1,35 @@
+require 'spec_helper'
+
+describe 'defined_with_params' do
+  describe 'when no resource is specified' do
+    it { is_expected.to run.with_params().and_raise_error(ArgumentError) }
+  end
+  describe 'when compared against a resource with no attributes' do
+    let :pre_condition do
+      'user { "dan": }'
+    end
+    it { is_expected.to run.with_params('User[dan]', {}).and_return(true) }
+    it { is_expected.to run.with_params('User[bob]', {}).and_return(false) }
+    it { is_expected.to run.with_params('User[dan]', {'foo' => 'bar'}).and_return(false) }
+  end
+
+  describe 'when compared against a resource with attributes' do
+    let :pre_condition do
+      'user { "dan": ensure => present, shell => "/bin/csh", managehome => false}'
+    end
+    it { is_expected.to run.with_params('User[dan]', {}).and_return(true) }
+    it { is_expected.to run.with_params('User[dan]', '').and_return(true) }
+    it { is_expected.to run.with_params('User[dan]', {'ensure' => 'present'}).and_return(true) }
+    it { is_expected.to run.with_params('User[dan]', {'ensure' => 'present', 'managehome' => false}).and_return(true) }
+    it { is_expected.to run.with_params('User[dan]', {'ensure' => 'absent', 'managehome' => false}).and_return(false) }
+  end
+
+  describe 'when passing undef values' do
+    let :pre_condition do
+      'file { "/tmp/a": ensure => present }'
+    end
+
+    it { is_expected.to run.with_params('File[/tmp/a]', {}).and_return(true) }
+    it { is_expected.to run.with_params('File[/tmp/a]', { 'ensure' => 'present', 'owner' => :undef }).and_return(true) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_at_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_at_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_at_spec.rb	(revision 30960)
@@ -0,0 +1,28 @@
+require 'spec_helper'
+
+describe 'delete_at' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one', 1).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(1, 1).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(['one'], 'two').and_raise_error(Puppet::ParseError) }
+  it {
+    pending("Current implementation ignores parameters after the first two.")
+    is_expected.to run.with_params(['one'], 0, 1).and_raise_error(Puppet::ParseError)
+  }
+
+  describe 'argument validation' do
+    it { is_expected.to run.with_params([0, 1, 2], 3).and_raise_error(Puppet::ParseError) }
+  end
+
+  it { is_expected.to run.with_params([0, 1, 2], 1).and_return([0, 2]) }
+  it { is_expected.to run.with_params([0, 1, 2], -1).and_return([0, 1]) }
+  it { is_expected.to run.with_params([0, 1, 2], -4).and_return([0, 1, 2]) }
+
+  it "should leave the original array intact" do
+    argument = [1, 2, 3]
+    original = argument.dup
+    result = subject.call([argument,2])
+    expect(argument).to eq(original)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_regex_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_regex_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_regex_spec.rb	(revision 30960)
@@ -0,0 +1,54 @@
+require 'spec_helper'
+
+describe 'delete_regex' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([], 'two') }
+  it { is_expected.to run.with_params({}, 'two') }
+  it { is_expected.to run.with_params([], 'two', 'three').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([], 'two', 'three', 'four').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(1, 'two').and_raise_error(TypeError) }
+
+  describe 'deleting from an array' do
+    it { is_expected.to run.with_params([], '').and_return([]) }
+    it { is_expected.to run.with_params([], 'two').and_return([]) }
+    it { is_expected.to run.with_params(['two'], 'two').and_return([]) }
+    it { is_expected.to run.with_params(['two', 'two'], 'two').and_return([]) }
+    it { is_expected.to run.with_params(['one', 'two', 'three'], '^t.*').and_return(['one']) }
+    it { is_expected.to run.with_params(['ab', 'b', 'c', 'b'], 'b').and_return(['ab', 'c']) }
+    it { is_expected.to run.with_params(['one', 'two', 'three'], 'four').and_return(['one', 'two', 'three']) }
+    it { is_expected.to run.with_params(['one', 'two', 'three'], 'e').and_return(['one', 'two', 'three']) }
+    it { is_expected.to run.with_params(['one', 'two', 'three'], 'two').and_return(['one', 'three']) }
+    it { is_expected.to run.with_params(['two', 'one', 'two', 'three', 'two'], 'two').and_return(['one', 'three']) }
+    it { is_expected.to run.with_params(['abracadabra'], 'abr').and_return(['abracadabra']) }
+    it { is_expected.to run.with_params(['abracadabra'], '^.*jimbob.*$').and_return(['abracadabra']) }
+  end
+
+  describe 'deleting from an array' do
+    it { is_expected.to run.with_params({}, '').and_return({}) }
+    it { is_expected.to run.with_params({}, 'key').and_return({}) }
+    it { is_expected.to run.with_params({'key' => 'value'}, 'key').and_return({}) }
+    it { is_expected.to run \
+      .with_params({'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'}, 'key2') \
+      .and_return( {'key1' => 'value1', 'key3' => 'value3'})
+    }
+    it { is_expected.to run \
+      .with_params({'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'}, ['key1', 'key2']) \
+      .and_return( {'key3' => 'value3'})
+    }
+  end
+
+  it "should leave the original array intact" do
+    argument1 = ['one','two','three']
+    original1 = argument1.dup
+    subject.call([argument1,'two'])
+    expect(argument1).to eq(original1)
+  end
+  it "should leave the original hash intact" do
+    argument1 = {'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'}
+    original1 = argument1.dup
+    subject.call([argument1,'key2'])
+    expect(argument1).to eq(original1)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_spec.rb	(revision 30960)
@@ -0,0 +1,70 @@
+require 'spec_helper'
+
+describe 'delete' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([], 'two') }
+  it { is_expected.to run.with_params([], 'two', 'three').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(1, 'two').and_raise_error(TypeError) }
+
+  describe 'deleting from an array' do
+    it { is_expected.to run.with_params([], '').and_return([]) }
+    it { is_expected.to run.with_params([], 'two').and_return([]) }
+    it { is_expected.to run.with_params(['two'], 'two').and_return([]) }
+    it { is_expected.to run.with_params(['two', 'two'], 'two').and_return([]) }
+    it { is_expected.to run.with_params(['ab', 'b', 'c', 'b'], 'b').and_return(['ab', 'c']) }
+    it { is_expected.to run.with_params(['one', 'two', 'three'], 'four').and_return(['one', 'two', 'three']) }
+    it { is_expected.to run.with_params(['one', 'two', 'three'], 'e').and_return(['one', 'two', 'three']) }
+    it { is_expected.to run.with_params(['one', 'two', 'three'], 'two').and_return(['one', 'three']) }
+    it { is_expected.to run.with_params(['two', 'one', 'two', 'three', 'two'], 'two').and_return(['one', 'three']) }
+    it { is_expected.to run.with_params(['one', 'two', 'three', 'two'], ['one', 'two']).and_return(['three']) }
+  end
+
+  describe 'deleting from a string' do
+    it { is_expected.to run.with_params('', '').and_return('') }
+    it { is_expected.to run.with_params('bar', '').and_return('bar') }
+    it { is_expected.to run.with_params('', 'bar').and_return('') }
+    it { is_expected.to run.with_params('bar', 'bar').and_return('') }
+    it { is_expected.to run.with_params('barbar', 'bar').and_return('') }
+    it { is_expected.to run.with_params('barfoobar', 'bar').and_return('foo') }
+    it { is_expected.to run.with_params('foobarbabarz', 'bar').and_return('foobaz') }
+    it { is_expected.to run.with_params('foobarbabarz', ['foo', 'bar']).and_return('baz') }
+    # this is so sick
+    it { is_expected.to run.with_params('barfoobar', ['barbar', 'foo']).and_return('barbar') }
+    it { is_expected.to run.with_params('barfoobar', ['foo', 'barbar']).and_return('') }
+  end
+
+  describe 'deleting from an array' do
+    it { is_expected.to run.with_params({}, '').and_return({}) }
+    it { is_expected.to run.with_params({}, 'key').and_return({}) }
+    it { is_expected.to run.with_params({'key' => 'value'}, 'key').and_return({}) }
+    it { is_expected.to run \
+      .with_params({'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'}, 'key2') \
+      .and_return( {'key1' => 'value1', 'key3' => 'value3'})
+    }
+    it { is_expected.to run \
+      .with_params({'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'}, ['key1', 'key2']) \
+      .and_return( {'key3' => 'value3'})
+    }
+  end
+
+  it "should leave the original array intact" do
+    argument1 = ['one','two','three']
+    original1 = argument1.dup
+    result = subject.call([argument1,'two'])
+    expect(argument1).to eq(original1)
+  end
+  it "should leave the original string intact" do
+    argument1 = 'onetwothree'
+    original1 = argument1.dup
+    result = subject.call([argument1,'two'])
+    expect(argument1).to eq(original1)
+  end
+  it "should leave the original hash intact" do
+    argument1 = {'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3'}
+    original1 = argument1.dup
+    result = subject.call([argument1,'key2'])
+    expect(argument1).to eq(original1)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_undef_values_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_undef_values_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_undef_values_spec.rb	(revision 30960)
@@ -0,0 +1,56 @@
+require 'spec_helper'
+
+describe 'delete_undef_values' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError) }
+
+  describe 'when deleting from an array' do
+    [ :undef, '', nil ].each do |undef_value|
+      describe "when undef is represented by #{undef_value.inspect}" do
+        before do
+          pending("review behaviour when being passed undef as #{undef_value.inspect}") if undef_value == ''
+          pending("review behaviour when being passed undef as #{undef_value.inspect}") if undef_value == nil
+        end
+        it { is_expected.to run.with_params([undef_value]).and_return([]) }
+        it { is_expected.to run.with_params(['one',undef_value,'two','three']).and_return(['one','two','three']) }
+      end
+
+      it "should leave the original argument intact" do
+        argument = ['one',undef_value,'two']
+        original = argument.dup
+        result = subject.call([argument,2])
+        expect(argument).to eq(original)
+      end
+    end
+
+    it { is_expected.to run.with_params(['undef']).and_return(['undef']) }
+  end
+
+  describe 'when deleting from a hash' do
+    [ :undef, '', nil ].each do |undef_value|
+      describe "when undef is represented by #{undef_value.inspect}" do
+        before do
+          pending("review behaviour when being passed undef as #{undef_value.inspect}") if undef_value == ''
+          pending("review behaviour when being passed undef as #{undef_value.inspect}") if undef_value == nil
+        end
+        it { is_expected.to run.with_params({'key' => undef_value}).and_return({}) }
+        it { is_expected.to run \
+          .with_params({'key1' => 'value1', 'undef_key' => undef_value, 'key2' => 'value2'}) \
+          .and_return({'key1' => 'value1', 'key2' => 'value2'})
+        }
+      end
+
+      it "should leave the original argument intact" do
+        argument = { 'key1' => 'value1', 'key2' => undef_value }
+        original = argument.dup
+        result = subject.call([argument,2])
+        expect(argument).to eq(original)
+      end
+    end
+
+    it { is_expected.to run.with_params({'key' => 'undef'}).and_return({'key' => 'undef'}) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_values_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_values_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/delete_values_spec.rb	(revision 30960)
@@ -0,0 +1,37 @@
+require 'spec_helper'
+
+describe 'delete_values' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one', 'two', 'three').and_raise_error(Puppet::ParseError) }
+  describe 'when the first argument is not a hash' do
+    it { is_expected.to run.with_params(1, 'two').and_raise_error(TypeError) }
+    it { is_expected.to run.with_params('one', 'two').and_raise_error(TypeError) }
+    it { is_expected.to run.with_params([], 'two').and_raise_error(TypeError) }
+  end
+
+  describe 'when deleting from a hash' do
+    it { is_expected.to run.with_params({}, 'value').and_return({}) }
+    it { is_expected.to run \
+      .with_params({'key1' => 'value1'}, 'non-existing value') \
+      .and_return({'key1' => 'value1'})
+    }
+    it { is_expected.to run \
+      .with_params({'key1' => 'value1', 'key2' => 'value to delete'}, 'value to delete') \
+      .and_return({'key1' => 'value1'})
+    }
+    it { is_expected.to run \
+      .with_params({'key1' => 'value1', 'key2' => 'value to delete', 'key3' => 'value to delete'}, 'value to delete') \
+      .and_return({'key1' => 'value1'})
+    }
+  end
+
+  it "should leave the original argument intact" do
+    argument = { 'key1' => 'value1', 'key2' => 'value2' }
+    original = argument.dup
+    result = subject.call([argument, 'value2'])
+    expect(argument).to eq(original)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/deprecation_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/deprecation_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/deprecation_spec.rb	(revision 30960)
@@ -0,0 +1,57 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.0
+  describe 'deprecation' do
+    before(:each) {
+      # this is to reset the strict variable to default
+      Puppet.settings[:strict] = :warning
+    }
+
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(ArgumentError) }
+
+    it 'should display a single warning' do
+      Puppet.expects(:warning).with(includes('heelo'))
+      is_expected.to run.with_params('key', 'heelo')
+    end
+
+    it 'should display a single warning, despite multiple calls' do
+      Puppet.expects(:warning).with(includes('heelo')).once
+      is_expected.to run.with_params('key', 'heelo')
+      is_expected.to run.with_params('key', 'heelo')
+    end
+
+    it 'should fail twice with message, with multiple calls. when strict= :error' do
+      Puppet.settings[:strict] = :error
+      Puppet.expects(:warning).with(includes('heelo')).never
+      is_expected.to run.with_params('key', 'heelo').and_raise_error(RuntimeError, /deprecation. key. heelo/)
+      is_expected.to run.with_params('key', 'heelo').and_raise_error(RuntimeError, /deprecation. key. heelo/)
+    end
+
+    it 'should display nothing, despite multiple calls. strict= :off' do
+      Puppet.settings[:strict] = :off
+      Puppet.expects(:warning).with(includes('heelo')).never
+      is_expected.to run.with_params('key', 'heelo')
+      is_expected.to run.with_params('key', 'heelo')
+    end
+
+    after(:all) {
+      # this is to reset the strict variable to default
+      Puppet.settings[:strict] = :warning
+    }
+  end
+else
+  describe 'deprecation' do
+    after(:all) do
+      ENV.delete('STDLIB_LOG_DEPRECATIONS')
+    end
+    ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+    it 'should display a single warning' do
+      scope.expects(:warning).with(includes('heelo'))
+      is_expected.to run.with_params('key', 'heelo')
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/difference_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/difference_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/difference_spec.rb	(revision 30960)
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe 'difference' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one', 'two', 'three').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one', []).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([], 'two').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params({}, {}).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([], []).and_return([]) }
+  it { is_expected.to run.with_params([], ['one']).and_return([]) }
+  it { is_expected.to run.with_params(['one'], ['one']).and_return([]) }
+  it { is_expected.to run.with_params(['one'], []).and_return(['one']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], ['two', 'three']).and_return(['one']) }
+  it { is_expected.to run.with_params(['one', 'two', 'two', 'three'], ['two', 'three']).and_return(['one']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], ['two', 'two', 'three']).and_return(['one']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], ['two', 'three', 'four']).and_return(['one']) }
+  it 'should not confuse types' do is_expected.to run.with_params(['1', '2', '3'], [1, 2]).and_return(['1', '2', '3']) end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/dig44_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/dig44_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/dig44_spec.rb	(revision 30960)
@@ -0,0 +1,105 @@
+require 'spec_helper'
+
+describe 'dig44' do
+
+  let(:data) do
+    {
+        'a' => {
+            'g' => '2',
+            'e' => [
+                'f0',
+                'f1',
+                {
+                    'x' => {
+                        'y' => 'z'
+                    }
+                },
+                'f3',
+            ]
+        },
+        'b' => true,
+        'c' => false,
+        'd' => '1',
+        'e' => :undef,
+        'f' => nil,
+    }
+  end
+
+  context 'single values' do
+    it 'should exist' do
+      is_expected.not_to be_nil
+    end
+
+    it 'should require two arguments' do
+      is_expected.to run.with_params().and_raise_error(ArgumentError)
+    end
+
+    it 'should fail if the data is not a structure' do
+      is_expected.to run.with_params('test', []).and_raise_error(Puppet::Error)
+    end
+
+    it 'should fail if the path is not an array' do
+      is_expected.to run.with_params({}, '').and_raise_error(Puppet::Error)
+    end
+
+    it 'should return the value if the value is string' do
+      is_expected.to run.with_params(data, ['d'], 'default').and_return('1')
+    end
+
+    it 'should return true if the value is true' do
+      is_expected.to run.with_params(data, ['b'], 'default').and_return(true)
+    end
+
+    it 'should return false if the value is false' do
+      is_expected.to run.with_params(data, ['c'], 'default').and_return(false)
+    end
+
+    it 'should return the default if the value is nil' do
+      is_expected.to run.with_params(data, ['f'], 'default').and_return('default')
+    end
+
+    it 'should return the default if the value is :undef (same as nil)' do
+      is_expected.to run.with_params(data, ['e'], 'default').and_return('default')
+    end
+
+    it 'should return the default if the path is not found' do
+      is_expected.to run.with_params(data, ['missing'], 'default').and_return('default')
+    end
+  end
+
+  context 'structure values' do
+
+    it 'should be able to extract a deeply nested hash value' do
+      is_expected.to run.with_params(data, %w(a g), 'default').and_return('2')
+    end
+
+    it 'should return the default value if the path is too long' do
+      is_expected.to run.with_params(data, %w(a g c d), 'default').and_return('default')
+    end
+
+    it 'should support an array index (number) in the path' do
+      is_expected.to run.with_params(data, ['a', 'e', 1], 'default').and_return('f1')
+    end
+
+    it 'should support an array index (string) in the path' do
+      is_expected.to run.with_params(data, %w(a e 1), 'default').and_return('f1')
+    end
+
+    it 'should return the default value if an array index is not a number' do
+      is_expected.to run.with_params(data, %w(a b c), 'default').and_return('default')
+    end
+
+    it 'should return the default value if and index is out of array length' do
+      is_expected.to run.with_params(data, %w(a e 5), 'default').and_return('default')
+    end
+
+    it 'should be able to path though both arrays and hashes' do
+      is_expected.to run.with_params(data, %w(a e 2 x y), 'default').and_return('z')
+    end
+
+    it 'should return "nil" if value is not found and no default value is provided' do
+      is_expected.to run.with_params(data, %w(a 1)).and_return(nil)
+    end
+
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/dig_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/dig_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/dig_spec.rb	(revision 30960)
@@ -0,0 +1,13 @@
+require 'spec_helper'
+
+describe 'dig' do
+
+  it "should exist" do
+    expect(Puppet::Parser::Functions.function("dig")).to eq("function_dig")
+  end
+
+  it "should give a deprecation warning when called" do
+    scope.expects(:warning).with("dig() DEPRECATED: This function has been replaced in Puppet 4.5.0, please use dig44() for backwards compatibility or use the new version.")
+    scope.function_dig([{}, []])
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/dirname_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/dirname_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/dirname_spec.rb	(revision 30960)
@@ -0,0 +1,13 @@
+require 'spec_helper'
+
+describe 'dirname' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('/path/to/a/file.ext', []).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('/path/to/a/file.ext').and_return('/path/to/a') }
+  it { is_expected.to run.with_params('relative_path/to/a/file.ext').and_return('relative_path/to/a') }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/dos2unix_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/dos2unix_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/dos2unix_spec.rb	(revision 30960)
@@ -0,0 +1,40 @@
+require 'spec_helper'
+
+describe 'dos2unix' do
+  context 'Checking parameter validity' do
+    it { is_expected.not_to eq(nil) }
+    it do
+      is_expected.to run.with_params.and_raise_error(ArgumentError, /Wrong number of arguments/)
+    end
+    it do
+      is_expected.to run.with_params('one', 'two').and_raise_error(ArgumentError, /Wrong number of arguments/)
+    end
+    it do
+      is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError)
+    end
+    it do
+      is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError)
+    end
+    it do
+      is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError)
+    end
+  end
+
+  context 'Converting from dos to unix format' do
+    sample_text    = "Hello\r\nWorld\r\n"
+    desired_output = "Hello\nWorld\n"
+
+    it 'should output unix format' do
+      should run.with_params(sample_text).and_return(desired_output)
+    end
+  end
+
+  context 'Converting from unix to unix format' do
+    sample_text    = "Hello\nWorld\n"
+    desired_output = "Hello\nWorld\n"
+
+    it 'should output unix format' do
+      should run.with_params(sample_text).and_return(desired_output)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/downcase_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/downcase_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/downcase_spec.rb	(revision 30960)
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe 'downcase' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(100).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params("abc").and_return("abc") }
+  it { is_expected.to run.with_params("Abc").and_return("abc") }
+  it { is_expected.to run.with_params("ABC").and_return("abc") }
+
+  it { is_expected.to run.with_params(AlsoString.new("ABC")).and_return("abc") }
+  it { is_expected.to run.with_params([]).and_return([]) }
+  it { is_expected.to run.with_params(["ONE", "TWO"]).and_return(["one", "two"]) }
+  it { is_expected.to run.with_params(["One", 1, "Two"]).and_return(["one", 1, "two"]) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/empty_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/empty_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/empty_spec.rb	(revision 30960)
@@ -0,0 +1,22 @@
+require 'spec_helper'
+
+describe 'empty' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError)
+  }
+  it { is_expected.to run.with_params(0).and_return(false) }
+  it { is_expected.to run.with_params('').and_return(true) }
+  it { is_expected.to run.with_params('one').and_return(false) }
+
+  it { is_expected.to run.with_params(AlsoString.new('')).and_return(true) }
+  it { is_expected.to run.with_params(AlsoString.new('one')).and_return(false) }
+
+  it { is_expected.to run.with_params([]).and_return(true) }
+  it { is_expected.to run.with_params(['one']).and_return(false) }
+
+  it { is_expected.to run.with_params({}).and_return(true) }
+  it { is_expected.to run.with_params({'key' => 'value'}).and_return(false) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/ensure_packages_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/ensure_packages_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/ensure_packages_spec.rb	(revision 30960)
@@ -0,0 +1,36 @@
+require 'spec_helper'
+
+describe 'ensure_packages' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it {
+    pending("should not accept numbers as arguments")
+    is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError)
+  }
+  it {
+    pending("should not accept numbers as arguments")
+    is_expected.to run.with_params(["packagename", 1]).and_raise_error(Puppet::ParseError)
+  }
+  it { is_expected.to run.with_params("packagename") }
+  it { is_expected.to run.with_params(["packagename1", "packagename2"]) }
+
+  context 'given a catalog with "package { puppet: ensure => absent }"' do
+    let(:pre_condition) { 'package { puppet: ensure => absent }' }
+
+    describe 'after running ensure_package("facter")' do
+      before { subject.call(['facter']) }
+
+      # this lambda is required due to strangeness within rspec-puppet's expectation handling
+      it { expect(lambda { catalogue }).to contain_package('puppet').with_ensure('absent') }
+      it { expect(lambda { catalogue }).to contain_package('facter').with_ensure('present') }
+    end
+
+    describe 'after running ensure_package("facter", { "provider" => "gem" })' do
+      before { subject.call(['facter', { "provider" => "gem" }]) }
+
+      # this lambda is required due to strangeness within rspec-puppet's expectation handling
+      it { expect(lambda { catalogue }).to contain_package('puppet').with_ensure('absent').without_provider() }
+      it { expect(lambda { catalogue }).to contain_package('facter').with_ensure('present').with_provider("gem") }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/ensure_resource_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/ensure_resource_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/ensure_resource_spec.rb	(revision 30960)
@@ -0,0 +1,93 @@
+require 'spec_helper'
+
+describe 'ensure_resource' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(ArgumentError, /Must specify a type/) }
+  it { is_expected.to run.with_params('type').and_raise_error(ArgumentError, /Must specify a title/) }
+  if Puppet.version.to_f >= 4.6
+    it { is_expected.to run.with_params('type', 'title', {}, 'extras').and_raise_error(ArgumentError) }
+  else
+    it { is_expected.to run.with_params('type', 'title', {}, 'extras').and_raise_error(Puppet::ParseError) }
+  end
+
+  it {
+    pending("should not accept numbers as arguments")
+    is_expected.to run.with_params(1,2,3).and_raise_error(Puppet::ParseError)
+  }
+
+  context 'given an empty catalog' do
+    describe 'after running ensure_resource("user", "username1", {})' do
+      before { subject.call(['User', 'username1', {}]) }
+
+      # this lambda is required due to strangeness within rspec-puppet's expectation handling
+      it { expect(lambda { catalogue }).to contain_user('username1').without_ensure }
+    end
+
+    describe 'after running ensure_resource("user", "username1", { gid => undef })' do
+      before { subject.call(['User', 'username1', { 'gid' => :undef }]) }
+
+      # this lambda is required due to strangeness within rspec-puppet's expectation handling
+      it { expect(lambda { catalogue }).to contain_user('username1').without_ensure }
+      it { expect(lambda { catalogue }).to contain_user('username1').without_gid }
+    end
+
+    describe 'after running ensure_resource("user", "username1", { ensure => present, gid => undef })' do
+      before { subject.call(['User', 'username1', { 'ensure' => 'present', 'gid' => :undef }]) }
+
+      # this lambda is required due to strangeness within rspec-puppet's expectation handling
+      it { expect(lambda { catalogue }).to contain_user('username1').with_ensure('present') }
+      it { expect(lambda { catalogue }).to contain_user('username1').without_gid }
+    end
+
+  end
+
+  context 'given a catalog with "user { username1: ensure => present }"' do
+    let(:pre_condition) { 'user { username1: ensure => present }' }
+
+    describe 'after running ensure_resource("user", "username1", {})' do
+      before { subject.call(['User', 'username1', {}]) }
+
+      # this lambda is required due to strangeness within rspec-puppet's expectation handling
+      it { expect(lambda { catalogue }).to contain_user('username1').with_ensure('present') }
+    end
+
+    describe 'after running ensure_resource("user", "username2", {})' do
+      before { subject.call(['User', 'username2', {}]) }
+
+      # this lambda is required due to strangeness within rspec-puppet's expectation handling
+      it { expect(lambda { catalogue }).to contain_user('username1').with_ensure('present') }
+      it { expect(lambda { catalogue }).to contain_user('username2').without_ensure }
+    end
+
+    describe 'after running ensure_resource("user", "username1", { gid => undef })' do
+      before { subject.call(['User', 'username1', { 'gid' => :undef }]) }
+
+      # this lambda is required due to strangeness within rspec-puppet's expectation handling
+      it { expect(lambda { catalogue }).to contain_user('username1').with_ensure('present') }
+    end
+
+    describe 'after running ensure_resource("user", ["username1", "username2"], {})' do
+      before { subject.call(['User', ['username1', 'username2'], {}]) }
+
+      # this lambda is required due to strangeness within rspec-puppet's expectation handling
+      it { expect(lambda { catalogue }).to contain_user('username1').with_ensure('present') }
+      it { expect(lambda { catalogue }).to contain_user('username2').without_ensure }
+    end
+
+    describe 'when providing already set params' do
+      let(:params) { { 'ensure' => 'present' } }
+      before { subject.call(['User', ['username2', 'username3'], params]) }
+
+      # this lambda is required due to strangeness within rspec-puppet's expectation handling
+      it { expect(lambda { catalogue }).to contain_user('username1').with(params) }
+      it { expect(lambda { catalogue }).to contain_user('username2').with(params) }
+    end
+
+    context 'when trying to add params' do
+      it { is_expected.to run \
+        .with_params('User', 'username1', { 'ensure' => 'present', 'shell' => true }) \
+        .and_raise_error(Puppet::Resource::Catalog::DuplicateResourceError, /User\[username1\] is already declared/)
+      }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/flatten_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/flatten_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/flatten_spec.rb	(revision 30960)
@@ -0,0 +1,14 @@
+require 'spec_helper'
+
+describe 'flatten' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([], []).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([]).and_return([]) }
+  it { is_expected.to run.with_params(['one']).and_return(['one']) }
+  it { is_expected.to run.with_params([['one']]).and_return(['one']) }
+  it { is_expected.to run.with_params(["a","b","c","d","e","f","g"]).and_return(["a","b","c","d","e","f","g"]) }
+  it { is_expected.to run.with_params([["a","b",["c",["d","e"],"f","g"]]]).and_return(["a","b","c","d","e","f","g"]) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/floor_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/floor_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/floor_spec.rb	(revision 30960)
@@ -0,0 +1,12 @@
+require 'spec_helper'
+
+describe 'floor' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params("foo").and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params(34).and_return(34) }
+  it { is_expected.to run.with_params(-34).and_return(-34) }
+  it { is_expected.to run.with_params(33.1).and_return(33) }
+  it { is_expected.to run.with_params(-33.1).and_return(-34) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/fqdn_rand_string_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/fqdn_rand_string_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/fqdn_rand_string_spec.rb	(revision 30960)
@@ -0,0 +1,65 @@
+require 'spec_helper'
+
+describe 'fqdn_rand_string' do
+  let(:default_charset) { %r{\A[a-zA-Z0-9]{100}\z} }
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(ArgumentError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(0).and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params(1.5).and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params(-10).and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params("-10").and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params("string").and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params([]).and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params({}).and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params(1, 1).and_raise_error(ArgumentError, /second argument must be undef or a string/) }
+  it { is_expected.to run.with_params(1, []).and_raise_error(ArgumentError, /second argument must be undef or a string/) }
+  it { is_expected.to run.with_params(1, {}).and_raise_error(ArgumentError, /second argument must be undef or a string/) }
+  it { is_expected.to run.with_params(100).and_return(default_charset) }
+  it { is_expected.to run.with_params("100").and_return(default_charset) }
+  it { is_expected.to run.with_params(100, nil).and_return(default_charset) }
+  it { is_expected.to run.with_params(100, '').and_return(default_charset) }
+  it { is_expected.to run.with_params(100, 'a').and_return(/\Aa{100}\z/) }
+  it { is_expected.to run.with_params(100, 'ab').and_return(/\A[ab]{100}\z/) }
+
+  it "provides the same 'random' value on subsequent calls for the same host" do
+    expect(fqdn_rand_string(10)).to eql(fqdn_rand_string(10))
+  end
+
+  it "considers the same host and same extra arguments to have the same random sequence" do
+    first_random = fqdn_rand_string(10, :extra_identifier => [1, "same", "host"])
+    second_random = fqdn_rand_string(10, :extra_identifier => [1, "same", "host"])
+
+    expect(first_random).to eql(second_random)
+  end
+
+  it "allows extra arguments to control the random value on a single host" do
+    first_random = fqdn_rand_string(10, :extra_identifier => [1, "different", "host"])
+    second_different_random = fqdn_rand_string(10, :extra_identifier => [2, "different", "host"])
+
+    expect(first_random).not_to eql(second_different_random)
+  end
+
+  it "should return different strings for different hosts" do
+    val1 = fqdn_rand_string(10, :host => "first.host.com")
+    val2 = fqdn_rand_string(10, :host => "second.host.com")
+
+    expect(val1).not_to eql(val2)
+  end
+
+  def fqdn_rand_string(max, args = {})
+    host = args[:host] || '127.0.0.1'
+    charset = args[:charset]
+    extra = args[:extra_identifier] || []
+
+    # workaround not being able to use let(:facts) because some tests need
+    # multiple different hostnames in one context
+    scope.stubs(:lookupvar).with("::fqdn", {}).returns(host)
+
+    function_args = [max]
+    if args.has_key?(:charset) or !extra.empty?
+      function_args << charset
+    end
+    function_args += extra
+    scope.function_fqdn_rand_string(function_args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/fqdn_rotate_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/fqdn_rotate_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/fqdn_rotate_spec.rb	(revision 30960)
@@ -0,0 +1,75 @@
+require 'spec_helper'
+
+describe 'fqdn_rotate' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(0).and_raise_error(Puppet::ParseError, /Requires either array or string to work with/) }
+  it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /Requires either array or string to work with/) }
+  it { is_expected.to run.with_params('').and_return('') }
+  it { is_expected.to run.with_params('a').and_return('a') }
+
+  it { is_expected.to run.with_params([]).and_return([]) }
+  it { is_expected.to run.with_params(['a']).and_return(['a']) }
+
+  it "should rotate a string and the result should be the same size" do
+    expect(fqdn_rotate("asdf").size).to eq(4)
+  end
+
+  it "should rotate a string to give the same results for one host" do
+    val1 = fqdn_rotate("abcdefg", :host => 'one')
+    val2 = fqdn_rotate("abcdefg", :host => 'one')
+    expect(val1).to eq(val2)
+  end
+
+  it "allows extra arguments to control the random rotation on a single host" do
+    val1 = fqdn_rotate("abcdefg", :extra_identifier => [1, "different", "host"])
+    val2 = fqdn_rotate("abcdefg", :extra_identifier => [2, "different", "host"])
+    expect(val1).not_to eq(val2)
+  end
+
+  it "considers the same host and same extra arguments to have the same random rotation" do
+    val1 = fqdn_rotate("abcdefg", :extra_identifier => [1, "same", "host"])
+    val2 = fqdn_rotate("abcdefg", :extra_identifier => [1, "same", "host"])
+    expect(val1).to eq(val2)
+  end
+
+  it "should rotate a string to give different values on different hosts" do
+    val1 = fqdn_rotate("abcdefg", :host => 'one')
+    val2 = fqdn_rotate("abcdefg", :host => 'two')
+    expect(val1).not_to eq(val2)
+  end
+
+  it "should accept objects which extend String" do
+    result = fqdn_rotate(AlsoString.new('asdf'))
+    expect(result).to eq('dfas')
+  end
+
+  it "should use the Puppet::Util.deterministic_rand function" do
+    if Puppet::Util.respond_to?(:deterministic_rand)
+      Puppet::Util.expects(:deterministic_rand).with(44489829212339698569024999901561968770,4)
+      fqdn_rotate("asdf")
+    else
+      skip 'Puppet::Util#deterministic_rand not available'
+    end
+  end
+
+  it "should not leave the global seed in a deterministic state" do
+    fqdn_rotate("asdf")
+    rand1 = rand()
+    fqdn_rotate("asdf")
+    rand2 = rand()
+    expect(rand1).not_to eql(rand2)
+  end
+
+  def fqdn_rotate(value, args = {})
+    host = args[:host] || '127.0.0.1'
+    extra = args[:extra_identifier] || []
+
+    # workaround not being able to use let(:facts) because some tests need
+    # multiple different hostnames in one context
+    scope.stubs(:lookupvar).with("::fqdn").returns(host)
+
+    function_args = [value] + extra
+    scope.function_fqdn_rotate(function_args)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/get_module_path_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/get_module_path_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/get_module_path_spec.rb	(revision 30960)
@@ -0,0 +1,48 @@
+require 'spec_helper'
+
+describe 'get_module_path' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /Wrong number of arguments, expects one/) }
+  it { is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError, /Wrong number of arguments, expects one/) }
+  it { is_expected.to run.with_params('one', 'two', 'three').and_raise_error(Puppet::ParseError, /Wrong number of arguments, expects one/) }
+  it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /Could not find module/) }
+
+  class StubModule
+    attr_reader :path
+    def initialize(path)
+      @path = path
+    end
+  end
+
+  describe 'when locating a module' do
+    let(:modulepath) { "/tmp/does_not_exist" }
+    let(:path_of_module_foo) { StubModule.new("/tmp/does_not_exist/foo") }
+
+    before(:each) { Puppet[:modulepath] = modulepath }
+
+    context 'in the default environment' do
+      before(:each) { Puppet::Module.expects(:find).with('foo', 'rp_env').returns(path_of_module_foo) }
+
+      it { is_expected.to run.with_params('foo').and_return(path_of_module_foo.path) }
+
+      context 'when the modulepath is a list' do
+        before(:each) { Puppet[:modulepath] = modulepath + 'tmp/something_else' }
+
+        it { is_expected.to run.with_params('foo').and_return(path_of_module_foo.path) }
+      end
+    end
+
+    context 'in a non-default default environment' do
+      let(:environment) { 'test' }
+      before(:each) { Puppet::Module.expects(:find).with('foo', 'test').returns(path_of_module_foo) }
+
+      it { is_expected.to run.with_params('foo').and_return(path_of_module_foo.path) }
+
+      context 'when the modulepath is a list' do
+        before(:each) { Puppet[:modulepath] = modulepath + 'tmp/something_else' }
+
+        it { is_expected.to run.with_params('foo').and_return(path_of_module_foo.path) }
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/getparam_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/getparam_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/getparam_spec.rb	(revision 30960)
@@ -0,0 +1,27 @@
+require 'spec_helper'
+
+describe 'getparam' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(ArgumentError, /Must specify a reference/) }
+  it { is_expected.to run.with_params('User[one]').and_raise_error(ArgumentError, /Must specify name of a parameter/) }
+  it { is_expected.to run.with_params('User[one]', 2).and_raise_error(ArgumentError, /Must specify name of a parameter/) }
+  it { is_expected.to run.with_params('User[one]', []).and_raise_error(ArgumentError, /Must specify name of a parameter/) }
+  it { is_expected.to run.with_params('User[one]', {}).and_raise_error(ArgumentError, /Must specify name of a parameter/) }
+
+  describe 'when compared against a user resource with no params' do
+    let(:pre_condition) { 'user { "one": }' }
+
+    it { is_expected.to run.with_params('User[one]', 'ensure').and_return('') }
+    it { is_expected.to run.with_params('User[two]', 'ensure').and_return('') }
+    it { is_expected.to run.with_params('User[one]', 'shell').and_return('') }
+  end
+
+  describe 'when compared against a user resource with params' do
+    let(:pre_condition) { 'user { "one": ensure => present, shell => "/bin/sh", managehome => false, }' }
+
+    it { is_expected.to run.with_params('User[one]', 'ensure').and_return('present') }
+    it { is_expected.to run.with_params('User[two]', 'ensure').and_return('') }
+    it { is_expected.to run.with_params('User[one]', 'shell').and_return('/bin/sh') }
+    it { is_expected.to run.with_params('User[one]', 'managehome').and_return(false) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/getvar_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/getvar_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/getvar_spec.rb	(revision 30960)
@@ -0,0 +1,23 @@
+require 'spec_helper'
+
+describe 'getvar' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+  it { is_expected.to run.with_params('$::foo').and_return(nil) }
+
+  context 'given variables in namespaces' do
+    let(:pre_condition) {
+      <<-'ENDofPUPPETcode'
+      class site::data { $foo = 'baz' }
+      include site::data
+      ENDofPUPPETcode
+    }
+
+    it { is_expected.to run.with_params('site::data::foo').and_return('baz') }
+    it { is_expected.to run.with_params('::site::data::foo').and_return('baz') }
+    it { is_expected.to run.with_params('::site::data::bar').and_return(nil) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/grep_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/grep_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/grep_spec.rb	(revision 30960)
@@ -0,0 +1,19 @@
+require 'spec_helper'
+
+describe 'grep' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("grep does not actually check this, and raises NoMethodError instead")
+    is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError, /first argument not an array/)
+  }
+  it {
+    pending("grep does not actually check this, and raises NoMethodError instead")
+    is_expected.to run.with_params(1, 'two').and_raise_error(Puppet::ParseError, /first argument not an array/)
+  }
+  it { is_expected.to run.with_params('one', 'two', 'three').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params([], 'two').and_return([]) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], 'two').and_return(['two']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], 't(wo|hree)').and_return(['two', 'three']) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/has_interface_with_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/has_interface_with_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/has_interface_with_spec.rb	(revision 30960)
@@ -0,0 +1,38 @@
+require 'spec_helper'
+
+describe 'has_interface_with' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params("one", "two", "three").and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+  # We need to mock out the Facts so we can specify how we expect this function
+  # to behave on different platforms.
+  context "On Mac OS X Systems" do
+    let(:facts) { { :interfaces => 'lo0,gif0,stf0,en1,p2p0,fw0,en0,vmnet1,vmnet8,utun0' } }
+    it { is_expected.to run.with_params('lo0').and_return(true) }
+    it { is_expected.to run.with_params('lo').and_return(false) }
+  end
+
+  context "On Linux Systems" do
+    let(:facts) do
+      {
+        :interfaces => 'eth0,lo',
+        :ipaddress => '10.0.0.1',
+        :ipaddress_lo => '127.0.0.1',
+        :ipaddress_eth0 => '10.0.0.1',
+        :muppet => 'kermit',
+        :muppet_lo => 'mspiggy',
+        :muppet_eth0 => 'kermit',
+      }
+    end
+
+    it { is_expected.to run.with_params('lo').and_return(true) }
+    it { is_expected.to run.with_params('lo0').and_return(false) }
+    it { is_expected.to run.with_params('ipaddress', '127.0.0.1').and_return(true) }
+    it { is_expected.to run.with_params('ipaddress', '10.0.0.1').and_return(true) }
+    it { is_expected.to run.with_params('ipaddress', '8.8.8.8').and_return(false) }
+    it { is_expected.to run.with_params('muppet', 'kermit').and_return(true) }
+    it { is_expected.to run.with_params('muppet', 'mspiggy').and_return(true) }
+    it { is_expected.to run.with_params('muppet', 'bigbird').and_return(false) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/has_ip_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/has_ip_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/has_ip_address_spec.rb	(revision 30960)
@@ -0,0 +1,22 @@
+require 'spec_helper'
+
+describe 'has_ip_address' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params("one", "two").and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+  context "On Linux Systems" do
+    let(:facts) do
+      {
+        :interfaces => 'eth0,lo',
+        :ipaddress => '10.0.0.1',
+        :ipaddress_lo => '127.0.0.1',
+        :ipaddress_eth0 => '10.0.0.1',
+      }
+    end
+
+    it { is_expected.to run.with_params('127.0.0.1').and_return(true) }
+    it { is_expected.to run.with_params('10.0.0.1').and_return(true) }
+    it { is_expected.to run.with_params('8.8.8.8').and_return(false) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/has_ip_network_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/has_ip_network_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/has_ip_network_spec.rb	(revision 30960)
@@ -0,0 +1,22 @@
+require 'spec_helper'
+
+describe 'has_ip_network' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params("one", "two").and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+  context "On Linux Systems" do
+    let(:facts) do
+      {
+        :interfaces => 'eth0,lo',
+        :network => :undefined,
+        :network_lo => '127.0.0.0',
+        :network_eth0 => '10.0.0.0',
+      }
+    end
+
+    it { is_expected.to run.with_params('127.0.0.0').and_return(true) }
+    it { is_expected.to run.with_params('10.0.0.0').and_return(true) }
+    it { is_expected.to run.with_params('8.8.8.0').and_return(false) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/has_key_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/has_key_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/has_key_spec.rb	(revision 30960)
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe 'has_key' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params("one").and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params("one", "two", "three").and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params("one", "two").and_raise_error(Puppet::ParseError, /expects the first argument to be a hash/) }
+  it { is_expected.to run.with_params(1, "two").and_raise_error(Puppet::ParseError, /expects the first argument to be a hash/) }
+  it { is_expected.to run.with_params([], "two").and_raise_error(Puppet::ParseError, /expects the first argument to be a hash/) }
+
+  it { is_expected.to run.with_params({ 'key' => 'value' }, "key").and_return(true) }
+  it { is_expected.to run.with_params({}, "key").and_return(false) }
+  it { is_expected.to run.with_params({ 'key' => 'value'}, "not a key").and_return(false) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/hash_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/hash_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/hash_spec.rb	(revision 30960)
@@ -0,0 +1,14 @@
+require 'spec_helper'
+
+describe 'hash' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params([], 'two').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params(['one']).and_raise_error(Puppet::ParseError, /Unable to compute/) }
+  it { is_expected.to run.with_params([]).and_return({}) }
+  it { is_expected.to run.with_params(['key1', 'value1']).and_return({ 'key1' => 'value1' }) }
+  it { is_expected.to run.with_params(['key1', 'value1', 'key2', 'value2']).and_return({ 'key1' => 'value1', 'key2' => 'value2' }) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/intersection_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/intersection_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/intersection_spec.rb	(revision 30960)
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe 'intersection' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one', 'two', 'three').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params('one', []).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([], 'two').and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params({}, {}).and_raise_error(Puppet::ParseError) }
+  it { is_expected.to run.with_params([], []).and_return([]) }
+  it { is_expected.to run.with_params([], ['one']).and_return([]) }
+  it { is_expected.to run.with_params(['one'], []).and_return([]) }
+  it { is_expected.to run.with_params(['one'], ['one']).and_return(['one']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], ['two', 'three']).and_return(['two', 'three']) }
+  it { is_expected.to run.with_params(['one', 'two', 'two', 'three'], ['two', 'three']).and_return(['two', 'three']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], ['two', 'two', 'three']).and_return(['two', 'three']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], ['two', 'three', 'four']).and_return(['two', 'three']) }
+  it 'should not confuse types' do is_expected.to run.with_params(['1', '2', '3'], [1, 2]).and_return([]) end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_a_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_a_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_a_spec.rb	(revision 30960)
@@ -0,0 +1,25 @@
+require 'spec_helper'
+
+if ENV["FUTURE_PARSER"] == 'yes'
+  describe 'type_of' do
+    pending 'teach rspec-puppet to load future-only functions under 3.7.5' do
+      it { is_expected.not_to eq(nil) }
+    end
+  end
+end
+
+if Puppet.version.to_f >= 4.0
+  describe 'is_a' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(ArgumentError) }
+    it { is_expected.to run.with_params('', '').and_raise_error(ArgumentError) }
+
+    it 'succeeds when comparing a string and a string' do
+      is_expected.to run.with_params('hello world', String).and_return(true)
+    end
+
+    it 'fails when comparing an integer and a string' do
+      is_expected.to run.with_params(5, String).and_return(false)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_array_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_array_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_array_spec.rb	(revision 30960)
@@ -0,0 +1,36 @@
+require 'spec_helper'
+
+describe 'is_array' do
+  
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params([], []).and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params([]).and_return(true) }
+  it { is_expected.to run.with_params(['one']).and_return(true) }
+  it { is_expected.to run.with_params([1]).and_return(true) }
+  it { is_expected.to run.with_params([{}]).and_return(true) }
+  it { is_expected.to run.with_params([[]]).and_return(true) }
+  it { is_expected.to run.with_params('').and_return(false) }
+  it { is_expected.to run.with_params('one').and_return(false) }
+  it { is_expected.to run.with_params(1).and_return(false) }
+  it { is_expected.to run.with_params({}).and_return(false) }
+  context 'Checking for deprecation warning' do
+    after(:all) do
+      ENV.delete('STDLIB_LOG_DEPRECATIONS')
+    end 
+    # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
+    it 'should display a single deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+      scope.expects(:warning).with(includes('This method is deprecated'))
+      is_expected.to run.with_params(['1.2.3.4']).and_return(true)
+    end
+    it 'should display no warning for deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
+      scope.expects(:warning).with(includes('This method is deprecated')).never
+      is_expected.to run.with_params(['1.2.3.4']).and_return(true)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_bool_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_bool_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_bool_spec.rb	(revision 30960)
@@ -0,0 +1,33 @@
+require 'spec_helper'
+
+describe 'is_bool' do
+  
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(true, false).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(true).and_return(true) }
+  it { is_expected.to run.with_params(false).and_return(true) }
+  it { is_expected.to run.with_params([1]).and_return(false) }
+  it { is_expected.to run.with_params([{}]).and_return(false) }
+  it { is_expected.to run.with_params([[]]).and_return(false) }
+  it { is_expected.to run.with_params([true]).and_return(false) }
+  it { is_expected.to run.with_params('true').and_return(false) }
+  it { is_expected.to run.with_params('false').and_return(false) }
+  context 'Checking for deprecation warning' do
+    after(:all) do
+      ENV.delete('STDLIB_LOG_DEPRECATIONS')
+    end 
+    # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
+    it 'should display a single deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+      scope.expects(:warning).with(includes('This method is deprecated'))
+      is_expected.to run.with_params(true).and_return(true)
+    end
+    it 'should display no warning for deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
+      scope.expects(:warning).with(includes('This method is deprecated')).never
+      is_expected.to run.with_params(false).and_return(true)
+    end
+  end 
+end
+
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_domain_name_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_domain_name_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_domain_name_spec.rb	(revision 30960)
@@ -0,0 +1,43 @@
+require 'spec_helper'
+
+describe 'is_domain_name' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(1).and_return(false) }
+  it { is_expected.to run.with_params([]).and_return(false) }
+  it { is_expected.to run.with_params({}).and_return(false) }
+  it { is_expected.to run.with_params('').and_return(false) }
+  it { is_expected.to run.with_params('.').and_return(true) }
+  it { is_expected.to run.with_params('com').and_return(true) }
+  it { is_expected.to run.with_params('com.').and_return(true) }
+  it { is_expected.to run.with_params('x.com').and_return(true) }
+  it { is_expected.to run.with_params('x.com.').and_return(true) }
+  it { is_expected.to run.with_params('foo.example.com').and_return(true) }
+  it { is_expected.to run.with_params('foo.example.com.').and_return(true) }
+  it { is_expected.to run.with_params('2foo.example.com').and_return(true) }
+  it { is_expected.to run.with_params('2foo.example.com.').and_return(true) }
+  it { is_expected.to run.with_params('www.2foo.example.com').and_return(true) }
+  it { is_expected.to run.with_params('www.2foo.example.com.').and_return(true) }
+  describe 'inputs with spaces' do
+    it { is_expected.to run.with_params('invalid domain').and_return(false) }
+  end
+  describe 'inputs with hyphens' do
+    it { is_expected.to run.with_params('foo-bar.example.com').and_return(true) }
+    it { is_expected.to run.with_params('foo-bar.example.com.').and_return(true) }
+    it { is_expected.to run.with_params('www.foo-bar.example.com').and_return(true) }
+    it { is_expected.to run.with_params('www.foo-bar.example.com.').and_return(true) }
+    it { is_expected.to run.with_params('-foo.example.com').and_return(false) }
+    it { is_expected.to run.with_params('-foo.example.com').and_return(false) }
+  end
+  # Values obtained from Facter values will be frozen strings
+  # in newer versions of Facter:
+  it { is_expected.to run.with_params('www.example.com'.freeze).and_return(true) }
+  describe 'top level domain must be alphabetic if there are multiple labels' do
+    it { is_expected.to run.with_params('2com').and_return(true) }
+    it { is_expected.to run.with_params('www.example.2com').and_return(false) }
+  end
+  describe 'IP addresses are not domain names' do
+    it { is_expected.to run.with_params('192.168.1.1').and_return(false) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_email_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_email_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_email_address_spec.rb	(revision 30960)
@@ -0,0 +1,14 @@
+require 'spec_helper'
+
+describe 'is_email_address' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params([], []).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('bob@gmail.com').and_return(true) }
+  it { is_expected.to run.with_params('alice+puppetlabs.com@gmail.com').and_return(true) }
+  it { is_expected.to run.with_params('peter.parker@gmail.com').and_return(true) }
+  it { is_expected.to run.with_params('1.2.3@domain').and_return(false) }
+  it { is_expected.to run.with_params('1.2.3.4.5@').and_return(false) }
+  it { is_expected.to run.with_params({}).and_return(false) }
+  it { is_expected.to run.with_params([]).and_return(false) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_float_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_float_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_float_spec.rb	(revision 30960)
@@ -0,0 +1,42 @@
+require 'spec_helper'
+
+describe 'is_float' do
+
+  it { is_expected.not_to eq(nil) }
+
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(0.1, 0.2).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+  describe 'passing a string' do
+    it { is_expected.to run.with_params('0.1').and_return(true) }
+    it { is_expected.to run.with_params('1.0').and_return(true) }
+    it { is_expected.to run.with_params('1').and_return(false) }
+    it { is_expected.to run.with_params('one').and_return(false) }
+    it { is_expected.to run.with_params('one 1.0').and_return(false) }
+    it { is_expected.to run.with_params('1.0 one').and_return(false) }
+  end
+
+  describe 'passing numbers' do
+    it { is_expected.to run.with_params(0.1).and_return(true) }
+    it { is_expected.to run.with_params(1.0).and_return(true) }
+    it { is_expected.to run.with_params(1).and_return(false) }
+  end
+
+  context 'Checking for deprecation warning' do
+    after(:all) do
+      ENV.delete('STDLIB_LOG_DEPRECATIONS')
+    end
+    # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
+    it 'should display a single deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+      scope.expects(:warning).with(includes('This method is deprecated'))
+      is_expected.to run.with_params(2.2).and_return(true)
+    end
+    it 'should display no warning for deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
+      scope.expects(:warning).with(includes('This method is deprecated')).never
+      is_expected.to run.with_params(1.0).and_return(true)
+    end
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_function_available.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_function_available.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_function_available.rb	(revision 30960)
@@ -0,0 +1,9 @@
+require 'spec_helper'
+
+describe 'is_function_available' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('include').and_return(true) }
+  it { is_expected.to run.with_params('no_such_function').and_return(false) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_hash_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_hash_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_hash_spec.rb	(revision 30960)
@@ -0,0 +1,11 @@
+require 'spec_helper'
+
+describe 'is_hash' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params({}, {}).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('').and_return(false) }
+  it { is_expected.to run.with_params({}).and_return(true) }
+  it { is_expected.to run.with_params([]).and_return(false) }
+  it { is_expected.to run.with_params(1).and_return(false) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_integer_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_integer_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_integer_spec.rb	(revision 30960)
@@ -0,0 +1,45 @@
+require 'spec_helper'
+
+describe 'is_integer' do
+  
+  it { is_expected.not_to eq(nil) }
+
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(1, 2).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+  it { is_expected.to run.with_params(3).and_return(true) }
+  it { is_expected.to run.with_params('3').and_return(true) }
+  it { is_expected.to run.with_params(-3).and_return(true) }
+  it { is_expected.to run.with_params('-3').and_return(true) }
+
+  it { is_expected.to run.with_params(3.7).and_return(false) }
+  it { is_expected.to run.with_params('3.7').and_return(false) }
+  it { is_expected.to run.with_params(-3.7).and_return(false) }
+  it { is_expected.to run.with_params('3.7').and_return(false) }
+
+  it { is_expected.to run.with_params('one').and_return(false) }
+  it { is_expected.to run.with_params([]).and_return(false) }
+  it { is_expected.to run.with_params([1]).and_return(false) }
+  it { is_expected.to run.with_params({}).and_return(false) }
+  it { is_expected.to run.with_params(true).and_return(false) }
+  it { is_expected.to run.with_params(false).and_return(false) }
+  it { is_expected.to run.with_params('0001234').and_return(false) }
+
+  context 'Checking for deprecation warning' do
+    after(:all) do
+      ENV.delete('STDLIB_LOG_DEPRECATIONS')
+    end
+    # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
+    it 'should display a single deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+      scope.expects(:warning).with(includes('This method is deprecated'))
+      is_expected.to run.with_params(50).and_return(true)
+    end
+    it 'should display no warning for deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
+      scope.expects(:warning).with(includes('This method is deprecated')).never
+      is_expected.to run.with_params(50).and_return(true)
+    end
+  end 
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_ip_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_ip_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_ip_address_spec.rb	(revision 30960)
@@ -0,0 +1,40 @@
+require 'spec_helper'
+
+describe 'is_ip_address' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params([], []).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('1.2.3.4').and_return(true) }
+  it { is_expected.to run.with_params('1.2.3.255').and_return(true) }
+  it { is_expected.to run.with_params('1.2.3.256').and_return(false) }
+  it { is_expected.to run.with_params('1.2.3').and_return(false) }
+  it { is_expected.to run.with_params('1.2.3.4.5').and_return(false) }
+  it { is_expected.to run.with_params('fe00::1').and_return(true) }
+  it { is_expected.to run.with_params('fe80:0000:cd12:d123:e2f8:47ff:fe09:dd74').and_return(true) }
+  it { is_expected.to run.with_params('FE80:0000:CD12:D123:E2F8:47FF:FE09:DD74').and_return(true) }
+  it { is_expected.to run.with_params('fe80:0000:cd12:d123:e2f8:47ff:fe09:zzzz').and_return(false) }
+  it { is_expected.to run.with_params('fe80:0000:cd12:d123:e2f8:47ff:fe09').and_return(false) }
+  it { is_expected.to run.with_params('fe80:0000:cd12:d123:e2f8:47ff:fe09:dd74:dd74').and_return(false) }
+  it { is_expected.to run.with_params('').and_return(false) }
+  it { is_expected.to run.with_params('one').and_return(false) }
+  it { is_expected.to run.with_params(1).and_return(false) }
+  it { is_expected.to run.with_params({}).and_return(false) }
+  it { is_expected.to run.with_params([]).and_return(false) }
+
+  context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do
+    # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
+    it 'should display a single deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+      scope.expects(:warning).with(includes('This method is deprecated'))
+      is_expected.to run.with_params('1.2.3.4').and_return(true)
+    end
+    it 'should display no warning for deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
+      scope.expects(:warning).with(includes('This method is deprecated')).never
+      is_expected.to run.with_params('1.2.3.4').and_return(true)
+    end
+    after(:all) do 
+      ENV.delete('STDLIB_LOG_DEPRECATIONS')
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_ipv4_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_ipv4_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_ipv4_address_spec.rb	(revision 30960)
@@ -0,0 +1,30 @@
+require 'spec_helper'
+
+describe 'is_ipv4_address' do
+  
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('1.2.3.4').and_return(true) }
+  it { is_expected.to run.with_params('1.2.3.255').and_return(true) }
+  it { is_expected.to run.with_params('1.2.3').and_return(false) }
+  it { is_expected.to run.with_params('1.2.3.4.5').and_return(false) }
+  it { is_expected.to run.with_params('').and_return(false) }
+  it { is_expected.to run.with_params('one').and_return(false) }
+
+  context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do
+    after(:all) do
+      ENV.delete('STDLIB_LOG_DEPRECATIONS')
+    end
+    # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
+    it 'should display a single deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+      scope.expects(:warning).with(includes('This method is deprecated'))
+      is_expected.to run.with_params('1.2.3.4').and_return(true)
+    end
+    it 'should display no warning for deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
+      scope.expects(:warning).with(includes('This method is deprecated')).never
+      is_expected.to run.with_params('1.2.3.4').and_return(true)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_ipv6_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_ipv6_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_ipv6_address_spec.rb	(revision 30960)
@@ -0,0 +1,30 @@
+require 'spec_helper'
+
+describe 'is_ipv6_address' do
+  
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('2001:0db8:85a3:0000:0000:8a2e:0370:7334').and_return(true) }
+  it { is_expected.to run.with_params('85a3:0000:0000:8a2e:0370:7334:100.100.100.100').and_return(true) }
+  it { is_expected.to run.with_params('1.2.3').and_return(false) }
+  it { is_expected.to run.with_params('1.2.3.4.5').and_return(false) }
+  it { is_expected.to run.with_params('').and_return(false) }
+  it { is_expected.to run.with_params('one').and_return(false) }
+
+  context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do
+    after(:all) do
+      ENV.delete('STDLIB_LOG_DEPRECATIONS')
+    end
+    # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
+    it 'should display a single deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+      scope.expects(:warning).with(includes('This method is deprecated'))
+      is_expected.to run.with_params('2001:0db8:85a3:0000:0000:8a2e:0370:7334').and_return(true)
+    end
+    it 'should display no warning for deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
+      scope.expects(:warning).with(includes('This method is deprecated')).never
+      is_expected.to run.with_params('2001:0db8:85a3:0000:0000:8a2e:0370:7334').and_return(true)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_mac_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_mac_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_mac_address_spec.rb	(revision 30960)
@@ -0,0 +1,24 @@
+require 'spec_helper'
+
+describe 'is_mac_address' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params([], []).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('00:a0:1f:12:7f:a0').and_return(true) }
+  it { is_expected.to run.with_params('00:A0:1F:12:7F:A0').and_return(true) }
+  it { is_expected.to run.with_params('00:00:00:00:00:0g').and_return(false) }
+  it { is_expected.to run.with_params('').and_return(false) }
+  it { is_expected.to run.with_params('one').and_return(false) }
+  it {
+    pending "should properly typecheck its arguments"
+    is_expected.to run.with_params(1).and_return(false)
+  }
+  it {
+    pending "should properly typecheck its arguments"
+    is_expected.to run.with_params({}).and_return(false)
+  }
+  it {
+    pending "should properly typecheck its arguments"
+    is_expected.to run.with_params([]).and_return(false)
+  }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_numeric_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_numeric_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_numeric_spec.rb	(revision 30960)
@@ -0,0 +1,48 @@
+require 'spec_helper'
+
+describe 'is_numeric' do
+  
+  it { is_expected.not_to eq(nil) }
+
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(1, 2).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+  it { is_expected.to run.with_params(3).and_return(true) }
+  it { is_expected.to run.with_params('3').and_return(true) }
+  it { is_expected.to run.with_params(-3).and_return(true) }
+  it { is_expected.to run.with_params('-3').and_return(true) }
+  
+  it { is_expected.to run.with_params(3.7).and_return(true) }
+  it { is_expected.to run.with_params('3.7').and_return(true) }
+  it { is_expected.to run.with_params(-3.7).and_return(true) }
+  it { is_expected.to run.with_params('3.7').and_return(true) }
+
+  it { is_expected.to run.with_params('-342.2315e-12').and_return(true) }
+
+  it { is_expected.to run.with_params('one').and_return(false) }
+  it { is_expected.to run.with_params([]).and_return(false) }
+  it { is_expected.to run.with_params([1]).and_return(false) }
+  it { is_expected.to run.with_params({}).and_return(false) }
+  it { is_expected.to run.with_params(true).and_return(false) }
+  it { is_expected.to run.with_params(false).and_return(false) }
+  it { is_expected.to run.with_params('0001234').and_return(false) }
+  it { is_expected.to run.with_params(' - 1234').and_return(false) }
+
+  context 'Checking for deprecation warning' do
+    after(:all) do
+      ENV.delete('STDLIB_LOG_DEPRECATIONS')
+    end
+    # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
+    it 'should display a single deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+      scope.expects(:warning).with(includes('This method is deprecated'))
+      is_expected.to run.with_params(7).and_return(true)
+    end
+    it 'should display no warning for deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
+      scope.expects(:warning).with(includes('This method is deprecated')).never
+      is_expected.to run.with_params(7).and_return(true)
+    end
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_string_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_string_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/is_string_spec.rb	(revision 30960)
@@ -0,0 +1,47 @@
+require 'spec_helper'
+
+describe 'is_string' do
+
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+
+  it { is_expected.to run.with_params(3).and_return(false) }
+  it { is_expected.to run.with_params('3').and_return(false) }
+  it { is_expected.to run.with_params(-3).and_return(false) }
+  it { is_expected.to run.with_params('-3').and_return(false) }
+
+  it { is_expected.to run.with_params(3.7).and_return(false) }
+  it { is_expected.to run.with_params('3.7').and_return(false) }
+  it { is_expected.to run.with_params(-3.7).and_return(false) }
+  it { is_expected.to run.with_params('3.7').and_return(false) }
+
+  it { is_expected.to run.with_params([]).and_return(false) }
+  it { is_expected.to run.with_params([1]).and_return(false) }
+  it { is_expected.to run.with_params({}).and_return(false) }
+  it { is_expected.to run.with_params(true).and_return(false) }
+  it { is_expected.to run.with_params(false).and_return(false) }
+  it { is_expected.to run.with_params('one').and_return(true) }
+  it { is_expected.to run.with_params('0001234').and_return(true) }
+
+  context 'Checking for deprecation warning' do
+    after(:all) do
+      ENV.delete('STDLIB_LOG_DEPRECATIONS')
+    end
+    # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
+    it 'should display a single deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+      scope.expects(:warning).with(includes('This method is deprecated'))
+      is_expected.to run.with_params('sponge').and_return(true)
+    end
+    it 'should display no warning for deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
+      scope.expects(:warning).with(includes('This method is deprecated')).never
+      is_expected.to run.with_params('bob').and_return(true)
+    end
+  end 
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/join_keys_to_values_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/join_keys_to_values_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/join_keys_to_values_spec.rb	(revision 30960)
@@ -0,0 +1,19 @@
+require 'spec_helper'
+
+describe 'join_keys_to_values' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /Takes exactly two arguments/) }
+  it { is_expected.to run.with_params({}, '', '').and_raise_error(Puppet::ParseError, /Takes exactly two arguments/) }
+  it { is_expected.to run.with_params('one', '').and_raise_error(TypeError, /The first argument must be a hash/) }
+  it { is_expected.to run.with_params({}, 2).and_raise_error(TypeError, /The second argument must be a string/) }
+
+  it { is_expected.to run.with_params({}, '').and_return([]) }
+  it { is_expected.to run.with_params({}, ':').and_return([]) }
+  it { is_expected.to run.with_params({ 'key' => 'value' }, '').and_return(['keyvalue']) }
+  it { is_expected.to run.with_params({ 'key' => 'value' }, ':').and_return(['key:value']) }
+  it { is_expected.to run.with_params({ 'key' => nil }, ':').and_return(['key:']) }
+  it 'should run join_keys_to_values(<hash with multiple keys>, ":") and return the proper array' do
+    result = subject.call([{ 'key1' => 'value1', 'key2' => 'value2' }, ':'])
+    expect(result.sort).to eq(['key1:value1', 'key2:value2'].sort)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/join_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/join_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/join_spec.rb	(revision 30960)
@@ -0,0 +1,19 @@
+require 'spec_helper'
+
+describe 'join' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the second.")
+    is_expected.to run.with_params([], '', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /Requires array to work with/) }
+  it { is_expected.to run.with_params([], 2).and_raise_error(Puppet::ParseError, /Requires string to work with/) }
+
+  it { is_expected.to run.with_params([]).and_return('') }
+  it { is_expected.to run.with_params([], ':').and_return('') }
+  it { is_expected.to run.with_params(['one']).and_return('one') }
+  it { is_expected.to run.with_params(['one'], ':').and_return('one') }
+  it { is_expected.to run.with_params(['one', 'two', 'three']).and_return('onetwothree') }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], ':').and_return('one:two:three') }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/keys_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/keys_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/keys_spec.rb	(revision 30960)
@@ -0,0 +1,19 @@
+require 'spec_helper'
+
+describe 'keys' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params({}, {}).and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params('').and_raise_error(Puppet::ParseError, /Requires hash to work with/) }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires hash to work with/) }
+  it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError, /Requires hash to work with/) }
+  it { is_expected.to run.with_params({}).and_return([]) }
+  it { is_expected.to run.with_params({ 'key' => 'value' }).and_return(['key']) }
+  it 'should return the array of keys' do
+    result = subject.call([{ 'key1' => 'value1', 'key2' => 'value2' }])
+    expect(result).to match_array(['key1', 'key2'])
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/load_module_metadata_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/load_module_metadata_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/load_module_metadata_spec.rb	(revision 30960)
@@ -0,0 +1,38 @@
+require 'spec_helper'
+
+describe 'load_module_metadata' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params("one", "two", "three").and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+  describe "when calling with valid arguments" do
+    before :each do
+      if RSpec.configuration.puppet_future
+        allow(File).to receive(:read).with(/\/stdlib\/metadata.json/, {:encoding=>"utf-8"}).and_return('{"name": "puppetlabs-stdlib"}')
+      else
+        allow(File).to receive(:read).with(/\/stdlib\/metadata.json/).and_return('{"name": "puppetlabs-stdlib"}')
+      end
+    end
+    it "should json parse the file" do
+      allow(scope).to receive(:function_get_module_path).with(['science']).and_return('/path/to/module/')
+      allow(File).to receive(:exists?).with('/path/to/module/metadata.json').and_return(true)
+      allow(File).to receive(:read).with('/path/to/module/metadata.json').and_return('{"name": "spencer-science"}')
+
+      result = subject.call(['science'])
+      expect(result['name']).to eq('spencer-science')
+    end
+
+    it "should fail by default if there is no metadata.json" do
+      allow(scope).to   receive(:function_get_module_path).with(['science']).and_return('/path/to/module/')
+      allow(File).to receive(:exists?).with('/path/to/module/metadata.json').and_return(false)
+      expect {subject.call(['science'])}.to raise_error(Puppet::ParseError)
+    end
+
+    it "should return nil if user allows empty metadata.json" do
+      allow(scope).to receive(:function_get_module_path).with(['science']).and_return('/path/to/module/')
+      allow(File).to receive(:exists?).with('/path/to/module/metadata.json').and_return(false)
+      result = subject.call(['science', true])
+      expect(result).to eq({})
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/loadjson_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/loadjson_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/loadjson_spec.rb	(revision 30960)
@@ -0,0 +1,49 @@
+require 'spec_helper'
+
+describe 'loadjson' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(ArgumentError, /wrong number of arguments/i) }
+
+  describe "when calling with valid arguments" do
+    before :each do
+      if RSpec.configuration.puppet_future
+        allow(File).to receive(:read).with(/\/stdlib\/metadata.json/, {:encoding=>"utf-8"}).and_return('{"name": "puppetlabs-stdlib"}')
+      else
+        allow(File).to receive(:read).with(/\/stdlib\/metadata.json/).and_return('{"name": "puppetlabs-stdlib"}')
+      end
+    end
+
+    context 'when a non-existing file is specified' do
+      let(:filename) { '/tmp/doesnotexist' }
+      before {
+        allow(File).to receive(:exists?).with(filename).and_return(false).once
+        allow(PSON).to receive(:load).never
+      }
+      it { is_expected.to run.with_params(filename, {'default' => 'value'}).and_return({'default' => 'value'}) }
+    end
+
+    context 'when an existing file is specified' do
+      let(:filename) { '/tmp/doesexist' }
+      let(:data) { { 'key' => 'value' } }
+      let(:json) { '{"key":"value"}' }
+      before {
+        allow(File).to receive(:exists?).with(filename).and_return(true).once
+        allow(File).to receive(:read).with(filename).and_return(json).once
+        allow(File).to receive(:read).with(filename).and_return(json).once
+        allow(PSON).to receive(:load).with(json).and_return(data).once
+      }
+      it { is_expected.to run.with_params(filename).and_return(data) }
+    end
+
+    context 'when the file could not be parsed' do
+      let(:filename) { '/tmp/doesexist' }
+      let(:json) { '{"key":"value"}' }
+      before {
+        allow(File).to receive(:exists?).with(filename).and_return(true).once
+        allow(File).to receive(:read).with(filename).and_return(json).once
+        allow(PSON).to receive(:load).with(json).once.and_raise StandardError, 'Something terrible have happened!'
+      }
+      it { is_expected.to run.with_params(filename, {'default' => 'value'}).and_return({'default' => 'value'}) }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/loadyaml_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/loadyaml_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/loadyaml_spec.rb	(revision 30960)
@@ -0,0 +1,34 @@
+require 'spec_helper'
+
+describe 'loadyaml' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(ArgumentError, /wrong number of arguments/i) }
+
+  context 'when a non-existing file is specified' do
+    let(:filename) { '/tmp/doesnotexist' }
+    before {
+      File.expects(:exists?).with(filename).returns(false).once
+      YAML.expects(:load_file).never
+    }
+    it { is_expected.to run.with_params(filename, {'default' => 'value'}).and_return({'default' => 'value'}) }
+  end
+
+  context 'when an existing file is specified' do
+    let(:filename) { '/tmp/doesexist' }
+    let(:data) { { 'key' => 'value' } }
+    before {
+      File.expects(:exists?).with(filename).returns(true).once
+      YAML.expects(:load_file).with(filename).returns(data).once
+    }
+    it { is_expected.to run.with_params(filename).and_return(data) }
+  end
+
+  context 'when the file could not be parsed' do
+    let(:filename) { '/tmp/doesexist' }
+    before {
+      File.expects(:exists?).with(filename).returns(true).once
+      YAML.stubs(:load_file).with(filename).once.raises StandardError, 'Something terrible have happened!'
+    }
+    it { is_expected.to run.with_params(filename, {'default' => 'value'}).and_return({'default' => 'value'}) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/lstrip_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/lstrip_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/lstrip_spec.rb	(revision 30960)
@@ -0,0 +1,34 @@
+require 'spec_helper'
+
+describe 'lstrip' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /Requires either array or string to work with/) }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires either array or string to work with/) }
+  it { is_expected.to run.with_params('').and_return('') }
+  it { is_expected.to run.with_params(' ').and_return('') }
+  it { is_expected.to run.with_params('     ').and_return('') }
+  it { is_expected.to run.with_params("\t").and_return('') }
+  it { is_expected.to run.with_params("\t ").and_return('') }
+  it { is_expected.to run.with_params('one').and_return('one') }
+  it { is_expected.to run.with_params(' one').and_return('one') }
+  it { is_expected.to run.with_params('     one').and_return('one') }
+  it { is_expected.to run.with_params("\tone").and_return('one') }
+  it { is_expected.to run.with_params("\t one").and_return('one') }
+  it { is_expected.to run.with_params('one ').and_return('one ') }
+  it { is_expected.to run.with_params(' one ').and_return('one ') }
+  it { is_expected.to run.with_params('     one ').and_return('one ') }
+  it { is_expected.to run.with_params("\tone ").and_return('one ') }
+  it { is_expected.to run.with_params("\t one ").and_return('one ') }
+  it { is_expected.to run.with_params("one \t").and_return("one \t") }
+  it { is_expected.to run.with_params(" one \t").and_return("one \t") }
+  it { is_expected.to run.with_params("     one \t").and_return("one \t") }
+  it { is_expected.to run.with_params("\tone \t").and_return("one \t") }
+  it { is_expected.to run.with_params("\t one \t").and_return("one \t") }
+  it { is_expected.to run.with_params(' o n e ').and_return('o n e ') }
+  it { is_expected.to run.with_params(AlsoString.new(' one ')).and_return('one ') }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/max_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/max_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/max_spec.rb	(revision 30960)
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe 'max' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(1).and_return(1) }
+  it { is_expected.to run.with_params(1, 2).and_return(2) }
+  it { is_expected.to run.with_params(1, 2, 3).and_return(3) }
+  it { is_expected.to run.with_params(3, 2, 1).and_return(3) }
+  it { is_expected.to run.with_params('one').and_return('one') }
+  it { is_expected.to run.with_params('one', 'two').and_return('two') }
+  it { is_expected.to run.with_params('one', 'two', 'three').and_return('two') }
+  it { is_expected.to run.with_params('three', 'two', 'one').and_return('two') }
+
+  describe 'implementation artifacts' do
+    it { is_expected.to run.with_params(1, 'one').and_return('one') }
+    it { is_expected.to run.with_params('1', 'one').and_return('one') }
+    it { is_expected.to run.with_params('1.3e1', '1.4e0').and_return('1.4e0') }
+    it { is_expected.to run.with_params(1.3e1, 1.4e0).and_return(1.3e1) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/member_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/member_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/member_spec.rb	(revision 30960)
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe 'member' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params([], [], []).and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params([], '').and_return(false) }
+  it { is_expected.to run.with_params([], ['']).and_return(false) }
+  it { is_expected.to run.with_params([''], '').and_return(true) }
+  it { is_expected.to run.with_params([''], ['']).and_return(true) }
+  it { is_expected.to run.with_params([], 'one').and_return(false) }
+  it { is_expected.to run.with_params([], ['one']).and_return(false) }
+  it { is_expected.to run.with_params(['one'], 'one').and_return(true) }
+  it { is_expected.to run.with_params(['one'], ['one']).and_return(true) }
+  it { is_expected.to run.with_params(['one', 'two', 'three', 'four'], ['four', 'two']).and_return(true) }
+  it { is_expected.to run.with_params(['one', 'two', 'three', 'four'], ['four', 'five']).and_return(false) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/merge_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/merge_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/merge_spec.rb	(revision 30960)
@@ -0,0 +1,25 @@
+require 'spec_helper'
+
+describe 'merge' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params({}, 'two').and_raise_error(Puppet::ParseError, /unexpected argument type String/) }
+  it { is_expected.to run.with_params({}, 1).and_raise_error(Puppet::ParseError, /unexpected argument type Fixnum/) }
+  it {
+    pending 'should not special case this'
+    is_expected.to run.with_params({}).and_return({})
+  }
+  it { is_expected.to run.with_params({}, {}).and_return({}) }
+  it { is_expected.to run.with_params({}, {}, {}).and_return({}) }
+  describe 'should accept empty strings as puppet undef' do
+    it { is_expected.to run.with_params({}, '').and_return({}) }
+  end
+  it { is_expected.to run.with_params({ 'key' => 'value' }, {}).and_return({ 'key' => 'value' }) }
+  it { is_expected.to run.with_params({}, { 'key' => 'value' }).and_return({ 'key' => 'value' }) }
+  it { is_expected.to run.with_params({ 'key' => 'value1' }, { 'key' => 'value2' }).and_return({ 'key' => 'value2' }) }
+  it {
+    is_expected.to run \
+      .with_params({ 'key1' => 'value1' }, { 'key2' => 'value2' }, { 'key3' => 'value3' }) \
+      .and_return({ 'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3' })
+  }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/min_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/min_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/min_spec.rb	(revision 30960)
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe 'min' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(1).and_return(1) }
+  it { is_expected.to run.with_params(1, 2).and_return(1) }
+  it { is_expected.to run.with_params(1, 2, 3).and_return(1) }
+  it { is_expected.to run.with_params(3, 2, 1).and_return(1) }
+  it { is_expected.to run.with_params('one').and_return('one') }
+  it { is_expected.to run.with_params('one', 'two').and_return('one') }
+  it { is_expected.to run.with_params('one', 'two', 'three').and_return('one') }
+  it { is_expected.to run.with_params('three', 'two', 'one').and_return('one') }
+
+  describe 'implementation artifacts' do
+    it { is_expected.to run.with_params(1, 'one').and_return(1) }
+    it { is_expected.to run.with_params('1', 'one').and_return('1') }
+    it { is_expected.to run.with_params('1.3e1', '1.4e0').and_return('1.3e1') }
+    it { is_expected.to run.with_params(1.3e1, 1.4e0).and_return(1.4e0) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/num2bool_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/num2bool_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/num2bool_spec.rb	(revision 30960)
@@ -0,0 +1,22 @@
+require 'spec_helper'
+
+describe 'num2bool' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(1, 2).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('abc').and_raise_error(Puppet::ParseError, /does not look like a number/) }
+  it { is_expected.to run.with_params(1).and_return(true) }
+  it { is_expected.to run.with_params('1').and_return(true) }
+  it { is_expected.to run.with_params(1.5).and_return(true) }
+  it { is_expected.to run.with_params('1.5').and_return(true) }
+  it { is_expected.to run.with_params(-1).and_return(false) }
+  it { is_expected.to run.with_params('-1').and_return(false) }
+  it { is_expected.to run.with_params(-1.5).and_return(false) }
+  it { is_expected.to run.with_params('-1.5').and_return(false) }
+  it { is_expected.to run.with_params(0).and_return(false) }
+  it { is_expected.to run.with_params('0').and_return(false) }
+  it { is_expected.to run.with_params([]).and_return(false) }
+  it { is_expected.to run.with_params('[]').and_raise_error(Puppet::ParseError, /does not look like a number/) }
+  it { is_expected.to run.with_params({}).and_return(false) }
+  it { is_expected.to run.with_params('{}').and_raise_error(Puppet::ParseError, /does not look like a number/) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/parsejson_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/parsejson_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/parsejson_spec.rb	(revision 30960)
@@ -0,0 +1,64 @@
+require 'spec_helper'
+
+describe 'parsejson' do
+  it 'should exist' do
+    is_expected.not_to eq(nil)
+  end
+
+  it 'should raise an error if called without any arguments' do
+    is_expected.to run.with_params().
+                       and_raise_error(/wrong number of arguments/i)
+  end
+
+  context 'with correct JSON data' do
+
+    it 'should be able to parse a JSON data with a Hash' do
+      is_expected.to run.with_params('{"a":"1","b":"2"}').
+                         and_return({'a'=>'1', 'b'=>'2'})
+    end
+
+    it 'should be able to parse a JSON data with an Array' do
+      is_expected.to run.with_params('["a","b","c"]').
+                         and_return(['a', 'b', 'c'])
+    end
+
+    it 'should be able to parse empty JSON values' do
+      is_expected.to run.with_params('[]').
+                         and_return([])
+      is_expected.to run.with_params('{}').
+                         and_return({})
+    end
+
+    it 'should be able to parse a JSON data with a mixed structure' do
+      is_expected.to run.with_params('{"a":"1","b":2,"c":{"d":[true,false]}}').
+                         and_return({'a' =>'1', 'b' => 2, 'c' => { 'd' => [true, false] } })
+    end
+
+    it 'should not return the default value if the data was parsed correctly' do
+      is_expected.to run.with_params('{"a":"1"}', 'default_value').
+                         and_return({'a' => '1'})
+    end
+
+  end
+
+  context 'with incorrect JSON data' do
+    it 'should raise an error with invalid JSON and no default' do
+      is_expected.to run.with_params('').
+                         and_raise_error(PSON::ParserError)
+    end
+
+    it 'should support a structure for a default value' do
+      is_expected.to run.with_params('', {'a' => '1'}).
+                         and_return({'a' => '1'})
+    end
+
+    ['', 1, 1.2, nil, true, false, [], {}, :yaml].each do |value|
+      it "should return the default value for an incorrect #{value.inspect} (#{value.class}) parameter" do
+        is_expected.to run.with_params(value, 'default_value').
+                           and_return('default_value')
+      end
+    end
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/parseyaml_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/parseyaml_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/parseyaml_spec.rb	(revision 30960)
@@ -0,0 +1,81 @@
+require 'spec_helper'
+
+describe 'parseyaml' do
+  it 'should exist' do
+    is_expected.not_to eq(nil)
+  end
+
+  it 'should raise an error if called without any arguments' do
+    is_expected.to run.with_params().
+                       and_raise_error(/wrong number of arguments/i)
+  end
+
+  context 'with correct YAML data' do
+    it 'should be able to parse a YAML data with a String' do
+      is_expected.to run.with_params('--- just a string').
+                         and_return('just a string')
+      is_expected.to run.with_params('just a string').
+                         and_return('just a string')
+    end
+
+    it 'should be able to parse a YAML data with a Hash' do
+      is_expected.to run.with_params("---\na: '1'\nb: '2'\n").
+                         and_return({'a' => '1', 'b' => '2'})
+    end
+
+    it 'should be able to parse a YAML data with an Array' do
+      is_expected.to run.with_params("---\n- a\n- b\n- c\n").
+                         and_return(['a', 'b', 'c'])
+    end
+
+    it 'should be able to parse a YAML data with a mixed structure' do
+      is_expected.to run.with_params("---\na: '1'\nb: 2\nc:\n  d:\n  - :a\n  - true\n  - false\n").
+                         and_return({'a' => '1', 'b' => 2, 'c' => {'d' => [:a, true, false]}})
+    end
+
+    it 'should not return the default value if the data was parsed correctly' do
+      is_expected.to run.with_params("---\na: '1'\n", 'default_value').
+                         and_return({'a' => '1'})
+    end
+
+  end
+
+  context 'on a modern ruby', :unless => RUBY_VERSION == '1.8.7' do
+    it 'should raise an error with invalid YAML and no default' do
+      is_expected.to run.with_params('["one"').
+                         and_raise_error(Psych::SyntaxError)
+    end
+  end
+
+    context 'when running on ruby 1.8.7, which does not have Psych', :if => RUBY_VERSION == '1.8.7' do
+      it 'should raise an error with invalid YAML and no default' do
+        is_expected.to run.with_params('["one"').
+          and_raise_error(ArgumentError)
+      end
+    end
+
+  context 'with incorrect YAML data' do
+    it 'should support a structure for a default value' do
+      is_expected.to run.with_params('', {'a' => '1'}).
+                         and_return({'a' => '1'})
+    end
+
+    [1, 1.2, nil, true, false, [], {}, :yaml].each do |value|
+      it "should return the default value for an incorrect #{value.inspect} (#{value.class}) parameter" do
+        is_expected.to run.with_params(value, 'default_value').
+                           and_return('default_value')
+      end
+    end
+
+    context 'when running on modern rubies', :unless => RUBY_VERSION == '1.8.7' do
+      ['---', '...', '*8', ''].each do |value|
+        it "should return the default value for an incorrect #{value.inspect} string parameter" do
+          is_expected.to run.with_params(value, 'default_value').
+                             and_return('default_value')
+        end
+      end
+    end
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/pick_default_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/pick_default_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/pick_default_spec.rb	(revision 30960)
@@ -0,0 +1,24 @@
+require 'spec_helper'
+
+describe 'pick_default' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::Error, /Must receive at least one argument/) }
+
+  it { is_expected.to run.with_params('one', 'two').and_return('one') }
+  it { is_expected.to run.with_params('', 'two').and_return('two') }
+  it { is_expected.to run.with_params(:undef, 'two').and_return('two') }
+  it { is_expected.to run.with_params(:undefined, 'two').and_return('two') }
+  it { is_expected.to run.with_params(nil, 'two').and_return('two') }
+
+  [ '', :undef, :undefined, nil, {}, [], 1, 'default' ].each do |value|
+    describe "when providing #{value.inspect} as default" do
+      it { is_expected.to run.with_params('one', value).and_return('one') }
+      it { is_expected.to run.with_params([], value).and_return([]) }
+      it { is_expected.to run.with_params({}, value).and_return({}) }
+      it { is_expected.to run.with_params(value, value).and_return(value) }
+      it { is_expected.to run.with_params(:undef, value).and_return(value) }
+      it { is_expected.to run.with_params(:undefined, value).and_return(value) }
+      it { is_expected.to run.with_params(nil, value).and_return(value) }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/pick_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/pick_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/pick_spec.rb	(revision 30960)
@@ -0,0 +1,12 @@
+require 'spec_helper'
+
+describe 'pick' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /must receive at least one non empty value/) }
+  it { is_expected.to run.with_params('', nil, :undef, :undefined).and_raise_error(Puppet::ParseError, /must receive at least one non empty value/) }
+  it { is_expected.to run.with_params('one', 'two').and_return('one') }
+  it { is_expected.to run.with_params('', 'two').and_return('two') }
+  it { is_expected.to run.with_params(:undef, 'two').and_return('two') }
+  it { is_expected.to run.with_params(:undefined, 'two').and_return('two') }
+  it { is_expected.to run.with_params(nil, 'two').and_return('two') }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/prefix_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/prefix_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/prefix_spec.rb	(revision 30960)
@@ -0,0 +1,28 @@
+require 'spec_helper'
+
+describe 'prefix' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the second.")
+    is_expected.to run.with_params([], 'a', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, /expected first argument to be an Array or a Hash/) }
+  it { is_expected.to run.with_params([], 2).and_raise_error(Puppet::ParseError, /expected second argument to be a String/) }
+  it { is_expected.to run.with_params([]).and_return([]) }
+  it { is_expected.to run.with_params(['one', 2]).and_return(['one', '2']) }
+  it { is_expected.to run.with_params([], '').and_return([]) }
+  it { is_expected.to run.with_params([''], '').and_return(['']) }
+  it { is_expected.to run.with_params(['one'], 'pre').and_return(['preone']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], 'pre').and_return(['preone', 'pretwo', 'prethree']) }
+  it { is_expected.to run.with_params({}).and_return({}) }
+  it { is_expected.to run.with_params({ 'key1' => 'value1', 2 => 3}).and_return({ 'key1' => 'value1', '2' => 3 }) }
+  it { is_expected.to run.with_params({}, '').and_return({}) }
+  it { is_expected.to run.with_params({ 'key' => 'value' }, '').and_return({ 'key' => 'value' }) }
+  it { is_expected.to run.with_params({ 'key' => 'value' }, 'pre').and_return({ 'prekey' => 'value' }) }
+  it {
+    is_expected.to run \
+      .with_params({ 'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3' }, 'pre') \
+      .and_return({ 'prekey1' => 'value1', 'prekey2' => 'value2', 'prekey3' => 'value3' })
+  }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/private_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/private_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/private_spec.rb	(revision 30960)
@@ -0,0 +1,56 @@
+require 'spec_helper'
+
+describe 'private' do
+  it 'should issue a warning' do
+    scope.expects(:warning).with("private() DEPRECATED: This function will cease to function on Puppet 4; please use assert_private() before upgrading to puppet 4 for backwards-compatibility, or migrate to the new parser's typing system.")
+    begin
+      subject.call []
+    rescue
+      # ignore this
+    end
+  end
+
+  context "when called from inside module" do
+    it "should not fail" do
+      scope.expects(:lookupvar).with('module_name').returns('foo')
+      scope.expects(:lookupvar).with('caller_module_name').returns('foo')
+      expect {
+        subject.call []
+      }.not_to raise_error
+    end
+  end
+
+  context "with an explicit failure message" do
+    it "prints the failure message on error" do
+      scope.expects(:lookupvar).with('module_name').returns('foo')
+      scope.expects(:lookupvar).with('caller_module_name').returns('bar')
+      expect {
+        subject.call ['failure message!']
+      }.to raise_error Puppet::ParseError, /failure message!/
+    end
+  end
+
+  context "when called from private class" do
+    it "should fail with a class error message" do
+      scope.expects(:lookupvar).with('module_name').returns('foo')
+      scope.expects(:lookupvar).with('caller_module_name').returns('bar')
+      scope.source.expects(:name).returns('foo::baz')
+      scope.source.expects(:type).returns('hostclass')
+      expect {
+        subject.call []
+      }.to raise_error Puppet::ParseError, /Class foo::baz is private/
+    end
+  end
+
+  context "when called from private definition" do
+    it "should fail with a class error message" do
+      scope.expects(:lookupvar).with('module_name').returns('foo')
+      scope.expects(:lookupvar).with('caller_module_name').returns('bar')
+      scope.source.expects(:name).returns('foo::baz')
+      scope.source.expects(:type).returns('definition')
+      expect {
+        subject.call []
+      }.to raise_error Puppet::ParseError, /Definition foo::baz is private/
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/pw_hash_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/pw_hash_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/pw_hash_spec.rb	(revision 30960)
@@ -0,0 +1,69 @@
+require 'spec_helper'
+
+describe 'pw_hash' do
+
+  it { is_expected.not_to eq(nil) }
+
+  context 'when there are less than 3 arguments' do
+    it { is_expected.to run.with_params().and_raise_error(ArgumentError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('password').and_raise_error(ArgumentError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('password', 'sha-256').and_raise_error(ArgumentError, /wrong number of arguments/i) }
+  end
+
+  context 'when there are more than 3 arguments' do
+    it { is_expected.to run.with_params('password', 'sha-256', 'salt', 'extra').and_raise_error(ArgumentError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('password', 'sha-256', 'salt', 'extra', 'extra').and_raise_error(ArgumentError, /wrong number of arguments/i) }
+  end
+
+  context 'when the first argument is not a string' do
+    it { is_expected.to run.with_params([], 'sha-256', 'salt').and_raise_error(ArgumentError, /first argument must be a string/) }
+    it { is_expected.to run.with_params({}, 'sha-256', 'salt').and_raise_error(ArgumentError, /first argument must be a string/) }
+    it { is_expected.to run.with_params(1, 'sha-256', 'salt').and_raise_error(ArgumentError, /first argument must be a string/) }
+    it { is_expected.to run.with_params(true, 'sha-256', 'salt').and_raise_error(ArgumentError, /first argument must be a string/) }
+  end
+
+  context 'when the first argument is undefined' do
+    it { is_expected.to run.with_params('', 'sha-256', 'salt').and_return(nil) }
+    it { is_expected.to run.with_params(nil, 'sha-256', 'salt').and_return(nil) }
+  end
+
+  context 'when the second argument is not a string' do
+    it { is_expected.to run.with_params('password', [], 'salt').and_raise_error(ArgumentError, /second argument must be a string/) }
+    it { is_expected.to run.with_params('password', {}, 'salt').and_raise_error(ArgumentError, /second argument must be a string/) }
+    it { is_expected.to run.with_params('password', 1, 'salt').and_raise_error(ArgumentError, /second argument must be a string/) }
+    it { is_expected.to run.with_params('password', true, 'salt').and_raise_error(ArgumentError, /second argument must be a string/) }
+  end
+
+  context 'when the second argument is not one of the supported hashing algorithms' do
+    it { is_expected.to run.with_params('password', 'no such algo', 'salt').and_raise_error(ArgumentError, /is not a valid hash type/) }
+  end
+
+  context 'when the third argument is not a string' do
+    it { is_expected.to run.with_params('password', 'sha-256', []).and_raise_error(ArgumentError, /third argument must be a string/) }
+    it { is_expected.to run.with_params('password', 'sha-256', {}).and_raise_error(ArgumentError, /third argument must be a string/) }
+    it { is_expected.to run.with_params('password', 'sha-256', 1).and_raise_error(ArgumentError, /third argument must be a string/) }
+    it { is_expected.to run.with_params('password', 'sha-256', true).and_raise_error(ArgumentError, /third argument must be a string/) }
+  end
+
+  context 'when the third argument is empty' do
+    it { is_expected.to run.with_params('password', 'sha-512', '').and_raise_error(ArgumentError, /third argument must not be empty/) }
+  end
+
+  context 'when the third argument contains invalid characters' do
+    it { is_expected.to run.with_params('password', 'sha-512', 'one%').and_raise_error(ArgumentError, /characters in salt must be in the set/) }
+  end
+
+  context 'when running on a platform with a weak String#crypt implementation' do
+    before(:each) { allow_any_instance_of(String).to receive(:crypt).with('$1$1').and_return('a bad hash') }
+
+    it { is_expected.to run.with_params('password', 'sha-512', 'salt').and_raise_error(Puppet::ParseError, /system does not support enhanced salts/) }
+  end
+
+  if RUBY_PLATFORM == 'java' or 'test'.crypt('$1$1') == '$1$1$Bp8CU9Oujr9SSEw53WV6G.'
+    describe "on systems with enhanced salts support" do
+      it { is_expected.to run.with_params('password', 'md5', 'salt').and_return('$1$salt$qJH7.N4xYta3aEG/dfqo/0') }
+      it { is_expected.to run.with_params('password', 'sha-256', 'salt').and_return('$5$salt$Gcm6FsVtF/Qa77ZKD.iwsJlCVPY0XSMgLJL0Hnww/c1') }
+      it { is_expected.to run.with_params('password', 'sha-512', 'salt').and_return('$6$salt$IxDD3jeSOb5eB1CX5LBsqZFVkJdido3OUILO5Ifz5iwMuTS4XMS130MTSuDDl3aCI6WouIL9AjRbLCelDCy.g.') }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/range_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/range_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/range_spec.rb	(revision 30960)
@@ -0,0 +1,118 @@
+require 'spec_helper'
+
+describe 'range' do
+  it { is_expected.not_to eq(nil) }
+
+  describe 'signature validation in puppet3', :unless => RSpec.configuration.puppet_future do
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it {
+      pending("Current implementation ignores parameters after the third.")
+      is_expected.to run.with_params(1, 2, 3, 4).and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+    }
+    it { is_expected.to run.with_params('1..2..3').and_raise_error(Puppet::ParseError, /Unable to compute range/i) }
+    it { is_expected.to run.with_params('').and_raise_error(Puppet::ParseError, /Unknown range format/i) }
+  end
+
+  describe 'signature validation in puppet4', :if => RSpec.configuration.puppet_future do
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params().and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params('').and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params({}).and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params([]).and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params(true).and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params(true).and_raise_error(ArgumentError) }
+    it {                                        is_expected.to run.with_params(1, 2, 'foo').and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params(1, 2, []).and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params(1, 2, {}).and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params(1, 2, true).and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params(1, 2, 3, 4).and_raise_error(ArgumentError) }
+    it { pending "the puppet 4 implementation"; is_expected.to run.with_params('1..2..3').and_raise_error(ArgumentError) }
+  end
+
+  context 'with characters as bounds' do
+    it { is_expected.to run.with_params('d', 'a').and_return([]) }
+    it { is_expected.to run.with_params('a', 'a').and_return(['a']) }
+    it { is_expected.to run.with_params('a', 'b').and_return(['a', 'b']) }
+    it { is_expected.to run.with_params('a', 'd').and_return(['a', 'b', 'c', 'd']) }
+    it { is_expected.to run.with_params('a', 'd', 1).and_return(['a', 'b', 'c', 'd']) }
+    it { is_expected.to run.with_params('a', 'd', '1').and_return(['a', 'b', 'c', 'd']) }
+    it { is_expected.to run.with_params('a', 'd', 2).and_return(['a', 'c']) }
+    it { is_expected.to run.with_params('a', 'd', -2).and_return(['a', 'c']) }
+    it { is_expected.to run.with_params('a', 'd', 3).and_return(['a', 'd']) }
+    it { is_expected.to run.with_params('a', 'd', 4).and_return(['a']) }
+  end
+
+  context 'with strings as bounds' do
+    it { is_expected.to run.with_params('onea', 'oned').and_return(['onea', 'oneb', 'onec', 'oned']) }
+    it { is_expected.to run.with_params('two', 'one').and_return([]) }
+    it { is_expected.to run.with_params('true', 'false').and_return([]) }
+    it { is_expected.to run.with_params('false', 'true').and_return(['false']) }
+  end
+
+  context 'with integers as bounds' do
+    it { is_expected.to run.with_params(4, 1).and_return([]) }
+    it { is_expected.to run.with_params(1, 1).and_return([1]) }
+    it { is_expected.to run.with_params(1, 2).and_return([1, 2]) }
+    it { is_expected.to run.with_params(1, 4).and_return([1, 2, 3, 4]) }
+    it { is_expected.to run.with_params(1, 4, 1).and_return([1, 2, 3, 4]) }
+    it { is_expected.to run.with_params(1, 4, '1').and_return([1, 2, 3, 4]) }
+    it { is_expected.to run.with_params(1, 4, 2).and_return([1, 3]) }
+    it { is_expected.to run.with_params(1, 4, -2).and_return([1, 3]) }
+    it { is_expected.to run.with_params(1, 4, 3).and_return([1, 4]) }
+    it { is_expected.to run.with_params(1, 4, 4).and_return([1]) }
+  end
+
+  context 'with integers as strings as bounds' do
+    it { is_expected.to run.with_params('4', '1').and_return([]) }
+    it { is_expected.to run.with_params('1', '1').and_return([1]) }
+    it { is_expected.to run.with_params('1', '2').and_return([1, 2]) }
+    it { is_expected.to run.with_params('1', '4').and_return([1, 2, 3, 4]) }
+    it { is_expected.to run.with_params('1', '4', 1).and_return([1, 2, 3, 4]) }
+    it { is_expected.to run.with_params('1', '4', '1').and_return([1, 2, 3, 4]) }
+    it { is_expected.to run.with_params('1', '4', 2).and_return([1, 3]) }
+    it { is_expected.to run.with_params('1', '4', -2).and_return([1, 3]) }
+    it { is_expected.to run.with_params('1', '4', 3).and_return([1, 4]) }
+    it { is_expected.to run.with_params('1', '4', 4).and_return([1]) }
+  end
+
+  context 'with prefixed numbers as strings as bounds' do
+    it { is_expected.to run.with_params('host01', 'host04').and_return(['host01', 'host02', 'host03', 'host04']) }
+    it { is_expected.to run.with_params('01', '04').and_return([1, 2, 3, 4]) }
+  end
+
+  context 'with dash-range syntax' do
+    it { is_expected.to run.with_params('4-1').and_return([]) }
+    it { is_expected.to run.with_params('1-1').and_return([1]) }
+    it { is_expected.to run.with_params('1-2').and_return([1, 2]) }
+    it { is_expected.to run.with_params('1-4').and_return([1, 2, 3, 4]) }
+  end
+
+  context 'with two-dot-range syntax' do
+    it { is_expected.to run.with_params('4..1').and_return([]) }
+    it { is_expected.to run.with_params('1..1').and_return([1]) }
+    it { is_expected.to run.with_params('1..2').and_return([1, 2]) }
+    it { is_expected.to run.with_params('1..4').and_return([1, 2, 3, 4]) }
+  end
+
+  context 'with three-dot-range syntax' do
+    it { is_expected.to run.with_params('4...1').and_return([]) }
+    it { is_expected.to run.with_params('1...1').and_return([]) }
+    it { is_expected.to run.with_params('1...2').and_return([1]) }
+    it { is_expected.to run.with_params('1...3').and_return([1, 2]) }
+    it { is_expected.to run.with_params('1...5').and_return([1, 2, 3, 4]) }
+  end
+
+  describe 'when passing mixed arguments as bounds' do
+    it {
+      pending('these bounds should not be allowed as ruby will OOM hard. e.g. `(\'host0\'..\'hosta\').to_a` has 3239930 elements on ruby 1.9, adding more \'0\'s and \'a\'s increases that exponentially')
+      is_expected.to run.with_params('0', 'a').and_raise_error(Puppet::ParseError, /cannot interpolate between numeric and non-numeric bounds/)
+    }
+    it {
+      pending('these bounds should not be allowed as ruby will OOM hard. e.g. `(\'host0\'..\'hosta\').to_a` has 3239930 elements on ruby 1.9, adding more \'0\'s and \'a\'s increases that exponentially')
+      is_expected.to run.with_params(0, 'a').and_raise_error(Puppet::ParseError, /cannot interpolate between numeric and non-numeric bounds/)
+    }
+    it {
+      pending('these bounds should not be allowed as ruby will OOM hard. e.g. `(\'host0\'..\'hosta\').to_a` has 3239930 elements on ruby 1.9, adding more \'0\'s and \'a\'s increases that exponentially')
+      is_expected.to run.with_params('h0', 'ha').and_raise_error(Puppet::ParseError, /cannot interpolate between numeric and non-numeric bounds/)
+    }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/regexpescape_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/regexpescape_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/regexpescape_spec.rb	(revision 30960)
@@ -0,0 +1,36 @@
+require 'spec_helper'
+
+describe 'regexpescape' do
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it {
+      pending("Current implementation ignores parameters after the first.")
+      is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+    }
+    it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+    it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+    it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+  end
+
+  describe 'handling normal strings' do
+    it 'should call ruby\'s Regexp.escape function' do
+      Regexp.expects(:escape).with('regexp_string').returns('escaped_regexp_string').once
+      is_expected.to run.with_params('regexp_string').and_return('escaped_regexp_string')
+    end
+  end
+
+  describe 'handling classes derived from String' do
+    it 'should call ruby\'s Regexp.escape function' do
+      regexp_string = AlsoString.new('regexp_string')
+      Regexp.expects(:escape).with(regexp_string).returns('escaped_regexp_string').once
+      is_expected.to run.with_params(regexp_string).and_return("escaped_regexp_string")
+    end
+  end
+
+  describe 'strings in arrays handling' do
+    it { is_expected.to run.with_params([]).and_return([]) }
+    it { is_expected.to run.with_params(['one*', "two"]).and_return(['one\*', "two"]) }
+    it { is_expected.to run.with_params(['one*', 1, true, {}, "two"]).and_return(['one\*', 1, true, {}, "two"]) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/reject_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/reject_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/reject_spec.rb	(revision 30960)
@@ -0,0 +1,19 @@
+require 'spec_helper'
+
+describe 'reject' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params([], 'pattern', 'extra').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+  it {
+    pending("reject does not actually check this, and raises NoMethodError instead")
+    is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError, /first argument not an array/)
+  }
+  it {
+    pending("reject does not actually check this, and raises NoMethodError instead")
+    is_expected.to run.with_params(1, 'two').and_raise_error(Puppet::ParseError, /first argument not an array/)
+  }
+  it { is_expected.to run.with_params([], 'two').and_return([]) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], 'two').and_return(['one', 'three']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], 't(wo|hree)').and_return(['one']) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/reverse_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/reverse_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/reverse_spec.rb	(revision 30960)
@@ -0,0 +1,31 @@
+require 'spec_helper'
+
+describe 'reverse' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params([], 'extra').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+  it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+  it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+  it { is_expected.to run.with_params([]).and_return([]) }
+  it { is_expected.to run.with_params(['a']).and_return(['a']) }
+  it { is_expected.to run.with_params(['one']).and_return(['one']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three']).and_return(['three', 'two', 'one']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three', 'four']).and_return(['four', 'three', 'two', 'one']) }
+
+  it { is_expected.to run.with_params('').and_return('') }
+  it { is_expected.to run.with_params('a').and_return('a') }
+  it { is_expected.to run.with_params('abc').and_return('cba') }
+  it { is_expected.to run.with_params('abcd').and_return('dcba') }
+
+  context 'when using a class extending String' do
+    it 'should call its reverse method' do
+      value = AlsoString.new('asdfghjkl')
+      value.expects(:reverse).returns('foo')
+      expect(subject).to run.with_params(value).and_return('foo')
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/rstrip_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/rstrip_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/rstrip_spec.rb	(revision 30960)
@@ -0,0 +1,34 @@
+require 'spec_helper'
+
+describe 'rstrip' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /Requires either array or string to work with/) }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires either array or string to work with/) }
+  it { is_expected.to run.with_params('').and_return('') }
+  it { is_expected.to run.with_params(' ').and_return('') }
+  it { is_expected.to run.with_params('     ').and_return('') }
+  it { is_expected.to run.with_params("\t").and_return('') }
+  it { is_expected.to run.with_params("\t ").and_return('') }
+  it { is_expected.to run.with_params('one').and_return('one') }
+  it { is_expected.to run.with_params(' one').and_return(' one') }
+  it { is_expected.to run.with_params('     one').and_return('     one') }
+  it { is_expected.to run.with_params("\tone").and_return("\tone") }
+  it { is_expected.to run.with_params("\t one").and_return("\t one") }
+  it { is_expected.to run.with_params('one ').and_return('one') }
+  it { is_expected.to run.with_params(' one ').and_return(' one') }
+  it { is_expected.to run.with_params('     one ').and_return('     one') }
+  it { is_expected.to run.with_params("\tone ").and_return("\tone") }
+  it { is_expected.to run.with_params("\t one ").and_return("\t one") }
+  it { is_expected.to run.with_params("one\t").and_return('one') }
+  it { is_expected.to run.with_params(" one\t").and_return(' one') }
+  it { is_expected.to run.with_params("     one\t").and_return('     one') }
+  it { is_expected.to run.with_params("\tone\t").and_return("\tone") }
+  it { is_expected.to run.with_params("\t one\t").and_return("\t one") }
+  it { is_expected.to run.with_params(' o n e ').and_return(' o n e') }
+  it { is_expected.to run.with_params(AlsoString.new(' one ')).and_return(' one') }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/seeded_rand_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/seeded_rand_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/seeded_rand_spec.rb	(revision 30960)
@@ -0,0 +1,53 @@
+require 'spec_helper'
+
+describe 'seeded_rand' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(ArgumentError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(1).and_raise_error(ArgumentError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(0, '').and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params(1.5, '').and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params(-10, '').and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params("-10", '').and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params("string", '').and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params([], '').and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params({}, '').and_raise_error(ArgumentError, /first argument must be a positive integer/) }
+  it { is_expected.to run.with_params(1, 1).and_raise_error(ArgumentError, /second argument must be a string/) }
+  it { is_expected.to run.with_params(1, []).and_raise_error(ArgumentError, /second argument must be a string/) }
+  it { is_expected.to run.with_params(1, {}).and_raise_error(ArgumentError, /second argument must be a string/) }
+
+  it "provides a random number strictly less than the given max" do
+    expect(seeded_rand(3, 'seed')).to satisfy {|n| n.to_i < 3 }
+  end
+
+  it "provides a random number greater or equal to zero" do
+    expect(seeded_rand(3, 'seed')).to satisfy {|n| n.to_i >= 0 }
+  end
+
+  it "provides the same 'random' value on subsequent calls for the same host" do
+    expect(seeded_rand(10, 'seed')).to eql(seeded_rand(10, 'seed'))
+  end
+
+  it "allows seed to control the random value on a single host" do
+    first_random = seeded_rand(1000, 'seed1')
+    second_different_random = seeded_rand(1000, 'seed2')
+
+    expect(first_random).not_to eql(second_different_random)
+  end
+
+  it "should not return different values for different hosts" do
+    val1 = seeded_rand(1000, 'foo', :host => "first.host.com")
+    val2 = seeded_rand(1000, 'foo', :host => "second.host.com")
+
+    expect(val1).to eql(val2)
+  end
+
+  def seeded_rand(max, seed, args = {})
+    host = args[:host] || '127.0.0.1'
+
+    # workaround not being able to use let(:facts) because some tests need
+    # multiple different hostnames in one context
+    scope.stubs(:lookupvar).with("::fqdn", {}).returns(host)
+
+    scope.function_seeded_rand([max, seed])
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/shell_escape_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/shell_escape_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/shell_escape_spec.rb	(revision 30960)
@@ -0,0 +1,22 @@
+require 'spec_helper'
+
+describe 'shell_escape' do
+  it { is_expected.not_to eq(nil) }
+
+  describe 'signature validation' do
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('foo', 'bar').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  end
+
+  describe 'stringification' do
+    it { is_expected.to run.with_params(10).and_return('10') }
+    it { is_expected.to run.with_params(false).and_return('false') }
+  end
+
+  describe 'escaping' do
+    it { is_expected.to run.with_params('foo').and_return('foo') }
+    it { is_expected.to run.with_params('foo bar').and_return('foo\ bar') }
+    it { is_expected.to run.with_params('~`!@#$%^&*()_+-=[]\{}|;\':",./<>?')
+           .and_return('\~\`\!@\#\$\%\^\&\*\(\)_\+-\=\[\]\\\\\{\}\|\;\\\':\",./\<\>\?') }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/shell_join_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/shell_join_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/shell_join_spec.rb	(revision 30960)
@@ -0,0 +1,23 @@
+require 'spec_helper'
+
+describe 'shell_join' do
+  it { is_expected.not_to eq(nil) }
+
+  describe 'signature validation' do
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params(['foo'], ['bar']).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('foo').and_raise_error(Puppet::ParseError, /is not an Array/i) }
+  end
+
+  describe 'shell argument joining' do
+    it { is_expected.to run.with_params(['foo']).and_return('foo') }
+    it { is_expected.to run.with_params(['foo', 'bar']).and_return('foo bar') }
+    it { is_expected.to run.with_params(['foo', 'bar baz']).and_return('foo bar\ baz') }
+    it { is_expected.to run.with_params(['~`!@#$', '%^&*()_+-=', '[]\{}|;\':"', ',./<>?'])
+                            .and_return('\~\`\!@\#\$ \%\^\&\*\(\)_\+-\= \[\]\\\\\{\}\|\;\\\':\" ,./\<\>\?') }
+  end
+
+  describe 'stringification' do
+    it { is_expected.to run.with_params([10, false, 'foo']).and_return('10 false foo') }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/shell_split_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/shell_split_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/shell_split_spec.rb	(revision 30960)
@@ -0,0 +1,24 @@
+require 'spec_helper'
+
+describe 'shell_split' do
+  it { is_expected.not_to eq(nil) }
+
+  describe 'signature validation' do
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('foo', 'bar').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  end
+
+  describe 'stringification' do
+    it { is_expected.to run.with_params(10).and_return(['10']) }
+    it { is_expected.to run.with_params(false).and_return(['false']) }
+  end
+
+  describe 'shell line spliting' do
+    it { is_expected.to run.with_params('foo').and_return(['foo']) }
+    it { is_expected.to run.with_params('foo bar').and_return(['foo', 'bar']) }
+    it { is_expected.to run.with_params('\~\`\!@\#\$\%\^\&\*\(\)_\+-\=\[\]\\\\\{\}\|\;\\\':\",./\<\>\?')
+         .and_return(['~`!@#$%^&*()_+-=[]\{}|;\':",./<>?']) }
+    it { is_expected.to run.with_params('\~\`\!@\#\$ \%\^\&\*\(\)_\+-\= \[\]\\\\\{\}\|\;\\\':\" ,./\<\>\?')
+         .and_return(['~`!@#$', '%^&*()_+-=', '[]\{}|;\':"', ',./<>?']) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/shuffle_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/shuffle_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/shuffle_spec.rb	(revision 30960)
@@ -0,0 +1,33 @@
+require 'spec_helper'
+
+describe 'shuffle' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params([], 'extra').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+  it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+  it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+
+  context 'when running with a specific seed' do
+    # make tests deterministic
+    before(:each) { srand(2) }
+
+    it { is_expected.to run.with_params([]).and_return([]) }
+    it { is_expected.to run.with_params(['a']).and_return(['a']) }
+    it { is_expected.to run.with_params(['one']).and_return(['one']) }
+    it { is_expected.to run.with_params(['one', 'two', 'three']).and_return(['two', 'one', 'three']) }
+    it { is_expected.to run.with_params(['one', 'two', 'three', 'four']).and_return(['four', 'three', 'two', 'one']) }
+
+    it { is_expected.to run.with_params('').and_return('') }
+    it { is_expected.to run.with_params('a').and_return('a') }
+    it { is_expected.to run.with_params('abc').and_return('bac') }
+    it { is_expected.to run.with_params('abcd').and_return('dcba') }
+
+    context 'when using a class extending String' do
+      it { is_expected.to run.with_params(AlsoString.new('asdfghjkl')).and_return('lkhdsfajg') }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/size_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/size_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/size_spec.rb	(revision 30960)
@@ -0,0 +1,35 @@
+require 'spec_helper'
+
+describe 'size' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params([], 'extra').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Unknown type given/) }
+  it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /Unknown type given/) }
+  it { is_expected.to run.with_params('1').and_raise_error(Puppet::ParseError, /Requires either string, array or hash to work/) }
+  it { is_expected.to run.with_params('1.0').and_raise_error(Puppet::ParseError, /Requires either string, array or hash to work/) }
+  it { is_expected.to run.with_params([]).and_return(0) }
+  it { is_expected.to run.with_params(['a']).and_return(1) }
+  it { is_expected.to run.with_params(['one', 'two', 'three']).and_return(3) }
+  it { is_expected.to run.with_params(['one', 'two', 'three', 'four']).and_return(4) }
+
+  it { is_expected.to run.with_params({}).and_return(0) }
+  it { is_expected.to run.with_params({'1' => '2'}).and_return(1) }
+  it { is_expected.to run.with_params({'1' => '2', '4' => '4'}).and_return(2) }
+
+  it { is_expected.to run.with_params('').and_return(0) }
+  it { is_expected.to run.with_params('a').and_return(1) }
+  it { is_expected.to run.with_params('abc').and_return(3) }
+  it { is_expected.to run.with_params('abcd').and_return(4) }
+
+  context 'when using a class extending String' do
+    it 'should call its size method' do
+      value = AlsoString.new('asdfghjkl')
+      value.expects(:size).returns('foo')
+      expect(subject).to run.with_params(value).and_return('foo')
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/sort_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/sort_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/sort_spec.rb	(revision 30960)
@@ -0,0 +1,24 @@
+require 'spec_helper'
+
+describe 'sort' do
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params([], 'extra').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { pending('stricter input checking'); is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /requires string or array/) }
+    it { pending('stricter input checking'); is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /requires string or array/) }
+    it { pending('stricter input checking'); is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /requires string or array/) }
+  end
+
+  context 'when called with an array' do
+    it { is_expected.to run.with_params([]).and_return([]) }
+    it { is_expected.to run.with_params(['a']).and_return(['a']) }
+    it { is_expected.to run.with_params(['c', 'b', 'a']).and_return(['a', 'b', 'c']) }
+  end
+
+  context 'when called with a string' do
+    it { is_expected.to run.with_params('').and_return('') }
+    it { is_expected.to run.with_params('a').and_return('a') }
+    it { is_expected.to run.with_params('cbda').and_return('abcd') }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/squeeze_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/squeeze_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/squeeze_spec.rb	(revision 30960)
@@ -0,0 +1,44 @@
+require 'spec_helper'
+
+describe 'squeeze' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('', '', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(1).and_raise_error(NoMethodError) }
+  it { is_expected.to run.with_params({}).and_raise_error(NoMethodError) }
+  it { is_expected.to run.with_params(true).and_raise_error(NoMethodError) }
+
+  context 'when squeezing a single string' do
+    it { is_expected.to run.with_params('').and_return('') }
+    it { is_expected.to run.with_params('a').and_return('a') }
+    it { is_expected.to run.with_params('aaaaaaaaa').and_return('a') }
+    it { is_expected.to run.with_params('aaaaaaaaa', 'a').and_return('a') }
+    it { is_expected.to run.with_params('aaaaaaaaabbbbbbbbbbcccccccccc', 'b-c').and_return('aaaaaaaaabc') }
+  end
+
+  context 'when squeezing values in an array' do
+    it {
+      is_expected.to run \
+        .with_params(['', 'a', 'aaaaaaaaa', 'aaaaaaaaabbbbbbbbbbcccccccccc']) \
+        .and_return( ['', 'a', 'a',         'abc'])
+    }
+    it {
+      is_expected.to run \
+        .with_params(['', 'a', 'aaaaaaaaa', 'aaaaaaaaabbbbbbbbbbcccccccccc'], 'a') \
+        .and_return( ['', 'a', 'a',         'abbbbbbbbbbcccccccccc'])
+    }
+    it {
+      is_expected.to run \
+        .with_params(['', 'a', 'aaaaaaaaa', 'aaaaaaaaabbbbbbbbbbcccccccccc'], 'b-c') \
+        .and_return( ['', 'a', 'aaaaaaaaa', 'aaaaaaaaabc'])
+    }
+  end
+
+  context 'when using a class extending String' do
+    it 'should call its squeeze method' do
+      value = AlsoString.new('aaaaaaaaa')
+      value.expects(:squeeze).returns('foo')
+      expect(subject).to run.with_params(value).and_return('foo')
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/str2bool_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/str2bool_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/str2bool_spec.rb	(revision 30960)
@@ -0,0 +1,23 @@
+require 'spec_helper'
+
+describe 'str2bool' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params('true', 'extra').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /Unknown type of boolean given/) }
+
+  describe 'when testing values that mean "true"' do
+    [ 'TRUE','1', 't', 'y', 'true', 'yes', true ].each do |value|
+      it { is_expected.to run.with_params(value).and_return(true) }
+    end
+  end
+
+  describe 'when testing values that mean "false"' do
+    [ 'FALSE','', '0', 'f', 'n', 'false', 'no', false, 'undef', 'undefined' ].each do |value|
+      it { is_expected.to run.with_params(value).and_return(false) }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/str2saltedsha512_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/str2saltedsha512_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/str2saltedsha512_spec.rb	(revision 30960)
@@ -0,0 +1,17 @@
+require 'spec_helper'
+
+describe 'str2saltedsha512' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('password', 2).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires a String argument/) }
+
+  context 'when running with a specific seed' do
+    # make tests deterministic
+    before(:each) { srand(2) }
+
+    it { is_expected.to run.with_params('').and_return('0f8a612f4eeed08e47b3875d00f33c5688f7926298f2d9b5fe19d1323f910bc78b6f7b5892596d2fabaa65e7a8d99b3768c102610cf0432c4827eee01f09451e3fae4f7a') }
+    it { is_expected.to run.with_params('password').and_return('0f8a612f43134376566c5707718d600effcfb17581fc9d3fa64d7f447dfda317c174ffdb498d2c5bd5c2075dab41c9d7ada5afbdc6b55354980eb5ba61802371e6b64956') }
+    it { is_expected.to run.with_params('verylongpassword').and_return('0f8a612f7a448537540e062daa8621f9bae326ca8ccb899e1bdb10e7c218cebfceae2530b856662565fdc4d81e986fc50cfbbc46d50436610ed9429ff5e43f2c45b5d039') }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/strftime_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/strftime_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/strftime_spec.rb	(revision 30960)
@@ -0,0 +1,26 @@
+require 'spec_helper'
+
+describe 'strftime' do
+  it "should exist" do
+    expect(Puppet::Parser::Functions.function("strftime")).to eq("function_strftime")
+  end
+
+  it "should raise a ParseError if there is less than 1 arguments" do
+    expect { scope.function_strftime([]) }.to( raise_error(Puppet::ParseError))
+  end
+
+  it "using %s should be higher then when I wrote this test" do
+    result = scope.function_strftime(["%s"])
+    expect(result.to_i).to(be > 1311953157)
+  end
+
+  it "using %s should be lower then 1.5 trillion" do
+    result = scope.function_strftime(["%s"])
+    expect(result.to_i).to(be < 1500000000)
+  end
+
+  it "should return a date when given %Y-%m-%d" do
+    result = scope.function_strftime(["%Y-%m-%d"])
+    expect(result).to match(/^\d{4}-\d{2}-\d{2}$/)
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/strip_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/strip_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/strip_spec.rb	(revision 30960)
@@ -0,0 +1,34 @@
+require 'spec_helper'
+
+describe 'strip' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /Requires either array or string to work with/) }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires either array or string to work with/) }
+  it { is_expected.to run.with_params('').and_return('') }
+  it { is_expected.to run.with_params(' ').and_return('') }
+  it { is_expected.to run.with_params('     ').and_return('') }
+  it { is_expected.to run.with_params("\t").and_return('') }
+  it { is_expected.to run.with_params("\t ").and_return('') }
+  it { is_expected.to run.with_params('one').and_return('one') }
+  it { is_expected.to run.with_params(' one').and_return('one') }
+  it { is_expected.to run.with_params('     one').and_return('one') }
+  it { is_expected.to run.with_params("\tone").and_return('one') }
+  it { is_expected.to run.with_params("\t one").and_return('one') }
+  it { is_expected.to run.with_params('one ').and_return('one') }
+  it { is_expected.to run.with_params(' one ').and_return('one') }
+  it { is_expected.to run.with_params('     one ').and_return('one') }
+  it { is_expected.to run.with_params("\tone ").and_return('one') }
+  it { is_expected.to run.with_params("\t one ").and_return('one') }
+  it { is_expected.to run.with_params("one \t").and_return('one') }
+  it { is_expected.to run.with_params(" one \t").and_return('one') }
+  it { is_expected.to run.with_params("     one \t").and_return('one') }
+  it { is_expected.to run.with_params("\tone \t").and_return('one') }
+  it { is_expected.to run.with_params("\t one \t").and_return('one') }
+  it { is_expected.to run.with_params(' o n e ').and_return('o n e') }
+  it { is_expected.to run.with_params(AlsoString.new(' one ')).and_return('one') }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/suffix_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/suffix_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/suffix_spec.rb	(revision 30960)
@@ -0,0 +1,38 @@
+require 'spec_helper'
+
+describe 'suffix' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the second.")
+    is_expected.to run.with_params([], 'a', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, /expected first argument to be an Array/) }
+  it { is_expected.to run.with_params([], 2).and_raise_error(Puppet::ParseError, /expected second argument to be a String/) }
+  it { is_expected.to run.with_params([]).and_return([]) }
+  it { is_expected.to run.with_params(['one', 2]).and_return(['one', '2']) }
+  it { is_expected.to run.with_params([], '').and_return([]) }
+  it { is_expected.to run.with_params([''], '').and_return(['']) }
+  it { is_expected.to run.with_params(['one'], 'post').and_return(['onepost']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], 'post').and_return(['onepost', 'twopost', 'threepost']) }
+  it {
+    is_expected.to run.with_params({}).and_return({})
+  }
+  it {
+    is_expected.to run.with_params({ 'key1' => 'value1', 2 => 3}).and_return({ 'key1' => 'value1', '2' => 3 })
+  }
+  it {
+    is_expected.to run.with_params({}, '').and_return({})
+  }
+  it {
+    is_expected.to run.with_params({ 'key' => 'value' }, '').and_return({ 'key' => 'value' })
+  }
+  it {
+    is_expected.to run.with_params({ 'key' => 'value' }, 'post').and_return({ 'keypost' => 'value' })
+  }
+  it {
+    is_expected.to run \
+      .with_params({ 'key1' => 'value1', 'key2' => 'value2', 'key3' => 'value3' }, 'post') \
+      .and_return({ 'key1post' => 'value1', 'key2post' => 'value2', 'key3post' => 'value3' })
+  }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/swapcase_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/swapcase_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/swapcase_spec.rb	(revision 30960)
@@ -0,0 +1,40 @@
+require 'spec_helper'
+
+describe 'swapcase' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params('a', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+  it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+  it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+  describe 'with strings as inputs' do
+    it { is_expected.to run.with_params('').and_return('') }
+    it { is_expected.to run.with_params('one').and_return('ONE') }
+    it { is_expected.to run.with_params('ONE').and_return('one') }
+    it { is_expected.to run.with_params('oNe').and_return('OnE') }
+  end
+  describe 'with arrays as inputs' do
+    it { is_expected.to run.with_params([]).and_return([]) }
+    describe 'only containing strings' do
+      it { is_expected.to run.with_params(['']).and_return(['']) }
+      it { is_expected.to run.with_params(['one']).and_return(['ONE']) }
+      it { is_expected.to run.with_params(['ONE']).and_return(['one']) }
+      it { is_expected.to run.with_params(['oNe']).and_return(['OnE']) }
+      it { is_expected.to run.with_params(['one', 'ONE']).and_return(['ONE', 'one']) }
+      it { is_expected.to run.with_params(['ONE', 'OnE']).and_return(['one', 'oNe']) }
+      it { is_expected.to run.with_params(['oNe', 'one']).and_return(['OnE', 'ONE']) }
+    end
+    describe 'containing mixed types' do
+      it { is_expected.to run.with_params(['OnE', {}]).and_return(['oNe', {}]) }
+      it { is_expected.to run.with_params(['OnE', 1]).and_return(['oNe', 1]) }
+      it { is_expected.to run.with_params(['OnE', []]).and_return(['oNe', []]) }
+      it { is_expected.to run.with_params(['OnE', ['two']]).and_return(['oNe', ['two']]) }
+    end
+  end
+  it "should accept objects which extend String" do
+    is_expected.to run.with_params(AlsoString.new("OnE")).and_return('oNe')
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/time_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/time_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/time_spec.rb	(revision 30960)
@@ -0,0 +1,21 @@
+require 'spec_helper'
+
+describe 'time' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params('a', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+  context 'when running at a specific time' do
+    before(:each) {
+      # get a value before stubbing the function
+      test_time = Time.utc(2006, 10, 13, 8, 15, 11)
+      Time.expects(:new).with().returns(test_time).once
+    }
+    it { is_expected.to run.with_params().and_return(1160727311) }
+    it { is_expected.to run.with_params('').and_return(1160727311) }
+    it { is_expected.to run.with_params([]).and_return(1160727311) }
+    it { is_expected.to run.with_params({}).and_return(1160727311) }
+    it { is_expected.to run.with_params('foo').and_return(1160727311) }
+    it { is_expected.to run.with_params('UTC').and_return(1160727311) }
+    it { is_expected.to run.with_params('America/New_York').and_return(1160727311) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/to_bytes_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/to_bytes_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/to_bytes_spec.rb	(revision 30960)
@@ -0,0 +1,72 @@
+require 'spec_helper'
+
+describe 'to_bytes' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params('1', 'extras').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params([]).and_raise_error(TypeError, /(can't convert|no implicit conversion of) Array (in)?to String/) }
+  it { is_expected.to run.with_params({}).and_raise_error(TypeError, /(can't convert|no implicit conversion of) Hash (in)?to String/) }
+  it { is_expected.to run.with_params(true).and_raise_error(TypeError, /(can't convert|no implicit conversion of) (TrueClass|true) (in)?to String/) }
+
+  describe 'when passing numbers' do
+    it { is_expected.to run.with_params(0).and_return(0) }
+    it { is_expected.to run.with_params(1).and_return(1) }
+    it { is_expected.to run.with_params(-1).and_return(-1) }
+    it { is_expected.to run.with_params(1.1).and_return(1.1) }
+    it { is_expected.to run.with_params(-1.1).and_return(-1.1) }
+  end
+
+  describe 'when passing numbers as strings' do
+    describe 'without a unit' do
+      it { is_expected.to run.with_params('1').and_return(1) }
+      it { is_expected.to run.with_params('-1').and_return(-1) }
+      # these are so wrong
+      it { is_expected.to run.with_params('1.1').and_return(1) }
+      it { is_expected.to run.with_params('-1.1').and_return(-1) }
+    end
+
+    describe 'with a unit' do
+      it { is_expected.to run.with_params('1k').and_return(1024) }
+      it { is_expected.to run.with_params('-1kB').and_return(-1024) }
+      it { is_expected.to run.with_params('1k').and_return(1024) }
+      it { is_expected.to run.with_params('1M').and_return(1024*1024) }
+      it { is_expected.to run.with_params('1G').and_return(1024*1024*1024) }
+      it { is_expected.to run.with_params('1T').and_return(1024*1024*1024*1024) }
+      it { is_expected.to run.with_params('1P').and_return(1024*1024*1024*1024*1024) }
+      it { is_expected.to run.with_params('1E').and_return(1024*1024*1024*1024*1024*1024) }
+      it { is_expected.to run.with_params('1.5e3M').and_return(1572864000) }
+
+      it { is_expected.to run.with_params('4k').and_return(4*1024) }
+      it { is_expected.to run.with_params('-4kB').and_return(4*-1024) }
+      it { is_expected.to run.with_params('4k').and_return(4*1024) }
+      it { is_expected.to run.with_params('4M').and_return(4*1024*1024) }
+      it { is_expected.to run.with_params('4G').and_return(4*1024*1024*1024) }
+      it { is_expected.to run.with_params('4T').and_return(4*1024*1024*1024*1024) }
+      it { is_expected.to run.with_params('4P').and_return(4*1024*1024*1024*1024*1024) }
+      it { is_expected.to run.with_params('4E').and_return(4*1024*1024*1024*1024*1024*1024) }
+
+      # these are so wrong
+      it { is_expected.to run.with_params('1.0001 k').and_return(1024) }
+      it { is_expected.to run.with_params('-1.0001 kB').and_return(-1024) }
+    end
+
+    describe 'with a unknown unit' do
+      it { is_expected.to run.with_params('1KB').and_raise_error(Puppet::ParseError, /Unknown prefix/) }
+      it { is_expected.to run.with_params('1K').and_raise_error(Puppet::ParseError, /Unknown prefix/) }
+      it { is_expected.to run.with_params('1mb').and_raise_error(Puppet::ParseError, /Unknown prefix/) }
+      it { is_expected.to run.with_params('1m').and_raise_error(Puppet::ParseError, /Unknown prefix/) }
+      it { is_expected.to run.with_params('1%').and_raise_error(Puppet::ParseError, /Unknown prefix/) }
+      it { is_expected.to run.with_params('1 p').and_raise_error(Puppet::ParseError, /Unknown prefix/) }
+    end
+  end
+
+  # these are so wrong
+  describe 'when passing random stuff' do
+    it { is_expected.to run.with_params('-1....1').and_return(-1) }
+    it { is_expected.to run.with_params('-1.e.e.e.1').and_return(-1) }
+    it { is_expected.to run.with_params('-1+1').and_return(-1) }
+    it { is_expected.to run.with_params('1-1').and_return(1) }
+    it { is_expected.to run.with_params('1 kaboom').and_return(1024) }
+    it { is_expected.to run.with_params('kaboom').and_return(0) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/try_get_value_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/try_get_value_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/try_get_value_spec.rb	(revision 30960)
@@ -0,0 +1,100 @@
+require 'spec_helper'
+
+describe 'try_get_value' do
+
+  let(:data) do
+    {
+        'a' => {
+            'g' => '2',
+            'e' => [
+                'f0',
+                'f1',
+                {
+                    'x' => {
+                        'y' => 'z'
+                    }
+                },
+                'f3',
+            ]
+        },
+        'b' => true,
+        'c' => false,
+        'd' => '1',
+    }
+  end
+
+  context 'single values' do
+    it 'should exist' do
+      is_expected.not_to eq(nil)
+    end
+
+    it 'should be able to return a single value' do
+      is_expected.to run.with_params('test').and_return('test')
+    end
+
+    it 'should use the default value if data is a single value and path is present' do
+      is_expected.to run.with_params('test', 'path', 'default').and_return('default')
+    end
+
+    it 'should return default if there is no data' do
+      is_expected.to run.with_params(nil, nil, 'default').and_return('default')
+    end
+
+    it 'should be able to use data structures as default values' do
+      is_expected.to run.with_params('test', 'path', data).and_return(data)
+    end
+  end
+
+  context 'structure values' do
+    it 'should be able to extracts a single hash value' do
+      is_expected.to run.with_params(data, 'd', 'default').and_return('1')
+    end
+
+    it 'should be able to extract a deeply nested hash value' do
+      is_expected.to run.with_params(data, 'a/g', 'default').and_return('2')
+    end
+
+    it 'should return the default value if the path is not found' do
+      is_expected.to run.with_params(data, 'missing', 'default').and_return('default')
+    end
+
+    it 'should return the default value if the path is too long' do
+      is_expected.to run.with_params(data, 'a/g/c/d', 'default').and_return('default')
+    end
+
+    it 'should support an array index in the path' do
+      is_expected.to run.with_params(data, 'a/e/1', 'default').and_return('f1')
+    end
+
+    it 'should return the default value if an array index is not a number' do
+      is_expected.to run.with_params(data, 'a/b/c', 'default').and_return('default')
+    end
+
+    it 'should return the default value if and index is out of array length' do
+      is_expected.to run.with_params(data, 'a/e/5', 'default').and_return('default')
+    end
+
+    it 'should be able to path though both arrays and hashes' do
+      is_expected.to run.with_params(data, 'a/e/2/x/y', 'default').and_return('z')
+    end
+
+    it 'should be able to return "true" value' do
+      is_expected.to run.with_params(data, 'b', 'default').and_return(true)
+      is_expected.to run.with_params(data, 'm', true).and_return(true)
+    end
+
+    it 'should be able to return "false" value' do
+      is_expected.to run.with_params(data, 'c', 'default').and_return(false)
+      is_expected.to run.with_params(data, 'm', false).and_return(false)
+    end
+
+    it 'should return "nil" if value is not found and no default value is provided' do
+      is_expected.to run.with_params(data, 'a/1').and_return(nil)
+    end
+
+    it 'should be able to use a custom path separator' do
+      is_expected.to run.with_params(data, 'a::g', 'default', '::').and_return('2')
+      is_expected.to run.with_params(data, 'a::c', 'default', '::').and_return('default')
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/type3x_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/type3x_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/type3x_spec.rb	(revision 30960)
@@ -0,0 +1,41 @@
+require 'spec_helper'
+
+describe 'type3x' do
+  it "should exist" do
+    expect(Puppet::Parser::Functions.function("type3x")).to eq("function_type3x")
+  end
+
+  it "should raise a ParseError if there is less than 1 arguments" do
+    expect { scope.function_type3x([]) }.to( raise_error(Puppet::ParseError))
+  end
+
+  it "should return string when given a string" do
+    result = scope.function_type3x(["aaabbbbcccc"])
+    expect(result).to(eq('string'))
+  end
+
+  it "should return array when given an array" do
+    result = scope.function_type3x([["aaabbbbcccc","asdf"]])
+    expect(result).to(eq('array'))
+  end
+
+  it "should return hash when given a hash" do
+    result = scope.function_type3x([{"a"=>1,"b"=>2}])
+    expect(result).to(eq('hash'))
+  end
+
+  it "should return integer when given an integer" do
+    result = scope.function_type3x(["1"])
+    expect(result).to(eq('integer'))
+  end
+
+  it "should return float when given a float" do
+    result = scope.function_type3x(["1.34"])
+    expect(result).to(eq('float'))
+  end
+
+  it "should return boolean when given a boolean" do
+    result = scope.function_type3x([true])
+    expect(result).to(eq('boolean'))
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/type_of_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/type_of_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/type_of_spec.rb	(revision 30960)
@@ -0,0 +1,25 @@
+require 'spec_helper'
+
+if ENV["FUTURE_PARSER"] == 'yes'
+  describe 'type_of' do
+    pending 'teach rspec-puppet to load future-only functions under 3.7.5' do
+      it { is_expected.not_to eq(nil) }
+    end
+  end
+end
+
+if Puppet.version.to_f >= 4.0
+  describe 'type_of' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(ArgumentError) }
+    it { is_expected.to run.with_params('', '').and_raise_error(ArgumentError) }
+
+    it 'gives the type of a string' do
+      expect(subject.call({}, 'hello world')).to be_kind_of(Puppet::Pops::Types::PStringType)
+    end
+
+    it 'gives the type of an integer' do
+      expect(subject.call({}, 5)).to be_kind_of(Puppet::Pops::Types::PIntegerType)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/type_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/type_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/type_spec.rb	(revision 30960)
@@ -0,0 +1,42 @@
+require 'spec_helper'
+
+describe 'type' do
+  it "should exist" do
+    expect(Puppet::Parser::Functions.function("type")).to eq("function_type")
+  end
+
+  it "should give a deprecation warning when called" do
+    scope.expects(:warning).with("type() DEPRECATED: This function will cease to function on Puppet 4; please use type3x() before upgrading to puppet 4 for backwards-compatibility, or migrate to the new parser's typing system.")
+    scope.function_type(["aoeu"])
+  end
+
+  it "should return string when given a string" do
+    result = scope.function_type(["aaabbbbcccc"])
+    expect(result).to(eq('string'))
+  end
+
+  it "should return array when given an array" do
+    result = scope.function_type([["aaabbbbcccc","asdf"]])
+    expect(result).to(eq('array'))
+  end
+
+  it "should return hash when given a hash" do
+    result = scope.function_type([{"a"=>1,"b"=>2}])
+    expect(result).to(eq('hash'))
+  end
+
+  it "should return integer when given an integer" do
+    result = scope.function_type(["1"])
+    expect(result).to(eq('integer'))
+  end
+
+  it "should return float when given a float" do
+    result = scope.function_type(["1.34"])
+    expect(result).to(eq('float'))
+  end
+
+  it "should return boolean when given a boolean" do
+    result = scope.function_type([true])
+    expect(result).to(eq('boolean'))
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/union_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/union_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/union_spec.rb	(revision 30960)
@@ -0,0 +1,24 @@
+require 'spec_helper'
+
+describe 'union' do
+  describe 'argument checking' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('one', []).and_raise_error(Puppet::ParseError, /Every parameter must be an array/) }
+    it { is_expected.to run.with_params([], 'two').and_raise_error(Puppet::ParseError, /Every parameter must be an array/) }
+    it { is_expected.to run.with_params({}, {}).and_raise_error(Puppet::ParseError, /Every parameter must be an array/) }
+  end
+
+  it { is_expected.to run.with_params([], []).and_return([]) }
+  it { is_expected.to run.with_params([], ['one']).and_return(['one']) }
+  it { is_expected.to run.with_params(['one'], []).and_return(['one']) }
+  it { is_expected.to run.with_params(['one'], ['one']).and_return(['one']) }
+  it { is_expected.to run.with_params(['one'], ['two']).and_return(['one', 'two']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], ['two', 'three']).and_return(['one', 'two', 'three']) }
+  it { is_expected.to run.with_params(['one', 'two', 'two', 'three'], ['two', 'three']).and_return(['one', 'two', 'three']) }
+  it { is_expected.to run.with_params(['one', 'two', 'three'], ['two', 'two', 'three']).and_return(['one', 'two', 'three']) }
+  it { is_expected.to run.with_params(['one', 'two'], ['two', 'three'], ['one', 'three']).and_return(['one', 'two', 'three']) }
+  it { is_expected.to run.with_params(['one', 'two'], ['three', 'four'], ['one', 'two', 'three'], ['four']).and_return(['one', 'two', 'three', 'four']) }
+  it 'should not confuse types' do is_expected.to run.with_params(['1', '2', '3'], [1, 2]).and_return(['1', '2', '3', 1, 2]) end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/unique_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/unique_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/unique_spec.rb	(revision 30960)
@@ -0,0 +1,27 @@
+require 'spec_helper'
+
+describe 'unique' do
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it {
+      pending("Current implementation ignores parameters after the first.")
+      is_expected.to run.with_params([], 'extra').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+    }
+    it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+    it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+    it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+  end
+
+  context 'when called with an array' do
+    it { is_expected.to run.with_params([]).and_return([]) }
+    it { is_expected.to run.with_params(['a']).and_return(['a']) }
+    it { is_expected.to run.with_params(['a', 'b', 'a']).and_return(['a', 'b']) }
+  end
+
+  context 'when called with a string' do
+    it { is_expected.to run.with_params('').and_return('') }
+    it { is_expected.to run.with_params('a').and_return('a') }
+    it { is_expected.to run.with_params('aaba').and_return('ab') }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/unix2dos_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/unix2dos_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/unix2dos_spec.rb	(revision 30960)
@@ -0,0 +1,40 @@
+require 'spec_helper'
+
+describe 'unix2dos' do
+  context 'Checking parameter validity' do
+    it { is_expected.not_to eq(nil) }
+    it do
+      is_expected.to run.with_params.and_raise_error(ArgumentError, /Wrong number of arguments/)
+    end
+    it do
+      is_expected.to run.with_params('one', 'two').and_raise_error(ArgumentError, /Wrong number of arguments/)
+    end
+    it do
+      is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError)
+    end
+    it do
+      is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError)
+    end
+    it do
+      is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError)
+    end
+  end
+
+  context 'Converting from unix to dos format' do
+    sample_text    = "Hello\nWorld\n"
+    desired_output = "Hello\r\nWorld\r\n"
+
+    it 'should output dos format' do
+      should run.with_params(sample_text).and_return(desired_output)
+    end
+  end
+
+  context 'Converting from dos to dos format' do
+    sample_text    = "Hello\r\nWorld\r\n"
+    desired_output = "Hello\r\nWorld\r\n"
+
+    it 'should output dos format' do
+      should run.with_params(sample_text).and_return(desired_output)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/upcase_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/upcase_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/upcase_spec.rb	(revision 30960)
@@ -0,0 +1,26 @@
+require 'spec_helper'
+
+describe 'upcase' do
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires an array, hash or object that responds to upcase/) }
+    it { is_expected.to run.with_params([1]).and_raise_error(Puppet::ParseError, /Requires an array, hash or object that responds to upcase/) }
+  end
+
+  describe 'normal string handling' do
+    it { is_expected.to run.with_params("abc").and_return("ABC") }
+    it { is_expected.to run.with_params("Abc").and_return("ABC") }
+    it { is_expected.to run.with_params("ABC").and_return("ABC") }
+  end
+
+  describe 'handling classes derived from String' do
+    it { is_expected.to run.with_params(AlsoString.new("ABC")).and_return("ABC") }
+  end
+
+  describe 'strings in arrays handling' do
+    it { is_expected.to run.with_params([]).and_return([]) }
+    it { is_expected.to run.with_params(["One", "twO"]).and_return(["ONE", "TWO"]) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/uriescape_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/uriescape_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/uriescape_spec.rb	(revision 30960)
@@ -0,0 +1,36 @@
+require 'spec_helper'
+
+describe 'uriescape' do
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it {
+      pending("Current implementation ignores parameters after the first.")
+      is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+    }
+    it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+    it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+    it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /Requires either array or string to work/) }
+  end
+
+  describe 'handling normal strings' do
+    it 'should call ruby\'s URI.escape function' do
+      URI.expects(:escape).with('uri_string').returns('escaped_uri_string').once
+      is_expected.to run.with_params('uri_string').and_return('escaped_uri_string') 
+    end
+  end
+
+  describe 'handling classes derived from String' do
+    it 'should call ruby\'s URI.escape function' do
+      uri_string = AlsoString.new('uri_string')
+      URI.expects(:escape).with(uri_string).returns('escaped_uri_string').once
+      is_expected.to run.with_params(uri_string).and_return("escaped_uri_string") 
+    end
+  end
+
+  describe 'strings in arrays handling' do
+    it { is_expected.to run.with_params([]).and_return([]) }
+    it { is_expected.to run.with_params(["one}", "two"]).and_return(["one%7D", "two"]) }
+    it { is_expected.to run.with_params(["one}", 1, true, {}, "two"]).and_return(["one%7D", 1, true, {}, "two"]) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_absolute_path_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_absolute_path_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_absolute_path_spec.rb	(revision 30960)
@@ -0,0 +1,73 @@
+require 'spec_helper'
+
+describe 'validate_absolute_path' do
+  after(:all) do
+    ENV.delete('STDLIB_LOG_DEPRECATIONS')
+  end
+
+  # Checking for deprecation warning
+  it 'should display a single deprecation' do
+    ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+    scope.expects(:warning).with(includes('This method is deprecated'))
+    is_expected.to run.with_params('c:/')
+  end
+
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  end
+
+  describe "valid paths handling" do
+    %w{
+      C:/
+      C:\\
+      C:\\WINDOWS\\System32
+      C:/windows/system32
+      X:/foo/bar
+      X:\\foo\\bar
+      \\\\host\\windows
+      //host/windows
+      /
+      /var/tmp
+      /var/opt/../lib/puppet
+    }.each do |path|
+      it { is_expected.to run.with_params(path) }
+      it { is_expected.to run.with_params(['/tmp', path]) }
+    end
+  end
+
+  describe 'invalid path handling' do
+    context 'garbage inputs' do
+      [
+        nil,
+        [ nil ],
+        [ nil, nil ],
+        { 'foo' => 'bar' },
+        { },
+        '',
+      ].each do |path|
+        it { is_expected.to run.with_params(path).and_raise_error(Puppet::ParseError, /is not an absolute path/) }
+        it { is_expected.to run.with_params([path]).and_raise_error(Puppet::ParseError, /is not an absolute path/) }
+        it { is_expected.to run.with_params(['/tmp', path]).and_raise_error(Puppet::ParseError, /is not an absolute path/) }
+      end
+    end
+
+    context 'relative paths' do
+      %w{
+        relative1
+        .
+        ..
+        ./foo
+        ../foo
+        etc/puppetlabs/puppet
+        opt/puppet/bin
+        relative\\windows
+      }.each do |path|
+        it { is_expected.to run.with_params(path).and_raise_error(Puppet::ParseError, /is not an absolute path/) }
+        it { is_expected.to run.with_params([path]).and_raise_error(Puppet::ParseError, /is not an absolute path/) }
+        it { is_expected.to run.with_params(['/tmp', path]).and_raise_error(Puppet::ParseError, /is not an absolute path/) }
+      end
+    end
+  end
+end
+
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_array_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_array_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_array_spec.rb	(revision 30960)
@@ -0,0 +1,37 @@
+require 'spec_helper'
+
+describe 'validate_array' do
+
+  describe 'signature validation' do
+    after(:all) do
+      ENV.delete('STDLIB_LOG_DEPRECATIONS')
+    end
+    it { is_expected.not_to eq(nil) }
+    # Checking for deprecation warning
+    it 'should display a single deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+      scope.expects(:warning).with(includes('This method is deprecated'))
+      is_expected.to run.with_params([])
+    end
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+    describe 'valid inputs' do
+      it { is_expected.to run.with_params([]) }
+      it { is_expected.to run.with_params(['one']) }
+      it { is_expected.to run.with_params([], ['two']) }
+      it { is_expected.to run.with_params(['one'], ['two']) }
+    end
+
+    describe 'invalid inputs' do
+      it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /is not an Array/) }
+      it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /is not an Array/) }
+      it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /is not an Array/) }
+      it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /is not an Array/) }
+      it { is_expected.to run.with_params([], {}).and_raise_error(Puppet::ParseError, /is not an Array/) }
+      it { is_expected.to run.with_params([], 1).and_raise_error(Puppet::ParseError, /is not an Array/) }
+      it { is_expected.to run.with_params([], true).and_raise_error(Puppet::ParseError, /is not an Array/) }
+      it { is_expected.to run.with_params([], 'one').and_raise_error(Puppet::ParseError, /is not an Array/) }
+    end
+  end
+end
+
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_augeas_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_augeas_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_augeas_spec.rb	(revision 30960)
@@ -0,0 +1,75 @@
+require 'spec_helper'
+
+describe 'validate_augeas' do
+  unless Puppet.features.augeas?
+    skip "ruby-augeas not installed"
+  else
+    describe 'signature validation' do
+      it { is_expected.not_to eq(nil) }
+      it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+      it { is_expected.to run.with_params('').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+      it { is_expected.to run.with_params('', '', [], '', 'extra').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+      it { is_expected.to run.with_params('one', 'one', 'MSG to User', '4th arg').and_raise_error(NoMethodError) }
+    end
+
+    describe 'valid inputs' do
+      inputs = [
+        [ "root:x:0:0:root:/root:/bin/bash\n", 'Passwd.lns' ],
+        [ "proc /proc   proc    nodev,noexec,nosuid     0       0\n", 'Fstab.lns'],
+      ]
+
+      inputs.each do |input|
+        it { is_expected.to run.with_params(*input) }
+      end
+    end
+
+    describe 'valid inputs which fail augeas validation' do
+      # The intent here is to make sure valid inputs raise exceptions when they
+      # don't specify an error message to display.  This is the behvior in
+      # 2.2.x and prior.
+      inputs = [
+        [ "root:x:0:0:root\n", 'Passwd.lns' ],
+        [ "127.0.1.1\n", 'Hosts.lns' ],
+      ]
+
+      inputs.each do |input|
+        it { is_expected.to run.with_params(*input).and_raise_error(Puppet::ParseError, /validate_augeas.*?matched less than it should/) }
+      end
+    end
+
+    describe "when specifying nice error messages" do
+      # The intent here is to make sure the function returns the 4th argument
+      # in the exception thrown
+      inputs = [
+        [ "root:x:0:0:root\n", 'Passwd.lns', [], 'Failed to validate passwd content' ],
+        [ "127.0.1.1\n", 'Hosts.lns', [], 'Wrong hosts content' ],
+      ]
+
+      inputs.each do |input|
+        it { is_expected.to run.with_params(*input).and_raise_error(Puppet::ParseError, /#{input[3]}/) }
+      end
+    end
+
+    describe "matching additional tests" do
+      inputs = [
+        [ "root:x:0:0:root:/root:/bin/bash\n", 'Passwd.lns', ['$file/foobar']],
+        [ "root:x:0:0:root:/root:/bin/bash\n", 'Passwd.lns', ['$file/root/shell[.="/bin/sh"]', 'foobar']],
+      ]
+
+      inputs.each do |input|
+        it { is_expected.to run.with_params(*input) }
+      end
+    end
+
+    describe "failing additional tests" do
+      inputs = [
+        [ "foobar:x:0:0:root:/root:/bin/bash\n", 'Passwd.lns', ['$file/foobar']],
+        [ "root:x:0:0:root:/root:/bin/sh\n", 'Passwd.lns', ['$file/root/shell[.="/bin/sh"]', 'foobar']],
+      ]
+
+      inputs.each do |input|
+        it { is_expected.to run.with_params(*input).and_raise_error(Puppet::ParseError, /testing path/) }
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_bool_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_bool_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_bool_spec.rb	(revision 30960)
@@ -0,0 +1,36 @@
+require 'spec_helper'
+
+describe 'validate_bool' do
+  after(:all) do
+    ENV.delete('STDLIB_LOG_DEPRECATIONS')
+  end
+
+  # Checking for deprecation warning
+  it 'should display a single deprecation' do
+    ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+    scope.expects(:warning).with(includes('This method is deprecated'))
+    is_expected.to run.with_params(true)
+  end
+
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  end
+
+  describe 'acceptable values' do
+    it { is_expected.to run.with_params(true) }
+    it { is_expected.to run.with_params(false) }
+    it { is_expected.to run.with_params(true, false, false, true) }
+  end
+
+  describe 'validation failures' do
+    it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /is not a boolean/) }
+    it { is_expected.to run.with_params(true, 'one').and_raise_error(Puppet::ParseError, /is not a boolean/) }
+    it { is_expected.to run.with_params('one', false).and_raise_error(Puppet::ParseError, /is not a boolean/) }
+    it { is_expected.to run.with_params("true").and_raise_error(Puppet::ParseError, /is not a boolean/) }
+    it { is_expected.to run.with_params("false").and_raise_error(Puppet::ParseError, /is not a boolean/) }
+    it { is_expected.to run.with_params(true, "false").and_raise_error(Puppet::ParseError, /is not a boolean/) }
+    it { is_expected.to run.with_params("true", false).and_raise_error(Puppet::ParseError, /is not a boolean/) }
+    it { is_expected.to run.with_params("true", false, false, false, false, false).and_raise_error(Puppet::ParseError, /is not a boolean/) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_cmd_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_cmd_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_cmd_spec.rb	(revision 30960)
@@ -0,0 +1,35 @@
+require 'spec_helper'
+
+describe 'validate_cmd' do
+  let(:touch) { File.exists?('/usr/bin/touch') ? '/usr/bin/touch' : '/bin/touch' }
+
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('', '', '', 'extra').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it {
+      pending('should implement stricter type checking')
+      is_expected.to run.with_params([], '', '').and_raise_error(Puppet::ParseError, /content must be a string/)
+    }
+    it {
+      pending('should implement stricter type checking')
+      is_expected.to run.with_params('', [], '').and_raise_error(Puppet::ParseError, /checkscript must be a string/)
+    }
+    it {
+      pending('should implement stricter type checking')
+      is_expected.to run.with_params('', '', []).and_raise_error(Puppet::ParseError, /custom error message must be a string/)
+    }
+  end
+
+  context 'when validation fails' do
+    context 'with % placeholder' do
+      it { is_expected.to run.with_params('', "#{touch} % /no/such/file").and_raise_error(Puppet::ParseError, /Execution of '#{touch} \S+ \/no\/such\/file' returned 1:.*(cannot touch|o such file or)/) }
+      it { is_expected.to run.with_params('', "#{touch} % /no/such/file", 'custom error').and_raise_error(Puppet::ParseError, /custom error/) }
+    end
+    context 'without % placeholder' do
+      it { is_expected.to run.with_params('', "#{touch} /no/such/file").and_raise_error(Puppet::ParseError, /Execution of '#{touch} \/no\/such\/file \S+' returned 1:.*(cannot touch|o such file or)/) }
+      it { is_expected.to run.with_params('', "#{touch} /no/such/file", 'custom error').and_raise_error(Puppet::ParseError, /custom error/) }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_email_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_email_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_email_address_spec.rb	(revision 30960)
@@ -0,0 +1,23 @@
+require 'spec_helper'
+
+describe 'validate_email_address' do
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  end
+
+  describe 'valid inputs' do
+    it { is_expected.to run.with_params('bob@gmail.com') }
+    it { is_expected.to run.with_params('alice+puppetlabs.com@gmail.com') }
+  end
+
+  describe 'invalid inputs' do
+    it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /is not a valid email/) }
+    it { is_expected.to run.with_params('bob@gmail.com', {}).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('bob@gmail.com', true).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('bob@gmail.com', 'one').and_raise_error(Puppet::ParseError, /is not a valid email/) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_hash_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_hash_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_hash_spec.rb	(revision 30960)
@@ -0,0 +1,38 @@
+require 'spec_helper'
+
+describe 'validate_hash' do
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+    describe 'check for deprecation warning' do
+      after(:all) do
+        ENV.delete('STDLIB_LOG_DEPRECATIONS')
+      end
+      # Checking for deprecation warning
+      it 'should display a single deprecation' do
+        ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+        scope.expects(:warning).with(includes('This method is deprecated'))
+        is_expected.to run.with_params({'key' => 'value'})
+      end
+    end
+
+    describe 'valid inputs' do
+      it { is_expected.to run.with_params({}) }
+      it { is_expected.to run.with_params({'key' => 'value'}) }
+      it { is_expected.to run.with_params({}, {'key' => 'value'}) }
+      it { is_expected.to run.with_params({'key1' => 'value1'}, {'key2' => 'value2'}) }
+    end
+
+    describe 'invalid inputs' do
+      it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError, /is not a Hash/) }
+      it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /is not a Hash/) }
+      it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /is not a Hash/) }
+      it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /is not a Hash/) }
+      it { is_expected.to run.with_params({}, []).and_raise_error(Puppet::ParseError, /is not a Hash/) }
+      it { is_expected.to run.with_params({}, 1).and_raise_error(Puppet::ParseError, /is not a Hash/) }
+      it { is_expected.to run.with_params({}, true).and_raise_error(Puppet::ParseError, /is not a Hash/) }
+      it { is_expected.to run.with_params({}, 'one').and_raise_error(Puppet::ParseError, /is not a Hash/) }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_integer_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_integer_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_integer_spec.rb	(revision 30960)
@@ -0,0 +1,101 @@
+require 'spec_helper'
+
+describe 'validate_integer' do
+  after(:all) do
+    ENV.delete('STDLIB_LOG_DEPRECATIONS')
+  end
+
+  # Checking for deprecation warning
+  it 'should display a single deprecation' do
+    ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+    scope.expects(:warning).with(includes('This method is deprecated'))
+    is_expected.to run.with_params(3)
+  end
+
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params(1, 2, 3, 4).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+    [ true, 'true', false, 'false', 'iAmAString', '1test', '1 test', 'test 1', 'test 1 test', 7.0, -7.0, {}, { 'key' => 'value' }, { 1=> 2 }, '', :undef , 'x'].each do |invalid|
+      it { is_expected.to run.with_params(invalid).and_raise_error(Puppet::ParseError, /to be an Integer/) }
+      it { is_expected.to run.with_params(invalid, 10).and_raise_error(Puppet::ParseError, /to be an Integer/) }
+      it { is_expected.to run.with_params(invalid, 10, -10).and_raise_error(Puppet::ParseError, /to be an Integer/) }
+      it { is_expected.to run.with_params([0, 1, 2, invalid, 3, 4], 10, -10).and_raise_error(Puppet::ParseError, /to be an Integer/) }
+    end
+
+    context 'when running on modern rubies', :unless => RUBY_VERSION == '1.8.7' do
+      it { is_expected.to run.with_params([0, 1, 2, {1=>2}, 3, 4], 10, -10).and_raise_error(Puppet::ParseError, /to be an Integer/) }
+    end
+
+    context 'when running on ruby, which munges hashes weirdly', :if => RUBY_VERSION == '1.8.7' do
+      it { is_expected.to run.with_params([0, 1, 2, {1=>2}, 3, 4], 10, -10).and_raise_error(Puppet::ParseError) }
+      it { is_expected.to run.with_params([0, 1, 2, {0=>2}, 3, 4], 10, -10).and_raise_error(Puppet::ParseError) }
+    end
+
+    it { is_expected.to run.with_params(1, '').and_raise_error(Puppet::ParseError, /to be unset or an Integer/) }
+    it { is_expected.to run.with_params(1, 2, '').and_raise_error(Puppet::ParseError, /to be unset or an Integer/) }
+    it { is_expected.to run.with_params(1, 2, 3).and_raise_error(Puppet::ParseError, /second argument to be larger than third argument/) }
+  end
+
+  context 'with no range constraints' do
+    it { is_expected.to run.with_params(1) }
+    it { is_expected.to run.with_params(-1) }
+    it { is_expected.to run.with_params('1') }
+    it { is_expected.to run.with_params('-1') }
+    it { is_expected.to run.with_params([1, 2, 3, 4]) }
+    it { is_expected.to run.with_params([1, '2', '3', 4]) }
+  end
+
+  context "with a maximum limit of 10" do
+    describe 'rejects numbers greater than the limit' do
+      it { is_expected.to run.with_params(11, 10).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+      it { is_expected.to run.with_params(100, 10).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+      it { is_expected.to run.with_params(2**65, 10).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+      it { is_expected.to run.with_params([1,2,10,100], 10).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+    end
+
+    describe 'accepts numbers less or equal to the limit' do
+      it { is_expected.to run.with_params(10, 10) }
+      it { is_expected.to run.with_params(1, 10) }
+      it { is_expected.to run.with_params(-1, 10) }
+      it { is_expected.to run.with_params('1', 10) }
+      it { is_expected.to run.with_params('-1', 10) }
+      it { is_expected.to run.with_params([1, 2, 3, 4], 10) }
+      it { is_expected.to run.with_params([1, '2', '3', 4], 10) }
+    end
+
+    context "with a minimum limit of -10" do
+      describe 'rejects numbers greater than the upper limit' do
+        it { is_expected.to run.with_params(11, 10, -10).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+        it { is_expected.to run.with_params(100, 10, -10).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+        it { is_expected.to run.with_params(2**65, 10, -10).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+        it { is_expected.to run.with_params([1,2,10,100], 10, -10).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+      end
+
+      describe 'rejects numbers smaller than the lower limit' do
+        it { is_expected.to run.with_params(-11, 10, -10).and_raise_error(Puppet::ParseError, /to be greater or equal/) }
+        it { is_expected.to run.with_params(-100, 10, -10).and_raise_error(Puppet::ParseError, /to be greater or equal/) }
+        it { is_expected.to run.with_params(-2**65, 10, -10).and_raise_error(Puppet::ParseError, /to be greater or equal/) }
+        it { is_expected.to run.with_params([-10, 1,2,10,-100], 10, -10).and_raise_error(Puppet::ParseError, /to be greater or equal/) }
+      end
+
+      describe 'accepts numbers between and including the limits' do
+        it { is_expected.to run.with_params(10, 10, -10) }
+        it { is_expected.to run.with_params(-10, 10, -10) }
+        it { is_expected.to run.with_params(1, 10, -10) }
+        it { is_expected.to run.with_params(-1, 10, -10) }
+        it { is_expected.to run.with_params('1', 10, -10) }
+        it { is_expected.to run.with_params('-1', 10, -10) }
+        it { is_expected.to run.with_params([1, 2, 3, 4], 10, -10) }
+        it { is_expected.to run.with_params([1, '2', '3', 4], 10, -10) }
+      end
+    end
+  end
+
+  it { is_expected.to run.with_params(10, 10, 10) }
+
+  describe 'empty upper limit is interpreted as infinity' do
+    it { is_expected.to run.with_params(11, '', 10) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_ip_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_ip_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_ip_address_spec.rb	(revision 30960)
@@ -0,0 +1,65 @@
+require 'spec_helper'
+
+describe 'validate_ip_address' do
+
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  end
+
+  describe 'valid inputs' do
+    it { is_expected.to run.with_params('0.0.0.0') }
+    it { is_expected.to run.with_params('8.8.8.8') }
+    it { is_expected.to run.with_params('127.0.0.1') }
+    it { is_expected.to run.with_params('10.10.10.10') }
+    it { is_expected.to run.with_params('194.232.104.150') }
+    it { is_expected.to run.with_params('244.24.24.24') }
+    it { is_expected.to run.with_params('255.255.255.255') }
+    it { is_expected.to run.with_params('1.2.3.4', '5.6.7.8') }
+    it { is_expected.to run.with_params('3ffe:0505:0002::') }
+    it { is_expected.to run.with_params('3ffe:0505:0002::', '3ffe:0505:0002::2') }
+    it { is_expected.to run.with_params('::1/64') }
+    it { is_expected.to run.with_params('fe80::a00:27ff:fe94:44d6/64') }
+
+    context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do
+      after(:all) do
+        ENV.delete('STDLIB_LOG_DEPRECATIONS')
+      end
+      # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
+      it 'should display a single deprecation' do
+        ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+        scope.expects(:warning).with(includes('This method is deprecated'))
+        is_expected.to run.with_params('1.2.3.4')
+      end
+      it 'should display no warning for deprecation' do
+        ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
+        scope.expects(:warning).with(includes('This method is deprecated')).never
+        is_expected.to run.with_params('1.2.3.4')
+      end
+    end
+    
+    context 'with netmasks' do
+      it { is_expected.to run.with_params('8.8.8.8/0') }
+      it { is_expected.to run.with_params('8.8.8.8/16') }
+      it { is_expected.to run.with_params('8.8.8.8/32') }
+      it { is_expected.to run.with_params('8.8.8.8/255.255.0.0') }
+    end
+  end
+
+  describe 'invalid inputs' do
+    it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /is not a valid IP/) }
+    it { is_expected.to run.with_params('0.0.0').and_raise_error(Puppet::ParseError, /is not a valid IP/) }
+    it { is_expected.to run.with_params('0.0.0.256').and_raise_error(Puppet::ParseError, /is not a valid IP/) }
+    it { is_expected.to run.with_params('0.0.0.0.0').and_raise_error(Puppet::ParseError, /is not a valid IP/) }
+    it { is_expected.to run.with_params('1.2.3.4', {}).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('1.2.3.4', 1).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('1.2.3.4', true).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('1.2.3.4', 'one').and_raise_error(Puppet::ParseError, /is not a valid IP/) }
+    it { is_expected.to run.with_params('::1', {}).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('::1', true).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('::1', 'one').and_raise_error(Puppet::ParseError, /is not a valid IP/) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_ipv4_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_ipv4_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_ipv4_address_spec.rb	(revision 30960)
@@ -0,0 +1,58 @@
+require 'spec_helper'
+
+describe 'validate_ipv4_address' do
+
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  end
+
+  context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do
+    after(:all) do
+      ENV.delete('STDLIB_LOG_DEPRECATIONS')
+    end
+    # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
+    it 'should display a single deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+      scope.expects(:warning).with(includes('This method is deprecated'))
+      is_expected.to run.with_params('1.2.3.4')
+    end
+    it 'should display no warning for deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
+      scope.expects(:warning).with(includes('This method is deprecated')).never
+      is_expected.to run.with_params('1.2.3.4')
+    end
+  end 
+
+  describe 'valid inputs' do
+    it { is_expected.to run.with_params('0.0.0.0') }
+    it { is_expected.to run.with_params('8.8.8.8') }
+    it { is_expected.to run.with_params('127.0.0.1') }
+    it { is_expected.to run.with_params('10.10.10.10') }
+    it { is_expected.to run.with_params('194.232.104.150') }
+    it { is_expected.to run.with_params('244.24.24.24') }
+    it { is_expected.to run.with_params('255.255.255.255') }
+    it { is_expected.to run.with_params('1.2.3.4', '5.6.7.8') }
+    context 'with netmasks' do
+      it { is_expected.to run.with_params('8.8.8.8/0') }
+      it { is_expected.to run.with_params('8.8.8.8/16') }
+      it { is_expected.to run.with_params('8.8.8.8/32') }
+      it { is_expected.to run.with_params('8.8.8.8/255.255.0.0') }
+    end
+  end
+
+  describe 'invalid inputs' do
+    it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /is not a valid IPv4/) }
+    it { is_expected.to run.with_params('0.0.0').and_raise_error(Puppet::ParseError, /is not a valid IPv4/) }
+    it { is_expected.to run.with_params('0.0.0.256').and_raise_error(Puppet::ParseError, /is not a valid IPv4/) }
+    it { is_expected.to run.with_params('0.0.0.0.0').and_raise_error(Puppet::ParseError, /is not a valid IPv4/) }
+    it { is_expected.to run.with_params('affe::beef').and_raise_error(Puppet::ParseError, /is not a valid IPv4/) }
+    it { is_expected.to run.with_params('1.2.3.4', {}).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('1.2.3.4', 1).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('1.2.3.4', true).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('1.2.3.4', 'one').and_raise_error(Puppet::ParseError, /is not a valid IPv4/) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_ipv6_address_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_ipv6_address_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_ipv6_address_spec.rb	(revision 30960)
@@ -0,0 +1,50 @@
+require 'spec_helper'
+
+describe 'validate_ipv6_address' do
+  
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  end
+
+  context 'Checking for deprecation warning', if: Puppet.version.to_f < 4.0 do
+    after(:all) do
+      ENV.delete('STDLIB_LOG_DEPRECATIONS')
+    end
+    # Checking for deprecation warning, which should only be provoked when the env variable for it is set.
+    it 'should display a single deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+      scope.expects(:warning).with(includes('This method is deprecated'))
+      is_expected.to run.with_params('3ffe:0505:0002::')
+    end
+    it 'should display no warning for deprecation' do
+      ENV['STDLIB_LOG_DEPRECATIONS'] = "false"
+      scope.expects(:warning).with(includes('This method is deprecated')).never
+      is_expected.to run.with_params('3ffe:0505:0002::')
+    end
+  end 
+
+  describe 'valid inputs' do
+    it { is_expected.to run.with_params('3ffe:0505:0002::') }
+    it { is_expected.to run.with_params('3ffe:0505:0002::', '3ffe:0505:0002::2') }
+    it { is_expected.to run.with_params('::1/64') }
+    it { is_expected.to run.with_params('fe80::a00:27ff:fe94:44d6/64') }
+  end
+
+  describe 'invalid inputs' do
+    it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /is not a valid IPv6/) }
+    it { is_expected.to run.with_params('0.0.0').and_raise_error(Puppet::ParseError, /is not a valid IPv6/) }
+    it { is_expected.to run.with_params('0.0.0.256').and_raise_error(Puppet::ParseError, /is not a valid IPv6/) }
+    it { is_expected.to run.with_params('0.0.0.0.0').and_raise_error(Puppet::ParseError, /is not a valid IPv6/) }
+    it { is_expected.to run.with_params('affe:beef').and_raise_error(Puppet::ParseError, /is not a valid IPv6/) }
+    it { is_expected.to run.with_params('::1', {}).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('::1', true).and_raise_error(Puppet::ParseError, /is not a string/) }
+    it { is_expected.to run.with_params('::1', 'one').and_raise_error(Puppet::ParseError, /is not a valid IPv6/) }
+    context 'unless running on ruby 1.8.7', :if => RUBY_VERSION != '1.8.7' do
+      it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /is not a string/) }
+      it { is_expected.to run.with_params('::1', 1).and_raise_error(Puppet::ParseError, /is not a string/) }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_legacy_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_legacy_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_legacy_spec.rb	(revision 30960)
@@ -0,0 +1,68 @@
+require 'spec_helper'
+
+if Puppet.version.to_f >= 4.0
+  describe 'validate_legacy' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params.and_raise_error(ArgumentError) }
+
+    describe 'when passing the type assertion and passing the previous validation' do
+      before do
+        scope.expects(:function_validate_foo).with([5]).once
+        Puppet.expects(:notice).never
+      end
+      it 'passes without notice' do
+        is_expected.to run.with_params('Integer', 'validate_foo', 5)
+      end
+    end
+
+    describe 'when passing the type assertion and failing the previous validation' do
+      before do
+        scope.expects(:function_validate_foo).with([5]).raises(Puppet::ParseError, 'foo').once
+        Puppet.expects(:notice).with(includes('Accepting previously invalid value for target type'))
+      end
+      it 'passes with a notice about newly accepted value' do
+        is_expected.to run.with_params('Integer', 'validate_foo', 5)
+      end
+    end
+
+    describe 'when failing the type assertion and passing the previous validation' do
+      before do
+        scope.expects(:function_validate_foo).with(['5']).once
+        subject.func.expects(:call_function).with('deprecation', 'validate_legacy', includes('expected an Integer value')).once
+      end
+      it 'passes with a deprecation message' do
+        is_expected.to run.with_params('Integer', 'validate_foo', '5')
+      end
+    end
+
+    describe 'when failing the type assertion and failing the previous validation' do
+      before do
+        scope.expects(:function_validate_foo).with(['5']).raises(Puppet::ParseError, 'foo').once
+        subject.func.expects(:call_function).with('fail', includes('expected an Integer value')).once
+      end
+      it 'fails with a helpful message' do
+        is_expected.to run.with_params('Integer', 'validate_foo', '5')
+      end
+    end
+
+    describe 'when passing in undef' do
+      before do
+        scope.expects(:function_validate_foo).with([:undef]).once
+        Puppet.expects(:notice).never
+      end
+      it 'works' do
+        is_expected.to run.with_params('Optional[Integer]', 'validate_foo', :undef)
+      end
+    end
+
+    describe 'when passing in multiple arguments' do
+      before do
+        scope.expects(:function_validate_foo).with([:undef, 1, 'foo']).once
+        Puppet.expects(:notice).never
+      end
+      it 'passes with a deprecation message' do
+        is_expected.to run.with_params('Optional[Integer]', 'validate_foo', :undef, 1, 'foo')
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_numeric_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_numeric_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_numeric_spec.rb	(revision 30960)
@@ -0,0 +1,100 @@
+require 'spec_helper'
+
+describe 'validate_numeric' do
+  after(:all) do
+    ENV.delete('STDLIB_LOG_DEPRECATIONS')
+  end
+  
+  # Checking for deprecation warning
+  it 'should display a single deprecation' do
+    ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+    scope.expects(:warning).with(includes('This method is deprecated'))
+    is_expected.to run.with_params(3)
+  end
+
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params(1, 2, 3, 4).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+    [ true, 'true', false, 'false', 'iAmAString', '1test', '1 test', 'test 1', 'test 1 test', {}, { 'key' => 'value' }, { 1=> 2 }, '', :undef , 'x'].each do |invalid|
+      it { is_expected.to run.with_params(invalid).and_raise_error(Puppet::ParseError, /to be a Numeric/) }
+      it { is_expected.to run.with_params(invalid, 10.0).and_raise_error(Puppet::ParseError, /to be a Numeric/) }
+      it { is_expected.to run.with_params(invalid, 10.0, -10.0).and_raise_error(Puppet::ParseError, /to be a Numeric/) }
+    end
+
+    context 'when running on modern rubies', :unless => RUBY_VERSION == '1.8.7' do
+      it { is_expected.to run.with_params([0, 1, 2, {1=>2}, 3, 4], 10, -10).and_raise_error(Puppet::ParseError, /to be a Numeric/) }
+    end
+
+    context 'when running on ruby, which munges hashes weirdly', :if => RUBY_VERSION == '1.8.7' do
+      it { is_expected.to run.with_params([0, 1, 2, {1=>2}, 3, 4], 10, -10).and_raise_error(Puppet::ParseError) }
+      it { is_expected.to run.with_params([0, 1, 2, {0=>2}, 3, 4], 10, -10).and_raise_error(Puppet::ParseError) }
+    end
+
+    it { is_expected.to run.with_params(1, '').and_raise_error(Puppet::ParseError, /to be unset or a Numeric/) }
+    it { is_expected.to run.with_params(1, 2, '').and_raise_error(Puppet::ParseError, /to be unset or a Numeric/) }
+    it { is_expected.to run.with_params(1, 2, 3).and_raise_error(Puppet::ParseError, /second argument to be larger than third argument/) }
+  end
+
+  context 'with no range constraints' do
+    it { is_expected.to run.with_params(1) }
+    it { is_expected.to run.with_params(-1) }
+    it { is_expected.to run.with_params('1') }
+    it { is_expected.to run.with_params('-1') }
+    it { is_expected.to run.with_params([1, 2, 3, 4]) }
+    it { is_expected.to run.with_params([1, '2', '3', 4]) }
+  end
+
+  context "with a maximum limit of 10.0" do
+    describe 'rejects numbers greater than the limit' do
+      it { is_expected.to run.with_params(11, 10.0).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+      it { is_expected.to run.with_params(100, 10.0).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+      it { is_expected.to run.with_params(2**65, 10.0).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+      it { is_expected.to run.with_params([1,2,10.0,100], 10.0).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+    end
+
+    describe 'accepts numbers less or equal to the limit' do
+      it { is_expected.to run.with_params(10.0, 10.0) }
+      it { is_expected.to run.with_params(1, 10.0) }
+      it { is_expected.to run.with_params(-1, 10.0) }
+      it { is_expected.to run.with_params('1', 10.0) }
+      it { is_expected.to run.with_params('-1', 10.0) }
+      it { is_expected.to run.with_params([1, 2, 3, 4], 10.0) }
+      it { is_expected.to run.with_params([1, '2', '3', 4], 10.0) }
+    end
+
+    context "with a minimum limit of -10.0" do
+      describe 'rejects numbers greater than the upper limit' do
+        it { is_expected.to run.with_params(11, 10.0, -10.0).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+        it { is_expected.to run.with_params(100, 10.0, -10.0).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+        it { is_expected.to run.with_params(2**65, 10.0, -10.0).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+        it { is_expected.to run.with_params([1,2,10.0,100], 10.0, -10.0).and_raise_error(Puppet::ParseError, /to be smaller or equal/) }
+      end
+
+      describe 'rejects numbers smaller than the lower limit' do
+        it { is_expected.to run.with_params(-11, 10.0, -10.0).and_raise_error(Puppet::ParseError, /to be greater or equal/) }
+        it { is_expected.to run.with_params(-100, 10.0, -10.0).and_raise_error(Puppet::ParseError, /to be greater or equal/) }
+        it { is_expected.to run.with_params(-2**65, 10.0, -10.0).and_raise_error(Puppet::ParseError, /to be greater or equal/) }
+        it { is_expected.to run.with_params([-10.0, 1,2,10.0,-100], 10.0, -10.0).and_raise_error(Puppet::ParseError, /to be greater or equal/) }
+      end
+
+      describe 'accepts numbers between and including the limits' do
+        it { is_expected.to run.with_params(10.0, 10.0, -10.0) }
+        it { is_expected.to run.with_params(-10.0, 10.0, -10.0) }
+        it { is_expected.to run.with_params(1, 10.0, -10.0) }
+        it { is_expected.to run.with_params(-1, 10.0, -10.0) }
+        it { is_expected.to run.with_params('1', 10.0, -10.0) }
+        it { is_expected.to run.with_params('-1', 10.0, -10.0) }
+        it { is_expected.to run.with_params([1, 2, 3, 4], 10.0, -10.0) }
+        it { is_expected.to run.with_params([1, '2', '3', 4], 10.0, -10.0) }
+      end
+    end
+  end
+
+  it { is_expected.to run.with_params(10.0, 10.0, 10.0) }
+
+  describe 'empty upper limit is interpreted as infinity' do
+    it { is_expected.to run.with_params(11, '', 10.0) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_re_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_re_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_re_spec.rb	(revision 30960)
@@ -0,0 +1,56 @@
+require 'spec_helper'
+
+describe 'validate_re' do
+  after(:all) do
+    ENV.delete('STDLIB_LOG_DEPRECATIONS')
+  end
+
+  # Checking for deprecation warning
+  it 'should display a single deprecation' do
+    ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+    scope.expects(:warning).with(includes('This method is deprecated'))
+    is_expected.to run.with_params('', '')
+  end
+
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('', '', '', 'extra').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+    describe 'valid inputs' do
+      it { is_expected.to run.with_params('', '') }
+      it { is_expected.to run.with_params('', ['']) }
+      it { is_expected.to run.with_params('', [''], 'custom error') }
+      it { is_expected.to run.with_params('one', '^one') }
+      it { is_expected.to run.with_params('one', [ '^one', '^two' ]) }
+      it { is_expected.to run.with_params('one', [ '^one', '^two' ], 'custom error') }
+    end
+
+    describe 'invalid inputs' do
+      it { is_expected.to run.with_params('', []).and_raise_error(Puppet::ParseError, /does not match/) }
+      it { is_expected.to run.with_params('one', 'two').and_raise_error(Puppet::ParseError, /does not match/) }
+      it { is_expected.to run.with_params('', 'two').and_raise_error(Puppet::ParseError, /does not match/) }
+      it { is_expected.to run.with_params('', ['two']).and_raise_error(Puppet::ParseError, /does not match/) }
+      it { is_expected.to run.with_params('', ['two'], 'custom error').and_raise_error(Puppet::ParseError, /custom error/) }
+      it { is_expected.to run.with_params('notone', '^one').and_raise_error(Puppet::ParseError, /does not match/) }
+      it { is_expected.to run.with_params('notone', [ '^one', '^two' ]).and_raise_error(Puppet::ParseError, /does not match/) }
+      it { is_expected.to run.with_params('notone', [ '^one', '^two' ], 'custom error').and_raise_error(Puppet::ParseError, /custom error/) }
+
+      describe 'non-string inputs' do
+        [
+          1,             # Fixnum
+          3.14,          # Float
+          nil,           # NilClass
+          true,          # TrueClass
+          false,         # FalseClass
+          ["10"],        # Array
+          :key,          # Symbol
+          {:key=>"val"}, # Hash
+        ].each do |input|
+          it { is_expected.to run.with_params(input, '.*').and_raise_error(Puppet::ParseError, /needs to be a String/) }
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_slength_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_slength_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_slength_spec.rb	(revision 30960)
@@ -0,0 +1,72 @@
+require 'spec_helper'
+
+describe 'validate_slength' do
+  after(:all) do
+    ENV.delete('STDLIB_LOG_DEPRECATIONS')
+  end
+
+  # Checking for deprecation warning
+  it 'should display a single deprecation' do
+    ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+    scope.expects(:warning).with(includes('This method is deprecated'))
+    is_expected.to run.with_params('1234567890', 10)
+  end
+  
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('', 2, 3, 'extra').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params('', '').and_raise_error(Puppet::ParseError, /second argument to be a positive Numeric/) }
+    it { is_expected.to run.with_params('', -1).and_raise_error(Puppet::ParseError, /second argument to be a positive Numeric/) }
+    it { is_expected.to run.with_params('', 1, '').and_raise_error(Puppet::ParseError, /third argument to be unset or a positive Numeric/) }
+    it { is_expected.to run.with_params('', 1, -1).and_raise_error(Puppet::ParseError, /third argument to be unset or a positive Numeric/) }
+    it { is_expected.to run.with_params('', 1, 2).and_raise_error(Puppet::ParseError, /argument to be equal to or larger than third argument/) }
+  end
+
+  context "with a maximum length of 10" do
+    describe 'rejects strings longer than the limit' do
+      it { is_expected.to run.with_params('1234567890a', 10).and_raise_error(Puppet::ParseError, /Expected length/) }
+      it { is_expected.to run.with_params('1234567890abcdef', 10).and_raise_error(Puppet::ParseError, /Expected length/) }
+      it { is_expected.to run.with_params([ 'one', '1234567890abcdef' ], 10).and_raise_error(Puppet::ParseError, /Expected length/) }
+    end
+
+    describe 'accepts strings shorter or equal to the limit' do
+      it { is_expected.to run.with_params('1234567890', 10) }
+      it { is_expected.to run.with_params('12345', 10) }
+      it { is_expected.to run.with_params([ 'one', 'two' ], 10) }
+    end
+
+    context "with a minimum length of 5" do
+      describe 'rejects strings longer than the upper limit' do
+        it { is_expected.to run.with_params('1234567890a', 10, 5).and_raise_error(Puppet::ParseError, /Expected length/) }
+        it { is_expected.to run.with_params('1234567890abcdef', 10, 5).and_raise_error(Puppet::ParseError, /Expected length/) }
+      end
+
+      describe 'rejects numbers shorter than the lower limit' do
+        it { is_expected.to run.with_params('one', 10, 5).and_raise_error(Puppet::ParseError, /Expected length/) }
+        it { is_expected.to run.with_params(['12345678', 'two'], 10, 5).and_raise_error(Puppet::ParseError, /Expected length/) }
+      end
+
+      describe 'accepts strings of length between and including the limits' do
+        it { is_expected.to run.with_params('12345', 10, 5) }
+        it { is_expected.to run.with_params('123456', 10, 5) }
+        it { is_expected.to run.with_params('1234567', 10, 5) }
+        it { is_expected.to run.with_params('12345678', 10, 5) }
+        it { is_expected.to run.with_params('123456789', 10, 5) }
+        it { is_expected.to run.with_params('1234567890', 10, 5) }
+        it { is_expected.to run.with_params(['1233456', '12345678'], 10, 5) }
+      end
+    end
+  end
+
+  describe 'corner cases' do
+    it { pending('this should work'); is_expected.to run.with_params('', 0, 0) }
+    it { is_expected.to run.with_params('1234567890', 10, 10) }
+  end
+
+  describe 'empty upper limit is interpreted as infinity' do
+    it { pending('not implemented'); is_expected.to run.with_params('1234567890ab', '', 10) }
+    it { pending('not implemented'); is_expected.to run.with_params('12345678', '', 10).and_raise_error(Puppet::ParseError, /Expected length/) }
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_string_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_string_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_string_spec.rb	(revision 30960)
@@ -0,0 +1,33 @@
+require 'spec_helper'
+
+describe 'validate_string' do
+  after(:all) do
+    ENV.delete('STDLIB_LOG_DEPRECATIONS')
+  end
+  
+  # Checking for deprecation warning
+  it 'should display a single deprecation' do
+    ENV['STDLIB_LOG_DEPRECATIONS'] = "true"
+    scope.expects(:warning).with(includes('This method is deprecated'))
+    is_expected.to run.with_params('', '')
+  end
+
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+
+    describe 'valid inputs' do
+      it { is_expected.to run.with_params('') }
+      it { is_expected.to run.with_params(nil) }
+      it { is_expected.to run.with_params('one') }
+      it { is_expected.to run.with_params('one', 'two') }
+    end
+
+    describe 'invalid inputs' do
+      it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError, /is not a string/) }
+      it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, /is not a string/) }
+      it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /is not a string/) }
+      it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, /is not a string/) }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_x509_rsa_key_pair_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_x509_rsa_key_pair_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/validate_x509_rsa_key_pair_spec.rb	(revision 30960)
@@ -0,0 +1,180 @@
+require 'spec_helper'
+
+describe 'validate_x509_rsa_key_pair' do
+
+  let(:valid_cert) do
+  <<EOS
+-----BEGIN CERTIFICATE-----
+MIIC9jCCAeCgAwIBAgIRAK11n3X7aypJ7FPM8UFyAeowCwYJKoZIhvcNAQELMBIx
+EDAOBgNVBAoTB0FjbWUgQ28wHhcNMTUxMTIzMjIzOTU4WhcNMTYxMTIyMjIzOTU4
+WjASMRAwDgYDVQQKEwdBY21lIENvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
+CgKCAQEAz9bY/piKahD10AiJSfbI2A8NG5UwRz0r9T/WfvNVdhgrsGFgNQjvpUoZ
+nNJpQIHBbgMOiXqfATFjJl5FjEkSf7GUHohlGVls9MX2JmVvknzsiitd75H/EJd+
+N+k915lix8Vqmj8d1CTlbF/8tEjzANI67Vqw5QTuqebO7rkIUvRg6yiRfSo75FK1
+RinCJyl++kmleBwQZBInQyg95GvJ5JTqMzBs67DeeyzskDhTeTePRYVF2NwL8QzY
+htvLIBERTNsyU5i7nkxY5ptUwgFUwd93LH4Q19tPqL5C5RZqXxhE51thOOwafm+a
+W/cRkqYqV+tv+j1jJ3WICyF1JNW0BQIDAQABo0swSTAOBgNVHQ8BAf8EBAMCAKAw
+EwYDVR0lBAwwCgYIKwYBBQUHAwEwDAYDVR0TAQH/BAIwADAUBgNVHREEDTALggls
+b2NhbGhvc3QwCwYJKoZIhvcNAQELA4IBAQAzRo0hpVTrFQZLIXpwvKwZVGvJdCkV
+P95DTsSk/VTGV+/YtxrRqks++hJZnctm2PbnTsCAoIP3AMx+vicCKiKrxvpsLU8/
++6cowUbcuGMdSQktwDqbAgEhQlLsETll06w1D/KC+ejOc4+LRn3GQcEyGDtMk/EX
+IeAvBZHr4/kVXWnfo6kzCLcku1f8yE/yDEFClZe9XV1Lk/s+3YfXVtNnMJJ1giZI
+QVOe6CkmuQq+4AtIeW8aLkvlfp632jag1F77a1y+L268koKkj0hBMrtcErVQaxmq
+xym0+soR4Tk4pTIGckeFglrLxkP2JpM/yTwSEAVlmG9vgTliYKyR0uMl
+-----END CERTIFICATE-----
+EOS
+  end
+
+  let(:valid_key) do
+  <<EOS
+-----BEGIN RSA PRIVATE KEY-----
+MIIEogIBAAKCAQEAz9bY/piKahD10AiJSfbI2A8NG5UwRz0r9T/WfvNVdhgrsGFg
+NQjvpUoZnNJpQIHBbgMOiXqfATFjJl5FjEkSf7GUHohlGVls9MX2JmVvknzsiitd
+75H/EJd+N+k915lix8Vqmj8d1CTlbF/8tEjzANI67Vqw5QTuqebO7rkIUvRg6yiR
+fSo75FK1RinCJyl++kmleBwQZBInQyg95GvJ5JTqMzBs67DeeyzskDhTeTePRYVF
+2NwL8QzYhtvLIBERTNsyU5i7nkxY5ptUwgFUwd93LH4Q19tPqL5C5RZqXxhE51th
+OOwafm+aW/cRkqYqV+tv+j1jJ3WICyF1JNW0BQIDAQABAoIBADAiZ/r+xP+vkd5u
+O61/lCBFzBlZQecdybJw6HJaVK6XBndA9hESUr4LHUdui6W+51ddKd65IV4bXAUk
+zCKjQb+FFvLDT/bA+TTvLATUdTSN7hJJ3OWBAHuNOlQklof6JCB0Hi4+89+P8/pX
+eKUgR/cmuTMDT/iaXdPHeqFbBQyA1ZpQFRjN5LyyJMS/9FkywuNc5wlpsArtc51T
+gIKENUZCuPhosR+kMFc2iuTNvqZWPhvouSrmhi2O6nSqV+oy0+irlqSpCF2GsCI8
+72TtLpq94Grrq0BEH5avouV+Lp4k83vO65OKCQKUFQlxz3Xkxm2U3J7KzxqnRtM3
+/b+cJ/kCgYEA6/yOnaEYhH/7ijhZbPn8RujXZ5VGJXKJqIuaPiHMmHVS5p1j6Bah
+2PcnqJA2IlLs3UloN+ziAxAIH6KCBiwlQ/uPBNMMaJsIjPNBEy8axjndKhKUpidg
+R0OJ7RQqMShOJ8akrSfWdPtXC/GBuwCYE//t77GgZaIMO3FcT9EKA48CgYEA4Xcx
+Fia0Jg9iyAhNmUOXI6hWcGENavMx01+x7XFhbnMjIKTZevFfTnTkrX6HyLXyGtMU
+gHOn+k4PE/purI4ARrKO8m5wYEKqSIt4dBMTkIXXirfQjXgfjR8E4T/aPe5fOFZo
+7OYuxLRtzmG1C2sW4txwKAKX1LaWcVx/RLSttSsCgYBbcj8Brk+F6OJcqYFdzXGJ
+OOlf5mSMVlopyg83THmwCqbZXtw8L6kAHqZrl5airmfDSJLuOQlMDoZXW+3u3mSC
+d5TwVahVUN57YDgzaumBLyMZDqIz0MZqVy23hTzkV64Rk9R0lR9xrYQJyMhw4sYL
+2f0mCTsSpzz+O+t9so+i2QKBgEC38gMlwPhb2kMI/x1LZYr6uzUu5qcYf+jowy4h
+KZKGwkKQj0zXFEB1FV8nvtpCP+irRmtIx6L13SYi8LnfWPzyLE4ynVdES5TfVAgd
+obQOdzx+XwL8xDHCAaiWp5K3ZeXKB/xYZnxYPlzLdyh76Ond1OPnOqX4c16+6llS
+c7pZAoGATd9NckT0XtXLEsF3IraDivq8dP6bccX2DNfS8UeEvRRrRwpFpSRrmuGb
+jbG4yzoIX4RjQfj/z48hwhJB+cKiN9WwcPsFXtHe7v3F6BRwK0JUfrCiXad8/SGZ
+KAf7Dfqi608zBdnPWHacre2Y35gPHB00nFQOLS6u46aBNSq07YA=
+-----END RSA PRIVATE KEY-----
+EOS
+  end
+
+  let(:another_valid_key) do
+  <<EOS
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAoISxYJBTPAeAzFnm+lE/ljLlmGal2Xr3vwZKkvJiuKA/m4QJ
+0ZNdtkBSDOVuG2dXVv6W4sChRtsCdvuVe7bjTYvlU8TWM3VEJDL9l9cRXScxxlKQ
+Xwb35y1yV35NJfaK/jzm9KcErtQQs1RxvGlWRaohmLM8uQcuhjZfMsSlQoHQD5LX
+sbPtk82RPyxYc1dj2vsaoi1VvuP2+jv4xLQOmNJY1bT5GTurqiltmxEtWhNNmGg0
+2wtK00ifqLVO5HNc3gXQCDM2M99Sbmn1YtbrgsU9xMYfcPmvQvb+YoKskyoqck+c
+HR//hi7vslbxABrny15LBkEfRc4TickphSGYXwIDAQABAoIBAATEzGw8/WwMIQRx
+K06GeWgh7PZBHm4+m/ud2TtSXiJ0CE+7dXs3cJJIiOd/LW08/bhE6gCkjmYHfaRB
+Ryicv1X/cPmzIFX5BuQ4a5ZGOmrVDkKBE27vSxAgJoR46RvWnjx9XLMp/xaekDxz
+psldK8X4DvV1ZbltgDFWji947hvyqUtHdKnkQnc5j7aCIFJf9GMfzaeeDPMaL8WF
+mVL4iy9EAOjNOHBshZj/OHyU5FbJ8ROwZQlCOiLCdFegftSIXt8EYDnjB3BdsALH
+N6hquqrD7xDKyRbTD0K7lqxUubuMwTQpi61jZD8TBTXEPyFVAnoMpXkc0Y+np40A
+YiIsR+kCgYEAyrc4Bh6fb9gt49IXGXOSRZ5i5+TmJho4kzIONrJ7Ndclwx9wzHfh
+eGBodWaw5CxxQGMf4vEiaZrpAiSFeDffBLR+Wa2TFE5aWkdYkR34maDjO00m4PE1
+S+YsZoGw7rGmmj+KS4qv2T26FEHtUI+F31RC1FPohLsQ22Jbn1ORipsCgYEAyrYB
+J2Ncf2DlX1C0GfxyUHQOTNl0V5gpGvpbZ0WmWksumYz2kSGOAJkxuDKd9mKVlAcz
+czmN+OOetuHTNqds2JJKKJy6hJbgCdd9aho3dId5Xs4oh4YwuFQiG8R/bJZfTlXo
+99Qr02L7MmDWYLmrR3BA/93UPeorHPtjqSaYU40CgYEAtmGfWwokIglaSDVVqQVs
+3YwBqmcrla5TpkMLvLRZ2/fktqfL4Xod9iKu+Klajv9ZKTfFkXWno2HHL7FSD/Yc
+hWwqnV5oDIXuDnlQOse/SeERb+IbD5iUfePpoJQgbrCQlwiB0TNGwOojR2SFMczf
+Ai4aLlQLx5dSND9K9Y7HS+8CgYEAixlHQ2r4LuQjoTs0ytwi6TgqE+vn3K+qDTwc
+eoods7oBWRaUn1RCKAD3UClToZ1WfMRQNtIYrOAsqdveXpOWqioAP0wE5TTOuZIo
+GiWxRgIsc7TNtOmNBv+chCdbNP0emxdyjJUIGb7DFnfCw47EjHnn8Guc13uXaATN
+B2ZXgoUCgYAGa13P0ggUf5BMJpBd8S08jKRyvZb1CDXcUCuGtk2yEx45ern9U5WY
+zJ13E5z9MKKO8nkGBqrRfjJa8Xhxk4HKNFuzHEet5lvNE7IKCF4YQRb0ZBhnb/78
++4ZKjFki1RrWRNSw9TdvrK6qaDKgTtCTtfRVXAYQXUgq7lSFOTtL3A==
+-----END RSA PRIVATE KEY-----
+EOS
+  end
+
+  let(:valid_cert_but_indented) do
+    valid_cert.gsub(/^/, '  ')
+  end
+
+  let(:valid_key_but_indented) do
+    valid_key.gsub(/^/, '  ')
+  end
+
+  let(:malformed_cert) do
+    truncate_middle(valid_cert)
+  end
+
+  let(:malformed_key) do
+    truncate_middle(valid_key)
+  end
+
+  let(:bad_cert) do
+    'foo'
+  end
+
+  let(:bad_key) do
+    'bar'
+  end
+
+  context 'function signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params(0, 1, 2, 3).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  end
+
+  context 'valid input' do
+    describe 'valid certificate and key' do
+      it { is_expected.to run.with_params(valid_cert, valid_key) }
+    end
+  end
+
+  context 'bad input' do
+    describe 'valid certificate, valid but indented key' do
+      it { is_expected.to run.with_params(valid_cert, valid_key_but_indented).and_raise_error(Puppet::ParseError, /Not a valid RSA key/) }
+    end
+
+    describe 'valid certificate, malformed key' do
+      it { is_expected.to run.with_params(valid_cert, malformed_key).and_raise_error(Puppet::ParseError, /Not a valid RSA key/) }
+    end
+
+    describe 'valid certificate, bad key' do
+      it { is_expected.to run.with_params(valid_cert, bad_key).and_raise_error(Puppet::ParseError, /Not a valid RSA key/) }
+    end
+
+    describe 'valid but indented certificate, valid key' do
+      it { is_expected.to run.with_params(valid_cert_but_indented, valid_key).and_raise_error(Puppet::ParseError, /Not a valid x509 certificate/) }
+    end
+
+    describe 'malformed certificate, valid key' do
+      it { is_expected.to run.with_params(malformed_cert, valid_key).and_raise_error(Puppet::ParseError, /Not a valid x509 certificate/) }
+    end
+
+    describe 'bad certificate, valid key' do
+      it { is_expected.to run.with_params(bad_cert, valid_key).and_raise_error(Puppet::ParseError, /Not a valid x509 certificate/) }
+    end
+
+    describe 'validate certificate and key; certficate not signed by key' do
+      it { is_expected.to run.with_params(valid_cert, another_valid_key).and_raise_error(Puppet::ParseError, /Certificate signature does not match supplied key/) }
+    end
+
+    describe 'valid cert and key but arguments in wrong order' do
+      it { is_expected.to run.with_params(valid_key, valid_cert).and_raise_error(Puppet::ParseError, /Not a valid x509 certificate/) }
+    end
+
+    describe 'non-string arguments' do
+      it { is_expected.to run.with_params({}, {}).and_raise_error(Puppet::ParseError, /is not a string/) }
+      it { is_expected.to run.with_params(1, 1).and_raise_error(Puppet::ParseError, /is not a string/) }
+      it { is_expected.to run.with_params(true, true).and_raise_error(Puppet::ParseError, /is not a string/) }
+      it { is_expected.to run.with_params("foo", {}).and_raise_error(Puppet::ParseError, /is not a string/) }
+      it { is_expected.to run.with_params(1, "bar").and_raise_error(Puppet::ParseError, /is not a string/) }
+      it { is_expected.to run.with_params("baz", true).and_raise_error(Puppet::ParseError, /is not a string/) }
+    end
+  end
+
+  def truncate_middle(string)
+    chars_to_truncate = 48
+    middle = (string.length / 2).floor
+    start_pos = middle - (chars_to_truncate / 2)
+    end_pos = middle + (chars_to_truncate / 2)
+
+    string[start_pos...end_pos] = ''
+    return string
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/values_at_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/values_at_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/values_at_spec.rb	(revision 30960)
@@ -0,0 +1,49 @@
+require 'spec_helper'
+
+describe 'values_at' do
+  describe 'signature validation' do
+    it { is_expected.not_to eq(nil) }
+    it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+    it {
+      pending("Current implementation ignores parameters after the first two.")
+      is_expected.to run.with_params([], 0, 1).and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+    }
+    it { is_expected.to run.with_params('', 1).and_raise_error(Puppet::ParseError, /Requires array/i) }
+    it { is_expected.to run.with_params({}, 1).and_raise_error(Puppet::ParseError, /Requires array/i) }
+    it { is_expected.to run.with_params(true, 1).and_raise_error(Puppet::ParseError, /Requires array/i) }
+    it { is_expected.to run.with_params(1, 1).and_raise_error(Puppet::ParseError, /Requires array/i) }
+    it { is_expected.to run.with_params([0,1,2], 'two').and_raise_error(Puppet::ParseError, /Unknown format of given index/) }
+    it { is_expected.to run.with_params([0,1,2], []).and_raise_error(Puppet::ParseError, /provide at least one positive index/) }
+    it { is_expected.to run.with_params([0,1,2], '-1-1').and_raise_error(Puppet::ParseError, /Unknown format of given index/) }
+    it { is_expected.to run.with_params([0,1,2], '2-1').and_raise_error(Puppet::ParseError, /Stop index in given indices range is smaller than the start index/) }
+  end
+
+  context 'when requesting a single item' do
+    it { is_expected.to run.with_params([0, 1, 2], -1).and_raise_error(Puppet::ParseError, /Unknown format of given index/) }
+    it { is_expected.to run.with_params([0, 1, 2], 0).and_return([0]) }
+    it { is_expected.to run.with_params([0, 1, 2], 1).and_return([1]) }
+    it { is_expected.to run.with_params([0, 1, 2], [1]).and_return([1]) }
+    it { is_expected.to run.with_params([0, 1, 2], '1').and_return([1]) }
+    it { is_expected.to run.with_params([0, 1, 2], '1-1').and_return([1]) }
+    it { is_expected.to run.with_params([0, 1, 2], 2).and_return([2]) }
+    it { is_expected.to run.with_params([0, 1, 2], 3).and_raise_error(Puppet::ParseError, /index exceeds array size/) }
+  end
+
+  context 'when requesting multiple items' do
+    it { is_expected.to run.with_params([0, 1, 2], [1, -1]).and_raise_error(Puppet::ParseError, /Unknown format of given index/) }
+    it { is_expected.to run.with_params([0, 1, 2], [0, 2]).and_return([0, 2]) }
+    it { is_expected.to run.with_params([0, 1, 2], ['0-2', 1, 2]).and_return([0, 1, 2, 1, 2]) }
+    it { is_expected.to run.with_params([0, 1, 2], [3, 2]).and_raise_error(Puppet::ParseError, /index exceeds array size/) }
+
+    describe 'different range syntaxes' do
+      it { is_expected.to run.with_params([0, 1, 2], '0-2').and_return([0, 1, 2]) }
+      it { is_expected.to run.with_params([0, 1, 2], '0..2').and_return([0, 1, 2]) }
+      it { is_expected.to run.with_params([0, 1, 2], '0...2').and_return([0, 1]) }
+      it {
+        pending('fix this bounds check')
+        is_expected.to run.with_params([0, 1, 2], '0...3').and_return([0, 1, 2])
+      }
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/values_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/values_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/values_spec.rb	(revision 30960)
@@ -0,0 +1,19 @@
+require 'spec_helper'
+
+describe 'values' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the first.")
+    is_expected.to run.with_params({}, 'extra').and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params('').and_raise_error(Puppet::ParseError, /Requires hash to work with/) }
+  it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, /Requires hash to work with/) }
+  it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError, /Requires hash to work with/) }
+  it { is_expected.to run.with_params({}).and_return([]) }
+  it { is_expected.to run.with_params({ 'key' => 'value' }).and_return(['value']) }
+  it 'should return the array of values' do
+    result = subject.call([{ 'key1' => 'value1', 'key2' => 'value2', 'duplicate_value_key' => 'value2' }])
+    expect(result).to match_array(['value1', 'value2', 'value2'])
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/zip_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/zip_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/zip_spec.rb	(revision 30960)
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe 'zip' do
+  it { is_expected.not_to eq(nil) }
+  it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it { is_expected.to run.with_params([]).and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
+  it {
+    pending("Current implementation ignores parameters after the third.")
+    is_expected.to run.with_params([], [], true, []).and_raise_error(Puppet::ParseError, /wrong number of arguments/i)
+  }
+  it { is_expected.to run.with_params([], []).and_return([]) }
+  it { is_expected.to run.with_params([1,2,3], [4,5,6]).and_return([[1,4], [2,5], [3,6]]) }
+  it { is_expected.to run.with_params([1,2,3], [4,5,6], false).and_return([[1,4], [2,5], [3,6]]) }
+  it { is_expected.to run.with_params([1,2,3], [4,5,6], true).and_return([1, 4, 2, 5, 3, 6]) }
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/monkey_patches/alias_should_to_must.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/monkey_patches/alias_should_to_must.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/monkey_patches/alias_should_to_must.rb	(revision 30960)
@@ -0,0 +1,9 @@
+#! /usr/bin/env ruby -S rspec
+require 'rspec'
+
+class Object
+  # This is necessary because the RAL has a 'should'
+  # method.
+  alias :must :should
+  alias :must_not :should_not
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/monkey_patches/publicize_methods.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/monkey_patches/publicize_methods.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/monkey_patches/publicize_methods.rb	(revision 30960)
@@ -0,0 +1,11 @@
+#! /usr/bin/env ruby -S rspec
+# Some monkey-patching to allow us to test private methods.
+class Class
+    def publicize_methods(*methods)
+        saved_private_instance_methods = methods.empty? ? self.private_instance_methods : methods
+
+        self.class_eval { public(*saved_private_instance_methods) }
+        yield
+        self.class_eval { private(*saved_private_instance_methods) }
+    end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/spec_helper.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/spec_helper.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/spec_helper.rb	(revision 30960)
@@ -0,0 +1,8 @@
+#This file is generated by ModuleSync, do not edit.
+require 'puppetlabs_spec_helper/module_spec_helper'
+
+# put local configuration and setup into spec_helper_local
+begin
+  require 'spec_helper_local'
+rescue LoadError
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/spec_helper_acceptance.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/spec_helper_acceptance.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/spec_helper_acceptance.rb	(revision 30960)
@@ -0,0 +1,70 @@
+#! /usr/bin/env ruby -S rspec
+require 'beaker-rspec'
+require 'beaker/puppet_install_helper'
+
+UNSUPPORTED_PLATFORMS = []
+
+run_puppet_install_helper
+
+RSpec.configure do |c|
+  # Project root
+  proj_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
+
+  # Readable test descriptions
+  c.formatter = :documentation
+
+  # Configure all nodes in nodeset
+  c.before :suite do
+    if ENV['FUTURE_PARSER'] == 'yes'
+      default[:default_apply_opts] ||= {}
+      default[:default_apply_opts].merge!({:parser => 'future'})
+    end
+
+    copy_root_module_to(default, :source => proj_root, :module_name => 'stdlib')
+  end
+end
+
+def is_future_parser_enabled?
+  if default[:type] == 'aio' || ENV['PUPPET_INSTALL_TYPE'] == 'agent'
+    return true
+  elsif default[:default_apply_opts]
+    return default[:default_apply_opts][:parser] == 'future'
+  end
+  return false
+end
+
+def get_puppet_version
+  (on default, puppet('--version')).output.chomp
+end
+
+RSpec.shared_context "with faked facts" do
+  let(:facts_d) do
+    puppet_version = get_puppet_version
+    if fact('osfamily') =~ /windows/i
+      if fact('kernelmajversion').to_f < 6.0
+        'C:/Documents and Settings/All Users/Application Data/PuppetLabs/facter/facts.d'
+      else
+        'C:/ProgramData/PuppetLabs/facter/facts.d'
+      end
+    elsif Puppet::Util::Package.versioncmp(puppet_version, '4.0.0') < 0 and fact('is_pe', '--puppet') == "true"
+      '/etc/puppetlabs/facter/facts.d'
+    else
+      '/etc/facter/facts.d'
+    end
+  end
+
+  before :each do
+    #No need to create on windows, PE creates by default
+    if fact('osfamily') !~ /windows/i
+      shell("mkdir -p '#{facts_d}'")
+    end
+  end
+
+  after :each do
+    shell("rm -f '#{facts_d}/fqdn.txt'", :acceptable_exit_codes => [0,1])
+  end
+
+  def fake_fact(name, value)
+    shell("echo #{name}=#{value} > '#{facts_d}/#{name}.txt'")
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/spec_helper_local.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/spec_helper_local.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/spec_helper_local.rb	(revision 30960)
@@ -0,0 +1,29 @@
+
+# hack to enable all the expect syntax (like allow_any_instance_of) in rspec-puppet examples
+RSpec::Mocks::Syntax.enable_expect(RSpec::Puppet::ManifestMatchers)
+
+RSpec.configure do |config|
+  # supply tests with a possibility to test for the future parser
+  config.add_setting :puppet_future
+  config.puppet_future = Puppet.version.to_f >= 4.0
+
+  config.before :each do
+    # Ensure that we don't accidentally cache facts and environment between
+    # test cases.  This requires each example group to explicitly load the
+    # facts being exercised with something like
+    # Facter.collection.loader.load(:ipaddress)
+    Facter.clear
+    Facter.clear_messages
+    
+    RSpec::Mocks.setup
+  end
+
+  config.after :each do
+    RSpec::Mocks.verify
+    RSpec::Mocks.teardown
+  end
+end
+
+# Helper class to test handling of arguments which are derived from string
+class AlsoString < String
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/facter_dot_d_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/facter_dot_d_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/facter_dot_d_spec.rb	(revision 30960)
@@ -0,0 +1,32 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper'
+require 'facter/facter_dot_d'
+
+describe Facter::Util::DotD do
+
+  context 'returns a simple fact' do
+    before :each do
+      Facter.stubs(:version).returns('1.6.1')
+      subject.stubs(:entries).returns(['/etc/facter/facts.d/fake_fact.txt'])
+      File.stubs(:readlines).with('/etc/facter/facts.d/fake_fact.txt').returns(['fake_fact=fake fact'])
+      subject.create
+    end
+
+    it 'should return successfully' do
+      expect(Facter.fact(:fake_fact).value).to eq('fake fact')
+    end
+  end
+
+  context 'returns a fact with equals signs' do
+    before :each do
+      Facter.stubs(:version).returns('1.6.1')
+      subject.stubs(:entries).returns(['/etc/facter/facts.d/foo.txt'])
+      File.stubs(:readlines).with('/etc/facter/facts.d/foo.txt').returns(['foo=1+1=2'])
+      subject.create
+    end
+
+    it 'should return successfully' do
+      expect(Facter.fact(:foo).value).to eq('1+1=2')
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/package_provider_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/package_provider_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/package_provider_spec.rb	(revision 30960)
@@ -0,0 +1,44 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper'
+require 'puppet/type'
+require 'puppet/type/package'
+
+describe 'package_provider', :type => :fact do
+  before { Facter.clear }
+  after { Facter.clear }
+
+  ['4.2.2', '3.7.1 (Puppet Enterprise 3.2.1)'].each do |puppetversion|
+    describe "on puppet ''#{puppetversion}''" do
+      before :each do
+        Facter.stubs(:value).returns puppetversion
+      end
+
+      context "darwin" do
+        it "should return pkgdmg" do
+          provider = Puppet::Type.type(:package).provider(:pkgdmg)
+          Puppet::Type.type(:package).stubs(:defaultprovider).returns provider
+
+          expect(Facter.fact(:package_provider).value).to eq('pkgdmg')
+        end
+      end
+
+      context "centos 7" do
+        it "should return yum" do
+          provider = Puppet::Type.type(:package).provider(:yum)
+          Puppet::Type.type(:package).stubs(:defaultprovider).returns provider
+
+          expect(Facter.fact(:package_provider).value).to eq('yum')
+        end
+      end
+
+      context "ubuntu" do
+        it "should return apt" do
+          provider = Puppet::Type.type(:package).provider(:apt)
+          Puppet::Type.type(:package).stubs(:defaultprovider).returns provider
+
+          expect(Facter.fact(:package_provider).value).to eq('apt')
+        end
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/pe_version_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/pe_version_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/pe_version_spec.rb	(revision 30960)
@@ -0,0 +1,88 @@
+#!/usr/bin/env rspec
+
+require 'spec_helper'
+
+describe "PE Version specs" do
+  before :each do
+    # Explicitly load the pe_version.rb file which contains generated facts
+    # that cannot be automatically loaded.  Puppet 2.x implements
+    # Facter.collection.load while Facter 1.x markes Facter.collection.load as
+    # a private method.
+    if Facter.collection.respond_to? :load
+      Facter.collection.load(:pe_version)
+    else
+      Facter.collection.loader.load(:pe_version)
+    end
+  end
+  
+  context "When puppetversion is nil" do
+    before :each do
+      Facter.fact(:puppetversion).stubs(:value).returns(nil)
+    end
+    
+    it "pe_version is nil" do
+      expect(Facter.fact(:puppetversion).value).to be_nil
+      expect(Facter.fact(:pe_version).value).to be_nil
+    end
+  end
+
+  context "If PE is installed" do
+    %w{ 2.6.1 2.10.300 }.each do |version|
+      puppetversion = "2.7.19 (Puppet Enterprise #{version})"
+      context "puppetversion => #{puppetversion}" do
+        before :each do
+          Facter.fact(:puppetversion).stubs(:value).returns(puppetversion)
+        end
+
+        (major,minor,patch) = version.split(".")
+
+        it "Should return true" do
+          expect(Facter.fact(:is_pe).value).to eq(true)
+        end
+
+        it "Should have a version of #{version}" do
+          expect(Facter.fact(:pe_version).value).to eq(version)
+        end
+
+        it "Should have a major version of #{major}" do
+          expect(Facter.fact(:pe_major_version).value).to eq(major)
+        end
+
+        it "Should have a minor version of #{minor}" do
+          expect(Facter.fact(:pe_minor_version).value).to eq(minor)
+        end
+
+        it "Should have a patch version of #{patch}" do
+          expect(Facter.fact(:pe_patch_version).value).to eq(patch)
+        end
+      end
+    end
+  end
+
+  context "When PE is not installed" do
+    before :each do
+      Facter.fact(:puppetversion).stubs(:value).returns("2.7.19")
+    end
+
+    it "is_pe is false" do
+      expect(Facter.fact(:is_pe).value).to eq(false)
+    end
+
+    it "pe_version is nil" do
+      expect(Facter.fact(:pe_version).value).to be_nil
+    end
+
+    it "pe_major_version is nil" do
+      expect(Facter.fact(:pe_major_version).value).to be_nil
+    end
+
+    it "pe_minor_version is nil" do
+      expect(Facter.fact(:pe_minor_version).value).to be_nil
+    end
+
+    it "Should have a patch version" do
+      expect(Facter.fact(:pe_patch_version).value).to be_nil
+    end
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/root_home_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/root_home_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/root_home_spec.rb	(revision 30960)
@@ -0,0 +1,65 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper'
+require 'facter/root_home'
+
+describe Facter::Util::RootHome do
+  context "solaris" do
+    let(:root_ent) { "root:x:0:0:Super-User:/:/sbin/sh" }
+    let(:expected_root_home) { "/" }
+
+    it "should return /" do
+      Facter::Util::Resolution.expects(:exec).with("getent passwd root").returns(root_ent)
+      expect(Facter::Util::RootHome.get_root_home).to eq(expected_root_home)
+    end
+  end
+  context "linux" do
+    let(:root_ent) { "root:x:0:0:root:/root:/bin/bash" }
+    let(:expected_root_home) { "/root" }
+
+    it "should return /root" do
+      Facter::Util::Resolution.expects(:exec).with("getent passwd root").returns(root_ent)
+      expect(Facter::Util::RootHome.get_root_home).to eq(expected_root_home)
+    end
+  end
+  context "windows" do
+    before :each do
+      Facter::Util::Resolution.expects(:exec).with("getent passwd root").returns(nil)
+    end
+    it "should be nil on windows" do
+      expect(Facter::Util::RootHome.get_root_home).to be_nil
+    end
+  end
+end
+
+describe 'root_home', :type => :fact do
+  before { Facter.clear }
+  after { Facter.clear }
+
+  context "macosx" do
+    before do
+      Facter.fact(:kernel).stubs(:value).returns("Darwin")
+      Facter.fact(:osfamily).stubs(:value).returns("Darwin")
+    end
+    let(:expected_root_home) { "/var/root" }
+    sample_dscacheutil = File.read(fixtures('dscacheutil','root'))
+
+    it "should return /var/root" do
+      Facter::Util::Resolution.stubs(:exec).with("dscacheutil -q user -a name root").returns(sample_dscacheutil)
+      expect(Facter.fact(:root_home).value).to eq(expected_root_home)
+    end
+  end
+
+  context "aix" do
+    before do
+      Facter.fact(:kernel).stubs(:value).returns("AIX")
+      Facter.fact(:osfamily).stubs(:value).returns("AIX")
+    end
+    let(:expected_root_home) { "/root" }
+    sample_lsuser = File.read(fixtures('lsuser','root'))
+
+    it "should return /root" do
+      Facter::Util::Resolution.stubs(:exec).with("lsuser -c -a home root").returns(sample_lsuser)
+      expect(Facter.fact(:root_home).value).to eq(expected_root_home)
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/service_provider_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/service_provider_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/service_provider_spec.rb	(revision 30960)
@@ -0,0 +1,37 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper'
+require 'puppet/type'
+require 'puppet/type/service'
+
+describe 'service_provider', :type => :fact do
+  before { Facter.clear }
+  after { Facter.clear }
+
+  context "macosx" do
+    it "should return launchd" do
+      provider = Puppet::Type.type(:service).provider(:launchd)
+      Puppet::Type.type(:service).stubs(:defaultprovider).returns provider
+
+      expect(Facter.fact(:service_provider).value).to eq('launchd')
+    end
+  end
+
+  context "systemd" do
+    it "should return systemd" do
+      provider = Puppet::Type.type(:service).provider(:systemd)
+      Puppet::Type.type(:service).stubs(:defaultprovider).returns provider
+
+      expect(Facter.fact(:service_provider).value).to eq('systemd')
+    end
+  end
+
+  context "redhat" do
+    it "should return redhat" do
+      provider = Puppet::Type.type(:service).provider(:redhat)
+      Puppet::Type.type(:service).stubs(:defaultprovider).returns provider
+
+      expect(Facter.fact(:service_provider).value).to eq('redhat')
+    end
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/util/puppet_settings_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/util/puppet_settings_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/facter/util/puppet_settings_spec.rb	(revision 30960)
@@ -0,0 +1,37 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper'
+require 'facter/util/puppet_settings'
+
+describe Facter::Util::PuppetSettings do
+
+  describe "#with_puppet" do
+    context "Without Puppet loaded" do
+      before(:each) do
+        Module.expects(:const_get).with("Puppet").raises(NameError)
+      end
+
+      it 'should be nil' do
+        expect(subject.with_puppet { Puppet[:vardir] }).to be_nil
+      end
+      it 'should not yield to the block' do
+        Puppet.expects(:[]).never
+        expect(subject.with_puppet { Puppet[:vardir] }).to be_nil
+      end
+    end
+    context "With Puppet loaded" do
+      module Puppet; end
+      let(:vardir) { "/var/lib/puppet" }
+
+      before :each do
+        Puppet.expects(:[]).with(:vardir).returns vardir
+      end
+
+      it 'should yield to the block' do
+        subject.with_puppet { Puppet[:vardir] }
+      end
+      it 'should return the nodes vardir' do
+        expect(subject.with_puppet { Puppet[:vardir] }).to eq vardir
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/parser/functions/enclose_ipv6_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/parser/functions/enclose_ipv6_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/parser/functions/enclose_ipv6_spec.rb	(revision 30960)
@@ -0,0 +1,69 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper'
+
+describe "the enclose_ipv6 function" do
+  let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
+
+  it "should exist" do
+    expect(Puppet::Parser::Functions.function("enclose_ipv6")).to eq("function_enclose_ipv6")
+  end
+
+  it "should raise a ParseError if there is less than 1 arguments" do
+    expect { scope.function_enclose_ipv6([]) }.to( raise_error(Puppet::ParseError) )
+  end
+
+  it "should raise a ParseError if there is more than 1 arguments" do
+    expect { scope.function_enclose_ipv6(['argument1','argument2']) }.to( raise_error(Puppet::ParseError) )
+  end
+
+  it "should raise a ParseError when given garbage" do
+    expect { scope.function_enclose_ipv6(['garbage']) }.to( raise_error(Puppet::ParseError) )
+  end
+
+  it "should raise a ParseError when given something else than a string or an array" do
+    expect { scope.function_enclose_ipv6([['1' => '127.0.0.1']]) }.to( raise_error(Puppet::ParseError) )
+  end
+
+  it "should not raise a ParseError when given a single ip string" do
+    expect { scope.function_enclose_ipv6(['127.0.0.1']) }.to_not raise_error
+  end
+
+  it "should not raise a ParseError when given * as ip string" do
+    expect { scope.function_enclose_ipv6(['*']) }.to_not raise_error
+  end
+
+  it "should not raise a ParseError when given an array of ip strings" do
+    expect { scope.function_enclose_ipv6([['127.0.0.1','fe80::1']]) }.to_not raise_error
+  end
+
+  it "should not raise a ParseError when given differently notations of ip addresses" do
+    expect { scope.function_enclose_ipv6([['127.0.0.1','fe80::1','[fe80::1]']]) }.to_not raise_error
+  end
+
+  it "should raise a ParseError when given a wrong ipv4 address" do
+    expect { scope.function_enclose_ipv6(['127..0.0.1']) }.to( raise_error(Puppet::ParseError) )
+  end
+
+  it "should raise a ParseError when given a ipv4 address with square brackets" do
+    expect { scope.function_enclose_ipv6(['[127.0.0.1]']) }.to( raise_error(Puppet::ParseError) )
+  end
+
+  it "should raise a ParseError when given a wrong ipv6 address" do
+    expect { scope.function_enclose_ipv6(['fe80:::1']) }.to( raise_error(Puppet::ParseError) )
+  end
+
+  it "should embrace ipv6 adresses within an array of ip addresses" do
+    result = scope.function_enclose_ipv6([['127.0.0.1','fe80::1','[fe80::2]']])
+    expect(result).to(eq(['127.0.0.1','[fe80::1]','[fe80::2]']))
+  end
+
+  it "should embrace a single ipv6 adresse" do
+    result = scope.function_enclose_ipv6(['fe80::1'])
+    expect(result).to(eq(['[fe80::1]']))
+  end
+
+  it "should not embrace a single ipv4 adresse" do
+    result = scope.function_enclose_ipv6(['127.0.0.1'])
+    expect(result).to(eq(['127.0.0.1']))
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/parser/functions/is_absolute_path_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/parser/functions/is_absolute_path_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/parser/functions/is_absolute_path_spec.rb	(revision 30960)
@@ -0,0 +1,86 @@
+require 'spec_helper'
+
+describe :is_absolute_path do
+  let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
+
+  let(:function_args) do
+    []
+  end
+
+  let(:function) do
+    scope.function_is_absolute_path(function_args)
+  end
+
+
+  describe 'validate arity' do
+    let(:function_args) do
+       [1,2]
+    end
+    it "should raise a ParseError if there is more than 1 arguments" do
+      lambda { function }.should( raise_error(ArgumentError))
+    end
+
+  end
+  
+  it "should exist" do
+    Puppet::Parser::Functions.function(subject).should == "function_#{subject}"
+  end
+
+  # help enforce good function defination
+  it 'should contain arity' do
+
+  end
+
+  it "should raise a ParseError if there is less than 1 arguments" do
+    lambda { function }.should( raise_error(ArgumentError))
+  end
+
+
+  describe 'should retrun true' do
+    let(:return_value) do
+      true
+    end
+
+    describe 'windows' do
+      let(:function_args) do
+        ['c:\temp\test.txt']
+      end
+      it 'should return data' do
+        function.should eq(return_value)
+      end
+    end
+
+    describe 'non-windows' do
+      let(:function_args) do
+        ['/temp/test.txt']
+      end
+
+      it 'should return data' do
+        function.should eq(return_value)
+      end
+    end
+  end
+
+  describe 'should return false' do
+    let(:return_value) do
+      false
+    end
+    describe 'windows' do
+      let(:function_args) do
+        ['..\temp\test.txt']
+      end
+      it 'should return data' do
+        function.should eq(return_value)
+      end
+    end
+
+    describe 'non-windows' do
+      let(:function_args) do
+        ['../var/lib/puppet']
+      end
+      it 'should return data' do
+        function.should eq(return_value)
+      end
+    end
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/provider/file_line/ruby_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/provider/file_line/ruby_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/provider/file_line/ruby_spec.rb	(revision 30960)
@@ -0,0 +1,447 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper'
+require 'tempfile'
+provider_class = Puppet::Type.type(:file_line).provider(:ruby)
+describe provider_class do
+  context "when adding" do
+    let :tmpfile do
+      tmp = Tempfile.new('tmp')
+      path = tmp.path
+      tmp.close!
+      path
+    end
+    let :resource do
+      Puppet::Type::File_line.new(
+        {:name => 'foo', :path => tmpfile, :line => 'foo'}
+      )
+    end
+    let :provider do
+      provider_class.new(resource)
+    end
+
+    it 'should detect if the line exists in the file' do
+      File.open(tmpfile, 'w') do |fh|
+        fh.write('foo')
+      end
+      expect(provider.exists?).to be_truthy
+    end
+    it 'should detect if the line does not exist in the file' do
+      File.open(tmpfile, 'w') do |fh|
+        fh.write('foo1')
+      end
+      expect(provider.exists?).to be_nil
+    end
+    it 'should append to an existing file when creating' do
+      provider.create
+      expect(File.read(tmpfile).chomp).to eq('foo')
+    end
+  end
+  context 'when using replace' do
+    before :each do
+      # TODO: these should be ported over to use the PuppetLabs spec_helper
+      #  file fixtures once the following pull request has been merged:
+      # https://github.com/puppetlabs/puppetlabs-stdlib/pull/73/files
+      tmp = Tempfile.new('tmp')
+      @tmpfile = tmp.path
+      tmp.close!
+      @resource = Puppet::Type::File_line.new(
+        {
+          :name    => 'foo',
+          :path    => @tmpfile,
+          :line    => 'foo = bar',
+          :match   => '^foo\s*=.*$',
+          :replace => false,
+        }
+      )
+      @provider = provider_class.new(@resource)
+    end
+
+    it 'should not replace the matching line' do
+      File.open(@tmpfile, 'w') do |fh|
+        fh.write("foo1\nfoo=blah\nfoo2\nfoo3")
+      end
+      expect(@provider.exists?).to be_truthy
+      @provider.create
+      expect(File.read(@tmpfile).chomp).to eql("foo1\nfoo=blah\nfoo2\nfoo3")
+    end
+
+    it 'should append the line if no matches are found' do
+      File.open(@tmpfile, 'w') do |fh|
+        fh.write("foo1\nfoo2")
+      end
+      expect(@provider.exists?).to be_nil
+      @provider.create
+      expect(File.read(@tmpfile).chomp).to eql("foo1\nfoo2\nfoo = bar")
+    end
+
+    it 'should raise an error with invalid values' do
+      expect {
+        @resource = Puppet::Type::File_line.new(
+          {
+            :name     => 'foo',
+            :path     => @tmpfile,
+            :line     => 'foo = bar',
+            :match    => '^foo\s*=.*$',
+            :replace  => 'asgadga',
+          }
+        )
+      }.to raise_error(Puppet::Error, /Invalid value "asgadga"\. Valid values are true, false\./)
+    end
+  end
+  context "when matching" do
+    before :each do
+      # TODO: these should be ported over to use the PuppetLabs spec_helper
+      #  file fixtures once the following pull request has been merged:
+      # https://github.com/puppetlabs/puppetlabs-stdlib/pull/73/files
+      tmp = Tempfile.new('tmp')
+      @tmpfile = tmp.path
+      tmp.close!
+      @resource = Puppet::Type::File_line.new(
+        {
+          :name  => 'foo',
+          :path  => @tmpfile,
+          :line  => 'foo = bar',
+          :match => '^foo\s*=.*$',
+        }
+      )
+      @provider = provider_class.new(@resource)
+    end
+
+    describe 'using match' do
+      it 'should raise an error if more than one line matches, and should not have modified the file' do
+        File.open(@tmpfile, 'w') do |fh|
+          fh.write("foo1\nfoo=blah\nfoo2\nfoo=baz")
+        end
+        expect(@provider.exists?).to be_nil
+        expect { @provider.create }.to raise_error(Puppet::Error, /More than one line.*matches/)
+        expect(File.read(@tmpfile)).to eql("foo1\nfoo=blah\nfoo2\nfoo=baz")
+      end
+
+      it 'should replace all lines that matches' do
+        @resource = Puppet::Type::File_line.new(
+          {
+            :name     => 'foo',
+            :path     => @tmpfile,
+            :line     => 'foo = bar',
+            :match    => '^foo\s*=.*$',
+            :multiple => true,
+          }
+        )
+        @provider = provider_class.new(@resource)
+        File.open(@tmpfile, 'w') do |fh|
+          fh.write("foo1\nfoo=blah\nfoo2\nfoo=baz")
+        end
+        expect(@provider.exists?).to be_nil
+        @provider.create
+        expect(File.read(@tmpfile).chomp).to eql("foo1\nfoo = bar\nfoo2\nfoo = bar")
+      end
+
+      it 'should raise an error with invalid values' do
+        expect {
+          @resource = Puppet::Type::File_line.new(
+            {
+              :name     => 'foo',
+              :path     => @tmpfile,
+              :line     => 'foo = bar',
+              :match    => '^foo\s*=.*$',
+              :multiple => 'asgadga',
+            }
+          )
+        }.to raise_error(Puppet::Error, /Invalid value "asgadga"\. Valid values are true, false\./)
+      end
+
+      it 'should replace a line that matches' do
+        File.open(@tmpfile, 'w') do |fh|
+          fh.write("foo1\nfoo=blah\nfoo2")
+        end
+        expect(@provider.exists?).to be_nil
+        @provider.create
+        expect(File.read(@tmpfile).chomp).to eql("foo1\nfoo = bar\nfoo2")
+      end
+      it 'should add a new line if no lines match' do
+        File.open(@tmpfile, 'w') do |fh|
+          fh.write("foo1\nfoo2")
+        end
+        expect(@provider.exists?).to be_nil
+        @provider.create
+        expect(File.read(@tmpfile)).to eql("foo1\nfoo2\nfoo = bar\n")
+      end
+      it 'should do nothing if the exact line already exists' do
+        File.open(@tmpfile, 'w') do |fh|
+          fh.write("foo1\nfoo = bar\nfoo2")
+        end
+        expect(@provider.exists?).to be_truthy
+        @provider.create
+        expect(File.read(@tmpfile).chomp).to eql("foo1\nfoo = bar\nfoo2")
+      end
+    end
+
+    describe 'using after' do
+      let :resource do
+        Puppet::Type::File_line.new(
+          {
+            :name  => 'foo',
+            :path  => @tmpfile,
+            :line  => 'inserted = line',
+            :after => '^foo1',
+          }
+        )
+      end
+
+      let :provider do
+        provider_class.new(resource)
+      end
+      context 'match and after set' do
+        shared_context 'resource_create' do
+          let(:match) { '^foo2$' }
+          let(:after) { '^foo1$' }
+          let(:resource) {
+            Puppet::Type::File_line.new(
+              {
+                :name  => 'foo',
+                :path  => @tmpfile,
+                :line  => 'inserted = line',
+                :after => after,
+                :match => match,
+              }
+            )
+          }
+        end
+        before :each do
+          File.open(@tmpfile, 'w') do |fh|
+            fh.write("foo1\nfoo2\nfoo = baz")
+          end
+        end
+        describe 'inserts at match' do
+          include_context 'resource_create'
+          it {
+            provider.create
+            expect(File.read(@tmpfile).chomp).to eq("foo1\ninserted = line\nfoo = baz")
+          }
+        end
+        describe 'inserts a new line after when no match' do
+          include_context 'resource_create' do
+            let(:match) { '^nevergoingtomatch$' }
+          end
+          it {
+            provider.create
+            expect(File.read(@tmpfile).chomp).to eq("foo1\ninserted = line\nfoo2\nfoo = baz")
+          }
+        end
+        describe 'append to end of file if no match for both after and match' do
+          include_context 'resource_create' do
+            let(:match) { '^nevergoingtomatch$' }
+            let(:after) { '^stillneverafter' }
+          end
+          it {
+            provider.create
+            expect(File.read(@tmpfile).chomp).to eq("foo1\nfoo2\nfoo = baz\ninserted = line")
+          }
+        end
+      end
+      context 'with one line matching the after expression' do
+        before :each do
+          File.open(@tmpfile, 'w') do |fh|
+            fh.write("foo1\nfoo = blah\nfoo2\nfoo = baz")
+          end
+        end
+
+        it 'inserts the specified line after the line matching the "after" expression' do
+          provider.create
+          expect(File.read(@tmpfile).chomp).to eql("foo1\ninserted = line\nfoo = blah\nfoo2\nfoo = baz")
+        end
+      end
+
+      context 'with multiple lines matching the after expression' do
+        before :each do
+          File.open(@tmpfile, 'w') do |fh|
+            fh.write("foo1\nfoo = blah\nfoo2\nfoo1\nfoo = baz")
+          end
+        end
+
+        it 'errors out stating "One or no line must match the pattern"' do
+          expect { provider.create }.to raise_error(Puppet::Error, /One or no line must match the pattern/)
+        end
+
+        it 'adds the line after all lines matching the after expression' do
+          @resource = Puppet::Type::File_line.new(
+            {
+              :name     => 'foo',
+              :path     => @tmpfile,
+              :line     => 'inserted = line',
+              :after    => '^foo1$',
+              :multiple => true,
+            }
+          )
+          @provider = provider_class.new(@resource)
+          expect(@provider.exists?).to be_nil
+          @provider.create
+          expect(File.read(@tmpfile).chomp).to eql("foo1\ninserted = line\nfoo = blah\nfoo2\nfoo1\ninserted = line\nfoo = baz")
+        end
+      end
+
+      context 'with no lines matching the after expression' do
+        let :content do
+          "foo3\nfoo = blah\nfoo2\nfoo = baz\n"
+        end
+
+        before :each do
+          File.open(@tmpfile, 'w') do |fh|
+            fh.write(content)
+          end
+        end
+
+        it 'appends the specified line to the file' do
+          provider.create
+          expect(File.read(@tmpfile)).to eq(content << resource[:line] << "\n")
+        end
+      end
+    end
+  end
+
+  context "when removing" do
+    before :each do
+      # TODO: these should be ported over to use the PuppetLabs spec_helper
+      #  file fixtures once the following pull request has been merged:
+      # https://github.com/puppetlabs/puppetlabs-stdlib/pull/73/files
+      tmp = Tempfile.new('tmp')
+      @tmpfile = tmp.path
+      tmp.close!
+      @resource = Puppet::Type::File_line.new(
+        {
+          :name   => 'foo',
+          :path   => @tmpfile,
+          :line   => 'foo',
+          :ensure => 'absent',
+        }
+      )
+      @provider = provider_class.new(@resource)
+    end
+    it 'should remove the line if it exists' do
+      File.open(@tmpfile, 'w') do |fh|
+        fh.write("foo1\nfoo\nfoo2")
+      end
+      @provider.destroy
+      expect(File.read(@tmpfile)).to eql("foo1\nfoo2")
+    end
+
+    it 'should remove the line without touching the last new line' do
+      File.open(@tmpfile, 'w') do |fh|
+        fh.write("foo1\nfoo\nfoo2\n")
+      end
+      @provider.destroy
+      expect(File.read(@tmpfile)).to eql("foo1\nfoo2\n")
+    end
+
+    it 'should remove any occurence of the line' do
+      File.open(@tmpfile, 'w') do |fh|
+        fh.write("foo1\nfoo\nfoo2\nfoo\nfoo")
+      end
+      @provider.destroy
+      expect(File.read(@tmpfile)).to eql("foo1\nfoo2\n")
+    end
+  end
+
+  context "when removing with a match" do
+    before :each do
+      # TODO: these should be ported over to use the PuppetLabs spec_helper
+      #  file fixtures once the following pull request has been merged:
+      # https://github.com/puppetlabs/puppetlabs-stdlib/pull/73/files
+      tmp = Tempfile.new('tmp')
+      @tmpfile = tmp.path
+      tmp.close!
+      @resource = Puppet::Type::File_line.new(
+        {
+          :name              => 'foo',
+          :path              => @tmpfile,
+          :line              => 'foo2',
+          :ensure            => 'absent',
+          :match             => 'o$',
+          :match_for_absence => true,
+        }
+      )
+      @provider = provider_class.new(@resource)
+    end
+
+    it 'should find a line to match' do
+      File.open(@tmpfile, 'w') do |fh|
+        fh.write("foo1\nfoo\nfoo2")
+      end
+      expect(@provider.exists?).to be_truthy
+    end
+
+    it 'should remove one line if it matches' do
+      File.open(@tmpfile, 'w') do |fh|
+        fh.write("foo1\nfoo\nfoo2")
+      end
+      @provider.destroy
+      expect(File.read(@tmpfile)).to eql("foo1\nfoo2")
+    end
+
+    it 'should raise an error if more than one line matches' do
+      File.open(@tmpfile, 'w') do |fh|
+        fh.write("foo1\nfoo\nfoo2\nfoo\nfoo")
+      end
+      expect { @provider.destroy }.to raise_error(Puppet::Error, /More than one line/)
+    end
+
+    it 'should remove multiple lines if :multiple is true' do
+      @resource = Puppet::Type::File_line.new(
+        {
+          :name              => 'foo',
+          :path              => @tmpfile,
+          :line              => 'foo2',
+          :ensure            => 'absent',
+          :match             => 'o$',
+          :multiple          => true,
+          :match_for_absence => true,
+        }
+      )
+      @provider = provider_class.new(@resource)
+      File.open(@tmpfile, 'w') do |fh|
+        fh.write("foo1\nfoo\nfoo2\nfoo\nfoo")
+      end
+      @provider.destroy
+      expect(File.read(@tmpfile)).to eql("foo1\nfoo2\n")
+    end
+
+    it 'should ignore the match if match_for_absence is not specified' do
+      @resource = Puppet::Type::File_line.new(
+        {
+          :name     => 'foo',
+          :path     => @tmpfile,
+          :line     => 'foo2',
+          :ensure   => 'absent',
+          :match    => 'o$',
+        }
+      )
+      @provider = provider_class.new(@resource)
+      File.open(@tmpfile, 'w') do |fh|
+        fh.write("foo1\nfoo\nfoo2")
+      end
+      @provider.destroy
+      expect(File.read(@tmpfile)).to eql("foo1\nfoo\n")
+    end
+
+    it 'should ignore the match if match_for_absence is false' do
+      @resource = Puppet::Type::File_line.new(
+        {
+          :name              => 'foo',
+          :path              => @tmpfile,
+          :line              => 'foo2',
+          :ensure            => 'absent',
+          :match             => 'o$',
+          :match_for_absence => false,
+        }
+      )
+      @provider = provider_class.new(@resource)
+      File.open(@tmpfile, 'w') do |fh|
+        fh.write("foo1\nfoo\nfoo2")
+      end
+      @provider.destroy
+      expect(File.read(@tmpfile)).to eql("foo1\nfoo\n")
+    end
+
+  end
+
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/type/anchor_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/type/anchor_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/type/anchor_spec.rb	(revision 30960)
@@ -0,0 +1,11 @@
+#!/usr/bin/env ruby
+
+require 'spec_helper'
+
+anchor = Puppet::Type.type(:anchor).new(:name => "ntp::begin")
+
+describe anchor do
+  it "should stringify normally" do
+    expect(anchor.to_s).to eq("Anchor[ntp::begin]")
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/type/file_line_spec.rb
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/type/file_line_spec.rb	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/unit/puppet/type/file_line_spec.rb	(revision 30960)
@@ -0,0 +1,76 @@
+#! /usr/bin/env ruby -S rspec
+require 'spec_helper'
+require 'tempfile'
+describe Puppet::Type.type(:file_line) do
+  let :file_line do
+    Puppet::Type.type(:file_line).new(:name => 'foo', :line => 'line', :path => '/tmp/path')
+  end
+  it 'should accept a line and path' do
+    file_line[:line] = 'my_line'
+    expect(file_line[:line]).to eq('my_line')
+    file_line[:path] = '/my/path'
+    expect(file_line[:path]).to eq('/my/path')
+  end
+  it 'should accept a match regex' do
+    file_line[:match] = '^foo.*$'
+    expect(file_line[:match]).to eq('^foo.*$')
+  end
+  it 'should accept a match regex that does not match the specified line' do
+    expect {
+      Puppet::Type.type(:file_line).new(
+          :name   => 'foo',
+          :path   => '/my/path',
+          :line   => 'foo=bar',
+          :match  => '^bar=blah$'
+    )}.not_to raise_error
+  end
+  it 'should accept a match regex that does match the specified line' do
+    expect {
+      Puppet::Type.type(:file_line).new(
+          :name   => 'foo',
+          :path   => '/my/path',
+          :line   => 'foo=bar',
+          :match  => '^\s*foo=.*$'
+      )}.not_to raise_error
+  end
+  it 'should accept posix filenames' do
+    file_line[:path] = '/tmp/path'
+    expect(file_line[:path]).to eq('/tmp/path')
+  end
+  it 'should not accept unqualified path' do
+    expect { file_line[:path] = 'file' }.to raise_error(Puppet::Error, /File paths must be fully qualified/)
+  end
+  it 'should require that a line is specified' do
+    expect { Puppet::Type.type(:file_line).new(:name => 'foo', :path => '/tmp/file') }.to raise_error(Puppet::Error, /line is a required attribute/)
+  end
+  it 'should not require that a line is specified when matching for absence' do
+    expect { Puppet::Type.type(:file_line).new(:name => 'foo', :path => '/tmp/file', :ensure => :absent, :match_for_absence => :true, :match => 'match') }.not_to raise_error
+  end
+  it 'should require that a file is specified' do
+    expect { Puppet::Type.type(:file_line).new(:name => 'foo', :line => 'path') }.to raise_error(Puppet::Error, /path is a required attribute/)
+  end
+  it 'should default to ensure => present' do
+    expect(file_line[:ensure]).to eq :present
+  end
+  it 'should default to replace => true' do
+    expect(file_line[:replace]).to eq :true
+  end
+
+  it "should autorequire the file it manages" do
+    catalog = Puppet::Resource::Catalog.new
+    file = Puppet::Type.type(:file).new(:name => "/tmp/path")
+    catalog.add_resource file
+    catalog.add_resource file_line
+
+    relationship = file_line.autorequire.find do |rel|
+      (rel.source.to_s == "File[/tmp/path]") and (rel.target.to_s == file_line.to_s)
+    end
+    expect(relationship).to be_a Puppet::Relationship
+  end
+
+  it "should not autorequire the file it manages if it is not managed" do
+    catalog = Puppet::Resource::Catalog.new
+    catalog.add_resource file_line
+    expect(file_line.autorequire).to be_empty
+  end
+end
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/absolutepath.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/absolutepath.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/absolutepath.pp	(revision 30960)
@@ -0,0 +1,2 @@
+# A strict absolutepath type
+type Stdlib::Absolutepath = Variant[Stdlib::Windowspath, Stdlib::Unixpath]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/absolute_path.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/absolute_path.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/absolute_path.pp	(revision 30960)
@@ -0,0 +1,7 @@
+# Emulate the is_absolute_path and validate_absolute_path functions
+#
+# The first pattern is originally from is_absolute_path, which had it from 2.7.x's lib/puppet/util.rb Puppet::Util.absolute_path?
+# slash = '[\\\\/]'
+# name = '[^\\\\/]+'
+# %r!^(([A-Z]:#{slash})|(#{slash}#{slash}#{name}#{slash}#{name})|(#{slash}#{slash}\?#{slash}#{name}))!i,
+type Stdlib::Compat::Absolute_path = Variant[Pattern[/^(([a-zA-Z]:[\\\/])|([\\\/][\\\/][^\\\/]+[\\\/][^\\\/]+)|([\\\/][\\\/]\?[\\\/][^\\\/]+))/], Pattern[/^\//]]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/array.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/array.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/array.pp	(revision 30960)
@@ -0,0 +1,2 @@
+# Emulate the is_array and validate_array functions
+type Stdlib::Compat::Array = Array[Any]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/bool.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/bool.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/bool.pp	(revision 30960)
@@ -0,0 +1,2 @@
+ # Emulate the is_bool and validate_bool functions
+ type Stdlib::Compat::Bool = Boolean
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/float.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/float.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/float.pp	(revision 30960)
@@ -0,0 +1,19 @@
+# Emulate the is_float function
+# The regex is what's currently used in is_float
+# To keep your development moving forward, you can also add a deprecation warning using the Integer type:
+#
+# ```class example($value) { validate_float($value,) }```
+#
+# would turn into
+#
+# ```
+# class example(Stdlib::Compat::Float $value) {
+#   validate_float($value, 10, 0)
+#   assert_type(Integer[0, 10], $value) |$expected, $actual| {
+#     warning("The 'value' parameter for the 'ntp' class has type ${actual}, but should be ${expected}.")
+#   }
+# }
+# ```
+#
+# This allows you to find all places where a consumers of your code call it with unexpected values.
+type Stdlib::Compat::Float = Variant[Float, Pattern[/^-?(?:(?:[1-9]\d*)|0)(?:\.\d+)(?:[eE]-?\d+)?$/]]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/integer.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/integer.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/integer.pp	(revision 30960)
@@ -0,0 +1,23 @@
+# Emulate the is_integer and validate_integer functions
+# The regex is what's currently used in is_integer
+# validate_numeric also allows range checking, which cannot be mapped to the string parsing inside the function.
+# For full backwards compatibility, you will need to keep the validate_numeric call around to catch everything.
+# To keep your development moving forward, you can also add a deprecation warning using the Integer type:
+#
+# ```class example($value) { validate_integer($value, 10, 0) }```
+#
+# would turn into
+#
+# ```
+# class example(Stdlib::Compat::Integer $value) {
+#   validate_numeric($value, 10, 0)
+#   assert_type(Integer[0, 10], $value) |$expected, $actual| {
+#     warning("The 'value' parameter for the 'ntp' class has type ${actual}, but should be ${expected}.")
+#   }
+# }
+# ```
+#
+# > Note that you need to use Variant[Integer[0, 10], Float[0, 10]] if you want to match both integers and floating point numbers.
+#
+# This allows you to find all places where a consumers of your code call it with unexpected values.
+type Stdlib::Compat::Integer = Variant[Integer, Pattern[/^-?(?:(?:[1-9]\d*)|0)$/], Array[Variant[Integer, Pattern[/^-?(?:(?:[1-9]\d*)|0)$/]]]]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/ip_address.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/ip_address.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/ip_address.pp	(revision 30960)
@@ -0,0 +1,1 @@
+type Stdlib::Compat::Ip_address = Variant[Stdlib::Compat::Ipv4, Stdlib::Compat::Ipv6]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/ipv4.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/ipv4.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/ipv4.pp	(revision 30960)
@@ -0,0 +1,2 @@
+# Emulate the validate_ipv4_address and is_ipv4_address functions
+type Stdlib::Compat::Ipv4 = Pattern[/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/ipv6.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/ipv6.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/ipv6.pp	(revision 30960)
@@ -0,0 +1,1 @@
+type Stdlib::Compat::Ipv6 = Pattern[/^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|((?:[\da-f]{1,4}:){6})(\d+)\.(\d+)\.(\d+)\.(\d+))$/]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/numeric.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/numeric.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/numeric.pp	(revision 30960)
@@ -0,0 +1,23 @@
+# Emulate the is_numeric and validate_numeric functions
+# The regex is what's currently used in is_numeric
+# validate_numeric also allows range checking, which cannot be mapped to the string parsing inside the function.
+# For full backwards compatibility, you will need to keep the validate_numeric call around to catch everything.
+# To keep your development moving forward, you can also add a deprecation warning using the Integer type:
+#
+# ```class example($value) { validate_numeric($value, 10, 0) }```
+#
+# would turn into
+#
+# ```
+# class example(Stdlib::Compat::Numeric $value) {
+#   validate_numeric($value, 10, 0)
+#   assert_type(Integer[0, 10], $value) |$expected, $actual| {
+#     warning("The 'value' parameter for the 'ntp' class has type ${actual}, but should be ${expected}.")
+#   }
+# }
+# ```
+#
+# > Note that you need to use Variant[Integer[0, 10], Float[0, 10]] if you want to match both integers and floating point numbers.
+#
+# This allows you to find all places where a consumers of your code call it with unexpected values.
+type Stdlib::Compat::Numeric = Variant[Numeric, Pattern[/^-?(?:(?:[1-9]\d*)|0)(?:\.\d+)?(?:[eE]-?\d+)?$/], Array[Variant[Numeric, Pattern[/^-?(?:(?:[1-9]\d*)|0)(?:\.\d+)?(?:[eE]-?\d+)?$/]]]]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/re.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/re.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/re.pp	(revision 30960)
@@ -0,0 +1,3 @@
+# Emulate the validate_re function
+# validate_re(value, re) translates to Pattern[re], which is not directly mappable as a type alias, but can be specified as Pattern[re].
+# Therefore this needs to be translated directly.
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/string.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/string.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/compat/string.pp	(revision 30960)
@@ -0,0 +1,2 @@
+# Emulate the is_string and validate_string functions
+type Stdlib::Compat::String = Optional[String]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/httpsurl.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/httpsurl.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/httpsurl.pp	(revision 30960)
@@ -0,0 +1,1 @@
+type Stdlib::HTTPSUrl = Pattern[/^https:\/\//]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/httpurl.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/httpurl.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/httpurl.pp	(revision 30960)
@@ -0,0 +1,1 @@
+type Stdlib::HTTPUrl = Pattern[/^https?:\/\//]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/unixpath.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/unixpath.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/unixpath.pp	(revision 30960)
@@ -0,0 +1,2 @@
+# this regex rejects any path component that is a / or a NUL
+type Stdlib::Unixpath = Pattern[/^\/([^\/\0]+(\/)?)+$/]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/windowspath.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/windowspath.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/types/windowspath.pp	(revision 30960)
@@ -0,0 +1,1 @@
+type Stdlib::Windowspath = Pattern[/^(([a-zA-Z]:[\\\/])|([\\\/][\\\/][^\\\/]+[\\\/][^\\\/]+)|([\\\/][\\\/]\?[\\\/][^\\\/]+))/]
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/files/id_rsa
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/files/id_rsa	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/files/id_rsa	(revision 30960)
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEpAIBAAKCAQEAnh3QT1Rrkj1Tjvp/eI/2OX/FShiAM42g3t9IbvQT3rQPghha
+bM8OJw5IckbVuSfc4Rirs5nAqiE07jOgRqR2sfWSj+5UUYxvC4d/NLAhgP+vdRI0
+lZkfJKy7xmSEMXshyqQwSxJnKSQQecqEsrhaSvuEYZiS3+yJmQO5rcYYHTxoXunK
+1GEWy7pDYL+tbrQf4W63vbYDV9oIhLqwbI/QiOcoTzzYKuoj/GQTsgl4FDX9+2wH
+uwI0FDFeRuiTGdXJRHjTzflMuWK36I68d8B3xuNDbsbjKxSEKOagmGt6vf0lTsbC
+SC1rfoWdm28XRnEDnfQF2BTTaMD2smNAXQJEqwIDAQABAoIBADkNyPzXGXnLZztQ
+aG64g8B7ulTiQmBX2pSRPTHMIN9bWb03zGk2zYSKQtn5dWU6XRlcLZjBAiRhlxfc
+yRi0f5/3XMtS1FoYsnkWi3AXnf9OQ6Ga0B6rAfHZ4mfUHV89bxQP6t0r5s2RleBc
+k0VqACrOVxZgV581WvE7xuRNdqYVdNJ2gHYCKJJhn+zboDMZxxqEMUuzAWuwV84S
+3LGGMGzkzMG0x7h6zKCuL3z8kkQYf5FNZz5YthAobGYHSf8U8Ck7/Wuk0Rric5us
+pZaLTLClU4fivoZ3Bj2GJtUrQhfLidtVFdy2KlxzuqsMQwqxLlW+NrZxS/mooe1P
+q1dWcgECgYEAzwu/KuSmFguDGh1uwDOixn1ujYZdqJQ7ada7cNDxJTHynr0d2sQ8
+B7Y2mjkc1GbiWAtjl8URhjar4lwWNAUBL9CULqHaZ7wuKcFr0JYZof6wD1oNpfnz
+ZpAyq2SV8qVkrrqa38TlyQC29E+cpDM69NhNuH9WebuJKLVkFxLd8GMCgYEAw4Bs
+lcFIWvFLv3MrX2NRJvDeb1O0W9FIq9xNEzgq8iXhjahGYQZZh7YgIr92WNgqYqCQ
+T/aiKyvTz5fQz/GB/OSxTcsZu8Tf35SZuk9IOqHmQRoGa4L/B4zKbXV0+giDUGYc
+HCvacA9SZRDbTcKfyhtsqZ2X30YcI6lSCKadeRkCgYBQfZqWDEndLCCNmH+jzO8t
+BzphXqkujmICpW49T51P/nj56T+f+sXzoYzcq/NfR5ga7mKLcBt99+cemvouwvtR
+IV9aOaX0yh2QMhe+AXx5k8/SSAoiSmerqcdpBjOdH1ti6jynXZ6PY+28UO7ujtQO
+t8CPR0HRFW0fHFWK+tS5TQKBgQCjVQri/o0VtZxkQbMNyWsGTpx3hAYd47aEJtSZ
+5wYyMiXD9L9/1g88i5NDlJQqW8bliWGn/NS1nrMiL6L757iC8QmUhcdlEXE8WOkq
+N4yPt60n3LdaYSHyS9TfKA9nyW7z36tCefzQPGzJFREzYROghdL9zjURC4D85jws
+EA9mGQKBgQCLIt42pkAaN8eqJ7IBF+3CAckstkq14qzKB8UGdEmuak4bcxJLIvcv
+rdGQ+fdtitmMU2fx3YC4s3Z8GoLFzP/Esjb4eSGt0pbhSxYIcHhLCmjmHxnVcZ3S
+6z2Pj3asryK7XxoZiODvZJcS1TbaOp1e2YQyxTEL5fwy4fNr4V+bIQ==
+-----END RSA PRIVATE KEY-----
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/files/id_rsa.pub
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/files/id_rsa.pub	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/files/id_rsa.pub	(revision 30960)
@@ -0,0 +1,1 @@
+ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeHdBPVGuSPVOO+n94j/Y5f8VKGIAzjaDe30hu9BPetA+CGFpszw4nDkhyRtW5J9zhGKuzmcCqITTuM6BGpHax9ZKP7lRRjG8Lh380sCGA/691EjSVmR8krLvGZIQxeyHKpDBLEmcpJBB5yoSyuFpK+4RhmJLf7ImZA7mtxhgdPGhe6crUYRbLukNgv61utB/hbre9tgNX2giEurBsj9CI5yhPPNgq6iP8ZBOyCXgUNf37bAe7AjQUMV5G6JMZ1clEeNPN+Uy5Yrfojrx3wHfG40NuxuMrFIQo5qCYa3q9/SVOxsJILWt+hZ2bbxdGcQOd9AXYFNNowPayY0BdAkSr cscarioni@Carlos-MacBook-Air.local
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/manifests/init.pp
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/manifests/init.pp	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/manifests/init.pp	(revision 30960)
@@ -0,0 +1,78 @@
+class zookeeper {
+
+ exec { "download_zookeeper":
+  command => "wget -O /tmp/zookeeper-3.4.9.tar.gz http://www-us.apache.org/dist/zookeeper/zookeeper-3.4.9/zookeeper-3.4.9.tar.gz",
+  timeout => 0,
+  path => $path,
+  unless => "ls ${install_dir} | grep zookeeper-3.4.9",
+  require => Package["oracle-java8-installer"]
+ }
+
+ exec { "unpack_zookeeper":
+  command => "tar -zxf /tmp/zookeeper-3.4.9.tar.gz -C ${install_dir}",
+  path => $path,
+  creates => "${zookeeper_home}-3.4.9",
+  require => Exec["download_zookeeper"]
+ }
+
+ exec { "rename_zookeeper":
+  command => "ln -s ${install_dir}/zookeeper-3.4.9 ${install_dir}/zookeeper",
+  path => $path,
+  creates => "${zookeeper_home}",
+  require => Exec["unpack_zookeeper"]
+ }
+
+ exec { 'chown_zookeeper':
+  command => "/bin/chown -R ${user}:${group} ${zookeeper_home}-3.4.9",
+  path => '/bin',
+  user => 'root',
+  require => Exec["rename_zookeeper"]
+ }
+
+ file { 
+  "${zookeeper_home}/conf/zoo.cfg":
+  content => template('zookeeper/zoo.cfg'),
+  mode => 644,
+  owner => $user,
+  group => $group,
+  require => Exec["chown_zookeeper"]
+ }
+ 
+
+ file { '/var/lib/zookeeper':
+    ensure => 'directory',
+    owner  => $user,
+    group  => $group,
+    mode   => 755,
+    require => Exec["chown_zookeeper"]	
+ }
+  
+# file {
+#   [ "${hadoop_home}/hadoop_store",
+#     "${hadoop_home}/hadoop_store/hdfs",
+#     "${hadoop_home}/hadoop_store/hdfs/namenode",
+#     "${hadoop_home}/hadoop_store/hdfs/datanode"]:
+#   ensure => 'directory',
+#   owner => "${user}",
+#   group => "${group}",
+#   mode => 755,
+#   require => Exec["chown_hadoop"]
+#  }
+
+ file {
+  "/home/${user}/.bashrc-setup-zookeeper":
+  content => template('zookeeper/setup-zookeeper.bash'),
+  mode => 644,
+  owner => $user,
+  group => $group,
+  require => [  Exec["unpack_zookeeper"], File["/home/${user}"] ]
+ }
+
+ file_line { "setup_zookeeper_home":
+    ensure => present,
+    path => "/home/${user}/.bashrc",
+    line => ". .bashrc-setup-zookeeper",
+    require => [  Exec["unpack_zookeeper"], File["/home/${user}"] ]	
+ }
+}
+
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/templates/setup-zookeeper.bash
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/templates/setup-zookeeper.bash	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/templates/setup-zookeeper.bash	(revision 30960)
@@ -0,0 +1,7 @@
+
+export JAVA_HOME=/usr/lib/jvm/java-8-oracle
+export PATH="$JAVA_HOME/bin:$PATH"
+
+export ZOOKEEPER_HOME="<%= @zookeeper_home %>"
+export PATH="$ZOOKEEPER_HOME/bin:$PATH"
+
Index: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/templates/zoo.cfg
===================================================================
--- other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/templates/zoo.cfg	(revision 30960)
+++ other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/zookeeper/templates/zoo.cfg	(revision 30960)
@@ -0,0 +1,3 @@
+tickTime=2000
+dataDir=/var/lib/zookeeper
+clientPort=2181
