Skip to content

Commit

Permalink
Initial import.
Browse files Browse the repository at this point in the history
  • Loading branch information
hectcastro committed Sep 7, 2012
0 parents commit 9da952c
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## v0.1.0

* Initial release.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# template-cookbook

## Description

A cool description – preferably wrapped at 80 characters.

## Requirements

### Platforms

* RedHat 6.3 (Santiago)
* Ubuntu 11.10 (Oneiric)
* Ubuntu 12.04 (Precise)

### Cookbooks

* apache2
* logrotate

## Attributes

* `node["template_cookbook"]["version"]` - Version of template-cookbook to
install.
* `node["template_cookbook"]["user"]` - User for template-cookbook.
* `node["template_cookbook"]["group"]` - Group for template-cookbook.

## Recipes

* `recipe[template-cookbook]` will install template-cookbook.
* `recipe[template-cookbook::alternate]` will install alternate
template-cookbook.

## Usage

A short write-up of any usage specific instructions. For example, default
passwords, examples of attributes that alter recipe behavior, and
auto-discovery of dependant services.
25 changes: 25 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
desc "Runs foodcritic"
task :foodcritic do
if Gem::Version.new("1.9.2") <= Gem::Version.new(RUBY_VERSION.dup)
sandbox = File.join(File.dirname(__FILE__), %w{tmp foodcritic cookbook})
prepare_foodcritic_sandbox(sandbox)

sh "foodcritic --epic-fail any #{File.dirname(sandbox)}"
else
STDERR.puts "WARN: foodcritic run is skipped as Ruby #{RUBY_VERSION} is < 1.9.2."
end
end

task :default => "foodcritic"

private

def prepare_foodcritic_sandbox(sandbox)
files = %w{*.md *.rb attributes definitions files providers
recipes resources templates}

rm_rf sandbox
mkdir_p sandbox
cp_r Dir.glob("{#{files.join(',')}}"), sandbox
puts "\n\n"
end
3 changes: 3 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
default["template_cookbook"]["version"] = "1.2.3"
default["template_cookbook"]["user"] = "template_user"
default["template_cookbook"]["group"] = "template_user"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require "minitest/autorun"

describe_recipe "template-cookbook::alternate" do
include MiniTest::Chef::Assertions
include MiniTest::Chef::Context
include MiniTest::Chef::Resources
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require "minitest/autorun"

describe_recipe "template-cookbook::default" do
include MiniTest::Chef::Assertions
include MiniTest::Chef::Context
include MiniTest::Chef::Resources
end
15 changes: 15 additions & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
maintainer "The Wharton School - The University of Pennsylvania"
maintainer_email "[email protected]"
license "Apache 2.0"
description "A cool description."
version "0.1.0"
recipe "template-cookbook", "Short description of template-cookbook default recipe."
recipe "template-cookbook::alternate", "Short description of template-cookbook::alternate recipe."

%w{ apache2 logrotate }.each do |d|
depends d
end

%w{ redhat ubuntu }.each do |os|
supports os
end
Empty file added recipes/alternate.rb
Empty file.
Empty file added recipes/default.rb
Empty file.
1 change: 1 addition & 0 deletions templates/default/template-cookbook.conf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A cool story.
4 changes: 4 additions & 0 deletions test/support/Gemfile.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source :rubygems

gem "rake"
gem "foodcritic"

0 comments on commit 9da952c

Please sign in to comment.