middleman-more 3.0.0 → 3.0.1.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. data/.cane +2 -0
  2. data/.cane-exclusions.yml +3 -0
  3. data/features/coffee-script.feature +6 -1
  4. data/features/markdown_redcarpet.feature +23 -1
  5. data/features/minify_css.feature +2 -0
  6. data/features/sass-assets-paths.feature +11 -0
  7. data/features/sass_cache_path.feature +22 -0
  8. data/features/slim.feature +49 -1
  9. data/features/support/env.rb +2 -2
  10. data/fixtures/asset-host-app/config.rb +1 -1
  11. data/fixtures/auto-css-app/config.rb +1 -1
  12. data/fixtures/auto-js-app/config.rb +1 -1
  13. data/fixtures/coffeescript-app/config.rb +1 -1
  14. data/fixtures/content-for-app/config.rb +1 -1
  15. data/fixtures/extensionless-text-files-app/config.rb +1 -1
  16. data/fixtures/lorem-app/config.rb +1 -1
  17. data/fixtures/markdown-app/source/images/blank.gif +0 -0
  18. data/fixtures/minify-css-app/source/stylesheets/report.css +1 -0
  19. data/fixtures/nested-layout-app/config.rb +1 -1
  20. data/fixtures/page-classes-app/config.rb +1 -1
  21. data/fixtures/relative-assets-app/config.rb +1 -1
  22. data/fixtures/sass-assets-path-app/assets/stylesheets/_shared-asset.sass +1 -0
  23. data/fixtures/sass-assets-path-app/assets/stylesheets/_shared-asset.scss +1 -0
  24. data/fixtures/sass-assets-path-app/config.rb +4 -0
  25. data/fixtures/sass-assets-path-app/my-vendor/stylesheets/_partial.sass +2 -0
  26. data/fixtures/sass-assets-path-app/source/stylesheets/plain.css.sass +16 -0
  27. data/fixtures/sass-cache-path-custom-app/config.rb +3 -0
  28. data/fixtures/sass-cache-path-custom-app/source/stylesheets/plain.css.sass +4 -0
  29. data/fixtures/sass-cache-path-default-app/config.rb +3 -0
  30. data/fixtures/sass-cache-path-default-app/source/stylesheets/plain.css.sass +4 -0
  31. data/fixtures/traversal-app/config.rb +1 -1
  32. data/fixtures/wildcard-directory-index-app/config.rb +1 -1
  33. data/lib/middleman-more.rb +19 -16
  34. data/lib/middleman-more/core_extensions/assets.rb +5 -5
  35. data/lib/middleman-more/core_extensions/compass.rb +9 -4
  36. data/lib/middleman-more/core_extensions/default_helpers.rb +3 -3
  37. data/lib/middleman-more/core_extensions/i18n.rb +31 -27
  38. data/lib/middleman-more/extensions/asset_hash.rb +8 -7
  39. data/lib/middleman-more/extensions/asset_host.rb +9 -9
  40. data/lib/middleman-more/extensions/automatic_image_sizes.rb +6 -6
  41. data/lib/middleman-more/extensions/automatic_image_sizes/fastimage.rb +6 -6
  42. data/lib/middleman-more/extensions/cache_buster.rb +11 -11
  43. data/lib/middleman-more/extensions/directory_indexes.rb +14 -13
  44. data/lib/middleman-more/extensions/gzip.rb +7 -7
  45. data/lib/middleman-more/extensions/lorem.rb +10 -10
  46. data/lib/middleman-more/extensions/minify_css.rb +5 -5
  47. data/lib/middleman-more/extensions/minify_css/rainpress.rb +2 -2
  48. data/lib/middleman-more/extensions/minify_javascript.rb +7 -7
  49. data/lib/middleman-more/extensions/relative_assets.rb +9 -9
  50. data/lib/middleman-more/templates/smacss.rb +30 -0
  51. data/lib/middleman-more/templates/smacss/source/_footer.haml +1 -0
  52. data/lib/middleman-more/templates/smacss/source/index.html.haml +1 -0
  53. data/lib/middleman-more/templates/smacss/source/layouts/layout.haml +13 -0
  54. data/lib/middleman-more/templates/smacss/source/stylesheets/_0.site-settings.scss +0 -0
  55. data/lib/middleman-more/templates/smacss/source/stylesheets/_1.base.scss +2 -0
  56. data/lib/middleman-more/templates/smacss/source/stylesheets/_2.layout.scss +2 -0
  57. data/lib/middleman-more/templates/smacss/source/stylesheets/_3.states.scss +2 -0
  58. data/lib/middleman-more/templates/smacss/source/stylesheets/_4.themes.scss +2 -0
  59. data/lib/middleman-more/templates/smacss/source/stylesheets/modules/_btn.scss +2 -0
  60. data/lib/middleman-more/templates/smacss/source/stylesheets/style.css.scss +7 -0
  61. data/lib/middleman_extension.rb +1 -1
  62. metadata +47 -11
@@ -3,8 +3,8 @@ require 'stringio'
3
3
  require 'find'
4
4
 
5
5
  module Middleman::Extensions
6
-
7
- # This extension Gzips assets and pages when building.
6
+
7
+ # This extension Gzips assets and pages when building.
8
8
  # Gzipped assets and pages can be served directly by Apache or
9
9
  # Nginx with the proper configuration, and pre-zipping means that we
10
10
  # can use a more agressive compression level at no CPU cost per request.
@@ -21,13 +21,13 @@ module Middleman::Extensions
21
21
  exts = options[:exts] || %w(.js .css .html .htm)
22
22
 
23
23
  app.after_build do |builder|
24
-
24
+
25
25
  paths = ::Middleman::Util.all_files_under(self.class.inst.build_dir)
26
26
  paths.each do |path|
27
27
  next unless exts.include? path.extname
28
-
28
+
29
29
  output_filename, old_size, new_size = Middleman::Extensions::Gzip.gzip_file(path.to_s)
30
-
30
+
31
31
  if output_filename
32
32
  size_change_word = (old_size - new_size) > 0 ? 'smaller' : 'larger'
33
33
  builder.say_status :gzip, "#{output_filename} (#{number_to_human_size((old_size - new_size).abs)} #{size_change_word})"
@@ -35,7 +35,7 @@ module Middleman::Extensions
35
35
  end
36
36
  end
37
37
  end
38
-
38
+
39
39
  alias :included :registered
40
40
  end
41
41
 
@@ -64,7 +64,7 @@ module Middleman::Extensions
64
64
 
65
65
  old_size = File.size(path)
66
66
  new_size = File.size(output_filename)
67
-
67
+
68
68
  [output_filename, old_size, new_size]
69
69
  end
70
70
  end
@@ -1,22 +1,22 @@
1
1
  # Extension namespace
2
2
  module Middleman
3
3
  module Extensions
4
-
4
+
5
5
  # Lorem helper
6
6
  module Lorem
7
-
7
+
8
8
  # Setup extension
9
9
  class << self
10
-
10
+
11
11
  # Once registered
12
12
  def registered(app)
13
13
  # Include methods
14
14
  app.send :include, InstanceMethods
15
15
  end
16
-
16
+
17
17
  alias :included :registered
18
18
  end
19
-
19
+
20
20
  # Lorem extension instance methods
21
21
  module InstanceMethods
22
22
  # Access to the Lorem object
@@ -24,7 +24,7 @@ module Middleman
24
24
  def lorem
25
25
  @_lorem ||= LoremObject.new
26
26
  end
27
-
27
+
28
28
  # Return a placeholder image using placekitten.com
29
29
  #
30
30
  # @param [String] size
@@ -39,7 +39,7 @@ module Middleman
39
39
  # Adapted from Frank:
40
40
  # https://github.com/blahed/frank/
41
41
  # Copyright (c) 2010 Travis Dunn
42
- #
42
+ #
43
43
  # Permission is hereby granted, free of charge, to any person
44
44
  # obtaining a copy of this software and associated documentation
45
45
  # files (the "Software"), to deal in the Software without
@@ -48,10 +48,10 @@ module Middleman
48
48
  # copies of the Software, and to permit persons to whom the
49
49
  # Software is furnished to do so, subject to the following
50
50
  # conditions:
51
- #
51
+ #
52
52
  # The above copyright notice and this permission notice shall be
53
53
  # included in all copies or substantial portions of the Software.
54
- #
54
+ #
55
55
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
56
56
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
57
57
  # OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -194,4 +194,4 @@ module Middleman
194
194
  end
195
195
  end
196
196
  end
197
- end
197
+ end
@@ -1,13 +1,13 @@
1
1
  # Extensions namespace
2
2
  module Middleman
3
3
  module Extensions
4
-
5
- # Minify CSS Extension
4
+
5
+ # Minify CSS Extension
6
6
  module MinifyCss
7
-
7
+
8
8
  # Setup extension
9
9
  class << self
10
-
10
+
11
11
  # Once registered
12
12
  def registered(app, options={})
13
13
  app.set :css_compressor, false
@@ -29,7 +29,7 @@ module Middleman
29
29
  end
30
30
  alias :included :registered
31
31
  end
32
-
32
+
33
33
  # Rack middleware to look for CSS and compress it
34
34
  class Rack
35
35
 
@@ -25,7 +25,7 @@ class Rainpress
25
25
  :comments => true,
26
26
  :newlines => true,
27
27
  :spaces => true,
28
- :colors => true,
28
+ :colors => false,
29
29
  :misc => true
30
30
  }
31
31
  @opts.merge! opts
@@ -165,4 +165,4 @@ class Rainpress
165
165
  end
166
166
  end
167
167
 
168
- end
168
+ end
@@ -1,13 +1,13 @@
1
1
  # Extension namespace
2
2
  module Middleman
3
3
  module Extensions
4
-
4
+
5
5
  # Minify Javascript Extension
6
6
  module MinifyJavascript
7
-
7
+
8
8
  # Setup extension
9
9
  class << self
10
-
10
+
11
11
  # Once registered
12
12
  def registered(app, options={})
13
13
  app.set :js_compressor, false
@@ -21,9 +21,9 @@ module Middleman
21
21
  require 'uglifier'
22
22
  ::Uglifier.new
23
23
  end
24
-
24
+
25
25
  # Setup Rack middlware to minify JS
26
- use Rack, :compressor => chosen_compressor,
26
+ use Rack, :compressor => chosen_compressor,
27
27
  :ignore => ignore,
28
28
  :inline => inline
29
29
  end
@@ -33,7 +33,7 @@ module Middleman
33
33
 
34
34
  # Rack middleware to look for JS and compress it
35
35
  class Rack
36
-
36
+
37
37
  # Init
38
38
  # @param [Class] app
39
39
  # @param [Hash] options
@@ -84,7 +84,7 @@ module Middleman
84
84
  end
85
85
  rescue ExecJS::ProgramError => e
86
86
  warn "WARNING: Couldn't compress JavaScript in #{path}: #{e.message}"
87
- end
87
+ end
88
88
 
89
89
  [status, headers, response]
90
90
  end
@@ -1,30 +1,30 @@
1
1
  # Extension namespace
2
2
  module Middleman
3
3
  module Extensions
4
-
4
+
5
5
  # Relative Assets extension
6
6
  module RelativeAssets
7
-
7
+
8
8
  # Setup extension
9
9
  class << self
10
-
10
+
11
11
  # Once registered
12
12
  def registered(app)
13
13
  # Tell compass to use relative assets
14
14
  app.compass_config do |config|
15
15
  config.relative_assets = true
16
16
  end
17
-
17
+
18
18
  # Include instance methods
19
19
  app.send :include, InstanceMethods
20
20
  end
21
-
21
+
22
22
  alias :included :registered
23
23
  end
24
-
24
+
25
25
  # Relative Assets instance method
26
26
  module InstanceMethods
27
-
27
+
28
28
  # asset_url override for relative assets
29
29
  # @param [String] path
30
30
  # @param [String] prefix
@@ -35,8 +35,8 @@ module Middleman
35
35
  if path.include?("//")
36
36
  path
37
37
  else
38
- current_dir = Pathname('/' + current_resource.destination_path).dirname
39
- Pathname(path).relative_path_from(current_dir)
38
+ current_dir = Pathname('/' + current_resource.destination_path)
39
+ Pathname(path).relative_path_from(current_dir.dirname)
40
40
  end
41
41
  end
42
42
  end
@@ -0,0 +1,30 @@
1
+ # SMACSS
2
+ class Middleman::Templates::Smacss < Middleman::Templates::Base
3
+
4
+ class_option "css_dir",
5
+ :default => "stylesheets",
6
+ :desc => 'The path to the css files'
7
+ class_option "js_dir",
8
+ :default => "javascripts",
9
+ :desc => 'The path to the javascript files'
10
+ class_option "images_dir",
11
+ :default => "images",
12
+ :desc => 'The path to the image files'
13
+
14
+ # Template files are relative to this file
15
+ # @return [String]
16
+ def self.source_root
17
+ File.dirname(__FILE__)
18
+ end
19
+
20
+ # Output the files
21
+ # @return [void]
22
+ def build_scaffold!
23
+ template "shared/config.tt", File.join(location, "config.rb")
24
+ directory "smacss/source", File.join(location, "source")
25
+ empty_directory File.join(location, "source")
26
+ end
27
+ end
28
+
29
+ # Register the template
30
+ Middleman::Templates.register(:smacss, Middleman::Templates::Smacss)
@@ -0,0 +1 @@
1
+ %footer &copy; 2012
@@ -0,0 +1 @@
1
+ %h1 Middleman
@@ -0,0 +1,13 @@
1
+ !!! 5
2
+ %html
3
+ %head
4
+ %title Middleman
5
+ %meta{:charset => "utf-8"}
6
+ %meta{:content => "Middleman", :name => "description"}
7
+ %meta{:content => "on", "http-equiv" => "cleartype"}
8
+ %meta{:content => "IE=edge,chrome=1", "http-equiv" => "X-UA-Compatible"}
9
+ %link{:href => "stylesheets/style.css", :rel => "stylesheet"}
10
+
11
+ %body
12
+ = yield
13
+ = render_partial 'footer'
@@ -0,0 +1,2 @@
1
+ /* Base
2
+ ================================================== */
@@ -0,0 +1,2 @@
1
+ /* Layout
2
+ ================================================== */
@@ -0,0 +1,2 @@
1
+ /* States
2
+ ================================================== */
@@ -0,0 +1,2 @@
1
+ /* Themes
2
+ ================================================== */
@@ -0,0 +1,2 @@
1
+ /* Buttons
2
+ ================================================== */
@@ -0,0 +1,7 @@
1
+ @import
2
+ "0.site-settings",
3
+ "1.base",
4
+ "2.layout",
5
+ "3.states",
6
+ "4.themes",
7
+ "modules/btn";
@@ -1 +1 @@
1
- require "middleman-more"
1
+ require "middleman-more"
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-more
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
5
- prerelease:
4
+ version: 3.0.1.pre
5
+ prerelease: 6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Thomas Reynolds
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-07-09 00:00:00.000000000 Z
13
+ date: 2012-09-01 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: middleman-core
@@ -19,7 +19,7 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 3.0.0
22
+ version: 3.0.1.pre
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,7 +27,7 @@ dependencies:
27
27
  requirements:
28
28
  - - '='
29
29
  - !ruby/object:Gem::Version
30
- version: 3.0.0
30
+ version: 3.0.1.pre
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: uglifier
33
33
  requirement: !ruby/object:Gem::Requirement
@@ -198,6 +198,8 @@ executables: []
198
198
  extensions: []
199
199
  extra_rdoc_files: []
200
200
  files:
201
+ - .cane
202
+ - .cane-exclusions.yml
201
203
  - .gemtest
202
204
  - Rakefile
203
205
  - features/asset_hash.feature
@@ -234,6 +236,8 @@ files:
234
236
  - features/nested_layouts.feature
235
237
  - features/partials.feature
236
238
  - features/relative_assets.feature
239
+ - features/sass-assets-paths.feature
240
+ - features/sass_cache_path.feature
237
241
  - features/sass_partials.feature
238
242
  - features/scss-support.feature
239
243
  - features/sitemap_traversal.feature
@@ -386,6 +390,7 @@ files:
386
390
  - fixtures/markdown-app/source/autolink.html.markdown
387
391
  - fixtures/markdown-app/source/fenced_code_blocks.html.markdown
388
392
  - fixtures/markdown-app/source/hard_wrap.html.markdown
393
+ - fixtures/markdown-app/source/images/blank.gif
389
394
  - fixtures/markdown-app/source/index.html.markdown
390
395
  - fixtures/markdown-app/source/no_intra_emphasis.html.markdown
391
396
  - fixtures/markdown-app/source/smarty_pants.html.markdown
@@ -396,6 +401,7 @@ files:
396
401
  - fixtures/markdown-app/source/with_toc_data.html.markdown
397
402
  - fixtures/minify-css-app/source/inline-css.html.haml
398
403
  - fixtures/minify-css-app/source/more-css/site.css
404
+ - fixtures/minify-css-app/source/stylesheets/report.css
399
405
  - fixtures/minify-css-app/source/stylesheets/site.css.sass
400
406
  - fixtures/minify-js-app/config.rb
401
407
  - fixtures/minify-js-app/source/inline-coffeescript.html.haml
@@ -461,6 +467,15 @@ files:
461
467
  - fixtures/relative-assets-app/source/img/blank.gif
462
468
  - fixtures/relative-assets-app/source/relative_image.html.erb
463
469
  - fixtures/relative-assets-app/source/stylesheets/relative_assets.css.sass
470
+ - fixtures/sass-assets-path-app/assets/stylesheets/_shared-asset.sass
471
+ - fixtures/sass-assets-path-app/assets/stylesheets/_shared-asset.scss
472
+ - fixtures/sass-assets-path-app/config.rb
473
+ - fixtures/sass-assets-path-app/my-vendor/stylesheets/_partial.sass
474
+ - fixtures/sass-assets-path-app/source/stylesheets/plain.css.sass
475
+ - fixtures/sass-cache-path-custom-app/config.rb
476
+ - fixtures/sass-cache-path-custom-app/source/stylesheets/plain.css.sass
477
+ - fixtures/sass-cache-path-default-app/config.rb
478
+ - fixtures/sass-cache-path-default-app/source/stylesheets/plain.css.sass
464
479
  - fixtures/scss-app/config.rb
465
480
  - fixtures/scss-app/source/stylesheets/layout.css.sass
466
481
  - fixtures/scss-app/source/stylesheets/site_scss.css.scss
@@ -587,6 +602,17 @@ files:
587
602
  - lib/middleman-more/extensions/minify_css/rainpress.rb
588
603
  - lib/middleman-more/extensions/minify_javascript.rb
589
604
  - lib/middleman-more/extensions/relative_assets.rb
605
+ - lib/middleman-more/templates/smacss.rb
606
+ - lib/middleman-more/templates/smacss/source/_footer.haml
607
+ - lib/middleman-more/templates/smacss/source/index.html.haml
608
+ - lib/middleman-more/templates/smacss/source/layouts/layout.haml
609
+ - lib/middleman-more/templates/smacss/source/stylesheets/_0.site-settings.scss
610
+ - lib/middleman-more/templates/smacss/source/stylesheets/_1.base.scss
611
+ - lib/middleman-more/templates/smacss/source/stylesheets/_2.layout.scss
612
+ - lib/middleman-more/templates/smacss/source/stylesheets/_3.states.scss
613
+ - lib/middleman-more/templates/smacss/source/stylesheets/_4.themes.scss
614
+ - lib/middleman-more/templates/smacss/source/stylesheets/modules/_btn.scss
615
+ - lib/middleman-more/templates/smacss/source/stylesheets/style.css.scss
590
616
  - lib/middleman_extension.rb
591
617
  - middleman-more.gemspec
592
618
  homepage: http://middlemanapp.com
@@ -604,16 +630,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
604
630
  version: '0'
605
631
  segments:
606
632
  - 0
607
- hash: -34936377537429209
633
+ hash: -2447366148291236453
608
634
  required_rubygems_version: !ruby/object:Gem::Requirement
609
635
  none: false
610
636
  requirements:
611
- - - ! '>='
637
+ - - ! '>'
612
638
  - !ruby/object:Gem::Version
613
- version: '0'
614
- segments:
615
- - 0
616
- hash: -34936377537429209
639
+ version: 1.3.1
617
640
  requirements: []
618
641
  rubyforge_project:
619
642
  rubygems_version: 1.8.24
@@ -655,6 +678,8 @@ test_files:
655
678
  - features/nested_layouts.feature
656
679
  - features/partials.feature
657
680
  - features/relative_assets.feature
681
+ - features/sass-assets-paths.feature
682
+ - features/sass_cache_path.feature
658
683
  - features/sass_partials.feature
659
684
  - features/scss-support.feature
660
685
  - features/sitemap_traversal.feature
@@ -807,6 +832,7 @@ test_files:
807
832
  - fixtures/markdown-app/source/autolink.html.markdown
808
833
  - fixtures/markdown-app/source/fenced_code_blocks.html.markdown
809
834
  - fixtures/markdown-app/source/hard_wrap.html.markdown
835
+ - fixtures/markdown-app/source/images/blank.gif
810
836
  - fixtures/markdown-app/source/index.html.markdown
811
837
  - fixtures/markdown-app/source/no_intra_emphasis.html.markdown
812
838
  - fixtures/markdown-app/source/smarty_pants.html.markdown
@@ -817,6 +843,7 @@ test_files:
817
843
  - fixtures/markdown-app/source/with_toc_data.html.markdown
818
844
  - fixtures/minify-css-app/source/inline-css.html.haml
819
845
  - fixtures/minify-css-app/source/more-css/site.css
846
+ - fixtures/minify-css-app/source/stylesheets/report.css
820
847
  - fixtures/minify-css-app/source/stylesheets/site.css.sass
821
848
  - fixtures/minify-js-app/config.rb
822
849
  - fixtures/minify-js-app/source/inline-coffeescript.html.haml
@@ -882,6 +909,15 @@ test_files:
882
909
  - fixtures/relative-assets-app/source/img/blank.gif
883
910
  - fixtures/relative-assets-app/source/relative_image.html.erb
884
911
  - fixtures/relative-assets-app/source/stylesheets/relative_assets.css.sass
912
+ - fixtures/sass-assets-path-app/assets/stylesheets/_shared-asset.sass
913
+ - fixtures/sass-assets-path-app/assets/stylesheets/_shared-asset.scss
914
+ - fixtures/sass-assets-path-app/config.rb
915
+ - fixtures/sass-assets-path-app/my-vendor/stylesheets/_partial.sass
916
+ - fixtures/sass-assets-path-app/source/stylesheets/plain.css.sass
917
+ - fixtures/sass-cache-path-custom-app/config.rb
918
+ - fixtures/sass-cache-path-custom-app/source/stylesheets/plain.css.sass
919
+ - fixtures/sass-cache-path-default-app/config.rb
920
+ - fixtures/sass-cache-path-default-app/source/stylesheets/plain.css.sass
885
921
  - fixtures/scss-app/config.rb
886
922
  - fixtures/scss-app/source/stylesheets/layout.css.sass
887
923
  - fixtures/scss-app/source/stylesheets/site_scss.css.scss