From a9408c792ba48ffc5e59d8641a538a83197b7064 Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Thu, 15 May 2014 21:08:35 -0700 Subject: [PATCH] Initial commit Added skeleton from `puppet module generate` minus bits related to manifests. --- .gitignore | 15 +++++++++++++++ Rakefile | 18 ++++++++++++++++++ metadata.json | 17 +++++++++++++++++ spec/classes/init_spec.rb | 7 +++++++ spec/spec_helper.rb | 17 +++++++++++++++++ 5 files changed, 74 insertions(+) create mode 100644 .gitignore create mode 100644 Rakefile create mode 100644 metadata.json create mode 100644 spec/classes/init_spec.rb create mode 100644 spec/spec_helper.rb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ac0a8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +## MAC OS +.DS_Store + +## TEXTMATE +*.tmproj +tmtags + +## EMACS +*~ +\#* +.\#* + +## VIM +*.swp +tags diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..d1e11f7 --- /dev/null +++ b/Rakefile @@ -0,0 +1,18 @@ +require 'rubygems' +require 'puppetlabs_spec_helper/rake_tasks' +require 'puppet-lint/tasks/puppet-lint' +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] + +desc "Validate manifests, templates, and ruby files" +task :validate do + Dir['manifests/**/*.pp'].each do |manifest| + sh "puppet parser validate --noop #{manifest}" + end + Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file| + sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/ + end + Dir['templates/**/*.erb'].each do |template| + sh "erb -P -x -T '-' #{template} | ruby -c" + end +end diff --git a/metadata.json b/metadata.json new file mode 100644 index 0000000..d2225f8 --- /dev/null +++ b/metadata.json @@ -0,0 +1,17 @@ +{ + "name": "sharpie-puppet_yardoc", + "version": "0.0.1", + "author": "Charlie Sharpsteen", + "summary": "Puppet documentation via YARD", + "license": "Apache 2.0", + "source": "", + "project_page": null, + "issues_url": null, + "dependencies": [ + { + "name": "puppetlabs-stdlib", + "version_range": ">= 1.0.0" + } + ] +} + diff --git a/spec/classes/init_spec.rb b/spec/classes/init_spec.rb new file mode 100644 index 0000000..5d4503c --- /dev/null +++ b/spec/classes/init_spec.rb @@ -0,0 +1,7 @@ +require 'spec_helper' +describe 'puppet_yardoc' do + + context 'with defaults for all parameters' do + it { should contain_class('puppet_yardoc') } + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..5fda588 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,17 @@ +dir = File.expand_path(File.dirname(__FILE__)) +$LOAD_PATH.unshift File.join(dir, 'lib') + +require 'mocha' +require 'puppet' +require 'rspec' +require 'spec/autorun' + +Spec::Runner.configure do |config| + config.mock_with :mocha +end + +# We need this because the RAL uses 'should' as a method. This +# allows us the same behaviour but with a different method name. +class Object + alias :must :should +end