├── node.json ├── Gemfile ├── .gitignore ├── cookbooks └── cookbook_guide │ ├── Berksfile │ ├── spec │ ├── spec_helper.rb │ └── unit │ │ └── recipes │ │ └── default_spec.rb │ ├── files │ └── default │ │ ├── reveal.json │ │ └── nodeserver │ ├── .gitignore │ ├── metadata.rb │ ├── Gemfile │ ├── .kitchen.yml │ ├── Rakefile │ ├── test │ └── integration │ │ └── default │ │ └── default_spec.rb │ ├── recipes │ └── default.rb │ ├── .rubocop.yml │ └── LICENSE ├── solo.rb ├── cookbook-guide.pdf ├── nodes └── README.md ├── docs ├── reveal.json ├── 14_code_climate.md ├── 13_hosted_testing_tools.md ├── 01_chef_partner_cookbooks.md ├── 02_why_write_chef_community_cookbooks.md ├── 05_naming_your_cookbook.md ├── 10_lint.md ├── 18_advanced_debugging.md ├── 04_how_to_write_a_good_cookbook.md ├── 22_joining_the_cpcp.md ├── 08_community_quality_metrics.md ├── 16_other_things_we_look_for.md ├── 07_community_cookbook_documentation.md ├── 15_travis_ci.md ├── 03_what_is_a_chef_partner_cookbook.md ├── 21_weve_made_it_easy.md ├── 19_supermarket.md ├── 06_writing_the_readme.md ├── 11_unit_tests.md ├── 20_advanced_jenkins_jobs.md ├── 17_custom_resources.md ├── 12_integration_tests.md ├── 09_ruby_style.md └── theme │ └── chef.css ├── dockerfiles ├── reveal.json └── supervisord.conf ├── scripts ├── cibuild └── update_container.sh ├── .travis.yml ├── Vagrantfile ├── CONTRIBUTING ├── Gemfile.lock ├── Dockerfile ├── README.md └── LICENSE /node.json: -------------------------------------------------------------------------------- 1 | { 2 | "run_list": [ "recipe[bootstrap]" ] 3 | } 4 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem 'html-proofer' 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | nodes/vagrant* 3 | .direnv/ 4 | .envrc 5 | .ruby-version -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/Berksfile: -------------------------------------------------------------------------------- 1 | source "https://supermarket.chef.io" 2 | 3 | metadata 4 | -------------------------------------------------------------------------------- /solo.rb: -------------------------------------------------------------------------------- 1 | current_dir = File.dirname(__FILE__) 2 | cookbook_path [ "#{current_dir}/cookbooks" ] 3 | -------------------------------------------------------------------------------- /cookbook-guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chef-boneyard/cookbook-guide/HEAD/cookbook-guide.pdf -------------------------------------------------------------------------------- /nodes/README.md: -------------------------------------------------------------------------------- 1 | This directory needs to be exist for the `chef-zero` provisioner to work properly. 2 | -------------------------------------------------------------------------------- /docs/reveal.json: -------------------------------------------------------------------------------- 1 | { 2 | "controls": true, 3 | "progress": true, 4 | "center": false 5 | } 6 | -------------------------------------------------------------------------------- /dockerfiles/reveal.json: -------------------------------------------------------------------------------- 1 | { 2 | "controls": true, 3 | "progress": true, 4 | "center": false 5 | } 6 | -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/spec/spec_helper.rb: -------------------------------------------------------------------------------- 1 | require "chefspec" 2 | require "chefspec/berkshelf" 3 | ChefSpec::Coverage.start! 4 | -------------------------------------------------------------------------------- /scripts/cibuild: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e # halt script on error 3 | 4 | bundle exec htmlproofer ./_site --allow-hash-href 5 | -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/files/default/reveal.json: -------------------------------------------------------------------------------- 1 | { 2 | "controls": true, 3 | "progress": true, 4 | "center": false 5 | } 6 | -------------------------------------------------------------------------------- /dockerfiles/supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | 4 | [program:nodejs] 5 | autostart=true 6 | user=root 7 | command=/usr/bin/nodejs /usr/bin/reveal-md /tmp/index.md --theme chef 8 | -------------------------------------------------------------------------------- /docs/14_code_climate.md: -------------------------------------------------------------------------------- 1 | ## Code Climate 2 | 3 | * Checks code quality and runs automated tools. 4 | * [Code Climate blog post on testing for Chef](https://codeclimate.com/changelog/56030367e30ba04323004eea). 5 | -------------------------------------------------------------------------------- /docs/13_hosted_testing_tools.md: -------------------------------------------------------------------------------- 1 | ## Hosted Testing Tools 2 | 3 | * These may be configured to automatically test incoming PRs on GitHub. 4 | * [Code Climate](https://codeclimate.com) 5 | * [Travis.CI](https://travis-ci.org) 6 | -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/.gitignore: -------------------------------------------------------------------------------- 1 | .vagrant 2 | Berksfile.lock 3 | Gemfile.lock 4 | *~ 5 | *# 6 | .#* 7 | \#*# 8 | .*.sw[a-z] 9 | *.un~ 10 | .bundle 11 | .cache 12 | .kitchen 13 | bin 14 | .kitchen.local.yml 15 | .coverage 16 | -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/metadata.rb: -------------------------------------------------------------------------------- 1 | name "cookbook_guide" 2 | maintainer "Partner Engineering from Chef, Inc." 3 | maintainer_email "partnereng@chef.io" 4 | license "Apache 2.0" 5 | description "Bootstraps the cookbook-guide vm" 6 | version "1.0.0" 7 | -------------------------------------------------------------------------------- /docs/01_chef_partner_cookbooks.md: -------------------------------------------------------------------------------- 1 | # Chef Partner Cookbook Guide 2 | 3 | Hi from Chef's Technical Alliance Team! 4 | 5 | * Here are some standards for the Chef Partner Cookbook Program. 6 | * And some best practices we've found over years of writing cookbooks. 7 | 8 | JJ Asghar 9 | -------------------------------------------------------------------------------- /docs/02_why_write_chef_community_cookbooks.md: -------------------------------------------------------------------------------- 1 | ## Why Write Chef Community Cookbooks? 2 | 3 | * Help customers succeed. 4 | * Own the way our shared customers use your technology and Chef. 5 | * Reach thousands of joint users. 6 | * Users provide real-world feedback. 7 | * Good marketing opportunity. 8 | -------------------------------------------------------------------------------- /docs/05_naming_your_cookbook.md: -------------------------------------------------------------------------------- 1 | ## Naming your cookbook 2 | 3 | * You should name your cookbook for what it is. 4 | * Be as descriptive as possible. 5 | * You should take note of [RFC-078](https://github.com/chef/chef-rfc/blob/master/rfc078-supermarket-prefix.md) in case for prefixing your cookbook for the [Supermarket](https://supermarket.chef.io). 6 | -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | gem "chef" 4 | gem "chefspec" 5 | gem "test-kitchen" 6 | gem "kitchen-vagrant" 7 | gem "kitchen-inspec" 8 | 9 | group :lint do 10 | gem "foodcritic" 11 | gem "rubocop" 12 | gem "rainbow" 13 | end 14 | 15 | group :unit do 16 | gem "berkshelf" 17 | gem "fauxhai" 18 | end 19 | -------------------------------------------------------------------------------- /docs/10_lint.md: -------------------------------------------------------------------------------- 1 | ## Linting and Cookbook Style 2 | 3 | * [Foodcritic](http://www.foodcritic.io) 4 | * Now included with the [ChefDK](https://downloads.chef.io/chef-dk/). 5 | * Chef style guide for cookbooks. 6 | * Eliminates potential issues. 7 | * Please document your overrides or disagreements. 8 | * As long as you justify that's all we are looking for. 9 | -------------------------------------------------------------------------------- /docs/18_advanced_debugging.md: -------------------------------------------------------------------------------- 1 | ## Advanced Debugging 2 | 3 | * [Pry](https://pryrepl.org/) is an interactive shell for debugging Ruby. 4 | * Chef has the pry gem already included as a dependency. 5 | * Include this block in your recipes, libraries or custom Resources to drop into pry during a ```chef-client``` run. 6 | ```ruby 7 | require 'pry'; binding.pry 8 | ``` 9 | -------------------------------------------------------------------------------- /docs/04_how_to_write_a_good_cookbook.md: -------------------------------------------------------------------------------- 1 | ## How to Write a "Good" Cookbook 2 | 3 | * "Good" is subjective, but there are guidelines to do better. 4 | * Use the ChefDK for development. 5 | * [downloads.chef.io/chef-dk/](https://downloads.chef.io/chef-dk/) 6 | * `chef generate cookbook` 7 | * Fill in the appropriate content. 8 | * Check the `LICENSE.md`. (We prefer Apache v2.) 9 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: ruby 2 | rvm: 3 | - 2.1 4 | 5 | # Assume bundler is being used, therefore 6 | # the `install` step will run `bundle install` by default. 7 | script: ./scripts/cibuild 8 | 9 | env: 10 | global: 11 | - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer 12 | 13 | sudo: false # route your build to the container-based infrastructure for a faster build 14 | -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/.kitchen.yml: -------------------------------------------------------------------------------- 1 | driver: 2 | name: vagrant 3 | network: 4 | - ["forwarded_port", {guest: 1948, host: 1948, auto_correct: true}] 5 | 6 | provisioner: 7 | name: chef_zero 8 | require_chef_omnibus: latest 9 | 10 | verifier: 11 | name: inspec 12 | 13 | platforms: 14 | - name: ubuntu-14.04 15 | 16 | suites: 17 | - name: default 18 | run_list: 19 | - recipe[bootstrap::default] -------------------------------------------------------------------------------- /docs/22_joining_the_cpcp.md: -------------------------------------------------------------------------------- 1 | ## Joining the Chef Partner Cookbook Program 2 | 3 | * Contact JJ to say you're ready for validation . 4 | * Or apply through the landing page for [Partner Cookbooks](https://www.chef.io/partners/cookbooks/) 5 | * Discuss proposed cookbook features. 6 | * Provide examples and documentation. 7 | * Answer technical questions, code reviews, and provide feedback. 8 | * Help promote usage. 9 | -------------------------------------------------------------------------------- /scripts/update_container.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | docker stop chef-partner-cookbook-guide 4 | docker rm -f $(docker ps -aq --filter name=cookbook-guide) 5 | docker rm -f $(docker ps -aq --filter name=chef-partner-cookbook-guide) 6 | docker pull jjasghar/chef-partner-cookbook-guide 7 | docker run -p 1948:1948 --name 'cookbook-guide' -d 'jjasghar/chef-partner-cookbook-guide' 8 | sleep 2 9 | open http://localhost:1948/index.md 10 | -------------------------------------------------------------------------------- /docs/08_community_quality_metrics.md: -------------------------------------------------------------------------------- 1 | ## Community Quality Metrics 2 | 3 | * Community-provided documentation for objectively assessing cookbooks. 4 | * These are leading indicators of quality. 5 | * Usually easy to achieve, show you took the time to try to do a good job. 6 | * [github.com/chef-cookbooks/cookbook-quality-metrics](https://github.com/chef-cookbooks/cookbook-quality-metrics) 7 | * You should be able check off on these before sharing. 8 | -------------------------------------------------------------------------------- /docs/16_other_things_we_look_for.md: -------------------------------------------------------------------------------- 1 | ## Other Things We Look For 2 | 3 | * Semantic versioning observed. 4 | * Use Chef's built-in Resources. 5 | * Windows support and testing where applicable. 6 | * Attributes defined and documented in the `attributes/default.rb`. 7 | * Idempotent recipes. 8 | * Recipes requiring multiple runs are generally discouraged. 9 | * Run the recipes twice to catch non-idempotent behavior. 10 | * Private Recipes are generally a good pattern. 11 | -------------------------------------------------------------------------------- /docs/07_community_cookbook_documentation.md: -------------------------------------------------------------------------------- 1 | ## Community Cookbook Documentation 2 | 3 | * Examples for how Chef Software cookbooks are managed. 4 | * [github.com/chef-cookbooks/community_cookbook_documentation](https://github.com/chef-cookbooks/community_cookbook_documentation) 5 | * `CONTRIBUTING.md` explaining how to help further development. 6 | * `LICENSE` Apache v2 license provided. 7 | * `TESTING.md` explaining how to test this cookbook. 8 | * `README.md` your over arching explanation of this cookbook. 9 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | Vagrant.configure(2) do |config| 2 | # export VAGRANT_DEFAULT_PROVIDER=virtualbox 3 | config.vm.define "guide" do |g| 4 | g.vm.box = "bento/ubuntu-14.04" 5 | g.vm.provider "virtualbox" 6 | g.vm.synced_folder ".", "/vagrant" 7 | g.vm.network :forwarded_port, guest: 1948, host: 1948 8 | g.vm.provision "chef_zero" do |chef| 9 | chef.cookbooks_path = "cookbooks" 10 | chef.nodes_path = "nodes" 11 | 12 | chef.add_recipe "cookbook_guide" 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /docs/15_travis_ci.md: -------------------------------------------------------------------------------- 1 | ## Travis.CI 2 | 3 | * The ChefDK is fully supported. 4 | * example: [github.com/chef-cookbooks/mysql/blob/master/.travis.yml](https://github.com/chef-cookbooks/mysql/blob/master/.travis.yml) 5 | * Be cautious on putting Test-Kitchen and public cloud plugins on Travis.CI, there is a possibility of being charged by public clouds. 6 | * Another [example][tomcat] of a complete verification on the Travis system via the ChefDK. 7 | 8 | [tomcat]: https://github.com/chef-cookbooks/tomcat/blob/master/.travis.yml 9 | -------------------------------------------------------------------------------- /docs/03_what_is_a_chef_partner_cookbook.md: -------------------------------------------------------------------------------- 1 | ## What is a Chef Partner Cookbook? 2 | 3 | * Chef's Partner Engineering helps you write your cookbook. 4 | * The cookbook is Open Source and freely available. 5 | * We want to help all our users succeed with both companies' software. 6 | * Joint marketing opportunities, starts with the Chef blog! 7 | * A [Supermarket](https://supermarket.chef.io) badge and mention on the [Chef Partner cookbook](https://www.chef.io/partners/cookbooks/) page. 8 | * All the benefits of Community Cookbooks! 9 | -------------------------------------------------------------------------------- /docs/21_weve_made_it_easy.md: -------------------------------------------------------------------------------- 1 | ## We've made it easy to start 2 | 3 | * We have created a cookbook generator to work with the ChefDK. 4 | * [Cookbook-guide generator](https://github.com/chef-partners/cookbook-guide-generator) 5 | * Install the ChefDK, clone down the above repo, and then: 6 | ```shell 7 | $ chef generate cookbook -g ~/cookbook-guide-generator/cookbooks your-new-cookbook-name 8 | ``` 9 | * You get a skeleton of everything we mention in this presentation. 10 | * Fill out the TODOs and your specific code and you're pretty much done! 11 | -------------------------------------------------------------------------------- /docs/19_supermarket.md: -------------------------------------------------------------------------------- 1 | ## Supermarket 2 | 3 | * Chef's community site for sharing cookbooks. 4 | * Not only cookbooks, but other extensions too! 5 | * The site is: [supermarket.chef.io](https://supermarket.chef.io). 6 | * Please publish your cookbook here. 7 | * Fill all the extra fields. 8 | * "Chef Partner Cookbook" badge when you are certified. 9 | * A list of the [already certified cookbooks](https://supermarket.chef.io/cookbooks?utf8=%E2%9C%93&q=&badges%5B%5D=partner&platforms%5B%5D=). 10 | * The main landing page for [Partner Cookbooks](https://www.chef.io/partners/cookbooks/). 11 | -------------------------------------------------------------------------------- /CONTRIBUTING: -------------------------------------------------------------------------------- 1 | Chef does not require that contributors sign a contributor license agreement (CLA) in order to contribute to the documentation. 2 | 3 | If you would like to contribute, please do one of the following: 4 | 5 | 1) For simple changes, please use pull requests. 6 | 7 | 2) Use branches for more complex changes, longer topics, and so on. In general, if the changes are within a single topic, using a pull request is just fine. 8 | 9 | Chef will handle the version updates during the release process. You are welcome to correct typos or otherwise make updates to documentation in the README. 10 | -------------------------------------------------------------------------------- /docs/06_writing_the_readme.md: -------------------------------------------------------------------------------- 1 | ## Writing the README 2 | 3 | * Fill in the `chef generate cookbook`'s `README.md`. 4 | * Add a `SCOPE` of what it does and doesn't do. 5 | * List the `REQUIREMENTS` for using this cookbook. 6 | * List the platforms tested and what is supported. 7 | * Document any other cookbooks or ruby libraries as dependencies. 8 | * Are there other external packages needed for usage? 9 | * Document how/where to get them. 10 | * Explain the `USAGE`. 11 | * How/why it is tested or refer to a `TESTING.md`. 12 | * If there are Resources provided, document each and their properties. 13 | -------------------------------------------------------------------------------- /docs/11_unit_tests.md: -------------------------------------------------------------------------------- 1 | ## Unit Tests 2 | 3 | * [ChefSpec](https://github.com/sethvargo/chefspec) 4 | * It's included with the [ChefDK](https://downloads.chef.io/chef-dk/). 5 | * Chef-specific unit tests, extension of rspec. 6 | * Use to test logic of cookbooks. 7 | * Just having it present catches compilation errors. 8 | * [github.com/sethvargo/chefspec](https://github.com/sethvargo/chefspec) has lots of examples. 9 | * [betterspecs.org](http://betterspecs.org) for thoughts on better unit testing. 10 | * It can help to have the Coverage report in your `spec_helper.rb`. 11 | ```ruby 12 | at_exit { ChefSpec::Coverage.report! } 13 | ``` 14 | -------------------------------------------------------------------------------- /docs/20_advanced_jenkins_jobs.md: -------------------------------------------------------------------------------- 1 | ## Advanced Jenkins Jobs 2 | 3 | * [jenkins-job-builder][jjb] is a `yaml` based way to configure a [Jenkins](https://jenkins.io/index.html) server. 4 | * Having jenkins and jenkins-jobs like [this example][minecraftyml] can help automate validation of the cookbooks and changes from the community. 5 | * You can gate integration tests on public clouds with test-kitchen and Jenkins. 6 | * These can be used to compliment hosted [Travis](https://travis-ci.org) tests. 7 | 8 | [jjb]: http://docs.openstack.org/infra/jenkins-job-builder 9 | [minecraftyml]: https://github.com/jjasghar/jenkins-jobs/blob/master/minecraft-basic.yml 10 | -------------------------------------------------------------------------------- /docs/17_custom_resources.md: -------------------------------------------------------------------------------- 1 | ## Custom Resources 2 | 3 | * Safely abstract away messy CLI or API calls. 4 | * Provide opportunities for error handling and conditional logic. 5 | * Benefits of standard Resources. 6 | * types, names, parameters 7 | * notifications, default parameters, etc. 8 | * Develop against Chef 13.0 or later. 9 | * Custom Resources added to make development much easier. 10 | * [docs.chef.io/decks/custom_resources.html](https://docs.chef.io/decks/custom_resources.html) 11 | * Backwards-compatible library for earlier Chef versions. 12 | * [supermarket.chef.io/cookbooks/compat_resource](https://supermarket.chef.io/cookbooks/compat_resource) 13 | -------------------------------------------------------------------------------- /docs/12_integration_tests.md: -------------------------------------------------------------------------------- 1 | ## Integration Tests 2 | 3 | * [Test Kitchen](https://kitchen.ci) 4 | * It's included with the [ChefDK](https://downloads.chef.io/chef-dk/). 5 | * Integration test with "real" machines. 6 | * Tests on each supported platform. 7 | * Start with `chef generate cookbook`'s `.kitchen.yml` 8 | * Use InSpec to test, use the Test Kitchen driver 9 | * [docs.chef.io/inspec_reference.html](https://docs.chef.io/inspec_reference.html) 10 | * [github.com/chef/kitchen-inspec](https://github.com/chef/kitchen-inspec) 11 | * Multiple plugins and options, check the [ECOSYSTEM.md](https://github.com/test-kitchen/test-kitchen/blob/master/ECOSYSTEM.md). 12 | -------------------------------------------------------------------------------- /docs/09_ruby_style.md: -------------------------------------------------------------------------------- 1 | ## Ruby Style 2 | 3 | * If you don't have a style preference already here are policies to start with. 4 | * [cookstyle](https://github.com/chef/cookstyle) 5 | * It is included with the [ChefDK](https://downloads.chef.io/chef-dk/). 6 | * The [usage of cookstyle](https://github.com/chef/cookstyle#usage). 7 | * Ruby static code analyzer and style enforcement. 8 | * A starter [cookstyle yml](https://github.com/chef/cookstyle/blob/master/config/cookstyle_base.yml) should be located at: `./.rubocop.yml`. 9 | * Document your overrides or disagreements and move on. 10 | * Considering implications of rules is more important than blindly following. 11 | * Spend the time to understand your standards, it'll help your future team. 12 | -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/Rakefile: -------------------------------------------------------------------------------- 1 | require "rspec/core/rake_task" 2 | require "rubocop/rake_task" 3 | require "foodcritic" 4 | require "chefspec" 5 | 6 | # Style tests. Rubocop and Foodcritic 7 | namespace :style do 8 | desc "Run Ruby style checks" 9 | RuboCop::RakeTask.new(:ruby) 10 | 11 | desc "Run Chef style checks" 12 | FoodCritic::Rake::LintTask.new(:chef) do |t| 13 | t.options = { 14 | fail_tags: ["any"], 15 | tags: [ 16 | "~FC005", 17 | "~FC023", 18 | ], 19 | } 20 | end 21 | end 22 | 23 | desc "Run all style checks" 24 | task style: ["style:chef", "style:ruby"] 25 | 26 | # Rspec and ChefSpec 27 | desc "Run ChefSpec examples" 28 | RSpec::Core::RakeTask.new(:spec) 29 | 30 | # Default # rubocop:enable all 31 | task default: %w{style spec} 32 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | activesupport (4.2.6) 5 | i18n (~> 0.7) 6 | json (~> 1.7, >= 1.7.7) 7 | minitest (~> 5.1) 8 | thread_safe (~> 0.3, >= 0.3.4) 9 | tzinfo (~> 1.1) 10 | addressable (2.4.0) 11 | colored (1.2) 12 | ethon (0.9.0) 13 | ffi (>= 1.3.0) 14 | ffi (1.9.10) 15 | html-proofer (3.0.6) 16 | activesupport (~> 4.2) 17 | addressable (~> 2.3) 18 | colored (~> 1.2) 19 | mercenary (~> 0.3.2) 20 | nokogiri (~> 1.5) 21 | parallel (~> 1.3) 22 | typhoeus (~> 0.7) 23 | yell (~> 2.0) 24 | i18n (0.7.0) 25 | json (1.8.3) 26 | mercenary (0.3.6) 27 | mini_portile2 (2.1.0) 28 | minitest (5.9.0) 29 | nokogiri (1.6.8) 30 | mini_portile2 (~> 2.1.0) 31 | pkg-config (~> 1.1.7) 32 | parallel (1.9.0) 33 | pkg-config (1.1.7) 34 | thread_safe (0.3.5) 35 | typhoeus (0.8.0) 36 | ethon (>= 0.8.0) 37 | tzinfo (1.2.2) 38 | thread_safe (~> 0.1) 39 | yell (2.0.6) 40 | 41 | PLATFORMS 42 | ruby 43 | 44 | DEPENDENCIES 45 | html-proofer 46 | 47 | BUNDLED WITH 48 | 1.12.5 49 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | MAINTAINER JJ Asghar jj@chef.io 3 | 4 | RUN apt-get update \ 5 | && apt-get install -y sudo curl \ 6 | && curl -sL https://deb.nodesource.com/setup_6.x | sudo bash - \ 7 | && apt-get install -y supervisor nodejs \ 8 | && apt-get update --fix-missing \ 9 | && apt-get install -y daemon git build-essential \ 10 | && mkdir -p /srv/cookbook-guide/ /var/log/supervisor 11 | 12 | COPY dockerfiles/reveal.json /tmp/reveal.json 13 | 14 | RUN git clone https://github.com/chef-partners/cookbook-guide.git /srv/cookbook-guide 15 | 16 | RUN for each in /srv/cookbook-guide/docs/*.md; do cat $each; echo "\n---\n"; done > /tmp/index.md 17 | 18 | RUN npm install -g reveal-md 19 | 20 | RUN cp /srv/cookbook-guide/docs/theme/chef.css /usr/lib/node_modules/reveal-md/node_modules/reveal.js/css/theme/ 21 | 22 | RUN cp /srv/cookbook-guide/docs/theme/chef.css /usr/lib/node_modules/reveal-md/node_modules/reveal.js/css/theme/source/ 23 | 24 | COPY dockerfiles/supervisord.conf /etc/supervisor/conf.d/supervisord.conf 25 | 26 | RUN echo "Thanks\!\n\nChef's Technical Alliance Team\n\n" >> /tmp/index.md 27 | 28 | EXPOSE 1948 29 | 30 | CMD ["/usr/bin/supervisord"] 31 | -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/test/integration/default/default_spec.rb: -------------------------------------------------------------------------------- 1 | # encoding: utf-8 2 | # author: JJ Asghar 3 | 4 | describe package("npm") do 5 | it { should be_installed } 6 | end 7 | 8 | describe package("daemon") do 9 | it { should be_installed } 10 | end 11 | 12 | describe package("phantomjs") do 13 | it { should be_installed } 14 | end 15 | 16 | describe port(1948) do 17 | it { should be_listening } 18 | its("protocols") { should include "tcp" } 19 | end 20 | 21 | describe directory("/home/vagrant/cookbook-guide/.git") do 22 | it { should be_directory } 23 | end 24 | 25 | describe service("nodeprinter") do 26 | it { should be_installed } 27 | it { should be_enabled } 28 | it { should be_running } 29 | end 30 | 31 | describe service("nodeserver") do 32 | it { should be_installed } 33 | it { should be_enabled } 34 | it { should be_running } 35 | end 36 | 37 | describe file("/tmp/reveal.json") do 38 | it { should be_file } 39 | end 40 | 41 | describe file("/tmp/index.md") do 42 | it { should be_file } 43 | end 44 | 45 | describe file("/etc/init.d/nodeserver") do 46 | it { should be_file } 47 | end 48 | 49 | describe file("/etc/init.d/nodeprinter") do 50 | it { should be_file } 51 | end 52 | -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/files/default/nodeserver: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This script will launch Nodejs in a mode that will automatically respawn if it 4 | # crashes. Output will be sent to /var/log/nodejs/nodejs.log. A PID file will be 5 | # created in the standard location. 6 | 7 | start () { 8 | echo -n "Starting nodejs server..." 9 | 10 | # Start daemon 11 | daemon --chdir='/home/vagrant/' --command "/usr/bin/nodejs /usr/bin/reveal-md /tmp/index.md --theme chef" --respawn --output=/var/log/nodejs/nodejs.log --name=nodejs --verbose 12 | 13 | RETVAL=$? 14 | if [ $RETVAL = 0 ] 15 | then 16 | echo "done." 17 | else 18 | echo "failed. See error code for more information." 19 | fi 20 | return $RETVAL 21 | } 22 | 23 | stop () { 24 | # Stop daemon 25 | echo -n "Stopping nodejs..." 26 | 27 | daemon --stop --name=nodejs --verbose 28 | RETVAL=$? 29 | 30 | if [ $RETVAL = 0 ] 31 | then 32 | echo "Done." 33 | else 34 | echo "Failed. See error code for more information." 35 | fi 36 | return $RETVAL 37 | } 38 | 39 | 40 | restart () { 41 | daemon --restart --name=nodejs --verbose 42 | } 43 | 44 | 45 | status () { 46 | # Report on the status of the daemon 47 | daemon --running --verbose --name=nodejs 48 | return $? 49 | } 50 | 51 | 52 | case "$1" in 53 | start) 54 | start 55 | ;; 56 | status) 57 | status 58 | ;; 59 | stop) 60 | stop 61 | ;; 62 | restart) 63 | restart 64 | ;; 65 | *) 66 | echo $"Usage: nodejs {start|status|stop|restart}" 67 | exit 3 68 | ;; 69 | esac 70 | 71 | exit $RETVAL 72 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | This is Chef's Partner Engineering guide for writing cookbooks. It is intended 2 | to provide guidelines for how to write high-quality cookbooks for sharing with 3 | the Chef Community. The content is in the [docs/](docs/) directory or you may 4 | view it as a presentation. 5 | 6 | # Contributing 7 | 8 | These guidelines are a living document, so feel free to send PRs and we'll 9 | discuss and incorporate the feedback. 10 | 11 | # Viewing and Downloading the Presentation 12 | 13 | The format is [reveal-md](https://github.com/webpro/reveal-md). You may use 14 | Vagrant and virtualbox to view the presentation without installing reveal-md and 15 | its dependencies. To view the deck: 16 | 17 | * Install [Vagrant](https://vagrantup.com) 18 | * Install [Virtualbox](https://www.virtualbox.org/wiki/Downloads) 19 | * `export VAGRANT_DEFAULT_PROVIDER=virtualbox` 20 | * `vagrant up guide` 21 | * Open up and you're in the presentation. 22 | * You may download the slides from the last slide or directly from 23 | 24 | ## Building Locally with Chef 25 | 26 | If you prefer to work with reveal-md directly instead of the Vagrant workflow, 27 | you can use `chef-solo` to bootstrap the cookbook. NOTE: this is only on Ubuntu 28 | at this time. 29 | 30 | ```shell 31 | $ sudo chef-solo -c solo.rb -j node.json 32 | ``` 33 | 34 | If you would prefer the manual steps: 35 | 36 | * Install npm and phantomjs 37 | * Configuring the npm registry and install reveal-md 38 | * cat the [docs](docs) contents to a single file with a separator for reveal-md 39 | * Add a final "Thanks" page to the slides 40 | * generate the PDF 41 | * Add the PDF link in the slides 42 | * launch reveal-md pointing to the slides 43 | 44 | ## Building the Docker container 45 | 46 | I added a [Dockerfile](./Dockerfile) because spinning up the Vagrant box felt slow. 47 | 48 | You can also pull from the [docker hub](https://hub.docker.com/r/jjasghar/chef-partner-cookbook-guide/) with the following: 49 | 50 | ```bash 51 | $ docker pull jjasghar/chef-partner-cookbook-guide:latest 52 | $ docker run -p 1948:1948 --name='chef-partner-cookbook-guide' -d jjasghar/chef-partner-cookbook-guide 53 | $ open http://localhost:1948/index.md 54 | ``` 55 | 56 | Or if you'd prefer here are the steps to build the container locally: 57 | 58 | ```bash 59 | $ git clone http://github.com/chef-partners/cookbook-guide 60 | $ cd cookbook-guide 61 | ``` 62 | 63 | Build the image yourself. 64 | 65 | ``` 66 | $ docker build -t="$USER/chef-partner-cookbook-guide" . --no-cache 67 | ``` 68 | 69 | After it's built, all you have to do is: 70 | 71 | ``` 72 | $ docker run -p 1948:1948 --name='cookbook-guide' -d $USER/chef-partner-cookbook-guide 73 | ``` 74 | 75 | Now you should be able to go to http://localhost:1948/index.md and see the presentation. 76 | 77 | ## Building a Habitat Plan. 78 | 79 | TODO: I'm in the process of figuring this out :metal: 80 | 81 | ## Updating the Presentation 82 | 83 | The content is the Markdown files in the [docs](docs) directory, but the 84 | `index.md` is dynamically generated inside the [Vagrantfile](Vagrantfile). You 85 | may `vagrant ssh guide` in and change the running command to point to the 86 | `/vagrant/docs/` directory and edit these and refresh your browser to see the 87 | content update. You may also `vagrant provision guide` if you want to refresh 88 | everything without destroying the VM. The file [docs/theme/chef.css](chef.css) 89 | controls the styling for the presentation. 90 | -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/recipes/default.rb: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # The bootstrap script for the cookbook-guide 4 | # 5 | # 6 | # What're you looking at? I know what I'm doing. 7 | # - Han Solo 8 | # 9 | 10 | execute 'curl -sL https://deb.nodesource.com/setup_5.x | sudo bash -' 11 | 12 | execute "Update the apt-cache" do 13 | command "sudo apt-get update" 14 | action :run 15 | end 16 | 17 | package 'nodejs' do 18 | action [:install] 19 | end 20 | 21 | execute "Update fix-missing because well reasons" do 22 | command "sudo apt-get update --fix-missing" 23 | action :run 24 | end 25 | 26 | %w{phantomjs daemon git build-essential}.each do |pkg| 27 | package pkg do 28 | action [:install] 29 | end 30 | end 31 | 32 | cookbook_file "/tmp/reveal.json" do 33 | owner "vagrant" 34 | mode "0644" 35 | source "reveal.json" 36 | end 37 | 38 | git "/home/vagrant/cookbook-guide" do 39 | repository "https://github.com/chef-partners/cookbook-guide.git" 40 | reference "master" 41 | action :checkout 42 | end 43 | 44 | execute "Get the markdowns to the correct location" do 45 | cwd "/home/vagrant" 46 | user "vagrant" 47 | command 'for each in /home/vagrant/cookbook-guide/docs/*.md; do cat $each; echo "\n---\n"; done > /tmp/index.md' 48 | creates "/tmp/index.md" 49 | action :run 50 | end 51 | 52 | execute "install reveal-md" do 53 | cwd "/home/vagrant" 54 | creates "/usr/bin/reveal-md" 55 | command "npm install -g reveal-md" 56 | action :run 57 | end 58 | 59 | execute "install phantomjs" do 60 | cwd "/home/vagrant" 61 | creates "/usr/bin/phantomjs" 62 | command "npm install -g phantomjs" 63 | action :run 64 | end 65 | 66 | execute "Copy the chef.css to the correct location" do 67 | command "cp /home/vagrant/cookbook-guide/docs/theme/chef.css /usr/lib/node_modules/reveal-md/node_modules/reveal.js/css/theme/" 68 | creates "/usr/lib/node_modules/reveal-md/node_modules/reveal.js/reveal.js/css/theme/chef.css" 69 | action :run 70 | end 71 | 72 | execute "Copy the chef.css for reveal.js" do 73 | command "cp /home/vagrant/cookbook-guide/docs/theme/chef.css /usr/lib/node_modules/reveal-md/node_modules/reveal.js/css/theme/source" 74 | creates "/usr/lib/node_modules/reveal-md/node_modules/reveal.js/reveal.js/css/theme/source/chef.css" 75 | action :run 76 | end 77 | 78 | bash "Adding some notes" do 79 | user "vagrant" 80 | cwd "/home/vagrant" 81 | code <<-EOH 82 | STATUS=0 83 | echo -e "# Thanks\!\nChef's Partner Engineering Team\n\n" >> /tmp/index.md || STATUS=1 84 | echo -e "\n[Download PDF of the slides](cookbook-guide.pdf)" >> /tmp/index.md || STATUS=1 85 | exit $STATUS 86 | EOH 87 | end 88 | 89 | directory "/var/log/nodejs" do 90 | owner "root" 91 | group "root" 92 | mode "0755" 93 | action :create 94 | end 95 | 96 | cookbook_file "/etc/init.d/nodeserver" do 97 | mode 755 98 | source "nodeserver" 99 | end 100 | 101 | execute "create pdf for presentation" do 102 | cwd "/tmp/" 103 | creates "/tmp/cookbook-guide.pdf" 104 | command "reveal-md /tmp/index.md --print cookbook-guide.pdf" 105 | action :run 106 | end 107 | 108 | service "nodeserver" do 109 | supports restart: true, start: true, stop: true, reload: true 110 | action [:enable, :start] 111 | end 112 | 113 | log 'Notice to user' do 114 | message "\n\n##############################################################################\nOpen up http://127.0.0.1:1948/index.md in a web browser and you are in the presentation. \n##############################################################################" 115 | level :info 116 | end 117 | -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/spec/unit/recipes/default_spec.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Cookbook Name:: bootstrap 3 | # Spec:: default 4 | # Copyright 2016, Chef Software, Inc 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | require "spec_helper" 20 | 21 | describe "bootstrap::default" do 22 | 23 | context "When all attributes are default, on an unspecified platform" do 24 | 25 | let(:chef_run) do 26 | runner = ChefSpec::ServerRunner.new 27 | runner.converge(described_recipe) 28 | end 29 | 30 | it "converges successfully" do 31 | chef_run # This should not raise an error 32 | end 33 | 34 | it "Copy reveal.json to /tmp" do 35 | expect(chef_run).to run_execute("Copy reveal.json to /tmp") 36 | end 37 | 38 | it "syncs a git the docs down" do 39 | expect(chef_run).to sync_git("/home/vagrant") 40 | end 41 | 42 | it "Get the markdowns to the correct location" do 43 | expect(chef_run).to run_execute("Get the markdowns to the correct location") 44 | end 45 | 46 | it "Update the apt-cache" do 47 | expect(chef_run).to run_execute("Update the apt-cache") 48 | end 49 | 50 | it "installs phantomjs" do 51 | expect(chef_run).to install_package("phantomjs") 52 | end 53 | 54 | it "installs npm" do 55 | expect(chef_run).to install_package("npm") 56 | end 57 | 58 | it "installs daemon" do 59 | expect(chef_run).to install_package("daemon") 60 | end 61 | 62 | it "install reveal-md" do 63 | expect(chef_run).to run_execute("install reveal-md") 64 | end 65 | 66 | it "copies the chef.css to the correct location" do 67 | expect(chef_run).to run_execute("Copy the chef.css to the correct location") 68 | end 69 | 70 | it "Copy the chef.css for reveal.js" do 71 | expect(chef_run).to run_execute("Copy the chef.css for reveal.js") 72 | end 73 | 74 | it "starts the nodeprinter service" do 75 | expect(chef_run).to start_service("nodeprinter") 76 | end 77 | 78 | it "starts the nodeserver service" do 79 | expect(chef_run).to start_service("nodeserver") 80 | end 81 | 82 | it "enables the nodeprinter service" do 83 | expect(chef_run).to enable_service("nodeprinter") 84 | end 85 | 86 | it "enables the nodeserver service" do 87 | expect(chef_run).to enable_service("nodeserver") 88 | end 89 | 90 | it "creates /etc/init.d/nodeserver" do 91 | expect(chef_run).to create_cookbook_file("/etc/init.d/nodeserver") 92 | end 93 | 94 | it "creates /etc/init.d/nodeprinter" do 95 | expect(chef_run).to create_cookbook_file("/etc/init.d/nodeprinter") 96 | end 97 | 98 | it "runs a bash script (set up npm)" do 99 | expect(chef_run).to run_bash("set up npm") 100 | end 101 | 102 | it "runs a bash script (Adding some notes)" do 103 | expect(chef_run).to run_bash("Adding some notes") 104 | end 105 | 106 | it "writes the log note" do 107 | expect(chef_run).to write_log("Open up http://127.0.0.1:1948/index.md in a web browser and you are in the presentation.") 108 | end 109 | end 110 | end 111 | -------------------------------------------------------------------------------- /docs/theme/chef.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Chef theme for reveal.js. Originally based off of the 'black' theme. 3 | * 4 | * Copyright (C) 2015 Hakim El Hattab, http://hakim.se 5 | * Copyright (C) 2015 Chef Software, Inc., http://chef.io 6 | */ 7 | section.has-light-background, section.has-light-background h1, section.has-light-background h2, section.has-light-background h3, section.has-light-background h4, section.has-light-background h5, section.has-light-background h6 { 8 | color: #3e4346; } 9 | 10 | /********************************************* 11 | * GLOBAL STYLES 12 | *********************************************/ 13 | body { 14 | background: #3e4346; 15 | background-color: #3e4346; } 16 | 17 | .reveal { 18 | font-family: Helvetica, sans-serif; 19 | font-size: 36px; 20 | font-weight: normal; 21 | color: #fff; } 22 | 23 | ::selection { 24 | color: #fff; 25 | background: #bee4fd; 26 | text-shadow: none; } 27 | 28 | .reveal .slides > section, .reveal .slides > section > section { 29 | line-height: 1.2; 30 | font-weight: inherit; } 31 | 32 | /********************************************* 33 | * HEADERS 34 | *********************************************/ 35 | .reveal h1, .reveal h2, .reveal h3, .reveal h4, .reveal h5, .reveal h6 { 36 | margin: 0 0 18px 0; 37 | color: #fff; 38 | font-family: Helvetica, sans-serif; 39 | font-weight: 600; 40 | line-height: 1.2; 41 | letter-spacing: normal; 42 | text-transform: uppercase; 43 | text-shadow: none; 44 | word-wrap: break-word; } 45 | 46 | .reveal h1 { 47 | font-size: 2.5em; } 48 | 49 | .reveal h2 { 50 | font-size: 1.6em; } 51 | 52 | .reveal h3 { 53 | font-size: 1.3em; } 54 | 55 | .reveal h4 { 56 | font-size: 1em; } 57 | 58 | .reveal h1 { 59 | text-shadow: none; } 60 | 61 | /********************************************* 62 | * OTHER 63 | *********************************************/ 64 | .reveal p { 65 | margin: 18px 0; 66 | line-height: 1.3; } 67 | 68 | /* Ensure certain elements are never larger than the slide itself */ 69 | .reveal img, .reveal video, .reveal iframe { 70 | max-width: 95%; 71 | max-height: 95%; } 72 | 73 | .reveal strong, .reveal b { 74 | font-weight: bold; } 75 | 76 | .reveal em { 77 | font-style: italic; } 78 | 79 | .reveal ol, .reveal dl, .reveal ul { 80 | display: inline-block; 81 | text-align: left; 82 | margin: 0 0 0 1em; } 83 | 84 | .reveal ol { 85 | list-style-type: decimal; } 86 | 87 | .reveal ul { 88 | list-style-type: disc; } 89 | 90 | .reveal ul ul { 91 | list-style-type: square; } 92 | 93 | .reveal ul ul ul { 94 | list-style-type: circle; } 95 | 96 | .reveal ul ul, .reveal ul ol, .reveal ol ol, .reveal ol ul { 97 | display: block; 98 | margin-left: 40px; } 99 | 100 | .reveal dt { 101 | font-weight: bold; } 102 | 103 | .reveal dd { 104 | margin-left: 40px; } 105 | 106 | .reveal q, .reveal blockquote { 107 | quotes: none; } 108 | 109 | .reveal blockquote { 110 | display: block; 111 | position: relative; 112 | width: 70%; 113 | margin: 18px auto; 114 | padding: 5px; 115 | font-style: italic; 116 | background: rgba(255, 255, 255, 0.05); 117 | box-shadow: 0px 0px 2px rgba(0, 0, 0, 0.2); } 118 | 119 | .reveal blockquote p:first-child, .reveal blockquote p:last-child { 120 | display: inline-block; } 121 | 122 | .reveal q { 123 | font-style: italic; } 124 | 125 | .reveal pre { 126 | display: block; 127 | position: relative; 128 | width: 90%; 129 | margin: 18px auto; 130 | text-align: left; 131 | font-size: 0.55em; 132 | font-family: monospace; 133 | line-height: 1.2em; 134 | word-wrap: break-word; 135 | box-shadow: 0px 0px 6px rgba(0, 0, 0, 0.3); } 136 | 137 | .reveal code { 138 | font-family: monospace; } 139 | 140 | .reveal pre code { 141 | display: block; 142 | padding: 5px; 143 | overflow: auto; 144 | max-height: 400px; 145 | word-wrap: normal; 146 | background: #3F3F3F; 147 | color: #DCDCDC; } 148 | 149 | .reveal table { 150 | margin: auto; 151 | border-collapse: collapse; 152 | border-spacing: 0; } 153 | 154 | .reveal table th { 155 | font-weight: bold; } 156 | 157 | .reveal table th, .reveal table td { 158 | text-align: left; 159 | padding: 0.2em 0.5em 0.2em 0.5em; 160 | border-bottom: 1px solid; } 161 | 162 | .reveal table th[align="center"], .reveal table td[align="center"] { 163 | text-align: center; } 164 | 165 | .reveal table th[align="right"], .reveal table td[align="right"] { 166 | text-align: right; } 167 | 168 | .reveal table tr:last-child td { 169 | border-bottom: none; } 170 | 171 | .reveal sup { 172 | vertical-align: super; } 173 | 174 | .reveal sub { 175 | vertical-align: sub; } 176 | 177 | .reveal small { 178 | display: inline-block; 179 | font-size: 0.6em; 180 | line-height: 1.2em; 181 | vertical-align: top; } 182 | 183 | .reveal small * { 184 | vertical-align: top; } 185 | 186 | /********************************************* 187 | * LINKS 188 | *********************************************/ 189 | .reveal a { 190 | color: #f18b21; 191 | text-decoration: none; 192 | -webkit-transition: color 0.15s ease; 193 | -moz-transition: color 0.15s ease; 194 | transition: color 0.15s ease; } 195 | 196 | .reveal a:hover { 197 | color: #8dcffc; 198 | text-shadow: none; 199 | border: none; } 200 | 201 | .reveal .roll span:after { 202 | color: #fff; 203 | background: #068ee9; } 204 | 205 | /********************************************* 206 | * IMAGES 207 | *********************************************/ 208 | .reveal section img { 209 | margin: 15px 0px; 210 | background: rgba(255, 255, 255, 0.12); 211 | border: 4px solid #fff; 212 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); } 213 | 214 | .reveal a img { 215 | -webkit-transition: all 0.15s linear; 216 | -moz-transition: all 0.15s linear; 217 | transition: all 0.15s linear; } 218 | 219 | .reveal a:hover img { 220 | background: rgba(255, 255, 255, 0.2); 221 | border-color: #f18b21; 222 | box-shadow: 0 0 18px rgba(0, 0, 0, 0.55); } 223 | 224 | /********************************************* 225 | * NAVIGATION CONTROLS 226 | *********************************************/ 227 | .reveal .controls div.navigate-left, .reveal .controls div.navigate-left.enabled { 228 | border-right-color: #f18b21; } 229 | 230 | .reveal .controls div.navigate-right, .reveal .controls div.navigate-right.enabled { 231 | border-left-color: #f18b21; } 232 | 233 | .reveal .controls div.navigate-up, .reveal .controls div.navigate-up.enabled { 234 | border-bottom-color: #f18b21; } 235 | 236 | .reveal .controls div.navigate-down, .reveal .controls div.navigate-down.enabled { 237 | border-top-color: #f18b21; } 238 | 239 | .reveal .controls div.navigate-left.enabled:hover { 240 | border-right-color: #8dcffc; } 241 | 242 | .reveal .controls div.navigate-right.enabled:hover { 243 | border-left-color: #8dcffc; } 244 | 245 | .reveal .controls div.navigate-up.enabled:hover { 246 | border-bottom-color: #8dcffc; } 247 | 248 | .reveal .controls div.navigate-down.enabled:hover { 249 | border-top-color: #8dcffc; } 250 | 251 | /********************************************* 252 | * PROGRESS BAR 253 | *********************************************/ 254 | .reveal .progress { 255 | background: rgba(0, 0, 0, 0.2); } 256 | 257 | .reveal .progress span { 258 | background: #f18b21; 259 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 260 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); 261 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985); } 262 | 263 | /********************************************* 264 | * SLIDE NUMBER 265 | *********************************************/ 266 | .reveal .slide-number { 267 | color: #f18b21; } 268 | -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/.rubocop.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Lint 3 | # 4 | 5 | Lint/AmbiguousOperator: 6 | Enabled: true 7 | Lint/BlockAlignment: 8 | Enabled: true 9 | Lint/CircularArgumentReference: 10 | Enabled: true 11 | Lint/ConditionPosition: 12 | Enabled: true 13 | Lint/Debugger: 14 | Enabled: true 15 | Lint/DefEndAlignment: 16 | Enabled: true 17 | Lint/DuplicateMethods: 18 | Enabled: true 19 | Lint/DuplicatedKey: 20 | Enabled: true 21 | Lint/EachWithObjectArgument: 22 | Enabled: true 23 | Lint/ElseLayout: 24 | Enabled: true 25 | Lint/EmptyEnsure: 26 | Enabled: true 27 | Lint/EmptyInterpolation: 28 | Enabled: true 29 | Lint/EndAlignment: 30 | Enabled: true 31 | Lint/EndInMethod: 32 | Enabled: true 33 | Lint/EnsureReturn: 34 | Enabled: true 35 | Lint/FormatParameterMismatch: 36 | Enabled: true 37 | Lint/InvalidCharacterLiteral: 38 | Enabled: true 39 | Lint/LiteralInCondition: 40 | Enabled: true 41 | Lint/LiteralInInterpolation: 42 | Enabled: true 43 | Lint/Loop: 44 | Enabled: true 45 | Lint/NonLocalExitFromIterator: 46 | Enabled: true 47 | Lint/RequireParentheses: 48 | Enabled: true 49 | Lint/StringConversionInInterpolation: 50 | Enabled: true 51 | Lint/UnneededDisable: 52 | Enabled: true 53 | Lint/UnreachableCode: 54 | Enabled: true 55 | Lint/UselessComparison: 56 | Enabled: true 57 | Lint/UselessElseWithoutRescue: 58 | Enabled: true 59 | Lint/UselessSetterCall: 60 | Enabled: true 61 | 62 | # 63 | # Disabled Lint 64 | # 65 | 66 | # These are disabled per https://github.com/chef/chef/pull/3038 67 | Lint/UnusedBlockArgument: 68 | Enabled: false 69 | Lint/UnusedMethodArgument: 70 | Enabled: false 71 | 72 | # We ignore Exceptions a lot 73 | Lint/HandleExceptions: 74 | Enabled: false 75 | # We also decorate Exceptions a lot 76 | Lint/RescueException: 77 | Enabled: false 78 | 79 | # 80 | # Performance 81 | # 82 | 83 | Performance/CaseWhenSplat: 84 | Enabled: true 85 | Performance/FixedSize: 86 | Enabled: true 87 | Performance/FlatMap: 88 | Enabled: true 89 | Performance/ReverseEach: 90 | Enabled: true 91 | Performance/Sample: 92 | Enabled: true 93 | Performance/Size: 94 | Enabled: true 95 | 96 | # 97 | # Rails 98 | # 99 | 100 | Rails/ActionFilter: 101 | Enabled: true 102 | Rails/Date: 103 | Enabled: true 104 | Rails/Delegate: 105 | Enabled: true 106 | Rails/FindBy: 107 | Enabled: true 108 | Rails/FindEach: 109 | Enabled: true 110 | Rails/HasAndBelongsToMany: 111 | Enabled: true 112 | Rails/Output: 113 | Enabled: true 114 | Rails/PluralizationGrammar: 115 | Enabled: true 116 | Rails/ReadWriteAttribute: 117 | Enabled: true 118 | Rails/ScopeArgs: 119 | Enabled: true 120 | Rails/TimeZone: 121 | Enabled: true 122 | Rails/Validation: 123 | Enabled: true 124 | 125 | # 126 | # Metrics 127 | # 128 | 129 | # Metrics cops are all disabled, there would be too much refactoring 130 | # work to do and we have much higher priorities. 131 | Metrics/AbcSize: 132 | Enabled: false 133 | Metrics/BlockNesting: 134 | Enabled: false 135 | Metrics/ClassLength: 136 | Enabled: false 137 | Metrics/CyclomaticComplexity: 138 | Enabled: false 139 | Metrics/LineLength: 140 | Enabled: false 141 | Metrics/MethodLength: 142 | Enabled: false 143 | Metrics/ModuleLength: 144 | Enabled: false 145 | Metrics/ParameterLists: 146 | Enabled: false 147 | Metrics/PerceivedComplexity: 148 | Enabled: false 149 | 150 | 151 | # 152 | # Style 153 | # 154 | 155 | Style/AlignHash: 156 | Enabled: true 157 | Style/ArrayJoin: 158 | Enabled: true 159 | Style/AsciiIdentifiers: 160 | Enabled: true 161 | Style/Attr: 162 | Enabled: true 163 | Style/BeginBlock: 164 | Enabled: true 165 | Style/CharacterLiteral: 166 | Enabled: true 167 | Style/ClassMethods: 168 | Enabled: true 169 | Style/ColonMethodCall: 170 | Enabled: true 171 | Style/CommandLiteral: 172 | Enabled: true 173 | Style/ElseAlignment: 174 | Enabled: true 175 | Style/EmptyLineBetweenDefs: 176 | Enabled: true 177 | Style/EmptyLines: 178 | Enabled: true 179 | Style/EmptyLinesAroundAccessModifier: 180 | Enabled: true 181 | Style/EmptyLinesAroundMethodBody: 182 | Enabled: true 183 | Style/EndBlock: 184 | Enabled: true 185 | Style/EndOfLine: 186 | Enabled: true 187 | Style/EvenOdd: 188 | Enabled: true 189 | Style/ExtraSpacing: 190 | Enabled: true 191 | Style/FlipFlop: 192 | Enabled: true 193 | Style/For: 194 | Enabled: true 195 | Style/IfWithSemicolon: 196 | Enabled: true 197 | Style/IndentationConsistency: 198 | Enabled: true 199 | Style/IndentationWidth: 200 | Enabled: true 201 | Style/InfiniteLoop: 202 | Enabled: true 203 | Style/InitialIndentation: 204 | Enabled: true 205 | Style/LambdaCall: 206 | Enabled: true 207 | Style/MethodDefParentheses: 208 | Enabled: true 209 | Style/MultilineOperationIndentation: 210 | Enabled: true 211 | EnforcedStyle: indented 212 | Style/NegatedWhile: 213 | Enabled: true 214 | Style/NestedModifier: 215 | Enabled: true 216 | Style/NestedTernaryOperator: 217 | Enabled: true 218 | Style/OneLineConditional: 219 | Enabled: true 220 | Style/ParenthesesAroundCondition: 221 | Enabled: true 222 | # - The chef source code predominantly uses {} for %,%i,%q,%Q,%r,%w,%W 223 | # - The old 1.9 pickaxe book predominantly uses {} for %,%q,%Q,%r,%w,%W,%x 224 | # - The chef source code does not use %x enough to determine a preference 225 | # - The old 1.9 pickaxe book does not use %i 226 | # - %s is not used in chef code or the pickaxe book, and is %s{} for consistency 227 | Style/PercentLiteralDelimiters: 228 | Enabled: true 229 | PreferredDelimiters: 230 | '%': '{}' 231 | '%i': '{}' 232 | '%q': '{}' 233 | '%Q': '{}' 234 | '%r': '{}' 235 | '%s': '{}' 236 | '%w': '{}' 237 | '%W': '{}' 238 | '%x': '{}' 239 | Style/PercentQLiterals: 240 | Enabled: true 241 | Style/RedundantFreeze: 242 | Enabled: true 243 | Style/RescueEnsureAlignment: 244 | Enabled: true 245 | # we only 'raise' and do not 'fail' 246 | Style/SignalException: 247 | EnforcedStyle: only_raise 248 | Enabled: true 249 | Style/SpaceAfterColon: 250 | Enabled: true 251 | Style/SpaceAfterComma: 252 | Enabled: true 253 | Style/SpaceAfterMethodName: 254 | Enabled: true 255 | Style/SpaceAroundBlockParameters: 256 | Enabled: true 257 | Style/SpaceAroundEqualsInParameterDefault: 258 | Enabled: true 259 | Style/SpaceAroundOperators: 260 | Enabled: true 261 | Style/SpaceBeforeBlockBraces: 262 | Enabled: true 263 | Style/SpaceBeforeFirstArg: 264 | Enabled: true 265 | Style/SpaceAroundKeyword: 266 | Enabled: true 267 | Style/SpaceInsideBlockBraces: 268 | Enabled: true 269 | Style/SpaceInsideHashLiteralBraces: 270 | Enabled: true 271 | Style/SpaceInsideRangeLiteral: 272 | Enabled: true 273 | Style/StabbyLambdaParentheses: 274 | Enabled: true 275 | # core chef community prefers double quotes over single quotes 276 | Style/StringLiterals: 277 | EnforcedStyle: double_quotes 278 | Enabled: true 279 | Style/SymbolLiteral: 280 | Enabled: true 281 | Style/Tab: 282 | Enabled: true 283 | Style/TrailingBlankLines: 284 | Enabled: true 285 | Style/TrailingCommaInArguments: 286 | Enabled: true 287 | # rubocop's default gets this completely backwards 288 | Style/TrailingCommaInLiteral: 289 | Enabled: true 290 | EnforcedStyleForMultiline: comma 291 | Style/TrailingUnderscoreVariable: 292 | Enabled: true 293 | Style/TrailingWhitespace: 294 | Enabled: true 295 | Style/UnneededCapitalW: 296 | Enabled: true 297 | #Style/UnneededPercentQ: # would like to enable this one but its buggy as of 0.35.1 298 | # Enabled: true 299 | Style/WhenThen: 300 | Enabled: true 301 | Style/WhileUntilDo: 302 | Enabled: true 303 | Style/WordArray: 304 | Enabled: true 305 | 306 | # 307 | # Disabled Style 308 | # 309 | 310 | # As of this commit we have 686 modules and classes without docs. 311 | # This is a cop that we /should/ have enabled, but tactically we can't really enable. 312 | Style/Documentation: 313 | Enabled: false 314 | 315 | # this makes whitespace formatting of DSL code impossible 316 | Style/SpaceBeforeFirstArg: 317 | Enabled: false 318 | 319 | # whitespace in expressions is useful to enhance readability 320 | Style/SpaceInsideBrackets: 321 | Enabled: false 322 | Style/SpaceInsideParens: 323 | Enabled: false 324 | 325 | # more whitespace cops that we allow since they can enhance readability 326 | Style/EmptyLinesAroundBlockBody: 327 | Enabled: false 328 | Style/EmptyLinesAroundClassBody: 329 | Enabled: false 330 | Style/EmptyLinesAroundModuleBody: 331 | Enabled: false 332 | 333 | # double negation is perfectly idiomatic ruby 334 | Style/DoubleNegation: 335 | Enabled: false 336 | # format strings are also perfectly idiomatic ruby 337 | Style/FormatString: 338 | Enabled: false 339 | # single line if/unless blocks may read more naturally than modifiers 340 | Style/IfUnlessModifier: 341 | Enabled: false 342 | 343 | # we are ruby > 2.0 only so can disable the Encoding cop 344 | Style/Encoding: 345 | Enabled: false 346 | 347 | # Dan is -1 on this one: https://github.com/chef/chef/pull/4526#issuecomment-179950045 348 | Style/IndentHash: 349 | Enabled: false 350 | 351 | # This is overly aggressive and autofix broke stuff, would need to exclude classes 352 | # - https://github.com/chef/chef/pull/4541 353 | Style/TrivialAccessors: 354 | Enabled: false -------------------------------------------------------------------------------- /cookbooks/cookbook_guide/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Attribution 3.0 Unported 2 | 3 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS LICENSE DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE INFORMATION PROVIDED, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM ITS USE. 4 | License 5 | 6 | THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW IS PROHIBITED. 7 | 8 | BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS. 9 | 10 | 1. Definitions 11 | 12 | "Adaptation" means a work based upon the Work, or upon the Work and other pre-existing works, such as a translation, adaptation, derivative work, arrangement of music or other alterations of a literary or artistic work, or phonogram or performance and includes cinematographic adaptations or any other form in which the Work may be recast, transformed, or adapted including in any form recognizably derived from the original, except that a work that constitutes a Collection will not be considered an Adaptation for the purpose of this License. For the avoidance of doubt, where the Work is a musical work, performance or phonogram, the synchronization of the Work in timed-relation with a moving image ("synching") will be considered an Adaptation for the purpose of this License. 13 | "Collection" means a collection of literary or artistic works, such as encyclopedias and anthologies, or performances, phonograms or broadcasts, or other works or subject matter other than works listed in Section 1(f) below, which, by reason of the selection and arrangement of their contents, constitute intellectual creations, in which the Work is included in its entirety in unmodified form along with one or more other contributions, each constituting separate and independent works in themselves, which together are assembled into a collective whole. A work that constitutes a Collection will not be considered an Adaptation (as defined above) for the purposes of this License. 14 | "Distribute" means to make available to the public the original and copies of the Work or Adaptation, as appropriate, through sale or other transfer of ownership. 15 | "Licensor" means the individual, individuals, entity or entities that offer(s) the Work under the terms of this License. 16 | "Original Author" means, in the case of a literary or artistic work, the individual, individuals, entity or entities who created the Work or if no individual or entity can be identified, the publisher; and in addition (i) in the case of a performance the actors, singers, musicians, dancers, and other persons who act, sing, deliver, declaim, play in, interpret or otherwise perform literary or artistic works or expressions of folklore; (ii) in the case of a phonogram the producer being the person or legal entity who first fixes the sounds of a performance or other sounds; and, (iii) in the case of broadcasts, the organization that transmits the broadcast. 17 | "Work" means the literary and/or artistic work offered under the terms of this License including without limitation any production in the literary, scientific and artistic domain, whatever may be the mode or form of its expression including digital form, such as a book, pamphlet and other writing; a lecture, address, sermon or other work of the same nature; a dramatic or dramatico-musical work; a choreographic work or entertainment in dumb show; a musical composition with or without words; a cinematographic work to which are assimilated works expressed by a process analogous to cinematography; a work of drawing, painting, architecture, sculpture, engraving or lithography; a photographic work to which are assimilated works expressed by a process analogous to photography; a work of applied art; an illustration, map, plan, sketch or three-dimensional work relative to geography, topography, architecture or science; a performance; a broadcast; a phonogram; a compilation of data to the extent it is protected as a copyrightable work; or a work performed by a variety or circus performer to the extent it is not otherwise considered a literary or artistic work. 18 | "You" means an individual or entity exercising rights under this License who has not previously violated the terms of this License with respect to the Work, or who has received express permission from the Licensor to exercise rights under this License despite a previous violation. 19 | "Publicly Perform" means to perform public recitations of the Work and to communicate to the public those public recitations, by any means or process, including by wire or wireless means or public digital performances; to make available to the public Works in such a way that members of the public may access these Works from a place and at a place individually chosen by them; to perform the Work to the public by any means or process and the communication to the public of the performances of the Work, including by public digital performance; to broadcast and rebroadcast the Work by any means including signs, sounds or images. 20 | "Reproduce" means to make copies of the Work by any means including without limitation by sound or visual recordings and the right of fixation and reproducing fixations of the Work, including storage of a protected performance or phonogram in digital form or other electronic medium. 21 | 2. Fair Dealing Rights. Nothing in this License is intended to reduce, limit, or restrict any uses free from copyright or rights arising from limitations or exceptions that are provided for in connection with the copyright protection under copyright law or other applicable laws. 22 | 23 | 3. License Grant. Subject to the terms and conditions of this License, Licensor hereby grants You a worldwide, royalty-free, non-exclusive, perpetual (for the duration of the applicable copyright) license to exercise the rights in the Work as stated below: 24 | 25 | to Reproduce the Work, to incorporate the Work into one or more Collections, and to Reproduce the Work as incorporated in the Collections; 26 | to create and Reproduce Adaptations provided that any such Adaptation, including any translation in any medium, takes reasonable steps to clearly label, demarcate or otherwise identify that changes were made to the original Work. For example, a translation could be marked "The original work was translated from English to Spanish," or a modification could indicate "The original work has been modified."; 27 | to Distribute and Publicly Perform the Work including as incorporated in Collections; and, 28 | to Distribute and Publicly Perform Adaptations. 29 | For the avoidance of doubt: 30 | 31 | Non-waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme cannot be waived, the Licensor reserves the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; 32 | Waivable Compulsory License Schemes. In those jurisdictions in which the right to collect royalties through any statutory or compulsory licensing scheme can be waived, the Licensor waives the exclusive right to collect such royalties for any exercise by You of the rights granted under this License; and, 33 | Voluntary License Schemes. The Licensor waives the right to collect royalties, whether individually or, in the event that the Licensor is a member of a collecting society that administers voluntary licensing schemes, via that society, from any exercise by You of the rights granted under this License. 34 | The above rights may be exercised in all media and formats whether now known or hereafter devised. The above rights include the right to make such modifications as are technically necessary to exercise the rights in other media and formats. Subject to Section 8(f), all rights not expressly granted by Licensor are hereby reserved. 35 | 36 | 4. Restrictions. The license granted in Section 3 above is expressly made subject to and limited by the following restrictions: 37 | 38 | You may Distribute or Publicly Perform the Work only under the terms of this License. You must include a copy of, or the Uniform Resource Identifier (URI) for, this License with every copy of the Work You Distribute or Publicly Perform. You may not offer or impose any terms on the Work that restrict the terms of this License or the ability of the recipient of the Work to exercise the rights granted to that recipient under the terms of the License. You may not sublicense the Work. You must keep intact all notices that refer to this License and to the disclaimer of warranties with every copy of the Work You Distribute or Publicly Perform. When You Distribute or Publicly Perform the Work, You may not impose any effective technological measures on the Work that restrict the ability of a recipient of the Work from You to exercise the rights granted to that recipient under the terms of the License. This Section 4(a) applies to the Work as incorporated in a Collection, but this does not require the Collection apart from the Work itself to be made subject to the terms of this License. If You create a Collection, upon notice from any Licensor You must, to the extent practicable, remove from the Collection any credit as required by Section 4(b), as requested. If You create an Adaptation, upon notice from any Licensor You must, to the extent practicable, remove from the Adaptation any credit as required by Section 4(b), as requested. 39 | If You Distribute, or Publicly Perform the Work or any Adaptations or Collections, You must, unless a request has been made pursuant to Section 4(a), keep intact all copyright notices for the Work and provide, reasonable to the medium or means You are utilizing: (i) the name of the Original Author (or pseudonym, if applicable) if supplied, and/or if the Original Author and/or Licensor designate another party or parties (e.g., a sponsor institute, publishing entity, journal) for attribution ("Attribution Parties") in Licensor's copyright notice, terms of service or by other reasonable means, the name of such party or parties; (ii) the title of the Work if supplied; (iii) to the extent reasonably practicable, the URI, if any, that Licensor specifies to be associated with the Work, unless such URI does not refer to the copyright notice or licensing information for the Work; and (iv) , consistent with Section 3(b), in the case of an Adaptation, a credit identifying the use of the Work in the Adaptation (e.g., "French translation of the Work by Original Author," or "Screenplay based on original Work by Original Author"). The credit required by this Section 4 (b) may be implemented in any reasonable manner; provided, however, that in the case of a Adaptation or Collection, at a minimum such credit will appear, if a credit for all contributing authors of the Adaptation or Collection appears, then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors. For the avoidance of doubt, You may only use the credit required by this Section for the purpose of attribution in the manner set out above and, by exercising Your rights under this License, You may not implicitly or explicitly assert or imply any connection with, sponsorship or endorsement by the Original Author, Licensor and/or Attribution Parties, as appropriate, of You or Your use of the Work, without the separate, express prior written permission of the Original Author, Licensor and/or Attribution Parties. 40 | Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable law, if You Reproduce, Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or Collections, You must not distort, mutilate, modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author's honor or reputation. Licensor agrees that in those jurisdictions (e.g. Japan), in which any exercise of the right granted in Section 3(b) of this License (the right to make Adaptations) would be deemed to be a distortion, mutilation, modification or other derogatory action prejudicial to the Original Author's honor and reputation, the Licensor will waive or not assert, as appropriate, this Section, to the fullest extent permitted by the applicable national law, to enable You to reasonably exercise Your right under Section 3(b) of this License (right to make Adaptations) but not otherwise. 41 | 5. Representations, Warranties and Disclaimer 42 | 43 | UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, LICENSOR OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE, MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY NOT APPLY TO YOU. 44 | 45 | 6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 46 | 47 | 7. Termination 48 | 49 | This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License. Individuals or entities who have received Adaptations or Collections from You under this License, however, will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will survive any termination of this License. 50 | Subject to the above terms and conditions, the license granted here is perpetual (for the duration of the applicable copyright in the Work). Notwithstanding the above, Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time; provided, however that any such election will not serve to withdraw this License (or any other license that has been, or is required to be, granted under the terms of this License), and this License will continue in full force and effect unless terminated as stated above. 51 | 8. Miscellaneous 52 | 53 | Each time You Distribute or Publicly Perform the Work or a Collection, the Licensor offers to the recipient a license to the Work on the same terms and conditions as the license granted to You under this License. 54 | Each time You Distribute or Publicly Perform an Adaptation, Licensor offers to the recipient a license to the original Work on the same terms and conditions as the license granted to You under this License. 55 | If any provision of this License is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this License, and without further action by the parties to this agreement, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable. 56 | No term or provision of this License shall be deemed waived and no breach consented to unless such waiver or consent shall be in writing and signed by the party to be charged with such waiver or consent. 57 | This License constitutes the entire agreement between the parties with respect to the Work licensed here. There are no understandings, agreements or representations with respect to the Work not specified here. Licensor shall not be bound by any additional provisions that may appear in any communication from You. This License may not be modified without the mutual written agreement of the Licensor and You. 58 | The rights granted under, and the subject matter referenced, in this License were drafted utilizing the terminology of the Berne Convention for the Protection of Literary and Artistic Works (as amended on September 28, 1979), the Rome Convention of 1961, the WIPO Copyright Treaty of 1996, the WIPO Performances and Phonograms Treaty of 1996 and the Universal Copyright Convention (as revised on July 24, 1971). These rights and subject matter take effect in the relevant jurisdiction in which the License terms are sought to be enforced according to the corresponding provisions of the implementation of those treaty provisions in the applicable national law. If the standard suite of rights granted under applicable copyright law includes additional rights not granted under this License, such additional rights are deemed to be included in the License; this License is not intended to restrict the license of any rights under applicable law. 59 | Creative Commons Notice 60 | 61 | Creative Commons is not a party to this License, and makes no warranty whatsoever in connection with the Work. Creative Commons will not be liable to You or any party on any legal theory for any damages whatsoever, including without limitation any general, special, incidental or consequential damages arising in connection to this license. Notwithstanding the foregoing two (2) sentences, if Creative Commons has expressly identified itself as the Licensor hereunder, it shall have all rights and obligations of Licensor. 62 | 63 | Except for the limited purpose of indicating to the public that the Work is licensed under the CCPL, Creative Commons does not authorize the use by either party of the trademark "Creative Commons" or any related trademark or logo of Creative Commons without the prior written consent of Creative Commons. Any permitted use will be in compliance with Creative Commons' then-current trademark usage guidelines, as may be published on its website or otherwise made available upon request from time to time. For the avoidance of doubt, this trademark restriction does not form part of this License. 64 | 65 | Creative Commons may be contacted at http://creativecommons.org/. 66 | --------------------------------------------------------------------------------