OSDN Git Service

adds the 00cookbook template cookbook.
authorwhitestar <whitestar@gaea.test>
Sun, 29 Jan 2017 05:47:48 +0000 (14:47 +0900)
committerwhitestar <whitestar@gaea.test>
Sun, 29 Jan 2017 05:47:48 +0000 (14:47 +0900)
cookbooks/00cookbook/.foodcritic [new file with mode: 0644]
cookbooks/00cookbook/.rubocop.yml [new file with mode: 0644]
cookbooks/00cookbook/CHANGELOG.md [new file with mode: 0644]
cookbooks/00cookbook/Gemfile [new file with mode: 0644]
cookbooks/00cookbook/README.md [new file with mode: 0644]
cookbooks/00cookbook/Rakefile [new file with mode: 0644]
cookbooks/00cookbook/metadata.rb [new file with mode: 0644]
cookbooks/00cookbook/recipes/default.rb [new file with mode: 0644]
cookbooks/00cookbook/spec/recipes/default_spec.rb [new file with mode: 0644]
cookbooks/00cookbook/spec/spec_helper.rb [new file with mode: 0644]

diff --git a/cookbooks/00cookbook/.foodcritic b/cookbooks/00cookbook/.foodcritic
new file mode 100644 (file)
index 0000000..3907cff
--- /dev/null
@@ -0,0 +1 @@
+~FC001
diff --git a/cookbooks/00cookbook/.rubocop.yml b/cookbooks/00cookbook/.rubocop.yml
new file mode 100644 (file)
index 0000000..4e84d82
--- /dev/null
@@ -0,0 +1,47 @@
+AllCops:
+  Exclude:
+    - vendor/**/*
+
+AlignParameters:
+  Enabled: false
+LineLength:
+  Enabled: false
+Lint/UnusedBlockArgument:
+  Enabled: false
+Metrics/AbcSize:
+  Enabled: false
+Style/BlockComments:
+  Enabled: false
+Style/BlockDelimiters:
+  Enabled: false
+Style/ExtraSpacing:
+  Enabled: false
+Style/FileName:
+  Enabled: false
+Style/LeadingCommentSpace:
+  Enabled: false
+Style/RescueModifier:
+  Enabled: false
+Style/SpaceBeforeFirstArg:
+  Enabled: false
+Style/TrailingCommaInLiteral:
+  EnforcedStyleForMultiline: comma
+Style/WordArray:
+  Enabled: false
+
+#Lint/ShadowingOuterLocalVariable:
+#  Enabled: false
+#Metrics/MethodLength:
+#  Max: 10
+#Metrics/ModuleLength:
+#  Max: 100
+#Metrics/CyclomaticComplexity:
+#  Max: 6
+#Metrics/PerceivedComplexity:
+#  Max: 7
+#Style/AccessorMethodName:
+#  Enabled: false
+#Style/MultilineOperationIndentation:
+#  Enabled: false
+#Style/PerlBackrefs:
+#  Enabled: false
diff --git a/cookbooks/00cookbook/CHANGELOG.md b/cookbooks/00cookbook/CHANGELOG.md
new file mode 100644 (file)
index 0000000..08cca34
--- /dev/null
@@ -0,0 +1,11 @@
+# 00cookbook CHANGELOG
+
+This file is used to list changes made in each version of the 00cookbook cookbook.
+
+## 0.1.0
+- [your_name] - Initial release of 00cookbook
+
+- - -
+Check the [Markdown Syntax Guide](http://daringfireball.net/projects/markdown/syntax) for help with Markdown.
+
+The [Github Flavored Markdown page](http://github.github.com/github-flavored-markdown/) describes the differences between markdown on github and standard markdown.
diff --git a/cookbooks/00cookbook/Gemfile b/cookbooks/00cookbook/Gemfile
new file mode 100644 (file)
index 0000000..907b097
--- /dev/null
@@ -0,0 +1,3 @@
+source 'https://rubygems.org'
+
+#gem 'foodcritic'
diff --git a/cookbooks/00cookbook/README.md b/cookbooks/00cookbook/README.md
new file mode 100644 (file)
index 0000000..93ccfcd
--- /dev/null
@@ -0,0 +1,80 @@
+# 00cookbook Cookbook
+
+TODO: Enter the cookbook description here.
+
+e.g.
+This cookbook makes your favorite breakfast sandwich.
+
+## Requirements
+
+TODO: List your cookbook requirements. Be sure to include any requirements this cookbook has on platforms, libraries, other cookbooks, packages, operating systems, etc.
+
+e.g.
+### Platforms
+
+- SandwichOS
+
+### Chef
+
+- Chef 12.0 or later
+
+### Cookbooks
+
+- `toaster` - 00cookbook needs toaster to brown your bagel.
+
+## Attributes
+
+TODO: List your cookbook attributes here.
+
+e.g.
+### 00cookbook::default
+
+<table>
+  <tr>
+    <th>Key</th>
+    <th>Type</th>
+    <th>Description</th>
+    <th>Default</th>
+  </tr>
+  <tr>
+    <td><tt>['00cookbook']['bacon']</tt></td>
+    <td>Boolean</td>
+    <td>whether to include bacon</td>
+    <td><tt>true</tt></td>
+  </tr>
+</table>
+
+## Usage
+
+### 00cookbook::default
+
+TODO: Write usage instructions for each cookbook.
+
+e.g.
+Just include `00cookbook` in your node's `run_list`:
+
+```json
+{
+  "name":"my_node",
+  "run_list": [
+    "recipe[00cookbook]"
+  ]
+}
+```
+
+## Contributing
+
+TODO: (optional) If this is a public cookbook, detail the process for contributing. If this is a private cookbook, remove this section.
+
+e.g.
+1. Fork the repository on Github
+2. Create a named feature branch (like `add_component_x`)
+3. Write your change
+4. Write tests for your change (if applicable)
+5. Run the tests, ensuring they all pass
+6. Submit a Pull Request using Github
+
+## License and Authors
+
+Authors: TODO: List authors
+
diff --git a/cookbooks/00cookbook/Rakefile b/cookbooks/00cookbook/Rakefile
new file mode 100644 (file)
index 0000000..513cecc
--- /dev/null
@@ -0,0 +1,23 @@
+require 'rspec/core/rake_task'
+require 'rubocop/rake_task'
+require 'foodcritic'
+
+namespace :style do
+  desc 'Run Ruby style checks'
+  RuboCop::RakeTask.new(:ruby)
+
+  desc 'Run Chef style checks'
+  FoodCritic::Rake::LintTask.new(:chef) do |t|
+    t.options = {
+      fail_tags: ['any'],
+    }
+  end
+end
+
+desc 'Run all style checks'
+task style: ['style:chef', 'style:ruby']
+
+desc 'Run ChefSpec examples'
+RSpec::Core::RakeTask.new(:spec)
+
+task default: ['style', 'spec']
diff --git a/cookbooks/00cookbook/metadata.rb b/cookbooks/00cookbook/metadata.rb
new file mode 100644 (file)
index 0000000..0f35f1f
--- /dev/null
@@ -0,0 +1,7 @@
+name             '00cookbook'
+maintainer       'whitestar'
+maintainer_email ''
+license          'Apache 2.0'
+description      'Installs/Configures 00cookbook'
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
+version          '0.1.0'
diff --git a/cookbooks/00cookbook/recipes/default.rb b/cookbooks/00cookbook/recipes/default.rb
new file mode 100644 (file)
index 0000000..24f98a5
--- /dev/null
@@ -0,0 +1,18 @@
+#
+# Cookbook Name:: 00cookbook
+# Recipe:: default
+#
+# Copyright 2017, whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
diff --git a/cookbooks/00cookbook/spec/recipes/default_spec.rb b/cookbooks/00cookbook/spec/recipes/default_spec.rb
new file mode 100644 (file)
index 0000000..ee2c1a2
--- /dev/null
@@ -0,0 +1,20 @@
+require_relative '../spec_helper'
+
+describe '00cookbook::default' do
+  subject { ChefSpec::Runner.new.converge(described_recipe) }
+
+  # Write quick specs using `it` blocks with implied subjects
+  it { should do_something('...') }
+
+  # Write full examples using the `expect` syntax
+  it 'does something' do
+    expect(subject).to do_something('...')
+  end
+
+  # Use an explicit subject
+  let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }
+
+  it 'does something' do
+    expect(chef_run).to do_something('...')
+  end
+end
diff --git a/cookbooks/00cookbook/spec/spec_helper.rb b/cookbooks/00cookbook/spec/spec_helper.rb
new file mode 100644 (file)
index 0000000..1995e2b
--- /dev/null
@@ -0,0 +1,25 @@
+# Added by ChefSpec
+require 'chefspec'
+
+# Uncomment to use ChefSpec's Berkshelf extension
+# require 'chefspec/berkshelf'
+
+RSpec.configure do |config|
+  # Specify the path for Chef Solo to find cookbooks
+  # config.cookbook_path = '/var/cookbooks'
+
+  # Specify the path for Chef Solo to find roles
+  # config.role_path = '/var/roles'
+
+  # Specify the Chef log_level (default: :warn)
+  # config.log_level = :debug
+
+  # Specify the path to a local JSON file with Ohai data
+  # config.path = 'ohai.json'
+
+  # Specify the operating platform to mock Ohai data from
+  # config.platform = 'ubuntu'
+
+  # Specify the operating version to mock Ohai data from
+  # config.version = '12.04'
+end