Skip to content

Commit

Permalink
Merge pull request #5 from fnichol/health
Browse files Browse the repository at this point in the history
Health
  • Loading branch information
fnichol committed Aug 5, 2014
2 parents e94d9ac + 12f8965 commit f4c071a
Show file tree
Hide file tree
Showing 26 changed files with 296 additions and 321 deletions.
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Style/CaseIndentation:
IndentWhenRelativeTo: end
106 changes: 0 additions & 106 deletions .tailor

This file was deleted.

38 changes: 25 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,34 @@
language: ruby

rvm:
- 2.0.0
- 1.9.3
- 1.9.2
- ruby-head
- 2.1
- 2.0.0
- 1.9.3
- 1.9.2
- ruby-head

env:
- "CHEF_VERSION="
- "CHEF_VERSION='~> 11.6.0'"
- "CHEF_VERSION='~> 11.4.4'"
- "CHEF_VERSION='~> 10.26'"
- "CHEF_VERSION="
- "CHEF_VERSION='~> 11.14.2'"
- "CHEF_VERSION='~> 11.4.4'"
- "CHEF_VERSION='~> 10.26'"

bundler_args: --without guard

matrix:
allow_failures:
- rvm: ruby-head
- rvm: ruby-head
exclude:
- rvm: 2.0.0
env: "CHEF_VERSION='~> 11.4.4'"
- rvm: 2.0.0
env: "CHEF_VERSION='~> 10.26'"
- rvm: 2.1
env: "CHEF_VERSION='~> 11.4.4'"
- rvm: 2.1
env: "CHEF_VERSION='~> 10.26'"
- rvm: 2.0.0
env: "CHEF_VERSION='~> 11.4.4'"
- rvm: 2.0.0
env: "CHEF_VERSION='~> 10.26'"

addons:
code_climate:
repo_token:
secure: "Apwuy7PdnWsOjQqkVYIfZQIcECns0D+eNecRmG0dQguBbgnQfG9xMMGIwuLshubhs9rPqAac/Bg9ZyIjWBa57V/ehaQg7BTzaN8K76R98lgrQ4Ub3bYoCU91zc554g4sgKMf5K8P5f1NLYGEyDb5+QP4oeafF1UDxwVHL17hHq0="
9 changes: 9 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@ source 'https://rubygems.org'

gemspec

group :guard do
gem 'guard-minitest'
gem 'guard-rubocop'
gem 'guard-cane'
gem 'guard-yard'
end

group :test do
# allow CI to override the version of Chef for matrix testing
gem 'chef', (ENV['CHEF_VERSION'] || '>= 0.10.10')

gem 'codeclimate-test-reporter', require: nil
end
27 changes: 20 additions & 7 deletions Guardfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
guard 'minitest' do
watch(%r|^spec/(.*)_spec\.rb|)
watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "spec/unit/#{m[1]}#{m[2]}_spec.rb" }
watch(%r|^spec/spec_helper\.rb|) { "spec" }
ignore %r{^\.gem/}

group :red_green_refactor, halt_on_fail: true do
guard :minitest do
watch(%r|^spec/(.*)_spec\.rb|)
watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "spec/unit/#{m[1]}#{m[2]}_spec.rb" }
watch(%r|^spec/spec_helper\.rb|) { "spec" }
end

guard :cane do
watch(%r|.*\.rb|)
watch('.cane')
end

guard :rubocop, all_on_start: false, keep_failed: false, cli: "-r finstyle" do
watch(%r{.+\.rb$})
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
end
end

guard 'cane' do
watch(%r|.*\.rb|)
watch('.cane')
guard :yard, port: "8808" do
watch(%r{lib/.+\.rb})
end
25 changes: 15 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'cane/rake_task'
require 'tailor/rake_task'
# -*- encoding: utf-8 -*-

require "bundler/gem_tasks"
require "rake/testtask"
require "cane/rake_task"

Rake::TestTask.new(:unit) do |t|
t.libs.push "lib"
t.test_files = FileList['spec/unit/**/*_spec.rb']
t.test_files = FileList["spec/unit/**/*_spec.rb"]
t.verbose = true
end

Rake::TestTask.new(:integration) do |t|
t.libs.push "lib"
t.test_files = FileList['spec/integration/**/*_spec.rb']
t.test_files = FileList["spec/integration/**/*_spec.rb"]
t.verbose = true
end

desc "Run all test suites"
task :test => [:unit, :integration]

require "finstyle"
require "rubocop/rake_task"
RuboCop::RakeTask.new(:style) do |task|
task.options << "--display-cop-names"
end

desc "Run cane to check quality metrics"
Cane::RakeTask.new do |cane|
cane.canefile = './.cane'
cane.canefile = "./.cane"
end

Tailor::RakeTask.new

desc "Display LOC stats"
task :stats do
puts "\n## Production Code Stats"
Expand All @@ -34,6 +39,6 @@ task :stats do
end

desc "Run all quality tasks"
task :quality => [:cane, :tailor, :stats]
task :quality => [:cane, :style, :stats]

task :default => [:test, :quality]
41 changes: 22 additions & 19 deletions emeril.gemspec
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'emeril/version'
require "emeril/version"
require "English"

Gem::Specification.new do |spec|
spec.name = "emeril"
spec.version = Emeril::VERSION
spec.authors = ["Fletcher Nichol"]
spec.email = ["fnichol@nichol.ca"]
spec.description = %q{Release Chef cookbooks}
spec.description = "Release Chef cookbooks"
spec.summary = spec.description
spec.homepage = "http://fnichol.github.io/emeril/"
spec.license = "MIT"

spec.files = `git ls-files`.split($/)
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
spec.executables = []
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
spec.require_paths = ["lib"]

spec.required_ruby_version = '>= 1.9.2'
spec.required_ruby_version = ">= 1.9.2"

spec.add_dependency 'chef', '> 0.10.10'
spec.add_dependency "chef", "> 0.10.10"

spec.add_development_dependency 'bundler', '~> 1.3'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'minitest'
spec.add_development_dependency 'guard-minitest'
spec.add_development_dependency 'mocha'
spec.add_development_dependency 'fakefs'
spec.add_development_dependency 'vcr'
spec.add_development_dependency 'webmock'
spec.add_development_dependency "bundler", "~> 1.3"
spec.add_development_dependency "rake"
spec.add_development_dependency "minitest"
spec.add_development_dependency "mocha"
spec.add_development_dependency "fakefs"
spec.add_development_dependency "vcr"
spec.add_development_dependency "webmock"

spec.add_development_dependency 'cane'
spec.add_development_dependency 'guard-cane'
spec.add_development_dependency 'tailor'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'countloc'
spec.add_development_dependency "simplecov"
spec.add_development_dependency "countloc"

# style and complexity libraries are tightly version pinned as newer releases
# may introduce new and undesireable style choices which would be immediately
# enforced in CI
spec.add_development_dependency "finstyle", "1.1.0"
spec.add_development_dependency "cane", "2.6.2"
end
12 changes: 6 additions & 6 deletions lib/emeril.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# -*- encoding: utf-8 -*-

require 'emeril/category'
require 'emeril/git_tagger'
require 'emeril/metadata_chopper'
require 'emeril/publisher'
require 'emeril/releaser'
require 'emeril/version'
require "emeril/category"
require "emeril/git_tagger"
require "emeril/metadata_chopper"
require "emeril/publisher"
require "emeril/releaser"
require "emeril/version"

module Emeril
end
6 changes: 3 additions & 3 deletions lib/emeril/category.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- encoding: utf-8 -*-

require 'net/http'
require 'json'
require "net/http"
require "json"

module Emeril

Expand All @@ -20,7 +20,7 @@ class Category
def self.for_cookbook(cookbook)
path = "/api/v1/cookbooks/#{cookbook}"
response = Net::HTTP.get_response("cookbooks.opscode.com", path)
JSON.parse(response.body)['category']
JSON.parse(response.body)["category"]
end
end
end
Loading

0 comments on commit f4c071a

Please sign in to comment.