emeril 0.7.0 → 0.8.0

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: f6302d107f9d6cf6b6b69b14bd4f6f0514d50fe6
4
- data.tar.gz: 1e89c4e9dfdba1758ce8d4cba37cf513bb0e3afb
3
+ metadata.gz: ea38c2a413453dc993a0f7c379b00e67755630eb
4
+ data.tar.gz: dac57f07727c206a5f4a1dd717282b0340fec835
5
5
  SHA512:
6
- metadata.gz: e8b707e4affd40fe9520dc2ed28717b761abab6ff7d020cebebc6f07d5059327ecbcc7409466b42dc8c7801c679feded3e4e54e16bbd34e9455ec9ae9b05081b
7
- data.tar.gz: 987c6de17c5bfbcc63fdde1607dfe3f4a002cc095b291856bfd7f65bb9801ba7dd6bf0fd60e26e211fc09bd095ab3d610b5542cd93ee4ed0f44b6fe17d54b016
6
+ metadata.gz: 6f720829a5ceda4b62888507ff8e0ca3e0aa74a6490e3fae7e0708c34893756f2ac22ad73322b6ea0e172b94ec66fed495af3ddc6038c5bfe613168c8264483a
7
+ data.tar.gz: e3af47e245b8334ba4c0ba6aba34009766b0bea2183e5ecdcea4879be52c0cfc1f4d4464e135a79bed108f4d93454d9f131f2c2fd481f6155ce04d2235c78be3
@@ -0,0 +1,2 @@
1
+ Style/CaseIndentation:
2
+ IndentWhenRelativeTo: end
@@ -1,22 +1,34 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 2.0.0
5
- - 1.9.3
6
- - 1.9.2
7
- - ruby-head
4
+ - 2.1
5
+ - 2.0.0
6
+ - 1.9.3
7
+ - 1.9.2
8
+ - ruby-head
8
9
 
9
10
  env:
10
- - "CHEF_VERSION="
11
- - "CHEF_VERSION='~> 11.6.0'"
12
- - "CHEF_VERSION='~> 11.4.4'"
13
- - "CHEF_VERSION='~> 10.26'"
11
+ - "CHEF_VERSION="
12
+ - "CHEF_VERSION='~> 11.14.2'"
13
+ - "CHEF_VERSION='~> 11.4.4'"
14
+ - "CHEF_VERSION='~> 10.26'"
15
+
16
+ bundler_args: --without guard
14
17
 
15
18
  matrix:
16
19
  allow_failures:
17
- - rvm: ruby-head
20
+ - rvm: ruby-head
18
21
  exclude:
19
- - rvm: 2.0.0
20
- env: "CHEF_VERSION='~> 11.4.4'"
21
- - rvm: 2.0.0
22
- env: "CHEF_VERSION='~> 10.26'"
22
+ - rvm: 2.1
23
+ env: "CHEF_VERSION='~> 11.4.4'"
24
+ - rvm: 2.1
25
+ env: "CHEF_VERSION='~> 10.26'"
26
+ - rvm: 2.0.0
27
+ env: "CHEF_VERSION='~> 11.4.4'"
28
+ - rvm: 2.0.0
29
+ env: "CHEF_VERSION='~> 10.26'"
30
+
31
+ addons:
32
+ code_climate:
33
+ repo_token:
34
+ secure: "Apwuy7PdnWsOjQqkVYIfZQIcECns0D+eNecRmG0dQguBbgnQfG9xMMGIwuLshubhs9rPqAac/Bg9ZyIjWBa57V/ehaQg7BTzaN8K76R98lgrQ4Ub3bYoCU91zc554g4sgKMf5K8P5f1NLYGEyDb5+QP4oeafF1UDxwVHL17hHq0="
@@ -1,3 +1,15 @@
1
+ ## 0.8.0 / 2014-08-06
2
+
3
+ ### Bug fixes
4
+
5
+ * Pull request [#4][]: Support Chef 11.6.2. ([@webframp][])
6
+
7
+ ### Improvements
8
+
9
+ * Pull request [#6][]: Add Supermarket friendliness (it previously worked fine, but now is directly using Supermarket). ([@fnichol][])
10
+ * Pull request [#5][]: Update testing and project health dependencies and coding style. ([@fnichol][])
11
+
12
+
1
13
  ## 0.7.0 / 2013-08-26
2
14
 
3
15
  ### Breaking Changes
@@ -38,6 +50,10 @@ The initial release, **BAM**!
38
50
  <!--- The following link definition list is generated by PimpMyChangelog --->
39
51
  [#1]: https://github.com/fnichol/emeril/issues/1
40
52
  [#2]: https://github.com/fnichol/emeril/issues/2
53
+ [#4]: https://github.com/fnichol/emeril/issues/4
54
+ [#5]: https://github.com/fnichol/emeril/issues/5
55
+ [#6]: https://github.com/fnichol/emeril/issues/6
41
56
  [@capen]: https://github.com/capen
42
57
  [@fnichol]: https://github.com/fnichol
43
58
  [@thbishop]: https://github.com/thbishop
59
+ [@webframp]: https://github.com/webframp
data/Gemfile CHANGED
@@ -2,7 +2,16 @@ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
5
+ group :guard do
6
+ gem 'guard-minitest'
7
+ gem 'guard-rubocop'
8
+ gem 'guard-cane'
9
+ gem 'guard-yard'
10
+ end
11
+
5
12
  group :test do
6
13
  # allow CI to override the version of Chef for matrix testing
7
14
  gem 'chef', (ENV['CHEF_VERSION'] || '>= 0.10.10')
15
+
16
+ gem 'codeclimate-test-reporter', require: nil
8
17
  end
data/Guardfile CHANGED
@@ -1,10 +1,23 @@
1
- guard 'minitest' do
2
- watch(%r|^spec/(.*)_spec\.rb|)
3
- watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "spec/unit/#{m[1]}#{m[2]}_spec.rb" }
4
- watch(%r|^spec/spec_helper\.rb|) { "spec" }
1
+ ignore %r{^\.gem/}
2
+
3
+ group :red_green_refactor, halt_on_fail: true do
4
+ guard :minitest do
5
+ watch(%r|^spec/(.*)_spec\.rb|)
6
+ watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "spec/unit/#{m[1]}#{m[2]}_spec.rb" }
7
+ watch(%r|^spec/spec_helper\.rb|) { "spec" }
8
+ end
9
+
10
+ guard :cane do
11
+ watch(%r|.*\.rb|)
12
+ watch('.cane')
13
+ end
14
+
15
+ guard :rubocop, all_on_start: false, keep_failed: false, cli: "-r finstyle" do
16
+ watch(%r{.+\.rb$})
17
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
18
+ end
5
19
  end
6
20
 
7
- guard 'cane' do
8
- watch(%r|.*\.rb|)
9
- watch('.cane')
21
+ guard :yard, port: "8808" do
22
+ watch(%r{lib/.+\.rb})
10
23
  end
data/README.md CHANGED
@@ -3,7 +3,9 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/emeril.png)](http://badge.fury.io/rb/emeril)
4
4
  [![Build Status](https://travis-ci.org/fnichol/emeril.png?branch=master)](https://travis-ci.org/fnichol/emeril)
5
5
  [![Code Climate](https://codeclimate.com/github/fnichol/emeril.png)](https://codeclimate.com/github/fnichol/emeril)
6
+ [![Test Coverage](https://codeclimate.com/github/fnichol/emeril/badges/coverage.svg)](https://codeclimate.com/github/fnichol/emeril)
6
7
  [![Dependency Status](https://gemnasium.com/fnichol/emeril.png)](https://gemnasium.com/fnichol/emeril)
8
+ [![Inline docs](http://inch-ci.org/github/fnichol/emeril.png?branch=master)](http://inch-ci.org/github/fnichol/emeril)
7
9
 
8
10
  Kick it up a notch! Emeril is a library that helps you release your Chef
9
11
  cookbooks from Rake, Thor, or a Ruby library. If `rake release` is all you
@@ -27,7 +29,7 @@ Need more details? Read on&hellip;
27
29
  ## <a name="screencast"></a> Screencast
28
30
 
29
31
  Here is a short screencast demonstating how Emeril can be used to release
30
- a cookbook to the Community Site.
32
+ a cookbook to the Supermarket site.
31
33
 
32
34
  [![Emeril screencast](https://raw.github.com/fnichol/emeril/master/images/emeril-vid.png)](http://vimeo.com/fnichol/emeril)
33
35
 
@@ -38,7 +40,7 @@ Emeril has 2 primary tasks and goals:
38
40
  1. Tag a Git commit with a semantic version tag with the form `"v1.2.5"` (by
39
41
  default)
40
42
  2. Optionally publish a versioned release of the cookbook to the
41
- [Community Site][community_site]
43
+ [Supermarket site][supermarket_site]
42
44
 
43
45
  The Git tagging is currently accomplished via shell out, so Git must be
44
46
  installed on your system.
@@ -95,9 +97,9 @@ file with some required attributes set.
95
97
 
96
98
  There are 2 configuration items you need:
97
99
 
98
- 1. Your [Community Site][community_site] username, chosen at signup time.
99
- 2. The file path to your [Community Site][community_site] user certificate.
100
- When you sign up to the Community Site, the site will provide this key to
100
+ 1. Your [Supermarket site][supermarket_site] username, chosen at signup time.
101
+ 2. The file path to your [Supermarket site][supermarket_site] user certificate.
102
+ When you sign up to the Supermarket site, the site will provide this key to
101
103
  you as a `*.pem` file.
102
104
 
103
105
  The easiest way to get setup is to add both of these items to your default
@@ -140,14 +142,14 @@ Emeril::RakeTasks.new do |t|
140
142
  end
141
143
  ```
142
144
 
143
- If your cookbook is not on the Community Site, you can skip the publishing step
144
- with the block form:
145
+ If your cookbook is not on the Supermarket site, you can skip the publishing
146
+ step with the block form:
145
147
 
146
148
  ```ruby
147
149
  require 'emeril/rake_tasks'
148
150
 
149
151
  Emeril::RakeTasks.new do |t|
150
- t.config[:publish_to_community] = false
152
+ t.config[:publish_to_supermarket] = false
151
153
  end
152
154
  ```
153
155
 
@@ -178,14 +180,14 @@ Emeril::ThorTasks.new do |t|
178
180
  end
179
181
  ```
180
182
 
181
- If your cookbook is not on the Community Site, you can skip the publishing step
182
- with the block form:
183
+ If your cookbook is not on the Supermarket site, you can skip the publishing
184
+ step with the block form:
183
185
 
184
186
  ```ruby
185
187
  require 'emeril/thor_tasks'
186
188
 
187
189
  Emeril::ThorTasks.new do |t|
188
- t.config[:publish_to_community] = false
190
+ t.config[:publish_to_supermarket] = false
189
191
  end
190
192
  ```
191
193
 
@@ -203,7 +205,7 @@ same code as the default Rake and Thor tasks, use the following:
203
205
  require 'chef/knife'
204
206
  Chef::Knife.new.configure_chef
205
207
 
206
- # Perform the git tagging and share to the Community Site
208
+ # Perform the git tagging and share to the Supermarket site
207
209
  require 'emeril'
208
210
  Emeril::Releaser.new(logger: Chef::Log).run
209
211
  ```
@@ -225,10 +227,17 @@ Emeril::Releaser.new(logger: Chef::Log).run
225
227
  [commit][ex3]. Emeril will tag and release your cookbook based on the
226
228
  last Git commit which is presumably your *version-bump-and-changelog*
227
229
  commit.
230
+ * **"What about adding support for X, Y, or Z?"** That's possible, but Emeril
231
+ has one primary focus: releasing your cookbook in an atomic and declarative
232
+ fashion. We can get the job done with a small amount of code--less than 400
233
+ LOC. There are other tools that are more wholistic and workflow oriented
234
+ and you are encouraged to check them out (noted below).
235
+ * **"That Chef dependency looks bulky, yo."** Hmm, that's not a question. Do
236
+ you you Knife? Congratulations, you have the Chef gem already! Are you using
237
+ the ChefDK package? You are good to go!
228
238
  * **"How do I change the category for my cookbook?"** Emeril will maintain
229
- the category used on the Community Site across releases. By default, new
230
- cookbooks will be put in the `"Other"` category. For now you can change
231
- the category directly on the Community Site, done! Otherwise, check out
239
+ the category used on the Supermarket site across releases. By default, new
240
+ cookbooks will be put in the `"Other"` category. Otherwise, check out
232
241
  the [Rake](#usage-rake) and [Thor](#usage-thor) sections for further
233
242
  configuration help.
234
243
  * **"Why is Emeril complaining that I'm missing the name attribute in my
@@ -245,6 +254,9 @@ Emeril::Releaser.new(logger: Chef::Log).run
245
254
  * [knife community site share][knife_share] - with some extra/manual git
246
255
  tagging, correct directory structure, and workflow. Ships with the
247
256
  [Chef gem][chef_gem].
257
+ * [Stove][stove] - a more workflow oriented with JIRA and GitHub
258
+ support, version bumping, and more by
259
+ [Seth Vargo](https://github.com/sethvargo).
248
260
 
249
261
  ## <a name="development"></a> Development
250
262
 
@@ -278,7 +290,7 @@ MIT (see [LICENSE.txt][license])
278
290
  [berkshelf_site]: http://berkshelf.com/
279
291
  [changelog_wikipedia]: http://en.wikipedia.org/wiki/Changelog
280
292
  [chef_gem]: https://github.com/opscode/chef
281
- [community_site]: http://community.opscode.com/
293
+ [supermarket_site]: https://supermarket.getchef.com/
282
294
  [ex1]: https://github.com/fnichol/chef-ruby_build/commit/c940b5e9cd40eaba10d6285de6648f4d25fe959d
283
295
  [ex2]: https://github.com/fnichol/chef-homesick/commit/80e558ff921f1c59698f6942214c0224a24392d7
284
296
  [ex3]: https://github.com/fnichol/chef-openoffice/commit/bf84aba0690a6b155b499b06df953be19a3aead1
@@ -290,3 +302,4 @@ MIT (see [LICENSE.txt][license])
290
302
  [knife_share]: http://docs.opscode.com/knife_cookbook_site.html#share
291
303
  [publisher_class]: https://github.com/fnichol/emeril/blob/master/lib/emeril/publisher.rb
292
304
  [semver_site]: http://semver.org/
305
+ [stove]: http://sethvargo.github.io/stove/
data/Rakefile CHANGED
@@ -1,30 +1,35 @@
1
- require 'bundler/gem_tasks'
2
- require 'rake/testtask'
3
- require 'cane/rake_task'
4
- require 'tailor/rake_task'
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+ require "cane/rake_task"
5
6
 
6
7
  Rake::TestTask.new(:unit) do |t|
7
8
  t.libs.push "lib"
8
- t.test_files = FileList['spec/unit/**/*_spec.rb']
9
+ t.test_files = FileList["spec/unit/**/*_spec.rb"]
9
10
  t.verbose = true
10
11
  end
11
12
 
12
13
  Rake::TestTask.new(:integration) do |t|
13
14
  t.libs.push "lib"
14
- t.test_files = FileList['spec/integration/**/*_spec.rb']
15
+ t.test_files = FileList["spec/integration/**/*_spec.rb"]
15
16
  t.verbose = true
16
17
  end
17
18
 
18
19
  desc "Run all test suites"
19
20
  task :test => [:unit, :integration]
20
21
 
22
+ require "finstyle"
23
+ require "rubocop/rake_task"
24
+ RuboCop::RakeTask.new(:style) do |task|
25
+ task.options << "--display-cop-names"
26
+ end
27
+
21
28
  desc "Run cane to check quality metrics"
22
29
  Cane::RakeTask.new do |cane|
23
- cane.canefile = './.cane'
30
+ cane.canefile = "./.cane"
24
31
  end
25
32
 
26
- Tailor::RakeTask.new
27
-
28
33
  desc "Display LOC stats"
29
34
  task :stats do
30
35
  puts "\n## Production Code Stats"
@@ -34,6 +39,6 @@ task :stats do
34
39
  end
35
40
 
36
41
  desc "Run all quality tasks"
37
- task :quality => [:cane, :tailor, :stats]
42
+ task :quality => [:cane, :style, :stats]
38
43
 
39
44
  task :default => [:test, :quality]
@@ -1,39 +1,42 @@
1
1
  # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
2
+ lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'emeril/version'
4
+ require "emeril/version"
5
+ require "English"
5
6
 
6
7
  Gem::Specification.new do |spec|
7
8
  spec.name = "emeril"
8
9
  spec.version = Emeril::VERSION
9
10
  spec.authors = ["Fletcher Nichol"]
10
11
  spec.email = ["fnichol@nichol.ca"]
11
- spec.description = %q{Release Chef cookbooks}
12
+ spec.description = "Release Chef cookbooks"
12
13
  spec.summary = spec.description
13
- spec.homepage = "https://github.com/fnichol/emeril"
14
+ spec.homepage = "http://fnichol.github.io/emeril/"
14
15
  spec.license = "MIT"
15
16
 
16
- spec.files = `git ls-files`.split($/)
17
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
18
  spec.executables = []
18
19
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
20
  spec.require_paths = ["lib"]
20
21
 
21
- spec.required_ruby_version = '>= 1.9.2'
22
+ spec.required_ruby_version = ">= 1.9.2"
22
23
 
23
- spec.add_dependency 'chef', '> 0.10.10'
24
+ spec.add_dependency "chef", "> 0.10.10"
24
25
 
25
- spec.add_development_dependency 'bundler', '~> 1.3'
26
- spec.add_development_dependency 'rake'
27
- spec.add_development_dependency 'minitest'
28
- spec.add_development_dependency 'guard-minitest'
29
- spec.add_development_dependency 'mocha'
30
- spec.add_development_dependency 'fakefs'
31
- spec.add_development_dependency 'vcr'
32
- spec.add_development_dependency 'webmock'
26
+ spec.add_development_dependency "bundler", "~> 1.3"
27
+ spec.add_development_dependency "rake"
28
+ spec.add_development_dependency "minitest"
29
+ spec.add_development_dependency "mocha"
30
+ spec.add_development_dependency "fakefs"
31
+ spec.add_development_dependency "vcr"
32
+ spec.add_development_dependency "webmock"
33
33
 
34
- spec.add_development_dependency 'cane'
35
- spec.add_development_dependency 'guard-cane'
36
- spec.add_development_dependency 'tailor'
37
- spec.add_development_dependency 'simplecov'
38
- spec.add_development_dependency 'countloc'
34
+ spec.add_development_dependency "simplecov"
35
+ spec.add_development_dependency "countloc"
36
+
37
+ # style and complexity libraries are tightly version pinned as newer releases
38
+ # may introduce new and undesireable style choices which would be immediately
39
+ # enforced in CI
40
+ spec.add_development_dependency "finstyle", "1.1.0"
41
+ spec.add_development_dependency "cane", "2.6.2"
39
42
  end
@@ -1,11 +1,11 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
- require 'emeril/category'
4
- require 'emeril/git_tagger'
5
- require 'emeril/metadata_chopper'
6
- require 'emeril/publisher'
7
- require 'emeril/releaser'
8
- require 'emeril/version'
3
+ require "emeril/category"
4
+ require "emeril/git_tagger"
5
+ require "emeril/metadata_chopper"
6
+ require "emeril/publisher"
7
+ require "emeril/releaser"
8
+ require "emeril/version"
9
9
 
10
10
  module Emeril
11
11
  end
@@ -1,7 +1,8 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
- require 'net/http'
4
- require 'json'
3
+ require "net/https"
4
+ require "json"
5
+ require "uri"
5
6
 
6
7
  module Emeril
7
8
 
@@ -18,9 +19,12 @@ module Emeril
18
19
  # on the Community site
19
20
  #
20
21
  def self.for_cookbook(cookbook)
21
- path = "/api/v1/cookbooks/#{cookbook}"
22
- response = Net::HTTP.get_response("cookbooks.opscode.com", path)
23
- JSON.parse(response.body)['category']
22
+ uri = URI("https://supermarket.getchef.com/api/v1/cookbooks/#{cookbook}")
23
+ http = Net::HTTP.new(uri.host, uri.port)
24
+ http.use_ssl = true
25
+ request = Net::HTTP::Get.new(uri.request_uri)
26
+ response = http.request(request)
27
+ JSON.parse(response.body)["category"]
24
28
  end
25
29
  end
26
30
  end
@@ -1,16 +1,18 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
 
3
- require 'emeril/logging'
3
+ require "English"
4
+
5
+ require "emeril/logging"
4
6
 
5
7
  module Emeril
6
8
 
7
9
  # Exception class raised when a git repo is not clean.
8
10
  #
9
- class GitNotCleanError < StandardError ; end
11
+ class GitNotCleanError < StandardError; end
10
12
 
11
13
  # Exception class raised when a git push does not return successfully.
12
14
  #
13
- class GitPushError < StandardError ; end
15
+ class GitPushError < StandardError; end
14
16
 
15
17
  # Applies a version tag on a git repository and pushes it to the origin
16
18
  # remote.
@@ -61,7 +63,7 @@ module Emeril
61
63
  attr_reader :logger, :source_path, :tag_prefix, :version
62
64
 
63
65
  def already_tagged?
64
- if sh_with_code('git tag')[0].split(/\n/).include?(version_tag)
66
+ if sh_with_code("git tag")[0].split(/\n/).include?(version_tag)
65
67
  info("Tag #{version_tag} has already been created.")
66
68
  true
67
69
  end
@@ -73,36 +75,38 @@ module Emeril
73
75
 
74
76
  def git_push
75
77
  perform_git_push
76
- perform_git_push ' --tags'
78
+ perform_git_push " --tags"
77
79
  info("Pushed git commits and tags.")
78
80
  end
79
81
 
80
82
  def guard_clean
81
- clean? or raise GitNotCleanError,
82
- "There are files that need to be committed first."
83
+ if !clean?
84
+ raise GitNotCleanError,
85
+ "There are files that need to be committed first."
86
+ end
83
87
  end
84
88
 
85
- def perform_git_push(options = '')
89
+ def perform_git_push(options = "")
86
90
  cmd = "git push origin master #{options}"
87
91
  out, code = sh_with_code(cmd)
88
92
  if code != 0
89
93
  raise GitPushError,
90
- "Couldn't git push. `#{cmd}' failed with the following output:" +
94
+ "Couldn't git push. `#{cmd}' failed with the following output:" \
91
95
  "\n\n#{out}\n"
92
96
  end
93
97
  end
94
98
 
95
99
  def sh_with_code(cmd, &block)
96
100
  cmd << " 2>&1"
97
- outbuf = ''
101
+ outbuf = ""
98
102
  debug(cmd)
99
103
  Dir.chdir(source_path) {
100
104
  outbuf = `#{cmd}`
101
- if $? == 0
105
+ if $CHILD_STATUS == 0
102
106
  block.call(outbuf) if block
103
107
  end
104
108
  }
105
- [outbuf, $?]
109
+ [outbuf, $CHILD_STATUS]
106
110
  end
107
111
 
108
112
  def tag_version