Clean up whitespace, play with cane for testing style quality and code complexity
This commit is contained in:
parent
955c66a54f
commit
446aa6a4ba
1
Gemfile
1
Gemfile
|
@ -17,6 +17,7 @@ group :test do
|
||||||
gem "slim"
|
gem "slim"
|
||||||
gem "coffee-filter", "~> 0.1.1"
|
gem "coffee-filter", "~> 0.1.1"
|
||||||
gem "liquid", "~> 2.2"
|
gem "liquid", "~> 2.2"
|
||||||
|
gem "cane"
|
||||||
|
|
||||||
platforms :ruby do
|
platforms :ruby do
|
||||||
gem "therubyracer"
|
gem "therubyracer"
|
||||||
|
|
7
Rakefile
7
Rakefile
|
@ -87,5 +87,12 @@ task :test do
|
||||||
end
|
end
|
||||||
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"
|
desc "Run tests for all middleman gems"
|
||||||
task :default => :test
|
task :default => :test
|
2
middleman-core/.cane
Normal file
2
middleman-core/.cane
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
--exclusions-file .cane-exclusions.yml
|
||||||
|
--no-doc
|
5
middleman-core/.cane-exclusions.yml
Normal file
5
middleman-core/.cane-exclusions.yml
Normal 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
0
middleman-core/lib/middleman-core.rb
Executable file → Normal file
0
middleman-core/lib/middleman-core/core_extensions/data.rb
Executable file → Normal file
0
middleman-core/lib/middleman-core/core_extensions/data.rb
Executable file → Normal file
0
middleman-core/lib/middleman-core/templates/html5/source/humans.txt
Executable file → Normal file
0
middleman-core/lib/middleman-core/templates/html5/source/humans.txt
Executable file → Normal file
0
middleman-core/lib/middleman-core/templates/html5/source/robots.txt
Executable file → Normal file
0
middleman-core/lib/middleman-core/templates/html5/source/robots.txt
Executable file → Normal file
0
middleman-core/lib/middleman-core/templates/mobile/source/humans.txt
Executable file → Normal file
0
middleman-core/lib/middleman-core/templates/mobile/source/humans.txt
Executable file → Normal file
0
middleman-core/lib/middleman-core/templates/mobile/source/robots.txt
Executable file → Normal file
0
middleman-core/lib/middleman-core/templates/mobile/source/robots.txt
Executable file → Normal file
2
middleman-more/.cane
Normal file
2
middleman-more/.cane
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
--exclusions-file .cane-exclusions.yml
|
||||||
|
--no-doc
|
3
middleman-more/.cane-exclusions.yml
Normal file
3
middleman-more/.cane-exclusions.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
style:
|
||||||
|
- lib/middleman-more/extensions/minify_css/rainpress.rb
|
||||||
|
- lib/middleman-more/extensions/automatic_image_sizes/fastimage.rb
|
|
@ -48,8 +48,8 @@ module Middleman
|
||||||
# Setup Optional Extensions
|
# Setup Optional Extensions
|
||||||
###
|
###
|
||||||
|
|
||||||
# CacheBuster adds a query string to assets in dynamic templates to avoid
|
# CacheBuster adds a query string to assets in dynamic templates to
|
||||||
# browser caches failing to update to your new content.
|
# avoid browser caches failing to update to your new content.
|
||||||
Middleman::Extensions.register(:cache_buster) do
|
Middleman::Extensions.register(:cache_buster) do
|
||||||
require "middleman-more/extensions/cache_buster"
|
require "middleman-more/extensions/cache_buster"
|
||||||
Middleman::Extensions::CacheBuster
|
Middleman::Extensions::CacheBuster
|
||||||
|
|
|
@ -71,7 +71,7 @@ module Middleman
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# A Compass template for Tilt
|
# A Compass Sass template for Tilt, adding our options in
|
||||||
class CompassSassTemplate < ::Middleman::Renderers::Sass::SassPlusCSSFilenameTemplate
|
class CompassSassTemplate < ::Middleman::Renderers::Sass::SassPlusCSSFilenameTemplate
|
||||||
private
|
private
|
||||||
def sass_options
|
def sass_options
|
||||||
|
@ -79,6 +79,7 @@ module Middleman
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# A Compass Scss template for Tilt, adding our options in
|
||||||
class CompassScssTemplate < ::Middleman::Renderers::Sass::ScssPlusCSSFilenameTemplate
|
class CompassScssTemplate < ::Middleman::Renderers::Sass::ScssPlusCSSFilenameTemplate
|
||||||
private
|
private
|
||||||
def sass_options
|
def sass_options
|
||||||
|
|
|
@ -22,6 +22,7 @@ module Middleman
|
||||||
alias :included :registered
|
alias :included :registered
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Central class for managing i18n extension
|
||||||
class Localizer
|
class Localizer
|
||||||
attr_reader :app
|
attr_reader :app
|
||||||
delegate :logger, :to => :app
|
delegate :logger, :to => :app
|
||||||
|
|
1
middleman-more/lib/middleman-more/extensions/asset_hash.rb
Executable file → Normal file
1
middleman-more/lib/middleman-more/extensions/asset_hash.rb
Executable file → Normal file
|
@ -20,6 +20,7 @@ module Middleman
|
||||||
alias :included :registered
|
alias :included :registered
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Central class for managing asset_hash extension
|
||||||
class AssetHashManager
|
class AssetHashManager
|
||||||
def initialize(app, exts, ignore)
|
def initialize(app, exts, ignore)
|
||||||
@app = app
|
@app = app
|
||||||
|
|
0
middleman-more/lib/middleman-more/extensions/automatic_image_sizes.rb
Executable file → Normal file
0
middleman-more/lib/middleman-more/extensions/automatic_image_sizes.rb
Executable file → Normal file
0
middleman-more/lib/middleman-more/extensions/automatic_image_sizes/fastimage.rb
Executable file → Normal file
0
middleman-more/lib/middleman-more/extensions/automatic_image_sizes/fastimage.rb
Executable file → Normal file
0
middleman-more/lib/middleman-more/extensions/cache_buster.rb
Executable file → Normal file
0
middleman-more/lib/middleman-more/extensions/cache_buster.rb
Executable file → Normal file
|
@ -21,6 +21,7 @@ module Middleman
|
||||||
alias :included :registered
|
alias :included :registered
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Central class for managing the directory indexes extension
|
||||||
class DirectoryIndexManager
|
class DirectoryIndexManager
|
||||||
def initialize(app)
|
def initialize(app)
|
||||||
@app = app
|
@app = app
|
||||||
|
|
0
middleman-more/lib/middleman-more/extensions/minify_javascript.rb
Executable file → Normal file
0
middleman-more/lib/middleman-more/extensions/minify_javascript.rb
Executable file → Normal file
4
middleman-more/lib/middleman-more/extensions/relative_assets.rb
Executable file → Normal file
4
middleman-more/lib/middleman-more/extensions/relative_assets.rb
Executable file → Normal file
|
@ -35,8 +35,8 @@ module Middleman
|
||||||
if path.include?("//")
|
if path.include?("//")
|
||||||
path
|
path
|
||||||
else
|
else
|
||||||
current_dir = Pathname('/' + current_resource.destination_path).dirname
|
current_dir = Pathname('/' + current_resource.destination_path)
|
||||||
Pathname(path).relative_path_from(current_dir)
|
Pathname(path).relative_path_from(current_dir.dirname)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue