Skip to content

Commit

Permalink
One of those tiny String tweak deals (style).
Browse files Browse the repository at this point in the history
  • Loading branch information
fnichol committed Aug 5, 2014
1 parent 5ccfa98 commit 4fa3356
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 91 deletions.
12 changes: 6 additions & 6 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'cane/rake_task'
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

Expand All @@ -25,7 +25,7 @@ end

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

desc "Display LOC stats"
Expand Down
26 changes: 13 additions & 13 deletions emeril.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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|
Expand All @@ -19,20 +19,20 @@ Gem::Specification.new do |spec|
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 '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 '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
Expand Down
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
10 changes: 5 additions & 5 deletions lib/emeril/git_tagger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require "English"

require 'emeril/logging'
require "emeril/logging"

module Emeril

Expand Down Expand Up @@ -63,7 +63,7 @@ def run
attr_reader :logger, :source_path, :tag_prefix, :version

def already_tagged?
if sh_with_code('git tag')[0].split(/\n/).include?(version_tag)
if sh_with_code("git tag")[0].split(/\n/).include?(version_tag)
info("Tag #{version_tag} has already been created.")
true
end
Expand All @@ -75,7 +75,7 @@ def clean?

def git_push
perform_git_push
perform_git_push ' --tags'
perform_git_push " --tags"
info("Pushed git commits and tags.")
end

Expand All @@ -86,7 +86,7 @@ def guard_clean
end
end

def perform_git_push(options = '')
def perform_git_push(options = "")
cmd = "git push origin master #{options}"
out, code = sh_with_code(cmd)
if code != 0
Expand All @@ -98,7 +98,7 @@ def perform_git_push(options = '')

def sh_with_code(cmd, &block)
cmd << " 2>&1"
outbuf = ''
outbuf = ""
debug(cmd)
Dir.chdir(source_path) {
outbuf = `#{cmd}`
Expand Down
18 changes: 9 additions & 9 deletions lib/emeril/publisher.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# -*- encoding: utf-8 -*-

require 'chef/cookbook_uploader'
require 'chef/cookbook_loader'
require 'chef/cookbook_site_streaming_uploader'
require 'chef/knife/cookbook_site_share'
require 'chef/knife/core/ui'
require 'fileutils'
require 'tmpdir'
require "chef/cookbook_uploader"
require "chef/cookbook_loader"
require "chef/cookbook_site_streaming_uploader"
require "chef/knife/cookbook_site_share"
require "chef/knife/core/ui"
require "fileutils"
require "tmpdir"

require 'emeril/logging'
require "emeril/logging"

module Emeril

Expand Down Expand Up @@ -80,7 +80,7 @@ def cookbook_files
files libraries providers recipes resources templates
]

Dir.glob("#{source_path}/{#{entries.join(',')}}")
Dir.glob("#{source_path}/{#{entries.join(",")}}")
end

def logging_ui(ui)
Expand Down
2 changes: 1 addition & 1 deletion lib/emeril/rake.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- encoding: utf-8 -*-

require 'emeril/rake_tasks'
require "emeril/rake_tasks"

Emeril::RakeTasks.new
6 changes: 3 additions & 3 deletions lib/emeril/rake_tasks.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- encoding: utf-8 -*-

require 'rake/tasklib'
require 'chef/knife'
require "rake/tasklib"
require "chef/knife"

require 'emeril'
require "emeril"

module Emeril

Expand Down
8 changes: 4 additions & 4 deletions lib/emeril/releaser.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- encoding: utf-8 -*-

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

module Emeril

Expand Down
2 changes: 1 addition & 1 deletion lib/emeril/thor.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- encoding: utf-8 -*-

require 'emeril/thor_tasks'
require "emeril/thor_tasks"

Emeril::ThorTasks.new
6 changes: 3 additions & 3 deletions lib/emeril/thor_tasks.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- encoding: utf-8 -*-

require 'thor'
require 'chef/knife'
require "thor"
require "chef/knife"

require 'emeril'
require "emeril"

module Emeril

Expand Down
10 changes: 5 additions & 5 deletions spec/integration/new_release_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- encoding: utf-8 -*-

require_relative '../spec_helper'
require 'vcr'
require_relative "../spec_helper"
require "vcr"

require 'chef/knife'
require 'emeril'
require "chef/knife"
require "emeril"

VCR.configure do |config|
config.ignore_hosts "codeclimate.com"
Expand Down Expand Up @@ -59,7 +59,7 @@
it "releases a new cookbook" do
make_cookbook!(:version => "1.2.3")

VCR.use_cassette('new_release') do
VCR.use_cassette("new_release") do
Emeril::Releaser.new(:logger => logger, :source_path => cookbook_path).run
end

Expand Down
12 changes: 6 additions & 6 deletions spec/integration/skip_publish_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- encoding: utf-8 -*-

require_relative '../spec_helper'
require 'vcr'
require_relative "../spec_helper"
require "vcr"

require 'chef/knife'
require 'emeril'
require "chef/knife"
require "emeril"

VCR.configure do |config|
config.ignore_hosts "codeclimate.com"
Expand All @@ -30,7 +30,7 @@
it "releases a new cookbook" do
make_cookbook!(:version => "4.5.6")

VCR.use_cassette('new_release') do
VCR.use_cassette("new_release") do
Emeril::Releaser.new(
:logger => logger,
:source_path => cookbook_path,
Expand All @@ -46,7 +46,7 @@
it "releases a new cookbook with a custom git tag prefix" do
make_cookbook!(:version => "1.0.0")

VCR.use_cassette('new_release') do
VCR.use_cassette("new_release") do
Emeril::Releaser.new(
:logger => logger,
:source_path => cookbook_path,
Expand Down
16 changes: 8 additions & 8 deletions spec/unit/emeril/category_spec.rb
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# -*- encoding: utf-8 -*-

require_relative '../../spec_helper'
require 'vcr'
require_relative "../../spec_helper"
require "vcr"

require 'emeril/category'
require "emeril/category"

VCR.configure do |config|
config.ignore_hosts "codeclimate.com"
config.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
config.cassette_library_dir = "spec/fixtures/vcr_cassettes"
config.hook_into :webmock
end

describe Emeril::Category do

describe ".for_cookbook" do
it "returns a category string for a known cookbook" do
VCR.use_cassette('known_cookbook') do
Emeril::Category.for_cookbook('mysql').must_equal 'Databases'
VCR.use_cassette("known_cookbook") do
Emeril::Category.for_cookbook("mysql").must_equal "Databases"
end
end

it "returns nil for a nonexistant cookbook" do
VCR.use_cassette('nonexistant_cookbook') do
Emeril::Category.for_cookbook('fooboobunnyyaya').must_be_nil
VCR.use_cassette("nonexistant_cookbook") do
Emeril::Category.for_cookbook("fooboobunnyyaya").must_be_nil
end
end
end
Expand Down
8 changes: 4 additions & 4 deletions spec/unit/emeril/git_tagger_spec.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- encoding: utf-8 -*-

require_relative '../../spec_helper'
require 'tmpdir'
require 'logger'
require_relative "../../spec_helper"
require "tmpdir"
require "logger"

require 'emeril/git_tagger'
require "emeril/git_tagger"

describe Emeril::GitTagger do

Expand Down
6 changes: 3 additions & 3 deletions spec/unit/emeril/metadata_chopper_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- encoding: utf-8 -*-

require_relative '../../spec_helper'
require_relative "../../spec_helper"

require 'emeril/metadata_chopper'
require "emeril/metadata_chopper"

describe Emeril::MetadataChopper do

Expand Down Expand Up @@ -56,7 +56,7 @@

def stub_metadata!(name = "foobar", version = "5.2.1")
File.open("/tmp/metadata.rb", "wb") do |f|
f.write <<-METADATA_RB.gsub(/^ {8}/, '')
f.write <<-METADATA_RB.gsub(/^ {8}/, "")
name "#{name}"
maintainer "Michael Bluth"
maintainer_email "michael@bluth.com"
Expand Down
Loading

0 comments on commit 4fa3356

Please sign in to comment.