middleman-more 3.0.0.rc.1 → 3.0.0.rc.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
- Feature: relative_link_to helper
1
+ Feature: link_to helper
2
2
 
3
- Scenario: relative_link_to produces relative links
3
+ Scenario: link_to produces relative links
4
4
  Given a fixture app "indexable-app"
5
5
  And an empty file named "config.rb"
6
6
  And a file named "source/link_to.html.erb" with:
@@ -21,7 +21,7 @@ Feature: relative_link_to helper
21
21
  Then I should see 'absolute: <a href="../needs_index.html">Needs Index</a>'
22
22
  Then I should see 'relative: <a href="../needs_index.html">Relative</a>'
23
23
 
24
- Scenario: relative_link_to produces relative links when :relative_links is set to true
24
+ Scenario: link_to produces relative links when :relative_links is set to true
25
25
  Given a fixture app "indexable-app"
26
26
  And a file named "config.rb" with:
27
27
  """
@@ -47,7 +47,7 @@ Feature: relative_link_to helper
47
47
  Then I should see 'absolute: <a href="../needs_index.html">Needs Index</a>'
48
48
  Then I should see 'relative: <a href="../needs_index.html">Relative</a>'
49
49
 
50
- Scenario: relative_link_to knows about directory indexes
50
+ Scenario: link_to knows about directory indexes
51
51
  Given a fixture app "indexable-app"
52
52
  And a file named "source/link_to.html.erb" with:
53
53
  """
@@ -65,4 +65,14 @@ Feature: relative_link_to helper
65
65
  Then I should see 'relative: <a href="needs_index/">Relative</a>'
66
66
  When I go to "/link_to/sub/"
67
67
  Then I should see 'absolute: <a href="../needs_index/">Needs Index</a>'
68
- Then I should see 'relative: <a href="../needs_index/">Relative</a>'
68
+ Then I should see 'relative: <a href="../needs_index/">Relative</a>'
69
+
70
+ Scenario: link_to can take a Resource
71
+ Given a fixture app "indexable-app"
72
+ And a file named "source/link_to.html.erb" with:
73
+ """
74
+ <%= link_to "Needs Index", sitemap.find_resource_by_path("/needs_index.html") %>
75
+ """
76
+ And the Server is running at "indexable-app"
77
+ When I go to "/link_to/"
78
+ Then I should see '<a href="/needs_index/">Needs Index</a>'
@@ -1,22 +1,19 @@
1
1
  module Middleman
2
2
  module CoreExtensions
3
-
4
- # Forward the settings on config.rb and the result of registered
3
+
4
+ # Forward the settings on config.rb and the result of registered
5
5
  # extensions to Compass
6
6
  module Compass
7
-
7
+
8
8
  # Extension registered
9
9
  class << self
10
-
10
+
11
11
  # Once registered
12
12
  def registered(app)
13
13
  # Require the library
14
14
  require "compass"
15
-
16
- # Where to look for fonts
17
- app.set :fonts_dir, "fonts"
18
-
19
- # Hooks to manually update the compass config after we're
15
+
16
+ # Hooks to manually update the compass config after we're
20
17
  # done with it
21
18
  app.define_hook :compass_config
22
19
 
@@ -35,14 +32,14 @@ module Middleman
35
32
  # Disable this initially, the cache_buster extension will
36
33
  # re-enable it if requested.
37
34
  config.asset_cache_buster :none
38
-
35
+
39
36
  # Disable this initially, the relative_assets extension will
40
37
  # re-enable it if requested.
41
38
  config.relative_assets = false
42
-
39
+
43
40
  # Default output style
44
41
  config.output_style = :nested
45
-
42
+
46
43
  # No line-comments in test mode (changing paths mess with sha1)
47
44
  config.line_comments = false if ENV["TEST"]
48
45
 
@@ -50,10 +47,10 @@ module Middleman
50
47
  config.asset_host(&asset_host)
51
48
  end
52
49
  end
53
-
50
+
54
51
  # Call hook
55
52
  run_hook :compass_config, ::Compass.configuration
56
-
53
+
57
54
  # Tell Tilt to use it as well (for inline sass blocks)
58
55
  ::Tilt.register 'sass', CompassSassTemplate
59
56
  ::Tilt.prefer(CompassSassTemplate)
@@ -67,7 +64,7 @@ module Middleman
67
64
  end
68
65
 
69
66
  end
70
-
67
+
71
68
  # A Compass template for Tilt
72
69
  class CompassSassTemplate < ::Middleman::Renderers::Sass::SassPlusCSSFilenameTemplate
73
70
  private
@@ -75,13 +72,13 @@ module Middleman
75
72
  super.merge(::Compass.configuration.to_sass_engine_options)
76
73
  end
77
74
  end
78
-
79
- class CompassScssTemplate < ::Middleman::Renderers::Sass::ScssPlusCSSFilenameTemplate
75
+
76
+ class CompassScssTemplate < ::Middleman::Renderers::Sass::ScssPlusCSSFilenameTemplate
80
77
  private
81
78
  def sass_options
82
79
  super.merge(::Compass.configuration.to_sass_engine_options)
83
80
  end
84
81
  end
85
-
82
+
86
83
  end
87
- end
84
+ end
@@ -124,8 +124,10 @@ module Middleman
124
124
  options = args[options_index] || {}
125
125
  relative = options.delete(:relative)
126
126
 
127
-
128
- if url.include? '://'
127
+ # Handle Resources, which define their own url method
128
+ if url.respond_to? :url
129
+ args[url_arg_index] = url.url
130
+ elsif url.include? '://'
129
131
  raise "Can't use the relative option with an external URL" if relative
130
132
  else
131
133
  # Handle relative urls
@@ -32,7 +32,7 @@ module Middleman
32
32
  def manipulate_resource_list(resources)
33
33
  resources.each do |resource|
34
34
  next unless @exts.include? resource.ext
35
- next if @ignore.any? { |r| resource.destination_path.match(r) }
35
+ next if @ignore.any? { |ignore| Middleman::Util.path_match(ignore, resource.destination_path) }
36
36
 
37
37
  if resource.template? # if it's a template, render it out
38
38
  digest = Digest::SHA1.hexdigest(resource.render)[0..7]
@@ -66,7 +66,7 @@ module Middleman
66
66
 
67
67
  headers["Content-Length"] = ::Rack::Utils.bytesize(minified).to_s
68
68
  response = [minified]
69
- elsif path.end_with?('.css') && @ignore.none? {|ignore| path =~ ignore }
69
+ elsif path.end_with?('.css') && @ignore.none? {|ignore| Middleman::Util.path_match(ignore, path) }
70
70
  uncompressed_source = ::Middleman::Util.extract_response_text(response)
71
71
  minified_css = @compressor.compress(uncompressed_source)
72
72
 
@@ -75,7 +75,7 @@ module Middleman
75
75
 
76
76
  headers["Content-Length"] = ::Rack::Utils.bytesize(minified).to_s
77
77
  response = [minified]
78
- elsif path.end_with?('.js') && @ignore.none? {|ignore| path =~ ignore }
78
+ elsif path.end_with?('.js') && @ignore.none? {|ignore| Middleman::Util.path_match(ignore, path) }
79
79
  uncompressed_source = ::Middleman::Util.extract_response_text(response)
80
80
  minified_js = @compressor.compress(uncompressed_source)
81
81
 
metadata CHANGED
@@ -1,215 +1,203 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: middleman-more
3
- version: !ruby/object:Gem::Version
4
- hash: 15424119
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.0.0.rc.2
5
5
  prerelease: 6
6
- segments:
7
- - 3
8
- - 0
9
- - 0
10
- - rc
11
- - 1
12
- version: 3.0.0.rc.1
13
6
  platform: ruby
14
- authors:
7
+ authors:
15
8
  - Thomas Reynolds
16
9
  - Ben Hollis
17
10
  autorequire:
18
11
  bindir: bin
19
12
  cert_chain: []
20
-
21
- date: 2012-06-06 00:00:00 -07:00
22
- default_executable:
23
- dependencies:
24
- - !ruby/object:Gem::Dependency
25
- requirement: &id001 !ruby/object:Gem::Requirement
26
- none: false
27
- requirements:
28
- - - "="
29
- - !ruby/object:Gem::Version
30
- hash: 15424119
31
- segments:
32
- - 3
33
- - 0
34
- - 0
35
- - rc
36
- - 1
37
- version: 3.0.0.rc.1
38
- version_requirements: *id001
13
+ date: 2012-06-17 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
39
16
  name: middleman-core
40
- prerelease: false
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - '='
21
+ - !ruby/object:Gem::Version
22
+ version: 3.0.0.rc.2
41
23
  type: :runtime
42
- - !ruby/object:Gem::Dependency
43
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
44
26
  none: false
45
- requirements:
27
+ requirements:
28
+ - - '='
29
+ - !ruby/object:Gem::Version
30
+ version: 3.0.0.rc.2
31
+ - !ruby/object:Gem::Dependency
32
+ name: uglifier
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
35
+ requirements:
46
36
  - - ~>
47
- - !ruby/object:Gem::Version
48
- hash: 31
49
- segments:
50
- - 1
51
- - 2
52
- - 0
37
+ - !ruby/object:Gem::Version
53
38
  version: 1.2.0
54
- version_requirements: *id002
55
- name: uglifier
56
- prerelease: false
57
39
  type: :runtime
58
- - !ruby/object:Gem::Dependency
59
- requirement: &id003 !ruby/object:Gem::Requirement
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
60
42
  none: false
61
- requirements:
62
- - - ">="
63
- - !ruby/object:Gem::Version
64
- hash: 3
65
- segments:
66
- - 3
67
- - 1
68
- - 0
69
- version: 3.1.0
70
- version_requirements: *id003
43
+ requirements:
44
+ - - ~>
45
+ - !ruby/object:Gem::Version
46
+ version: 1.2.0
47
+ - !ruby/object:Gem::Dependency
71
48
  name: haml
72
- prerelease: false
49
+ requirement: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
54
+ version: 3.1.0
73
55
  type: :runtime
74
- - !ruby/object:Gem::Dependency
75
- requirement: &id004 !ruby/object:Gem::Requirement
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
76
58
  none: false
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- hash: 13
81
- segments:
82
- - 3
83
- - 1
84
- - 7
85
- version: 3.1.7
86
- version_requirements: *id004
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: 3.1.0
63
+ - !ruby/object:Gem::Dependency
87
64
  name: sass
88
- prerelease: false
65
+ requirement: !ruby/object:Gem::Requirement
66
+ none: false
67
+ requirements:
68
+ - - ! '>='
69
+ - !ruby/object:Gem::Version
70
+ version: 3.1.7
89
71
  type: :runtime
90
- - !ruby/object:Gem::Dependency
91
- requirement: &id005 !ruby/object:Gem::Requirement
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
92
74
  none: false
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- hash: 45
97
- segments:
98
- - 0
99
- - 12
100
- - 1
101
- version: 0.12.1
102
- version_requirements: *id005
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: 3.1.7
79
+ - !ruby/object:Gem::Dependency
103
80
  name: compass
104
- prerelease: false
81
+ requirement: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: 0.12.1
105
87
  type: :runtime
106
- - !ruby/object:Gem::Dependency
107
- requirement: &id006 !ruby/object:Gem::Requirement
88
+ prerelease: false
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: 0.12.1
95
+ - !ruby/object:Gem::Dependency
96
+ name: coffee-script
97
+ requirement: !ruby/object:Gem::Requirement
108
98
  none: false
109
- requirements:
99
+ requirements:
110
100
  - - ~>
111
- - !ruby/object:Gem::Version
112
- hash: 7
113
- segments:
114
- - 2
115
- - 2
116
- - 0
101
+ - !ruby/object:Gem::Version
117
102
  version: 2.2.0
118
- version_requirements: *id006
119
- name: coffee-script
120
- prerelease: false
121
103
  type: :runtime
122
- - !ruby/object:Gem::Dependency
123
- requirement: &id007 !ruby/object:Gem::Requirement
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
124
106
  none: false
125
- requirements:
107
+ requirements:
126
108
  - - ~>
127
- - !ruby/object:Gem::Version
128
- hash: 29
129
- segments:
130
- - 1
131
- - 3
132
- - 3
133
- version: 1.3.3
134
- version_requirements: *id007
109
+ - !ruby/object:Gem::Version
110
+ version: 2.2.0
111
+ - !ruby/object:Gem::Dependency
135
112
  name: coffee-script-source
136
- prerelease: false
113
+ requirement: !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ~>
117
+ - !ruby/object:Gem::Version
118
+ version: 1.3.3
137
119
  type: :runtime
138
- - !ruby/object:Gem::Dependency
139
- requirement: &id008 !ruby/object:Gem::Requirement
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
140
122
  none: false
141
- requirements:
123
+ requirements:
142
124
  - - ~>
143
- - !ruby/object:Gem::Version
144
- hash: 31
145
- segments:
146
- - 1
147
- - 3
148
- - 2
149
- version: 1.3.2
150
- version_requirements: *id008
125
+ - !ruby/object:Gem::Version
126
+ version: 1.3.3
127
+ - !ruby/object:Gem::Dependency
151
128
  name: execjs
152
- prerelease: false
129
+ requirement: !ruby/object:Gem::Requirement
130
+ none: false
131
+ requirements:
132
+ - - ~>
133
+ - !ruby/object:Gem::Version
134
+ version: 1.3.2
153
135
  type: :runtime
154
- - !ruby/object:Gem::Dependency
155
- requirement: &id009 !ruby/object:Gem::Requirement
136
+ prerelease: false
137
+ version_requirements: !ruby/object:Gem::Requirement
156
138
  none: false
157
- requirements:
139
+ requirements:
158
140
  - - ~>
159
- - !ruby/object:Gem::Version
160
- hash: 7
161
- segments:
162
- - 0
163
- - 6
164
- - 0
165
- version: 0.6.0
166
- version_requirements: *id009
141
+ - !ruby/object:Gem::Version
142
+ version: 1.3.2
143
+ - !ruby/object:Gem::Dependency
167
144
  name: maruku
168
- prerelease: false
145
+ requirement: !ruby/object:Gem::Requirement
146
+ none: false
147
+ requirements:
148
+ - - ~>
149
+ - !ruby/object:Gem::Version
150
+ version: 0.6.0
169
151
  type: :runtime
170
- - !ruby/object:Gem::Dependency
171
- requirement: &id010 !ruby/object:Gem::Requirement
152
+ prerelease: false
153
+ version_requirements: !ruby/object:Gem::Requirement
172
154
  none: false
173
- requirements:
155
+ requirements:
174
156
  - - ~>
175
- - !ruby/object:Gem::Version
176
- hash: 7
177
- segments:
178
- - 0
179
- - 6
180
- - 0
157
+ - !ruby/object:Gem::Version
181
158
  version: 0.6.0
182
- version_requirements: *id010
159
+ - !ruby/object:Gem::Dependency
183
160
  name: i18n
184
- prerelease: false
161
+ requirement: !ruby/object:Gem::Requirement
162
+ none: false
163
+ requirements:
164
+ - - ~>
165
+ - !ruby/object:Gem::Version
166
+ version: 0.6.0
185
167
  type: :runtime
186
- - !ruby/object:Gem::Dependency
187
- requirement: &id011 !ruby/object:Gem::Requirement
168
+ prerelease: false
169
+ version_requirements: !ruby/object:Gem::Requirement
188
170
  none: false
189
- requirements:
171
+ requirements:
190
172
  - - ~>
191
- - !ruby/object:Gem::Version
192
- hash: 59
193
- segments:
194
- - 0
195
- - 10
196
- - 6
197
- version: 0.10.6
198
- version_requirements: *id011
173
+ - !ruby/object:Gem::Version
174
+ version: 0.6.0
175
+ - !ruby/object:Gem::Dependency
199
176
  name: padrino-helpers
200
- prerelease: false
177
+ requirement: !ruby/object:Gem::Requirement
178
+ none: false
179
+ requirements:
180
+ - - ~>
181
+ - !ruby/object:Gem::Version
182
+ version: 0.10.6
201
183
  type: :runtime
202
- description: A static site generator. Provides dozens of templating languages (Haml, Sass, Compass, Slim, CoffeeScript, and more). Makes minification, compression, cache busting, Yaml data (and more) an easy part of your development cycle.
203
- email:
184
+ prerelease: false
185
+ version_requirements: !ruby/object:Gem::Requirement
186
+ none: false
187
+ requirements:
188
+ - - ~>
189
+ - !ruby/object:Gem::Version
190
+ version: 0.10.6
191
+ description: A static site generator. Provides dozens of templating languages (Haml,
192
+ Sass, Compass, Slim, CoffeeScript, and more). Makes minification, compression, cache
193
+ busting, Yaml data (and more) an easy part of your development cycle.
194
+ email:
204
195
  - me@tdreyno.com
205
196
  - ben@benhollis.net
206
197
  executables: []
207
-
208
198
  extensions: []
209
-
210
199
  extra_rdoc_files: []
211
-
212
- files:
200
+ files:
213
201
  - .gemtest
214
202
  - Rakefile
215
203
  - features/asset_hash.feature
@@ -229,9 +217,9 @@ files:
229
217
  - features/gzip.feature
230
218
  - features/helpers_auto_javascript_include_tag.feature
231
219
  - features/helpers_auto_stylesheet_link_tag.feature
220
+ - features/helpers_link_to.feature
232
221
  - features/helpers_lorem.feature
233
222
  - features/helpers_page_classes.feature
234
- - features/helpers_relative_link_to.feature
235
223
  - features/i18n_builder.feature
236
224
  - features/i18n_preview.feature
237
225
  - features/ignore.feature
@@ -591,43 +579,35 @@ files:
591
579
  - lib/middleman-more/extensions/relative_assets.rb
592
580
  - lib/middleman_extension.rb
593
581
  - middleman-more.gemspec
594
- has_rdoc: true
595
582
  homepage: http://middlemanapp.com
596
- licenses:
583
+ licenses:
597
584
  - MIT
598
585
  post_install_message:
599
586
  rdoc_options: []
600
-
601
- require_paths:
587
+ require_paths:
602
588
  - lib
603
- required_ruby_version: !ruby/object:Gem::Requirement
589
+ required_ruby_version: !ruby/object:Gem::Requirement
604
590
  none: false
605
- requirements:
606
- - - ">="
607
- - !ruby/object:Gem::Version
608
- hash: 3
609
- segments:
591
+ requirements:
592
+ - - ! '>='
593
+ - !ruby/object:Gem::Version
594
+ version: '0'
595
+ segments:
610
596
  - 0
611
- version: "0"
612
- required_rubygems_version: !ruby/object:Gem::Requirement
597
+ hash: 1457809501983501963
598
+ required_rubygems_version: !ruby/object:Gem::Requirement
613
599
  none: false
614
- requirements:
615
- - - ">"
616
- - !ruby/object:Gem::Version
617
- hash: 25
618
- segments:
619
- - 1
620
- - 3
621
- - 1
600
+ requirements:
601
+ - - ! '>'
602
+ - !ruby/object:Gem::Version
622
603
  version: 1.3.1
623
604
  requirements: []
624
-
625
605
  rubyforge_project:
626
- rubygems_version: 1.6.2
606
+ rubygems_version: 1.8.23
627
607
  signing_key:
628
608
  specification_version: 3
629
609
  summary: Hand-crafted frontend development
630
- test_files:
610
+ test_files:
631
611
  - features/asset_hash.feature
632
612
  - features/asset_host.feature
633
613
  - features/asset_host_compass.feature
@@ -645,9 +625,9 @@ test_files:
645
625
  - features/gzip.feature
646
626
  - features/helpers_auto_javascript_include_tag.feature
647
627
  - features/helpers_auto_stylesheet_link_tag.feature
628
+ - features/helpers_link_to.feature
648
629
  - features/helpers_lorem.feature
649
630
  - features/helpers_page_classes.feature
650
- - features/helpers_relative_link_to.feature
651
631
  - features/i18n_builder.feature
652
632
  - features/i18n_preview.feature
653
633
  - features/ignore.feature
@@ -988,3 +968,4 @@ test_files:
988
968
  - fixtures/wildcard-directory-index-app/source/index.html.erb
989
969
  - fixtures/wildcard-directory-index-app/source/layouts/admin.erb
990
970
  - fixtures/wildcard-directory-index-app/source/layouts/layout.erb
971
+ has_rdoc: