middleman-more 3.0.10.pre.1 → 3.0.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,6 +11,7 @@ Feature: Directory Index
11
11
  | wildcard_leave_me_alone.html |
12
12
  | regular/index.html |
13
13
  | .htaccess |
14
+ | .htpasswd |
14
15
  Then the following files should not exist:
15
16
  | egular/index/index.html |
16
17
  | needs_index.html |
@@ -1,6 +1,6 @@
1
- Feature: SASS .sass_cache custom location
1
+ Feature: SASS .sass-cache custom location
2
2
 
3
- Scenario: Using the default location for .sass_cache folder
3
+ Scenario: Using the default location for .sass-cache folder
4
4
  Given the Server is running at "sass-cache-path-default-app"
5
5
 
6
6
  When I go to "/stylesheets/plain.css"
@@ -10,10 +10,10 @@ Feature: SASS .sass_cache custom location
10
10
  # Not sure how to test this location, as the directory is stored outside of the app root
11
11
  # during testing, but inside app root in "production"
12
12
 
13
- # Then a directory named ".sass_cache" should exist
13
+ # Then a directory named ".sass-cache" should exist
14
14
 
15
15
 
16
- Scenario: Using a custom location for .sass_cache folder
16
+ Scenario: Using a custom location for .sass-cache folder
17
17
  Given the Server is running at "sass-cache-path-custom-app"
18
18
 
19
19
  When I go to "/stylesheets/plain.css"
@@ -0,0 +1 @@
1
+ # .htpasswd
@@ -1,3 +1,3 @@
1
1
 
2
2
  # Using default setting
3
- # set :sass_cache_path, File.join(Dir.pwd, '.sass_cache')
3
+ # set :sass_cache_path, File.join(Dir.pwd, '.sass-cache')
@@ -13,12 +13,7 @@ module Middleman
13
13
 
14
14
  # Needed for helpers as well
15
15
  app.after_configuration do
16
- locales_glob = File.join(locales_dir, "*.yml");
17
-
18
- ::I18n.load_path += Dir[File.join(root, locales_glob)]
19
- ::I18n.reload!
20
-
21
- Localizer.new(self, locales_glob, options)
16
+ Localizer.new(self, options)
22
17
  end
23
18
  end
24
19
  alias :included :registered
@@ -29,12 +24,19 @@ module Middleman
29
24
  attr_reader :app
30
25
  delegate :logger, :to => :app
31
26
 
32
- def initialize(app, locales_glob, options={})
27
+ def initialize(app, options={})
33
28
  @app = app
34
- @locales_glob = locales_glob
29
+ @locales_glob = File.join(app.locales_dir, "**", "*.{rb,yml}")
30
+
31
+ regex = @locales_glob.sub(/\./, '\.').sub(File.join("**", "*"), ".*").sub(/\//, '\/').sub("{rb,yml}", "rb|yml")
32
+ @locales_regex = %r{^#{regex}}
33
+
35
34
  @maps = {}
36
35
  @options = options
37
36
 
37
+ ::I18n.load_path += Dir[File.join(app.root, @locales_glob)]
38
+ ::I18n.reload!
39
+
38
40
  @lang_map = @options[:lang_map] || {}
39
41
  @path = @options[:path] || "/:locale/"
40
42
  @templates_dir = @options[:templates_dir] || "localizable"
@@ -71,7 +73,7 @@ module Middleman
71
73
  end
72
74
 
73
75
  def on_file_changed(file)
74
- if File.fnmatch(@locales_glob, file)
76
+ if @locales_regex.match(file)
75
77
  ::I18n.reload!
76
78
  end
77
79
  end
@@ -79,7 +81,7 @@ module Middleman
79
81
  def langs
80
82
  @options[:langs] || begin
81
83
  Dir[File.join(@app.root, @locales_glob)].map { |file|
82
- File.basename(file).gsub(".yml", "")
84
+ File.basename(file).sub(/\.yml$/, "").sub(/\.rb$/, "")
83
85
  }.sort.map(&:to_sym)
84
86
  end
85
87
  end
@@ -7,7 +7,7 @@ module Middleman
7
7
  require 'rack/test'
8
8
  require 'uri'
9
9
 
10
- exts = options[:exts] || %w(.jpg .jpeg .png .gif .js .css)
10
+ exts = options[:exts] || %w(.jpg .jpeg .png .gif .js .css .otf .woff .eot .ttf .svg)
11
11
 
12
12
  # Allow specifying regexes to ignore, plus always ignore apple touch icons
13
13
  ignore = Array(options[:ignore]) << /^apple-touch-icon/
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.10.pre.1
5
- prerelease: 7
4
+ version: 3.0.11
5
+ prerelease:
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: 2013-01-09 00:00:00.000000000 Z
13
+ date: 2013-01-23 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.10.pre.1
22
+ version: 3.0.11
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.10.pre.1
30
+ version: 3.0.11
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: uglifier
33
33
  requirement: !ruby/object:Gem::Requirement
@@ -371,6 +371,7 @@ files:
371
371
  - fixtures/implied-extensions-app/source/test4.liquid
372
372
  - fixtures/indexable-app/config.rb
373
373
  - fixtures/indexable-app/source/.htaccess
374
+ - fixtures/indexable-app/source/.htpasswd
374
375
  - fixtures/indexable-app/source/a_folder/needs_index.html
375
376
  - fixtures/indexable-app/source/leave_me_alone.html
376
377
  - fixtures/indexable-app/source/needs_index.html
@@ -641,13 +642,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
641
642
  version: '0'
642
643
  segments:
643
644
  - 0
644
- hash: -1552576789193238252
645
+ hash: 1634045275272907332
645
646
  required_rubygems_version: !ruby/object:Gem::Requirement
646
647
  none: false
647
648
  requirements:
648
- - - ! '>'
649
+ - - ! '>='
649
650
  - !ruby/object:Gem::Version
650
- version: 1.3.1
651
+ version: '0'
652
+ segments:
653
+ - 0
654
+ hash: 1634045275272907332
651
655
  requirements: []
652
656
  rubyforge_project:
653
657
  rubygems_version: 1.8.24
@@ -824,6 +828,7 @@ test_files:
824
828
  - fixtures/implied-extensions-app/source/test4.liquid
825
829
  - fixtures/indexable-app/config.rb
826
830
  - fixtures/indexable-app/source/.htaccess
831
+ - fixtures/indexable-app/source/.htpasswd
827
832
  - fixtures/indexable-app/source/a_folder/needs_index.html
828
833
  - fixtures/indexable-app/source/leave_me_alone.html
829
834
  - fixtures/indexable-app/source/needs_index.html