hydeweb 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/HISTORY.md +5 -0
  2. data/lib/hyde/page.rb +7 -2
  3. data/lib/hyde.rb +1 -1
  4. metadata +1 -1
data/HISTORY.md CHANGED
@@ -1,3 +1,8 @@
1
+ v0.1.13
2
+ -------
3
+
4
+ - Try to fix an edge case where the path '/' gives you an arbitrary dotfile.
5
+
1
6
  v0.1.11
2
7
  -------
3
8
 
data/lib/hyde/page.rb CHANGED
@@ -10,6 +10,9 @@ class Page
10
10
  site = lambda { |*x| File.join site_path, *(x.compact) }
11
11
  try = lambda { |_id| p = new(_id, project); p if p.exists? }
12
12
 
13
+ # For paths like '/' or '/hello/'
14
+ nonfile = File.basename(id).gsub('/','').empty?
15
+
13
16
  # Account for:
14
17
  # ~/mysite/site/about/us.html.haml
15
18
  # about/us.html.haml => ~/mysite/site/about/us.html.haml
@@ -19,8 +22,10 @@ class Page
19
22
  #
20
23
  page = try[id]
21
24
  page ||= try[site[id]]
22
- page ||= try[Dir[site["#{id}.*"]].first]
23
- page ||= try[Dir[site["#{id.to_s.sub(/\.[^\.]*/,'')}.*"]].first]
25
+ unless nonfile
26
+ page ||= try[Dir[site["#{id}.*"]].first]
27
+ page ||= try[Dir[site["#{id.to_s.sub(/\.[^\.]*/,'')}.*"]].first]
28
+ end
24
29
  page ||= try[Dir[site[id, "index.*"]].first]
25
30
 
26
31
  # Subclass
data/lib/hyde.rb CHANGED
@@ -15,7 +15,7 @@ require 'shake'
15
15
  Tilt.mappings['html'] = Tilt.mappings['erb']
16
16
 
17
17
  class Hyde
18
- VERSION = "0.1.12"
18
+ VERSION = "0.1.13"
19
19
  PREFIX = File.expand_path('../', __FILE__)
20
20
 
21
21
  Error = Class.new(StandardError)
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: hydeweb
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.12
5
+ version: 0.1.13
6
6
  platform: ruby
7
7
  authors:
8
8
  - Rico Sta. Cruz