Clean up whitespace, play with cane for testing style quality and code complexity

This commit is contained in:
Thomas Reynolds 2012-08-13 15:39:06 -07:00
parent 955c66a54f
commit 446aa6a4ba
133 changed files with 895 additions and 871 deletions

View file

@ -17,6 +17,7 @@ group :test do
gem "slim"
gem "coffee-filter", "~> 0.1.1"
gem "liquid", "~> 2.2"
gem "cane"
platforms :ruby do
gem "therubyracer"

View file

@ -87,5 +87,12 @@ task :test do
end
end
desc "Rune cane for all middleman gems"
task :cane do
GEM_PATHS.each do |g|
sh "cd #{File.join(ROOT, g)} && #{Gem.ruby} -S cane"
end
end
desc "Run tests for all middleman gems"
task :default => :test

2
middleman-core/.cane Normal file
View file

@ -0,0 +1,2 @@
--exclusions-file .cane-exclusions.yml
--no-doc

View file

@ -0,0 +1,5 @@
style:
- lib/middleman-core/vendor/hooks-0.2.0/lib/hooks/inheritable_attribute.rb
- lib/middleman-core/vendor/hooks-0.2.0/test/hooks_test.rb
- lib/middleman-core/vendor/hooks-0.2.0/test/inheritable_attribute_test.rb
- lib/middleman-core/vendor/hooks-0.2.0/lib/hooks.rb

0
middleman-core/lib/middleman-core.rb Executable file → Normal file
View file

View file

View file

View file

View file

View file

2
middleman-more/.cane Normal file
View file

@ -0,0 +1,2 @@
--exclusions-file .cane-exclusions.yml
--no-doc

View file

@ -0,0 +1,3 @@
style:
- lib/middleman-more/extensions/minify_css/rainpress.rb
- lib/middleman-more/extensions/automatic_image_sizes/fastimage.rb

View file

@ -48,8 +48,8 @@ module Middleman
# Setup Optional Extensions
###
# CacheBuster adds a query string to assets in dynamic templates to avoid
# browser caches failing to update to your new content.
# CacheBuster adds a query string to assets in dynamic templates to
# avoid browser caches failing to update to your new content.
Middleman::Extensions.register(:cache_buster) do
require "middleman-more/extensions/cache_buster"
Middleman::Extensions::CacheBuster

View file

@ -71,7 +71,7 @@ module Middleman
end
# A Compass template for Tilt
# A Compass Sass template for Tilt, adding our options in
class CompassSassTemplate < ::Middleman::Renderers::Sass::SassPlusCSSFilenameTemplate
private
def sass_options
@ -79,6 +79,7 @@ module Middleman
end
end
# A Compass Scss template for Tilt, adding our options in
class CompassScssTemplate < ::Middleman::Renderers::Sass::ScssPlusCSSFilenameTemplate
private
def sass_options

View file

@ -22,6 +22,7 @@ module Middleman
alias :included :registered
end
# Central class for managing i18n extension
class Localizer
attr_reader :app
delegate :logger, :to => :app

View file

@ -20,6 +20,7 @@ module Middleman
alias :included :registered
end
# Central class for managing asset_hash extension
class AssetHashManager
def initialize(app, exts, ignore)
@app = app

View file

View file

View file

@ -21,6 +21,7 @@ module Middleman
alias :included :registered
end
# Central class for managing the directory indexes extension
class DirectoryIndexManager
def initialize(app)
@app = app

View file

View file

@ -35,8 +35,8 @@ module Middleman
if path.include?("//")
path
else
current_dir = Pathname('/' + current_resource.destination_path).dirname
Pathname(path).relative_path_from(current_dir)
current_dir = Pathname('/' + current_resource.destination_path)
Pathname(path).relative_path_from(current_dir.dirname)
end
end
end