meez 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d021b40536840a0ee4ddb59d05efab4519299adb
4
- data.tar.gz: b3ee70a136a34f880ab795ad0e625c892357dd1e
3
+ metadata.gz: 1a426f319bc0ccdbf0f9fad44dc8e1d7548b1add
4
+ data.tar.gz: f5efacab5645e9ae0da845529dc7c65d3380d538
5
5
  SHA512:
6
- metadata.gz: 052b81f84ccb5ef5e00f0250434fa8a6e75670addaff04f799dc3f1d62df60f39ce9c248c1fb13996221bd11571940e31f6393d710504f63bc1f1d1c56cea4e5
7
- data.tar.gz: eb3840daf6dd8d4d5ca840b824a8c579a3effbe8373b41380c720320feccfc83d3ccc4880195093e50c98a2715deb69b510ec0d01754ef901cfb4d2f349aa927
6
+ metadata.gz: d3af0a979e50500ca1b574e35a6d5b6f1b874d3a68b475479f041d245f8aa27beaff43df331c288f0c7465a9135a8284afedfd2616c156902b91a803892bfbe7
7
+ data.tar.gz: 59ca00404de8cd088e4d9e24eef6bc04ee11c534c33e68ba9b3401b0bad8ba7cb24858f00d5e6214d2ea91e4ac3d05e0fb783e19b6fceeddf0a8a094c90f606e
@@ -0,0 +1,12 @@
1
+ image: paulczar/meez
2
+ env:
3
+ - CI=drone
4
+ - USE_SYSTEM_GECODE=1
5
+ script:
6
+ - bundle install
7
+ - bundle exec berks install
8
+ - bundle exec rake style spec
9
+ notify:
10
+ email:
11
+ recipients:
12
+ - paul.czarkowski@rackspace.com
@@ -0,0 +1,3 @@
1
+ *.gem
2
+ Gemfile.lock
3
+ .kitchen/
@@ -0,0 +1,13 @@
1
+ # Dear Rubocop, we're going to agree to disagree on the following:
2
+
3
+ LineLength:
4
+ Max: 200
5
+
6
+ MethodLength:
7
+ Max: 25
8
+
9
+ ClassLength:
10
+ Max: 200
11
+
12
+ UnusedMethodArgument:
13
+ Enabled: false
@@ -0,0 +1,20 @@
1
+ FROM racker/precise-with-updates
2
+
3
+ RUN apt-get -yqq update && apt-get -yqq install curl build-essential libxml2-dev libxslt-dev git autoconf wget python-pip
4
+
5
+ RUN wget -q -O /tmp/chefdk.deb https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chefdk_0.1.0-1_amd64.deb \
6
+ && dpkg -i /tmp/chefdk.deb \
7
+ && rm /tmp/chefdk.deb
8
+
9
+ RUN wget -q -O /tmp/vagrant.deb http://files.vagrantup.com/packages/a40522f5fabccb9ddabad03d836e120ff5d14093/vagrant_1.3.5_x86_64.deb \
10
+ && dpkg -i /tmp/vagrant.deb \
11
+ && rm /tmp/vagrant.deb
12
+
13
+ RUN pip install swiftly awscli
14
+
15
+ ENV PATH /opt/chefdk/embedded/bin:/root/.chefdk/gem/ruby/2.1.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
16
+ ENV USE_SYSTEM_GECODE 1
17
+
18
+ ADD Gemfile /tmp/Gemfile
19
+
20
+ RUN cd /tmp && bundle install && rm Gemfile*
data/Gemfile ADDED
@@ -0,0 +1,20 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'berkshelf', '> 3'
4
+ gem 'chef', '>= 11.8'
5
+ gem 'rake', '>= 10.2'
6
+ gem 'rubocop', '= 0.23'
7
+ gem 'foodcritic', '>= 3.0'
8
+ gem 'chefspec', '>= 3.4'
9
+ gem 'serverspec', '>= 1.6'
10
+ gem 'guard', '>= 2.6'
11
+ gem 'guard-rubocop', '>= 1.1'
12
+ gem 'guard-foodcritic', '>= 1.0.2'
13
+ gem 'test-kitchen'
14
+ gem 'kitchen-vagrant'
15
+ gem 'kitchen-docker'
16
+
17
+ #group :infinite_loop_solver do
18
+ # gem 'celluloid', '~> 0.14'
19
+ # gem 'celluloid-io', '~> 0.14'
20
+ #end
@@ -0,0 +1,7 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard :rubocop do
5
+ watch(%r{.+\.rb$})
6
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
7
+ end
@@ -0,0 +1,155 @@
1
+ Meez
2
+ ----
3
+
4
+ About
5
+ =====
6
+
7
+ `Meez` is slang for `mise en place`
8
+
9
+ `Mise en place` is a French phrase which means "putting in place", as in set up. It is used in professional kitchens to refer to organizing and arranging the ingredients (e.g., cuts of meat, relishes, sauces, par-cooked items, spices, freshly chopped vegetables, and other components) that a cook will require for the menu items that he or she expects to prepare during his/her shift.[1] The practice is also effective in home kitchens.
10
+
11
+ `Meez` will create an opinionated chef cookbook skeleton complete with testing suite.
12
+
13
+ Install
14
+ =======
15
+
16
+ Setting the environment variable `USE_SYSTEM_GECODE=1` will help speed up builds by using the system `gecode` rather than compiling it from scratch.
17
+
18
+ Official
19
+ ----------
20
+
21
+ as of version `0.2.0` this is offered as a `chefdk` plugin.
22
+
23
+ `chef gem install meez`
24
+
25
+ Unofficial
26
+ -------------
27
+
28
+ Your results may vary using it outside of `chefdk`
29
+
30
+ `gem install meez`
31
+
32
+
33
+ Usage
34
+ =====
35
+
36
+ ```
37
+ Usage: meez [options] <cookbook name>
38
+
39
+ Options
40
+ -o, --cookbook-path USERNAME The directory where the cookbook will be created
41
+ -C, --copyright COPYRIGHT_HOLDER The name of the copyright holder.
42
+ -I, --license LICENSE The type of license under which a cookbook is distributed: apachev2, gplv2, gplv3, mit, or none (default).
43
+ -m, --email EMAIL The email address for the individual who maintains the cookbook.
44
+ -d, --kitchen-driver DRIVER The driver which use test-kitchen for creating platform instances: vagrant (default), docker
45
+ -h, --help help
46
+ ```
47
+
48
+ ### Example
49
+
50
+ ```
51
+ $ meez --cookbook-path /tmp --copyright Foo -I apachev2 -m foo@bah.com test
52
+ * Initializing Cookbook
53
+ ** Creating cookbook test
54
+ ** Creating README for cookbook: test
55
+ ** Creating CHANGELOG for cookbook: test
56
+ ** Creating metadata for cookbook: test
57
+ Rewriting metadata.rb
58
+ Rewriting recipes/default.rb
59
+ * Initializing Berkshelf
60
+ create /tmp/test/Berksfile
61
+ create /tmp/test/Thorfile
62
+ create /tmp/test/.gitignore
63
+ run git init from "/tmp/test"
64
+ create /tmp/test/Gemfile
65
+ * Initializing Vagranfile
66
+ * Initializing Knife
67
+ Append Gemfile
68
+ * Initializing Rakefile
69
+ Creating /tmp/test/Rakefile
70
+ * Initializing Rubocop
71
+ Append Gemfile
72
+ * Initializing Food Critic
73
+ Append Gemfile
74
+ * Initializing Chef Spec
75
+ Creating /tmp/test/test/unit/spec/spec_helper.rb
76
+ Creating /tmp/test/test/unit/spec/default_spec.rb
77
+ Append Gemfile
78
+ * Initializing Server Spec
79
+ Creating /tmp/test/test/integration/default/serverspec/spec_helper.rb
80
+ Creating /tmp/test/test/integration/default/serverspec/default_spec.rb
81
+ Append Gemfile
82
+ * Initializing Test Kitchen
83
+ create .kitchen.yml
84
+ append Rakefile
85
+ append Thorfile
86
+ exist test/integration/default
87
+ append .gitignore
88
+ append .gitignore
89
+ append Gemfile
90
+ append Gemfile
91
+ You must run `bundle install' to fetch any new gems.
92
+ Cookbook test created successfully
93
+ Next steps...
94
+ $ cd /tmp/test
95
+ $ export USE_SYSTEM_GECODE=1
96
+ $ bundle install
97
+ $ bundle exec berks install
98
+
99
+ $ cd /tmp/test
100
+ $ export USE_SYSTEM_GECODE=1
101
+ $ bundle install
102
+ Fetching gem metadata from https://rubygems.org/
103
+ Fetching additional metadata from https://rubygems.org/
104
+ Resolving dependencies...
105
+ ...
106
+ ...
107
+ Your bundle is complete!
108
+ $ bundle exec berks install
109
+ Using test (0.1.0) from metadata
110
+ $ bundle exec rake -T
111
+ rake integration # Run Test Kitchen integration tests
112
+ rake kitchen:all # Run all test instances
113
+ rake kitchen:default-ubuntu-1204 # Run default-ubuntu-1204 test instance
114
+ rake spec # Run ChefSpec unit tests
115
+ rake style # Run all style checks
116
+ rake style:chef # Lint Chef cookbooks
117
+ rake style:ruby # Run Ruby style checks
118
+ ```
119
+
120
+ Contributing
121
+ ------------
122
+
123
+ e.g.
124
+
125
+ 1. Fork the repository on Github
126
+ 2. Create a named feature branch (like `add_component_x`)
127
+ 3. Write your change
128
+ 4. Write tests for your change (if applicable)
129
+ 5. Run the tests, ensuring they all pass
130
+ 6. Submit a Pull Request using Github
131
+
132
+ License and Authors
133
+ -------------------
134
+
135
+ Authors:
136
+ ========
137
+
138
+ Paul Czarkowski - paul.czarkowski@rackspace.com
139
+
140
+ License:
141
+ ========
142
+
143
+ Copyright 2014 Paul Czarkowski, Rackspace Inc.
144
+
145
+ Licensed under the Apache License, Version 2.0 (the "License");
146
+ you may not use this file except in compliance with the License.
147
+ You may obtain a copy of the License at
148
+
149
+ http://www.apache.org/licenses/LICENSE-2.0
150
+
151
+ Unless required by applicable law or agreed to in writing, software
152
+ distributed under the License is distributed on an "AS IS" BASIS,
153
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
154
+ See the License for the specific language governing permissions and
155
+ limitations under the License.
@@ -0,0 +1,181 @@
1
+ # Encoding: utf-8
2
+ # The main Meez driver
3
+ class Meez
4
+ require 'fileutils'
5
+
6
+ def self.init(cookbook_name, options)
7
+ init_cookbook(cookbook_name, options)
8
+ init_berkshelf(cookbook_name, options)
9
+ init_vagrant(cookbook_name, options)
10
+ init_knife(cookbook_name, options)
11
+ init_rakefile(cookbook_name, options)
12
+ init_rubocop(cookbook_name, options)
13
+ init_foodcritic(cookbook_name, options)
14
+ init_chefspec(cookbook_name, options)
15
+ init_serverspec(cookbook_name, options)
16
+ init_kitchenci(cookbook_name, options)
17
+ init_guard(cookbook_name, options)
18
+ init_drone(cookbook_name, options)
19
+ init_docker(cookbook_name, options)
20
+ end
21
+
22
+ def self.write_template(name, path, cookbook_name, options)
23
+ require 'erb'
24
+ template = File.join(File.dirname(__FILE__), '../../templates', name)
25
+ target = File.join(path, File.basename(name, '.erb'))
26
+ puts "\tCreating #{target} from template"
27
+ content = ERB.new File.new(template).read
28
+ File.open(target, 'w') { |f| f.write(content.result(binding)) }
29
+ end
30
+
31
+ def self.append_file(file, content)
32
+ File.open(file, 'a') { |f| f.write("#{content}\n") }
33
+ end
34
+
35
+ def self.add_gem(cookbook_path, name, version = nil)
36
+ puts "adding #{name} gem to Gemfile"
37
+ if version
38
+ append_file(File.join(cookbook_path, 'Gemfile'), "gem '#{name}', '#{version}'")
39
+ else
40
+ append_file(File.join(cookbook_path, 'Gemfile'), "gem '#{name}'")
41
+ end
42
+ end
43
+
44
+ def self.gitignore(cookbook_path, file)
45
+ append_file(File.join(cookbook_path, '.gitignore'), file)
46
+ end
47
+
48
+ def self.init_cookbook(cookbook_name, options)
49
+ require 'chef/knife/cookbook_create'
50
+ puts '* Initializing Cookbook'
51
+ path = File.join(options[:path], cookbook_name)
52
+ create_cookbook = Chef::Knife::CookbookCreate.new
53
+ create_cookbook.name_args = [cookbook_name]
54
+ create_cookbook.config[:cookbook_path] = options[:path]
55
+ create_cookbook.config[:cookbook_copyright] = options[:copyright] || 'YOUR_COMPANY_NAME'
56
+ create_cookbook.config[:cookbook_license] = options[:license] || 'YOUR_EMAIL'
57
+ create_cookbook.config[:cookbook_email] = options[:email] || 'none'
58
+ create_cookbook.run
59
+ %w(metadata.rb recipes/default.rb).each do |file|
60
+ puts "\tRewriting #{file}"
61
+ contents = "# Encoding: utf-8\n#{File.read(File.join(path, file))}"
62
+ File.open(File.join(path, file), 'w') { |f| f.write(contents) }
63
+ end
64
+ end
65
+
66
+ def self.init_git(cookbook_name, options)
67
+ puts '* Initializing GIT repo'
68
+ path = File.join(options[:path], cookbook_name)
69
+ require 'git'
70
+ Git.init(path, repository: path)
71
+ end
72
+
73
+ def self.init_berkshelf(cookbook_name, options)
74
+ puts '* Initializing Berkshelf'
75
+ path = File.join(options[:path], cookbook_name)
76
+ require 'berkshelf'
77
+ require 'berkshelf/base_generator'
78
+ require 'berkshelf/init_generator'
79
+ Berkshelf::InitGenerator.new(
80
+ [path],
81
+ skip_test_kitchen: true,
82
+ skip_vagrant: true
83
+ ).invoke_all
84
+ contents = File.read(File.join(path, 'Gemfile'))
85
+ newgemfile = contents.gsub("\ngem 'berkshelf'\n", "\ngem 'berkshelf', '> 3'\n")
86
+ File.open(File.join(path, 'Gemfile'), 'w') { |f| f.write(newgemfile) }
87
+ end
88
+
89
+ def self.init_kitchenci(cookbook_name, options)
90
+ puts '* Initializing Test Kitchen'
91
+ path = File.join(options[:path], cookbook_name)
92
+ require 'kitchen'
93
+ require 'kitchen/generator/init'
94
+ Kitchen::Generator::Init.new([], {}, destination_root: path).invoke_all
95
+ options[:driver] ||= 'vagrant'
96
+ write_template('.kitchen.yml.erb', path, cookbook_name, options)
97
+ add_gem(path, 'kitchen-docker', '>=0.15.0') if options[:driver].eql? 'docker'
98
+ end
99
+
100
+ def self.init_vagrant(cookbook_name, options)
101
+ puts '* Initializing Vagranfile'
102
+ path = File.join(options[:path], cookbook_name)
103
+ write_template('Vagrantfile.erb', path, cookbook_name, options)
104
+ end
105
+
106
+ def self.init_chefspec(cookbook_name, options)
107
+ puts '* Initializing Chef Spec'
108
+ path = File.join(options[:path], cookbook_name)
109
+ spec_path = File.join(path, 'test', 'unit', 'spec')
110
+ FileUtils.mkdir_p(spec_path)
111
+ write_template('chefspec/spec_helper.rb.erb', spec_path, cookbook_name, options)
112
+ write_template('chefspec/default_spec.rb.erb', spec_path, cookbook_name, options)
113
+ gitignore(path, '.coverage/*')
114
+ add_gem(path, 'chefspec', '>= 3.4')
115
+ end
116
+
117
+ def self.init_rakefile(cookbook_name, options)
118
+ puts '* Initializing Rakefile'
119
+ path = File.join(options[:path], cookbook_name)
120
+ write_template('Rakefile.erb', path, cookbook_name, options)
121
+ add_gem(path, 'rake', '>= 10.2')
122
+ end
123
+
124
+ def self.init_rubocop(cookbook_name, options)
125
+ puts '* Initializing Rubocop'
126
+ path = File.join(options[:path], cookbook_name)
127
+ write_template('.rubocop.yml.erb', path, cookbook_name, options)
128
+ add_gem(path, 'rubocop', '= 0.23')
129
+ end
130
+
131
+ def self.init_knife(cookbook_name, options)
132
+ puts '* Initializing Knife'
133
+ path = File.join(options[:path], cookbook_name)
134
+ add_gem(path, 'chef', '>= 11.8')
135
+ end
136
+
137
+ def self.init_foodcritic(cookbook_name, options)
138
+ puts '* Initializing Food Critic'
139
+ path = File.join(options[:path], cookbook_name)
140
+ add_gem(path, 'foodcritic', '>= 3.0')
141
+ end
142
+
143
+ def self.init_serverspec(cookbook_name, options)
144
+ puts '* Initializing Server Spec'
145
+ path = File.join(options[:path], cookbook_name)
146
+ spec_path = File.join(path, 'test', 'integration', 'default', 'serverspec')
147
+ FileUtils.mkdir_p(spec_path)
148
+ write_template('serverspec/spec_helper.rb.erb', spec_path, cookbook_name, options)
149
+ write_template('serverspec/default_spec.rb.erb', spec_path, cookbook_name, options)
150
+ add_gem(path, 'serverspec', '>= 1.6')
151
+ end
152
+
153
+ def self.init_guard(cookbook_name, options)
154
+ puts '* Initializing Guard'
155
+ path = File.join(options[:path], cookbook_name)
156
+ write_template('Guardfile.erb', path, cookbook_name, options)
157
+ add_gem(path, 'guard', '>= 2.6')
158
+ add_gem(path, 'guard-rubocop', '>= 1.1')
159
+ add_gem(path, 'guard-foodcritic', '>= 1.0.2')
160
+ end
161
+
162
+ def self.init_drone(cookbook_name, options)
163
+ puts '* Initializing Drone'
164
+ path = File.join(options[:path], cookbook_name)
165
+ write_template('.drone.yml.erb', path, cookbook_name, options)
166
+ end
167
+
168
+ def self.init_docker(cookbook_name, options)
169
+ puts '* Initializing Docker'
170
+ path = File.join(options[:path], cookbook_name)
171
+ write_template('Dockerfile.erb', path, cookbook_name, options)
172
+ end
173
+
174
+ def self.bundle_install(cookbook_name, options)
175
+ require 'bundler'
176
+ puts '* Running bundle install'
177
+ path = File.join(options[:path], cookbook_name)
178
+ puts "\t append .gitignore"
179
+ Bundler.with_clean_env { exec({ 'BUNDLE_GEMFILE' => "#{path}/Gemfile" }, 'bundle install') }
180
+ end
181
+ end
@@ -0,0 +1,23 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = %q(meez)
3
+ s.version = '0.2.5'
4
+ s.date = %q(2014-01-08)
5
+ s.summary = 'Initializes a chef cookbook with TDD framework'
6
+ s.description = <<EOF
7
+ `Meez` (slang for `mise en place`) will create an opinionated chef cookbook skeleton complete with testing suite including:
8
+ berkshelf, chefspec, test kitchen, foodcritic, server spec
9
+
10
+ EOF
11
+ s.files = %x(git ls-files).split("\n")
12
+
13
+ s.executables = ['meez']
14
+ s.authors = ['Paul Czarkowski']
15
+ s.email = 'paul.czarkowski@rackspace.com'
16
+ s.homepage = 'http://github.com/paulczar/meez'
17
+ s.license = 'apache2'
18
+ s.require_paths = ['lib']
19
+ s.add_dependency 'chef', '~> 11.8'
20
+ s.add_dependency 'test-kitchen', '~> 1.2'
21
+ s.add_dependency 'bundler', '~> 1.5'
22
+ s.add_dependency 'berkshelf', '~> 3.1'
23
+ end
@@ -0,0 +1,8 @@
1
+ image: paulczar/meez
2
+ env:
3
+ - CI=drone
4
+ - USE_SYSTEM_GECODE=1
5
+ script:
6
+ - bundle install
7
+ - bundle exec berks install
8
+ - bundle exec rake style spec
@@ -0,0 +1,16 @@
1
+ ---
2
+ driver:
3
+ <% case options[:driver] when "vagrant" %>name: vagrant
4
+ <% when "docker" %>name: docker
5
+ provision_command: curl -L http://www.opscode.com/chef/install.sh | bash
6
+ <% end %>
7
+ provisioner:
8
+ name: chef_solo
9
+
10
+ platforms:
11
+ - name: ubuntu-12.04
12
+
13
+ suites:
14
+ - name: default
15
+ run_list: recipe[<%= cookbook_name %>::default]
16
+ attributes:
@@ -0,0 +1,10 @@
1
+ # Rubocop, we're buddies and all, but we're going to have to disagree on the following -
2
+
3
+ SingleSpaceBeforeFirstArg:
4
+ Enabled: false
5
+
6
+ UnusedBlockArgument:
7
+ Enabled: false
8
+
9
+ WordArray:
10
+ MinSize: 5
@@ -0,0 +1,10 @@
1
+ # builds docker container to be used with CI
2
+
3
+ FROM paulczar/meez
4
+
5
+ ADD Gemfile /tmp/Gemfile
6
+
7
+ ENV PATH /opt/chefdk/embedded/bin:/root/.chefdk/gem/ruby/2.1.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
8
+ ENV USE_SYSTEM_GECODE 1
9
+
10
+ RUN cd /tmp && bundle install
@@ -0,0 +1,15 @@
1
+ # Guardfile built by Meez ( http://github.com/paulczar/meez )
2
+ # for testing your chef cookbooks.
3
+
4
+ guard :rubocop do
5
+ watch(%r{.+\.rb$})
6
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
7
+ end
8
+
9
+ guard :foodcritic, cookbook_paths: '.', cli: ['--epic-fail', 'any'] do
10
+ watch(%r{attributes/.+\.rb$})
11
+ watch(%r{providers/.+\.rb$})
12
+ watch(%r{recipes/.+\.rb$})
13
+ watch(%r{resources/.+\.rb$})
14
+ watch(%r{metadata\.rb$})
15
+ end
@@ -0,0 +1,40 @@
1
+ # Encoding: utf-8
2
+ require 'bundler/setup'
3
+
4
+ namespace :style do
5
+ require 'rubocop/rake_task'
6
+ desc 'Run Ruby style checks'
7
+ RuboCop::RakeTask.new(:ruby)
8
+
9
+ require 'foodcritic'
10
+ desc 'Run Chef style checks'
11
+ FoodCritic::Rake::LintTask.new(:chef)
12
+ end
13
+
14
+ desc 'Run all style checks'
15
+ task style: ['style:chef', 'style:ruby']
16
+
17
+ require 'kitchen'
18
+ desc 'Run Test Kitchen integration tests'
19
+ task :integration do
20
+ Kitchen.logger = Kitchen.default_file_logger
21
+ Kitchen::Config.new.instances.each do |instance|
22
+ instance.test(:always)
23
+ end
24
+ end
25
+
26
+ require 'rspec/core/rake_task'
27
+ desc 'Run ChefSpec unit tests'
28
+ RSpec::Core::RakeTask.new(:spec) do |t, args|
29
+ t.rspec_opts = 'test/unit/spec'
30
+ end
31
+
32
+ # The default rake task should just run it all
33
+ task default: ['style', 'spec', 'integration']
34
+
35
+ begin
36
+ require 'kitchen/rake_tasks'
37
+ Kitchen::RakeTasks.new
38
+ rescue LoadError
39
+ puts '>>>>> Kitchen gem not loaded, omitting tasks' unless ENV['CI']
40
+ end
@@ -0,0 +1,19 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ Vagrant.configure('2') do |config|
5
+ config.vm.hostname = '<%= cookbook_name %>'
6
+ config.vm.box = 'ubuntu-12.04'
7
+ config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_#{config.vm.box}_chef-provisionerless.box"
8
+ config.omnibus.chef_version = 'latest'
9
+ config.berkshelf.enabled = true
10
+
11
+ config.vm.provision :chef_solo do |chef|
12
+ chef.json = {
13
+ }
14
+
15
+ chef.run_list = [
16
+ 'recipe[<%= cookbook_name %>::default]'
17
+ ]
18
+ end
19
+ end
@@ -0,0 +1,15 @@
1
+ # Encoding: utf-8
2
+
3
+ require_relative 'spec_helper'
4
+
5
+ describe '<%= cookbook_name %>::default' do
6
+ before { stub_resources }
7
+ describe 'ubuntu' do
8
+ let(:chef_run) { ChefSpec::Runner.new.converge(described_recipe) }
9
+
10
+ it 'writes some chefspec code' do
11
+ pending 'todo'
12
+ end
13
+
14
+ end
15
+ end
@@ -0,0 +1,20 @@
1
+ # Encoding: utf-8
2
+ require 'rspec/expectations'
3
+ require 'chefspec'
4
+ require 'chefspec/berkshelf'
5
+ require 'chef/application'
6
+
7
+ ::LOG_LEVEL = :fatal
8
+ ::UBUNTU_OPTS = {
9
+ platform: 'ubuntu',
10
+ version: '12.04',
11
+ log_level: ::LOG_LEVEL
12
+ }
13
+ ::CHEFSPEC_OPTS = {
14
+ log_level: ::LOG_LEVEL
15
+ }
16
+
17
+ def stub_resources
18
+ end
19
+
20
+ at_exit { ChefSpec::Coverage.report! }
@@ -0,0 +1,7 @@
1
+ # Encoding: utf-8
2
+
3
+ require_relative 'spec_helper'
4
+
5
+ describe 'default' do
6
+ it { pending 'write some tests' }
7
+ end
@@ -0,0 +1,11 @@
1
+ # Encoding: utf-8
2
+ require 'serverspec'
3
+
4
+ include Serverspec::Helper::Exec
5
+ include Serverspec::Helper::DetectOS
6
+
7
+ RSpec.configure do |c|
8
+ c.before :all do
9
+ c.path = '/sbin:/usr/bin'
10
+ end
11
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meez
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Czarkowski
@@ -76,7 +76,27 @@ executables:
76
76
  extensions: []
77
77
  extra_rdoc_files: []
78
78
  files:
79
+ - ".drone.yml"
80
+ - ".gitignore"
81
+ - ".rubocop.yml"
82
+ - Dockerfile
83
+ - Gemfile
84
+ - Guardfile
85
+ - README.md
79
86
  - bin/meez
87
+ - lib/meez/meez.rb
88
+ - meez.gemspec
89
+ - templates/.drone.yml.erb
90
+ - templates/.kitchen.yml.erb
91
+ - templates/.rubocop.yml.erb
92
+ - templates/Dockerfile.erb
93
+ - templates/Guardfile.erb
94
+ - templates/Rakefile.erb
95
+ - templates/Vagrantfile.erb
96
+ - templates/chefspec/default_spec.rb.erb
97
+ - templates/chefspec/spec_helper.rb.erb
98
+ - templates/serverspec/default_spec.rb.erb
99
+ - templates/serverspec/spec_helper.rb.erb
80
100
  homepage: http://github.com/paulczar/meez
81
101
  licenses:
82
102
  - apache2