guard-strainer 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.travis.yml +3 -0
  4. data/CONTRIBUTING.md +29 -0
  5. data/Gemfile +12 -0
  6. data/Guardfile +6 -0
  7. data/LICENSE.txt +22 -0
  8. data/README.md +51 -0
  9. data/Rakefile +34 -0
  10. data/guard-strainer.gemspec +25 -0
  11. data/lib/guard/strainer.rb +112 -0
  12. data/lib/guard/strainer/runner.rb +48 -0
  13. data/lib/guard/strainer/templates/Guardfile +7 -0
  14. data/lib/guard/strainer/version.rb +5 -0
  15. data/spec/fixtures/cookbooks/git/.gitignore +14 -0
  16. data/spec/fixtures/cookbooks/git/.kitchen.yml +46 -0
  17. data/spec/fixtures/cookbooks/git/Berksfile +8 -0
  18. data/spec/fixtures/cookbooks/git/CHANGELOG.md +76 -0
  19. data/spec/fixtures/cookbooks/git/CONTRIBUTING +29 -0
  20. data/spec/fixtures/cookbooks/git/Gemfile +3 -0
  21. data/spec/fixtures/cookbooks/git/LICENSE +201 -0
  22. data/spec/fixtures/cookbooks/git/README.md +115 -0
  23. data/spec/fixtures/cookbooks/git/TESTING.md +25 -0
  24. data/spec/fixtures/cookbooks/git/attributes/default.rb +40 -0
  25. data/spec/fixtures/cookbooks/git/metadata.rb +35 -0
  26. data/spec/fixtures/cookbooks/git/recipes/default.rb +46 -0
  27. data/spec/fixtures/cookbooks/git/recipes/server.rb +57 -0
  28. data/spec/fixtures/cookbooks/git/recipes/source.rb +49 -0
  29. data/spec/fixtures/cookbooks/git/recipes/windows.rb +32 -0
  30. data/spec/fixtures/cookbooks/git/templates/default/git-xinetd.d.erb +10 -0
  31. data/spec/fixtures/cookbooks/git/templates/default/sv-git-daemon-log-run.erb +2 -0
  32. data/spec/fixtures/cookbooks/git/templates/default/sv-git-daemon-run.erb +3 -0
  33. data/spec/fixtures/cookbooks/sudo/.chef/knife.rb +1 -0
  34. data/spec/fixtures/cookbooks/sudo/.gitignore +14 -0
  35. data/spec/fixtures/cookbooks/sudo/.kitchen.yml +35 -0
  36. data/spec/fixtures/cookbooks/sudo/.rspec +2 -0
  37. data/spec/fixtures/cookbooks/sudo/Berksfile +8 -0
  38. data/spec/fixtures/cookbooks/sudo/CHANGELOG.md +63 -0
  39. data/spec/fixtures/cookbooks/sudo/CONTRIBUTING.md +257 -0
  40. data/spec/fixtures/cookbooks/sudo/Gemfile +12 -0
  41. data/spec/fixtures/cookbooks/sudo/LICENSE +201 -0
  42. data/spec/fixtures/cookbooks/sudo/README.md +229 -0
  43. data/spec/fixtures/cookbooks/sudo/TESTING.md +25 -0
  44. data/spec/fixtures/cookbooks/sudo/attributes/default.rb +25 -0
  45. data/spec/fixtures/cookbooks/sudo/files/default/README +17 -0
  46. data/spec/fixtures/cookbooks/sudo/metadata.rb +46 -0
  47. data/spec/fixtures/cookbooks/sudo/providers/default.rb +135 -0
  48. data/spec/fixtures/cookbooks/sudo/recipes/default.rb +54 -0
  49. data/spec/fixtures/cookbooks/sudo/resources/default.rb +38 -0
  50. data/spec/fixtures/cookbooks/sudo/templates/default/sudoer.erb +6 -0
  51. data/spec/fixtures/cookbooks/sudo/templates/default/sudoers.erb +26 -0
  52. data/spec/fixtures/cookbooks/tmux/.chef/knife.rb +2 -0
  53. data/spec/fixtures/cookbooks/tmux/.gitignore +1 -0
  54. data/spec/fixtures/cookbooks/tmux/.travis.yml +7 -0
  55. data/spec/fixtures/cookbooks/tmux/CHANGELOG.md +39 -0
  56. data/spec/fixtures/cookbooks/tmux/CONTRIBUTING.md +257 -0
  57. data/spec/fixtures/cookbooks/tmux/Gemfile +6 -0
  58. data/spec/fixtures/cookbooks/tmux/LICENSE +201 -0
  59. data/spec/fixtures/cookbooks/tmux/README.md +52 -0
  60. data/spec/fixtures/cookbooks/tmux/Rakefile +34 -0
  61. data/spec/fixtures/cookbooks/tmux/attributes/default.rb +15 -0
  62. data/spec/fixtures/cookbooks/tmux/metadata.rb +7 -0
  63. data/spec/fixtures/cookbooks/tmux/recipes/default.rb +33 -0
  64. data/spec/fixtures/cookbooks/tmux/recipes/package.rb +5 -0
  65. data/spec/fixtures/cookbooks/tmux/recipes/source.rb +45 -0
  66. data/spec/fixtures/cookbooks/tmux/templates/default/tmux.conf.erb +35 -0
  67. data/spec/fixtures/cookbooks/tmux/test/kitchen/Kitchenfile +6 -0
  68. data/spec/guard/strainer/runner_spec.rb +66 -0
  69. data/spec/guard/strainer_spec.rb +114 -0
  70. data/spec/spec_helper.rb +24 -0
  71. metadata +213 -0
@@ -0,0 +1,40 @@
1
+ #
2
+ # Author:: Jamie Winsor (<jamie@vialstudios.com>)
3
+ # Cookbook Name:: git
4
+ # Attributes:: default
5
+ #
6
+ # Copyright 2008-2012, Opscode, Inc.
7
+ #
8
+ # Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+
20
+ case node['platform_family']
21
+ when 'windows'
22
+ default['git']['version'] = "1.8.1.2-preview20130201"
23
+ default['git']['url'] = "https://msysgit.googlecode.com/files/Git-#{node['git']['version']}.exe"
24
+ default['git']['checksum'] = "796ac91f0c7456b53f2717a81f475075cc581af2f447573131013cac5b63bb2a"
25
+ default['git']['display_name'] = "Git version #{ node['git']['version'] }"
26
+ when "mac_os_x"
27
+ default['git']['osx_dmg']['app_name'] = "git-1.8.2-intel-universal-snow-leopard"
28
+ default['git']['osx_dmg']['volumes_dir'] = "Git 1.8.2 Snow Leopard Intel Universal"
29
+ default['git']['osx_dmg']['package_id'] = "GitOSX.Installer.git182.git.pkg"
30
+ default['git']['osx_dmg']['url'] = "https://git-osx-installer.googlecode.com/files/git-1.8.2-intel-universal-snow-leopard.dmg"
31
+ default['git']['osx_dmg']['checksum'] = "e1d0ec7a9d9d03b9e61f93652b63505137f31217908635cdf2f350d07cb33e15"
32
+ else
33
+ default['git']['prefix'] = "/usr/local"
34
+ default['git']['version'] = "1.8.2.1"
35
+ default['git']['url'] = "https://nodeload.github.com/git/git/tar.gz/v#{node['git']['version']}"
36
+ default['git']['checksum'] = "bdc1768f70ce3d8f3e4edcdcd99b2f85a7f8733fb684398aebe58dde3e6bcca2"
37
+ end
38
+
39
+ default['git']['server']['base_path'] = "/srv/git"
40
+ default['git']['server']['export_all'] = "true"
@@ -0,0 +1,35 @@
1
+ name "git"
2
+ maintainer "Opscode, Inc."
3
+ maintainer_email "cookbooks@opscode.com"
4
+ license "Apache 2.0"
5
+ description "Installs git and/or sets up a Git server daemon"
6
+ long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7
+ version "2.5.3"
8
+ recipe "git", "Installs git"
9
+ recipe "git::server", "Sets up a runit_service for git daemon"
10
+ recipe "git::source", "Installs git from source"
11
+
12
+ %w{ amazon arch centos debian fedora redhat scientific oracle amazon ubuntu windows }.each do |os|
13
+ supports os
14
+ end
15
+
16
+ supports "mac_os_x", ">= 10.6.0"
17
+
18
+ %w{ dmg build-essential yum windows }.each do |cookbook|
19
+ depends cookbook
20
+ end
21
+
22
+ depends "runit", ">= 1.0"
23
+
24
+ attribute "git/server/base_path",
25
+ :display_name => "Git Daemon Base Path",
26
+ :description => "A directory containing git repositories to be exposed by the git-daemon",
27
+ :default => "/srv/git",
28
+ :recipes => ["git::server"]
29
+
30
+ attribute "git/server/export_all",
31
+ :display_name => "Git Daemon Export All",
32
+ :description => "Adds the --export-all option to the git-daemon parameters, making all repositories publicly readable even if they lack the \"git-daemon-export-ok\" file",
33
+ :choice => ["true", "false"],
34
+ :default => "true",
35
+ :recipes => ["git::server"]
@@ -0,0 +1,46 @@
1
+ #
2
+ # Cookbook Name:: git
3
+ # Recipe:: default
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ case node['platform_family']
20
+ when "debian"
21
+ if node['platform'] == "ubuntu" && node['platform_version'].to_f < 10.10
22
+ package "git-core"
23
+ else
24
+ package "git"
25
+ end
26
+ when "rhel","fedora"
27
+ case node['platform_version'].to_i
28
+ when 5
29
+ include_recipe "yum::epel"
30
+ end
31
+ package "git"
32
+ when "windows"
33
+ include_recipe 'git::windows'
34
+ when "mac_os_x"
35
+ dmg_package "GitOSX-Installer" do
36
+ app node['git']['osx_dmg']['app_name']
37
+ package_id node['git']['osx_dmg']['package_id']
38
+ volumes_dir node['git']['osx_dmg']['volumes_dir']
39
+ source node['git']['osx_dmg']['url']
40
+ checksum node['git']['osx_dmg']['checksum']
41
+ type "pkg"
42
+ action :install
43
+ end
44
+ else
45
+ package "git"
46
+ end
@@ -0,0 +1,57 @@
1
+ #
2
+ # Cookbook Name:: git
3
+ # Recipe:: server
4
+ #
5
+ # Copyright 2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ if node["platform"] == "windows"
20
+ return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe"
21
+ end
22
+
23
+ include_recipe "git"
24
+
25
+ directory node["git"]["server"]["base_path"] do
26
+ owner "root"
27
+ group "root"
28
+ mode 00755
29
+ end
30
+
31
+ case node['platform_family']
32
+ when "debian"
33
+ include_recipe "runit"
34
+
35
+ package "git-daemon-run"
36
+
37
+ runit_service "git-daemon" do
38
+ sv_templates false
39
+ end
40
+ when "rhel"
41
+ package "git-daemon"
42
+
43
+ template "/etc/xinetd.d/git" do
44
+ backup false
45
+ source "git-xinetd.d.erb"
46
+ owner "root"
47
+ group "root"
48
+ mode 00644
49
+ end
50
+
51
+ service "xinetd" do
52
+ action [:enable, :restart]
53
+ end
54
+ else
55
+ log "Platform requires setting up a git daemon service script."
56
+ log "Hint: /usr/bin/git daemon --export-all --user=nobody --group=daemon --base-path=#{node["git"]["server"]["base_path"]}"
57
+ end
@@ -0,0 +1,49 @@
1
+ #
2
+ # Cookbook Name:: git
3
+ # Recipe:: source
4
+ #
5
+ # Copyright 2012, Brian Flad, Fletcher Nichol
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ if node["platform"] == "windows"
20
+ return "#{node['platform']} is not supported by the #{cookbook_name}::#{recipe_name} recipe"
21
+ end
22
+
23
+ include_recipe "build-essential"
24
+
25
+ pkgs = value_for_platform_family(
26
+ ["rhel"] => %w{ expat-devel gettext-devel libcurl-devel openssl-devel perl-ExtUtils-MakeMaker zlib-devel },
27
+ ["debian"] => %w{ libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev }
28
+ )
29
+
30
+ pkgs.each do |pkg|
31
+ package pkg
32
+ end
33
+
34
+ remote_file "#{Chef::Config['file_cache_path']}/git-#{node['git']['version']}.tar.gz" do
35
+ source node['git']['url']
36
+ checksum node['git']['checksum']
37
+ mode 00644
38
+ not_if "test -f #{Chef::Config['file_cache_path']}/git-#{node['git']['version']}.tar.gz"
39
+ end
40
+
41
+ execute "Extracting and Building Git #{node['git']['version']} from Source" do
42
+ cwd Chef::Config['file_cache_path']
43
+ command <<-COMMAND
44
+ (mkdir git-#{node['git']['version']} && tar -zxf git-#{node['git']['version']}.tar.gz -C git-#{node['git']['version']} --strip-components 1)
45
+ (cd git-#{node['git']['version']} && make prefix=#{node['git']['prefix']} install)
46
+ COMMAND
47
+ creates "#{node['git']['prefix']}/bin/git"
48
+ not_if "git --version | grep #{node['git']['version']}"
49
+ end
@@ -0,0 +1,32 @@
1
+ #
2
+ # Cookbook Name:: git
3
+ # Recipe:: windows
4
+ #
5
+ # Copyright 2008-2009, Opscode, Inc.
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ windows_package node['git']['display_name'] do
20
+ action :install
21
+ source node['git']['url']
22
+ checksum node['git']['checksum']
23
+ installer_type :inno
24
+ end
25
+
26
+ # Git is installed to Program Files (x86) on 64-bit machines and
27
+ # 'Program Files' on 32-bit machines
28
+ PROGRAM_FILES = ENV['ProgramFiles(x86)'] || ENV['ProgramFiles']
29
+
30
+ windows_path "#{ PROGRAM_FILES }\\Git\\Cmd" do
31
+ action :add
32
+ end
@@ -0,0 +1,10 @@
1
+ service git
2
+ {
3
+ disable = no
4
+ socket_type = stream
5
+ wait = no
6
+ user = nobody
7
+ server = /usr/libexec/git-core/git-daemon
8
+ server_args = --base-path=<%= node["git"]["server"]["base_path"] %> <% if node["git"]["server"]["export_all"] == "true" %>--export-all <% end %>--syslog --inetd --verbose
9
+ log_on_failure += USERID
10
+ }
@@ -0,0 +1,2 @@
1
+ #!/bin/sh
2
+ exec svlogd -tt ./main
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+ exec 2>&1
3
+ exec /usr/bin/git daemon <% if node["git"]["server"]["export_all"] == "true" %>--export-all <% end %>--user=nobody --group=daemon --syslog --base-path=<%= node["git"]["server"]["base_path"] %> <%= node["git"]["server"]["base_path"] %>
@@ -0,0 +1 @@
1
+ cache_options( :path => "#{ENV['HOME']}/.chef/checksums" )
@@ -0,0 +1,14 @@
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
@@ -0,0 +1,35 @@
1
+ ---
2
+ driver_plugin: vagrant
3
+ driver_config:
4
+ require_chef_omnibus: true
5
+
6
+ platforms:
7
+ - name: ubuntu-12.04
8
+ driver_config:
9
+ box: opscode-ubuntu-12.04
10
+ box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box
11
+ run_list:
12
+ - recipe[apt]
13
+
14
+ - name: ubuntu-10.04
15
+ driver_config:
16
+ box: opscode-ubuntu-10.04
17
+ box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-10.04_provisionerless.box
18
+ run_list:
19
+ - recipe[apt]
20
+
21
+ - name: centos-6.4
22
+ driver_config:
23
+ box: opscode-centos-6.4
24
+ box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box
25
+
26
+ - name: centos-5.9
27
+ driver_config:
28
+ box: opscode-centos-5.9
29
+ box_url: https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_centos-5.9_provisionerless.box
30
+
31
+ suites:
32
+ - name: default
33
+ run_list:
34
+ - recipe[sudo]
35
+ attributes: {}
@@ -0,0 +1,2 @@
1
+ --color spec
2
+ --format Fuubar
@@ -0,0 +1,8 @@
1
+ site :opscode
2
+
3
+ metadata
4
+
5
+ group :integration do
6
+ cookbook "apt"
7
+ cookbook "yum"
8
+ end
@@ -0,0 +1,63 @@
1
+ ## v2.1.4:
2
+
3
+ This is a bugfix for 11.6.0 compatibility, as we're not
4
+ monkey-patching Erubis::Context.
5
+
6
+ ### Bug
7
+
8
+ - [COOK-3399]: Remove node attribute in comment of sudoers templates
9
+
10
+ ## v2.1.2:
11
+
12
+ ### Bug
13
+
14
+ - [COOK-2388]: Chef::ShellOut is deprecated, please use Mixlib::ShellOut
15
+ - [COOK-2814]: Incorrect syntax in README example
16
+
17
+ ## v2.1.0:
18
+
19
+ * [COOK-2388] - Chef::ShellOut is deprecated, please use
20
+ Mixlib::ShellOut
21
+ * [COOK-2427] - unable to install users cookbook in chef 11
22
+ * [COOK-2814] - Incorrect syntax in README example
23
+
24
+ ## v2.0.4:
25
+
26
+ * [COOK-2078] - syntax highlighting README on GitHub flavored markdown
27
+ * [COOK-2119] - LWRP template doesn't support multiple commands in a
28
+ single block.
29
+
30
+ ## v2.0.2:
31
+
32
+ * [COOK-2109] - lwrp uses incorrect action on underlying file
33
+ resource.
34
+
35
+ ## v2.0.0:
36
+
37
+ This is a major release because the LWRP's "nopasswd" attribute is
38
+ changed from true to false, to match the passwordless attribute in the
39
+ attributes file. This requires a change to people's LWRP use.
40
+
41
+ * [COOK-2085] - Incorrect default value in the sudo LWRP's nopasswd attribute
42
+
43
+ ## v1.3.0:
44
+
45
+ * [COOK-1892] - Revamp sudo cookbook and LWRP
46
+ * [COOK-2022] - add an attribute for setting /etc/sudoers Defaults
47
+
48
+ ## v1.2.2:
49
+
50
+ * [COOK-1628] - set host in sudo lwrp
51
+
52
+ ## v1.2.0:
53
+
54
+ * [COOK-1314] - default package action is now :install instead of :upgrade
55
+ * [COOK-1549] - Preserve SSH agent credentials upon sudo using an attribute
56
+
57
+ ## v1.1.0:
58
+
59
+ * [COOK-350] - LWRP to manage sudo files via includedir (/etc/sudoers.d)
60
+
61
+ ## v1.0.2:
62
+
63
+ * [COOK-903] - freebsd support
@@ -0,0 +1,257 @@
1
+ # Contributing to Opscode Cookbooks
2
+
3
+ We are glad you want to contribute to Opscode Cookbooks! The first
4
+ step is the desire to improve the project.
5
+
6
+ You can find the answers to additional frequently asked questions
7
+ [on the wiki](http://wiki.opscode.com/display/chef/How+to+Contribute).
8
+
9
+ You can find additional information about
10
+ [contributing to cookbooks](http://wiki.opscode.com/display/chef/How+to+Contribute+to+Opscode+Cookbooks)
11
+ on the wiki as well.
12
+
13
+ ## Quick-contribute
14
+
15
+ * Create an account on our [bug tracker](http://tickets.opscode.com)
16
+ * Sign our contributor agreement (CLA)
17
+ [ online](https://secure.echosign.com/public/hostedForm?formid=PJIF5694K6L)
18
+ (keep reading if you're contributing on behalf of your employer)
19
+ * Create a ticket for your change on the
20
+ [bug tracker](http://tickets.opscode.com)
21
+ * Link to your patch as a rebased git branch or pull request from the
22
+ ticket
23
+ * Resolve the ticket as fixed
24
+
25
+ We regularly review contributions and will get back to you if we have
26
+ any suggestions or concerns.
27
+
28
+ ## The Apache License and the CLA/CCLA
29
+
30
+ Licensing is very important to open source projects, it helps ensure
31
+ the software continues to be available under the terms that the author
32
+ desired. Chef uses the Apache 2.0 license to strike a balance between
33
+ open contribution and allowing you to use the software however you
34
+ would like to.
35
+
36
+ The license tells you what rights you have that are provided by the
37
+ copyright holder. It is important that the contributor fully
38
+ understands what rights they are licensing and agrees to them.
39
+ Sometimes the copyright holder isn't the contributor, most often when
40
+ the contributor is doing work for a company.
41
+
42
+ To make a good faith effort to ensure these criteria are met, Opscode
43
+ requires a Contributor License Agreement (CLA) or a Corporate
44
+ Contributor License Agreement (CCLA) for all contributions. This is
45
+ without exception due to some matters not being related to copyright
46
+ and to avoid having to continually check with our lawyers about small
47
+ patches.
48
+
49
+ It only takes a few minutes to complete a CLA, and you retain the
50
+ copyright to your contribution.
51
+
52
+ You can complete our contributor agreement (CLA)
53
+ [ online](https://secure.echosign.com/public/hostedForm?formid=PJIF5694K6L).
54
+ If you're contributing on behalf of your employer, have your employer
55
+ fill out our
56
+ [Corporate CLA](https://secure.echosign.com/public/hostedForm?formid=PIE6C7AX856)
57
+ instead.
58
+
59
+ ## Ticket Tracker (JIRA)
60
+
61
+ The [ticket tracker](http://tickets.opscode.com) is the most important
62
+ documentation for the code base. It provides significant historical
63
+ information, such as:
64
+
65
+ * Which release a bug fix is included in
66
+ * Discussion regarding the design and merits of features
67
+ * Error output to aid in finding similar bugs
68
+
69
+ Each ticket should aim to fix one bug or add one feature.
70
+
71
+ ## Using git
72
+
73
+ You can get a quick copy of the repository for this cookbook by
74
+ running `git clone
75
+ git://github.com/opscode-coobkooks/COOKBOOKNAME.git`.
76
+
77
+ For collaboration purposes, it is best if you create a Github account
78
+ and fork the repository to your own account. Once you do this you will
79
+ be able to push your changes to your Github repository for others to
80
+ see and use.
81
+
82
+ If you have another repository in your GitHub account named the same
83
+ as the cookbook, we suggest you suffix the repository with -cookbook.
84
+
85
+ ### Branches and Commits
86
+
87
+ You should submit your patch as a git branch named after the ticket,
88
+ such as COOK-1337. This is called a _topic branch_ and allows users to
89
+ associate a branch of code with the ticket.
90
+
91
+ It is a best practice to have your commit message have a _summary
92
+ line_ that includes the ticket number, followed by an empty line and
93
+ then a brief description of the commit. This also helps other
94
+ contributors understand the purpose of changes to the code.
95
+
96
+ [COOK-1757] - platform_family and style
97
+
98
+ * use platform_family for platform checking
99
+ * update notifies syntax to "resource_type[resource_name]" instead of
100
+ resources() lookup
101
+ * COOK-692 - delete config files dropped off by packages in conf.d
102
+ * dropped debian 4 support because all other platforms have the same
103
+ values, and it is older than "old stable" debian release
104
+
105
+ Remember that not all users use Chef in the same way or on the same
106
+ operating systems as you, so it is helpful to be clear about your use
107
+ case and change so they can understand it even when it doesn't apply
108
+ to them.
109
+
110
+ ### Github and Pull Requests
111
+
112
+ All of Opscode's open source cookbook projects are available on
113
+ [Github](http://www.github.com/opscode-cookbooks).
114
+
115
+ We don't require you to use Github, and we will even take patch diffs
116
+ attached to tickets on the tracker. However Github has a lot of
117
+ convenient features, such as being able to see a diff of changes
118
+ between a pull request and the main repository quickly without
119
+ downloading the branch.
120
+
121
+ If you do choose to use a pull request, please provide a link to the
122
+ pull request from the ticket __and__ a link to the ticket from the
123
+ pull request. Because pull requests only have two states, open and
124
+ closed, we can't easily filter pull requests that are waiting for a
125
+ reply from the author for various reasons.
126
+
127
+ ### More information
128
+
129
+ Additional help with git is available on the
130
+ [Working with Git](http://wiki.opscode.com/display/chef/Working+with+Git)
131
+ wiki page.
132
+
133
+ ## Functional and Unit Tests
134
+
135
+ This cookbook is set up to run tests under
136
+ [Opscode's test-kitchen](https://github.com/opscode/test-kitchen). It
137
+ uses minitest-chef to run integration tests after the node has been
138
+ converged to verify that the state of the node.
139
+
140
+ Test kitchen should run completely without exception using the default
141
+ [baseboxes provided by Opscode](https://github.com/opscode/bento).
142
+ Because Test Kitchen creates VirtualBox machines and runs through
143
+ every configuration in the Kitchenfile, it may take some time for
144
+ these tests to complete.
145
+
146
+ If your changes are only for a specific recipe, run only its
147
+ configuration with Test Kitchen. If you are adding a new recipe, or
148
+ other functionality such as a LWRP or definition, please add
149
+ appropriate tests and ensure they run with Test Kitchen.
150
+
151
+ If any don't pass, investigate them before submitting your patch.
152
+
153
+ Any new feature should have unit tests included with the patch with
154
+ good code coverage to help protect it from future changes. Similarly,
155
+ patches that fix a bug or regression should have a _regression test_.
156
+ Simply put, this is a test that would fail without your patch but
157
+ passes with it. The goal is to ensure this bug doesn't regress in the
158
+ future. Consider a regular expression that doesn't match a certain
159
+ pattern that it should, so you provide a patch and a test to ensure
160
+ that the part of the code that uses this regular expression works as
161
+ expected. Later another contributor may modify this regular expression
162
+ in a way that breaks your use cases. The test you wrote will fail,
163
+ signalling to them to research your ticket and use case and accounting
164
+ for it.
165
+
166
+ If you need help writing tests, please ask on the Chef Developer's
167
+ mailing list, or the #chef-hacking IRC channel.
168
+
169
+ ## Code Review
170
+
171
+ Opscode regularly reviews code contributions and provides suggestions
172
+ for improvement in the code itself or the implementation.
173
+
174
+ We find contributions by searching the ticket tracker for _resolved_
175
+ tickets with a status of _fixed_. If we have feedback we will reopen
176
+ the ticket and you should resolve it again when you've made the
177
+ changes or have a response to our feedback. When we believe the patch
178
+ is ready to be merged, we will tag the _Code Reviewed_ field with
179
+ _Reviewed_.
180
+
181
+ Depending on the project, these tickets are then merged within a week
182
+ or two, depending on the current release cycle.
183
+
184
+ ## Release Cycle
185
+
186
+ The versioning for Opscode Cookbook projects is X.Y.Z.
187
+
188
+ * X is a major release, which may not be fully compatible with prior
189
+ major releases
190
+ * Y is a minor release, which adds both new features and bug fixes
191
+ * Z is a patch release, which adds just bug fixes
192
+
193
+ A released version of a cookbook will end in an even number, e.g.
194
+ "1.2.4" or "0.8.0". When development for the next version of the
195
+ cookbook begins, the "Z" patch number is incremented to the next odd
196
+ number, however the next release of the cookbook may be a major or
197
+ minor incrementing version.
198
+
199
+ Releases of Opscode's cookbooks are usually announced on the Chef user
200
+ mailing list. Releases of several cookbooks may be batched together
201
+ and announced on the [Opscode Blog](http://www.opscode.com/blog).
202
+
203
+ ## Working with the community
204
+
205
+ These resources will help you learn more about Chef and connect to
206
+ other members of the Chef community:
207
+
208
+ * [chef](http://lists.opscode.com/sympa/info/chef) and
209
+ [chef-dev](http://lists.opscode.com/sympa/info/chef-dev) mailing
210
+ lists
211
+ * #chef and #chef-hacking IRC channels on irc.freenode.net
212
+ * [Community Cookbook site](http://community.opscode.com)
213
+ * [Chef wiki](http://wiki.opscode.com/display/chef)
214
+ * Opscode Chef [product page](http://www.opscode.com/chef)
215
+
216
+
217
+ ## Cookbook Contribution Do's and Don't's
218
+
219
+ Please do include tests for your contribution. If you need help, ask
220
+ on the
221
+ [chef-dev mailing list](http://lists.opscode.com/sympa/info/chef-dev)
222
+ or the
223
+ [#chef-hacking IRC channel](http://community.opscode.com/chat/chef-hacking).
224
+ Not all platforms that a cookbook supports may be supported by Test
225
+ Kitchen. Please provide evidence of testing your contribution if it
226
+ isn't trivial so we don't have to duplicate effort in testing. Chef
227
+ 10.14+ "doc" formatted output is sufficient.
228
+
229
+ Please do indicate new platform (families) or platform versions in the
230
+ commit message, and update the relevant ticket.
231
+
232
+ If a contribution adds new platforms or platform versions, indicate
233
+ such in the body of the commit message(s), and update the relevant
234
+ COOK ticket. When writing commit messages, it is helpful for others if
235
+ you indicate the COOK ticket. For example:
236
+
237
+ git commit -m '[COOK-1041] - Updated pool resource to correctly
238
+ delete.'
239
+
240
+ Please do use [foodcritic](http://acrmp.github.com/foodcritic) to
241
+ lint-check the cookbook. Except FC007, it should pass all correctness
242
+ rules. FC007 is okay as long as the dependent cookbooks are *required*
243
+ for the default behavior of the cookbook, such as to support an
244
+ uncommon platform, secondary recipe, etc.
245
+
246
+ Please do ensure that your changes do not break or modify behavior for
247
+ other platforms supported by the cookbook. For example if your changes
248
+ are for Debian, make sure that they do not break on CentOS.
249
+
250
+ Please do not modify the version number in the metadata.rb, Opscode
251
+ will select the appropriate version based on the release cycle
252
+ information above.
253
+
254
+ Please do not update the CHANGELOG.md for a new version. Not all
255
+ changes to a cookbook may be merged and released in the same versions.
256
+ Opscode will update the CHANGELOG.md when releasing a new version of
257
+ the cookbook.