middleman-core 3.3.7 → 3.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58d1f92ae43159b3ae4a6096479f56e409ee540a
4
- data.tar.gz: 6f6634ba7c4340dd2d5229f9222b8c1924a1b6a4
3
+ metadata.gz: c39177bcae9f7affa767b7fcf221be1558647868
4
+ data.tar.gz: 72e1622e55f6c7fec6e2fc98b3f345c039b8d298
5
5
  SHA512:
6
- metadata.gz: a937e12df16c26ec28ef901feac136da3ed1534fff3d0a5bbad69f22e0e78721bc01f6ca158f2f4219a73b674581b3341496a5bed270d17473de7fc8692d0a47
7
- data.tar.gz: 60aca4dc123e02ec8e906360e09cebad68bc0e98d53d6af7cddc995a60b986f2ff218c3696386dba6a59ee9f70941341dd38633b308c3a459b3e9be590e35963
6
+ metadata.gz: aaf08ab9935abdb556324add244473867837fe18b0194c189f6bf89348ce5c4ed22ccbf35e83685d4d2df03ad4e27d1c4eaa8ea3f669af530aed4bcfe11b4589
7
+ data.tar.gz: 39c5049097c9a69b269cdf07c60c9bac137e55d4cd21cdc39380b5392fe8308d0c07ae1d7ebd691076eb7db4ea6d0c6970b7426d9f69c83285eed7976b218713
@@ -8,6 +8,8 @@ Feature: Assets get a file hash appended to their and references to them are upd
8
8
  | favicon.ico |
9
9
  | images/100px-1242c368.png |
10
10
  | images/100px-5fd6fb90.jpg |
11
+ | images/200px-c11eb203.jpg |
12
+ | images/300px-59adce76.jpg |
11
13
  | images/100px-5fd6fb90.gif |
12
14
  | javascripts/application-1d8d5276.js |
13
15
  | stylesheets/site-50eaa978.css |
@@ -29,6 +31,9 @@ Feature: Assets get a file hash appended to their and references to them are upd
29
31
  And the file "index.html" should contain 'href="stylesheets/site-50eaa978.css"'
30
32
  And the file "index.html" should contain 'src="javascripts/application-1d8d5276.js"'
31
33
  And the file "index.html" should contain 'src="images/100px-5fd6fb90.jpg"'
34
+ And the file "index.html" should contain 'srcset="images/100px-5fd6fb90.jpg 1x, images/200px-c11eb203.jpg 2x, images/300px-59adce76.jpg 3x"'
35
+ And the file "index.html" should contain 'src="images/100px-5fd6fb90.gif"'
36
+ And the file "index.html" should contain 'src="images/100px-1242c368.png"'
32
37
  And the file "subdir/index.html" should contain 'href="../stylesheets/site-50eaa978.css"'
33
38
  And the file "subdir/index.html" should contain 'src="../javascripts/application-1d8d5276.js"'
34
39
  And the file "subdir/index.html" should contain 'src="../images/100px-5fd6fb90.jpg"'
@@ -49,6 +54,7 @@ Feature: Assets get a file hash appended to their and references to them are upd
49
54
  And I should see 'href="stylesheets/site-50eaa978.css"'
50
55
  And I should see 'src="javascripts/application-1d8d5276.js"'
51
56
  And I should see 'src="images/100px-5fd6fb90.jpg"'
57
+ And I should see 'srcset="images/100px-5fd6fb90.jpg 1x, images/200px-c11eb203.jpg 2x, images/300px-59adce76.jpg 3x"'
52
58
  When I go to "/subdir/"
53
59
  Then I should see 'href="../stylesheets/site-50eaa978.css"'
54
60
  And I should see 'src="../javascripts/application-1d8d5276.js"'
@@ -9,7 +9,6 @@ Feature: Builder
9
9
  | static.html |
10
10
  | services/index.html |
11
11
  | stylesheets/static.css |
12
- | spaces in file.html |
13
12
  | images/blank.gif |
14
13
  | images/Read me (example).txt |
15
14
  | images/Child folder/regular_file(example).txt |
@@ -27,7 +26,6 @@ Feature: Builder
27
26
  And the file "static.html" should contain "Static, no code!"
28
27
  And the file "services/index.html" should contain "Services"
29
28
  And the file "stylesheets/static.css" should contain "body"
30
- And the file "spaces in file.html" should contain "spaces"
31
29
 
32
30
  Scenario: Build glob
33
31
  Given a successfully built app at "glob-app" with flags "--glob '*.css'"
@@ -25,8 +25,7 @@ Feature: Directory Index
25
25
  And the file "a_folder/needs_index/index.html" should contain "Indexable"
26
26
  And the file "leave_me_alone.html" should contain "Stay away"
27
27
  And the file "regular/index.html" should contain "Regular"
28
- And the file "evil spaces/index.html" should contain "Spaces"
29
-
28
+ And the file "evil spaces/index.html" should contain "Filled with Evil Spaces"
30
29
 
31
30
  Scenario: Preview normal file
32
31
  Given the Server is running at "indexable-app"
@@ -35,8 +34,8 @@ Feature: Directory Index
35
34
 
36
35
  Scenario: Preview normal file with spaces in filename
37
36
  Given the Server is running at "indexable-app"
38
- When I go to "/evil%20spaces/"
39
- Then I should see "Spaces"
37
+ When I go to "/evil spaces/"
38
+ Then I should see "Filled with Evil Spaces"
40
39
 
41
40
  Scenario: Preview normal file subdirectory
42
41
  Given the Server is running at "indexable-app"
@@ -149,3 +149,22 @@ Feature: Neighboring YAML Front Matter
149
149
  Then I should see "Layout in use: Override"
150
150
  When I go to "/page_mentioned.html.erb.frontmatter"
151
151
  Then I should see "File Not Found"
152
+
153
+ Scenario: Neighbor frontmatter for destination of proxy resources
154
+ Given the Server is running at "frontmatter-settings-neighbor-app"
155
+ And the file "source/proxied_with_frontmatter.html.frontmatter" has the contents
156
+ """
157
+ ---
158
+ title: Proxied title
159
+ ---
160
+ """
161
+ And the file "source/ignored.html.erb" has the contents
162
+ """
163
+ ---
164
+ ignored: true
165
+ ---
166
+
167
+ <%= current_resource.data.title %>
168
+ """
169
+ When I go to "/proxied_with_frontmatter.html"
170
+ Then I should see "Proxied title"
@@ -140,14 +140,14 @@ Feature: Minify Javascript
140
140
  </script>
141
141
  <script type='text/javascript'>
142
142
  //<!--
143
- !function(){line(),here()}();
143
+ !function(){one,line(),here()}();
144
144
  //-->
145
145
  </script>
146
146
  <script type='text/html'>
147
147
  I'm a jQuery {{template}}.
148
148
  </script>
149
149
  """
150
-
150
+
151
151
  Scenario: Rendering external js with the feature enabled
152
152
  Given a fixture app "minify-js-app"
153
153
  And a file named "config.rb" with:
@@ -3,7 +3,7 @@
3
3
  <% end %>
4
4
 
5
5
  <h2>Image url:</h2>
6
- <img src="<%= image_path('100px.jpg') %>">
6
+ <img src="<%= image_path('100px.jpg') %>" srcset="<%= image_path('100px.jpg') %> 1x, <%= image_path('200px.jpg') %> 2x, <%= image_path('300px.jpg') %> 3x">
7
7
 
8
8
  <h2>Ignored path:</h2>
9
9
  <link rel="apple-touch-icon" href="apple-touch-icon.png">
@@ -1,4 +1,5 @@
1
1
  # Proxy ignored.html, which should ignore itself through a frontmatter
2
2
  page 'proxied.html', :proxy => 'ignored.html'
3
+ page 'proxied_with_frontmatter.html', :proxy => 'ignored.html'
3
4
  page 'override_layout.html', :layout => :alternate
4
5
  page 'page_mentioned.html'
@@ -1 +1 @@
1
- Spaces
1
+ Filled with Evil Spaces
@@ -1 +1 @@
1
- <%= "spaces" %>
1
+ <%= "correctly found spaces in file data" %>
@@ -61,7 +61,14 @@ module Middleman::CoreExtensions
61
61
  # @private
62
62
  # @return [Hash]
63
63
  def raw_data
64
- app.extensions[:frontmatter].data(source_file).first
64
+ data = app.extensions[:frontmatter].data(source_file).first
65
+
66
+ if proxy?
67
+ url_data = app.extensions[:frontmatter].data( File.join( app.source_dir, url ).chomp('/') ).first
68
+ data = data.deep_merge(url_data)
69
+ end
70
+
71
+ data
65
72
  end
66
73
 
67
74
  # This page's frontmatter
@@ -21,6 +21,9 @@ module Middleman
21
21
  ::Rack::Mime::MIME_TYPES['.html'] = 'text/html; charset=utf-8'
22
22
  ::Rack::Mime::MIME_TYPES['.htm'] = 'text/html; charset=utf-8'
23
23
 
24
+ # Sourcemap format
25
+ ::Rack::Mime::MIME_TYPES['.map'] = 'application/json; charset=utf-8'
26
+
24
27
  app.extend ClassMethods
25
28
  app.extend ServerMethods
26
29
 
@@ -40,7 +40,7 @@ module Middleman
40
40
  def initialize(store, path, source_file=nil)
41
41
  @store = store
42
42
  @app = @store.app
43
- @path = path.gsub(' ', '%20') # handle spaces in filenames
43
+ @path = path
44
44
  @source_file = source_file
45
45
  @destination_path = @path
46
46
 
@@ -69,7 +69,7 @@ end
69
69
 
70
70
  # Provide this Aruba overload in case we're matching something with quotes in it
71
71
  Then /^the file "([^"]*)" should contain '([^']*)'$/ do |file, partial_content|
72
- check_file_content(file, partial_content, true)
72
+ check_file_content(file, Regexp.new(Regexp.escape(partial_content)), true)
73
73
  end
74
74
 
75
75
  And /the file "(.*)" should be gzipped/ do |file|
@@ -72,13 +72,13 @@ end
72
72
 
73
73
  When /^I go to "([^\"]*)"$/ do |url|
74
74
  in_current_dir do
75
- @browser.get(URI.escape(url))
75
+ @browser.get(URI.encode(url))
76
76
  end
77
77
  end
78
78
 
79
79
  Then /^going to "([^\"]*)" should not raise an exception$/ do |url|
80
80
  in_current_dir do
81
- expect{ @browser.get(URI.escape(url)) }.to_not raise_exception
81
+ expect{ @browser.get(URI.encode(url)) }.to_not raise_exception
82
82
  end
83
83
  end
84
84
 
@@ -1 +1 @@
1
- //= require_tree .
1
+ //= require_tree .
@@ -9,7 +9,7 @@ class Middleman::Templates::Local < Middleman::Templates::Base
9
9
  # Just copy from the template path
10
10
  # @return [void]
11
11
  def build_scaffold!
12
- directory options[:template].to_s, location, force: options[:force]
12
+ directory options[:template].to_s, location, force: options[:force], exclude_pattern: /\.git\/.*/
13
13
  end
14
14
  end
15
15
 
@@ -68,7 +68,7 @@ module Middleman
68
68
  # @return [String]
69
69
  def normalize_path(path)
70
70
  # The tr call works around a bug in Ruby's Unicode handling
71
- path.sub(%r{^/}, '').tr('', '')
71
+ URI.decode(path).sub(%r{^/}, '').tr('', '')
72
72
  end
73
73
 
74
74
  # This is a separate method from normalize_path in case we
@@ -144,7 +144,7 @@ module Middleman
144
144
  path_or_resource.url
145
145
  else
146
146
  path_or_resource.dup
147
- end.gsub(' ', '%20')
147
+ end
148
148
 
149
149
  # Try to parse URL
150
150
  begin
@@ -182,7 +182,7 @@ module Middleman
182
182
  end
183
183
 
184
184
  if resource
185
- uri.path = relative_path_from_resource(this_resource, resource_url, effective_relative)
185
+ uri.path = URI.encode(relative_path_from_resource(this_resource, resource_url, effective_relative))
186
186
  else
187
187
  # If they explicitly asked for relative links but we can't find a resource...
188
188
  raise "No resource exists at #{url}" if relative
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  # Current Version
3
3
  # @return [String]
4
- VERSION = '3.3.7' unless const_defined?(:VERSION)
4
+ VERSION = '3.3.8' unless const_defined?(:VERSION)
5
5
  end
@@ -91,7 +91,7 @@ class Middleman::Extensions::AssetHash < ::Middleman::Extension
91
91
  dirpath = Pathname.new(File.dirname(path))
92
92
 
93
93
  # TODO: This regex will change some paths in plan HTML (not in a tag) - is that OK?
94
- body.gsub(/([=\'\"\(]\s*)([^\s\'\"\)]+(#{@exts_regex_text}))/) do |match|
94
+ body.gsub(/([=\'\"\(,]\s*)([^\s\'\"\)]+(#{@exts_regex_text}))/) do |match|
95
95
  opening_character = $1
96
96
  asset_path = $2
97
97
 
@@ -39,5 +39,5 @@ Gem::Specification.new do |s|
39
39
  s.add_dependency("listen", [">= 2.7.9", "< 3.0"])
40
40
 
41
41
  # i18n
42
- s.add_dependency("i18n", ["~> 0.6.9"])
42
+ s.add_dependency("i18n", ["~> 0.7.0"])
43
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.7
4
+ version: 3.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Reynolds
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-11-09 00:00:00.000000000 Z
13
+ date: 2015-02-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -182,14 +182,14 @@ dependencies:
182
182
  requirements:
183
183
  - - "~>"
184
184
  - !ruby/object:Gem::Version
185
- version: 0.6.9
185
+ version: 0.7.0
186
186
  type: :runtime
187
187
  prerelease: false
188
188
  version_requirements: !ruby/object:Gem::Requirement
189
189
  requirements:
190
190
  - - "~>"
191
191
  - !ruby/object:Gem::Version
192
- version: 0.6.9
192
+ version: 0.7.0
193
193
  description: A static site generator. Provides dozens of templating languages (Haml,
194
194
  Sass, Compass, Slim, CoffeeScript, and more). Makes minification, compression, cache
195
195
  busting, Yaml data (and more) an easy part of your development cycle.
@@ -327,6 +327,8 @@ files:
327
327
  - fixtures/asset-hash-app/source/images/100px.gif
328
328
  - fixtures/asset-hash-app/source/images/100px.jpg
329
329
  - fixtures/asset-hash-app/source/images/100px.png
330
+ - fixtures/asset-hash-app/source/images/200px.jpg
331
+ - fixtures/asset-hash-app/source/images/300px.jpg
330
332
  - fixtures/asset-hash-app/source/index.html.erb
331
333
  - fixtures/asset-hash-app/source/javascripts/application.js
332
334
  - fixtures/asset-hash-app/source/layout.erb
@@ -1271,7 +1273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1271
1273
  version: '0'
1272
1274
  requirements: []
1273
1275
  rubyforge_project:
1274
- rubygems_version: 2.2.2
1276
+ rubygems_version: 2.4.3
1275
1277
  signing_key:
1276
1278
  specification_version: 4
1277
1279
  summary: Hand-crafted frontend development
@@ -1396,6 +1398,8 @@ test_files:
1396
1398
  - fixtures/asset-hash-app/source/images/100px.gif
1397
1399
  - fixtures/asset-hash-app/source/images/100px.jpg
1398
1400
  - fixtures/asset-hash-app/source/images/100px.png
1401
+ - fixtures/asset-hash-app/source/images/200px.jpg
1402
+ - fixtures/asset-hash-app/source/images/300px.jpg
1399
1403
  - fixtures/asset-hash-app/source/index.html.erb
1400
1404
  - fixtures/asset-hash-app/source/javascripts/application.js
1401
1405
  - fixtures/asset-hash-app/source/layout.erb