utopia 0.9.60 → 0.9.61

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.
@@ -52,12 +52,12 @@ module Utopia
52
52
  end
53
53
 
54
54
  def href
55
- if @info[:uri]
56
- return @info[:uri]
57
- elsif @path
58
- return @path.to_s
59
- else
60
- nil
55
+ @info.fetch(:uri) do
56
+ if @path
57
+ @path.to_s
58
+ else
59
+ nil
60
+ end
61
61
  end
62
62
  end
63
63
 
@@ -161,7 +161,7 @@ module Utopia
161
161
 
162
162
  directory_link = Link.new(:directory, top + [filename, index_name], index_metadata)
163
163
 
164
- # Check for localized directory metadata and update the link
164
+ # Check for localized directory metadata and update the link:
165
165
  if directory_link.locale
166
166
  localized_metadata = metadata.delete(name + "." + directory_link.locale)
167
167
 
@@ -176,7 +176,8 @@ module Utopia
176
176
  end
177
177
 
178
178
  if indices == 0
179
- links << Link.new(:directory, top + [filename, ""], directory_metadata)
179
+ # Specify a nil uri if no index could be found for the directory:
180
+ links << Link.new(:directory, top + [filename, ""], {'uri' => nil}.merge(directory_metadata))
180
181
  end
181
182
  elsif filename.match(INDEX_XNODE_FILTER) && options[:indices] == false
182
183
  name = $1
@@ -193,8 +194,7 @@ module Utopia
193
194
 
194
195
  if options[:virtual]
195
196
  metadata.each do |name, details|
196
- # Given a virtual named such as "welcome.cn", merge it with metadata
197
- # from "welcome" if it exists.
197
+ # Given a virtual named such as "welcome.cn", merge it with metadata from "welcome" if it exists:
198
198
  basename, locale = name.split(".", 2)
199
199
 
200
200
  if virtual_metadata[basename]
@@ -35,8 +35,8 @@ module Utopia
35
35
  read_file = lambda { Trenni.new(File.read(path), path) }
36
36
 
37
37
  if @files
38
- @files.fetch(path) do
39
- @files[path] = read_file.call
38
+ @files.fetch(path) do |key|
39
+ @files[key] = read_file.call
40
40
  end
41
41
  else
42
42
  read_file.call
@@ -6,7 +6,7 @@ module Utopia
6
6
  module VERSION
7
7
  MAJOR = 0
8
8
  MINOR = 9
9
- TINY = 60
9
+ TINY = 61
10
10
 
11
11
  STRING = [MAJOR, MINOR, TINY].join('.')
12
12
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 9
8
- - 60
9
- version: 0.9.60
8
+ - 61
9
+ version: 0.9.61
10
10
  platform: ruby
11
11
  authors:
12
12
  - Samuel Williams