utopia 2.18.4 → 2.18.5

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
  SHA256:
3
- metadata.gz: 7d3b6e619bc7db476e12fb64c15765a84349a8aabc6ee8b2b4e46a8ea80936e4
4
- data.tar.gz: 3fe0eeafcf89805747e888122545ac3ab73e0a87a61f6a157eb8c7a86a442135
3
+ metadata.gz: 526a3c6e7bb9c6d338f6b48e0a2967b9c0d5388206059904efd111600c9c9b37
4
+ data.tar.gz: dd9cb6a66793cd0d621cb6edc843480f0297ef594c2750bacc203c3649091fac
5
5
  SHA512:
6
- metadata.gz: 1a3a7677b5ee5f54ceb5267614f46ca8791d6ac5db62db29485e9392cb993e4b6e39ab6be6a1bbbd9faa7182368612f3347cf4faa769e44ad00d35b9c2abe99b
7
- data.tar.gz: 5f9b615c2fe980279cbc0a5516d0e69e7c94af88805dce6d1c5409b860b5fb2be29f575da05c21aa750056232ef95c0fb802a789cc6630b24ff3fcd8514d0d49
6
+ metadata.gz: 3ae7de79938757ecd86a84d35a56d1185955812ab41cc0e29d44a6604ef669bfadbc52f36390e1d19cf53acc7a1f375cf59d484627d899c8ed3bdf3bb78b9927
7
+ data.tar.gz: 9d193e4f88eb12f346371c738396b555b94315f9dcdd004d9395cff0229887f37ad6f22ee5c87d86a12aa9e65b9ecd174005348e495e14ffda76ad57b930e8c5
data/bake/utopia/node.rb CHANGED
@@ -15,9 +15,11 @@ def update
15
15
 
16
16
  install_root = root + "public/_components"
17
17
 
18
- package_root.children.select(&:directory?).collect(&:basename).each do |package_directory|
18
+ package_paths = expand_package_paths(package_root)
19
+
20
+ package_paths.each do |package_path|
21
+ package_directory = package_path.relative_path_from(package_root)
19
22
  install_path = install_root + package_directory
20
- package_path = package_root + package_directory
21
23
 
22
24
  dist_path = package_path + 'dist'
23
25
 
@@ -34,3 +36,21 @@ def update
34
36
  FileUtils::Verbose.cp_r File.expand_path(link_path, install_path), install_path
35
37
  end
36
38
  end
39
+
40
+ private
41
+
42
+ def expand_package_paths(root, into = [])
43
+ paths = root.children.select(&:directory?)
44
+
45
+ paths.each do |path|
46
+ basename = path.basename.to_s
47
+ # Handle organisation sub-directories which start with an '@' symbol:
48
+ if basename.start_with?('@')
49
+ expand_package_paths(path, into)
50
+ else
51
+ into << path
52
+ end
53
+ end
54
+
55
+ return into
56
+ end
data/lib/.DS_Store ADDED
Binary file
Binary file
@@ -92,7 +92,7 @@ module Utopia
92
92
  end
93
93
  end
94
94
 
95
- # @param path [Path] the request_path is an absolute uri path, e.g. `/foo/bar`. If an xnode file exists on disk for this exact path, it is instantiated, otherwise nil.
95
+ # @param path [Path] the request path is an absolute uri path, e.g. `/foo/bar`. If an xnode file exists on disk for this exact path, it is instantiated, otherwise nil.
96
96
  def lookup_node(path, locale = nil)
97
97
  resolve_link(
98
98
  @links.for(path, locale)
@@ -100,11 +100,9 @@ module Utopia
100
100
  end
101
101
 
102
102
  def resolve_link(link)
103
- if path = link&.path
104
- full_path = File.join(@root, path.dirname, link.key + XNODE_EXTENSION)
105
-
103
+ if full_path = link&.full_path(@root)
106
104
  if File.exist?(full_path)
107
- return Node.new(self, path, path, full_path)
105
+ return Node.new(self, link.path, link.path, full_path)
108
106
  end
109
107
  end
110
108
  end
Binary file
@@ -50,6 +50,12 @@ module Utopia
50
50
  end
51
51
  end
52
52
 
53
+ def full_path(root, extension = XNODE_EXTENSION)
54
+ if @path&.file?
55
+ File.join(root, @path.dirname, self.key + XNODE_EXTENSION)
56
+ end
57
+ end
58
+
53
59
  def href
54
60
  @href ||= @info.fetch(:uri) do
55
61
  @info.fetch(:href) do
Binary file
data/lib/utopia/path.rb CHANGED
@@ -136,6 +136,10 @@ module Utopia
136
136
  return @components.last == ''
137
137
  end
138
138
 
139
+ def file?
140
+ return @components.last != ''
141
+ end
142
+
139
143
  def to_directory
140
144
  if directory?
141
145
  return self
@@ -259,6 +263,8 @@ module Utopia
259
263
  end
260
264
  end
261
265
 
266
+ alias last? file?
267
+
262
268
  # Pops the last path component.
263
269
  def pop
264
270
  # We don't want to convert an absolute path to a relative path.
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Utopia
24
- VERSION = "2.18.4"
24
+ VERSION = "2.18.5"
25
25
  end
data/setup/.DS_Store ADDED
Binary file
Binary file
Binary file
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.18.4
4
+ version: 2.18.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-19 00:00:00.000000000 Z
11
+ date: 2021-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -261,12 +261,15 @@ files:
261
261
  - bake/utopia/static.rb
262
262
  - bake/utopia/test.rb
263
263
  - bin/utopia
264
+ - lib/.DS_Store
264
265
  - lib/utopia.rb
266
+ - lib/utopia/.DS_Store
265
267
  - lib/utopia/command.rb
266
268
  - lib/utopia/command/environment.rb
267
269
  - lib/utopia/command/server.rb
268
270
  - lib/utopia/command/site.rb
269
271
  - lib/utopia/content.rb
272
+ - lib/utopia/content/.DS_Store
270
273
  - lib/utopia/content/document.rb
271
274
  - lib/utopia/content/link.rb
272
275
  - lib/utopia/content/links.rb
@@ -277,6 +280,7 @@ files:
277
280
  - lib/utopia/content/tags.rb
278
281
  - lib/utopia/content_length.rb
279
282
  - lib/utopia/controller.rb
283
+ - lib/utopia/controller/.DS_Store
280
284
  - lib/utopia/controller/actions.md
281
285
  - lib/utopia/controller/actions.rb
282
286
  - lib/utopia/controller/base.rb
@@ -307,7 +311,10 @@ files:
307
311
  - lib/utopia/static/local_file.rb
308
312
  - lib/utopia/static/mime_types.rb
309
313
  - lib/utopia/version.rb
314
+ - setup/.DS_Store
315
+ - setup/server/.DS_Store
310
316
  - setup/server/git/hooks/post-receive
317
+ - setup/site/.DS_Store
311
318
  - setup/site/.gitignore
312
319
  - setup/site/.rspec
313
320
  - setup/site/Guardfile
@@ -319,12 +326,14 @@ files:
319
326
  - setup/site/falcon.rb
320
327
  - setup/site/gems.rb
321
328
  - setup/site/lib/readme.txt
329
+ - setup/site/pages/.DS_Store
322
330
  - setup/site/pages/_heading.xnode
323
331
  - setup/site/pages/_page.xnode
324
332
  - setup/site/pages/errors/exception.xnode
325
333
  - setup/site/pages/errors/file-not-found.xnode
326
334
  - setup/site/pages/links.yaml
327
335
  - setup/site/pages/welcome/index.xnode
336
+ - setup/site/public/.DS_Store
328
337
  - setup/site/public/_static/icon.svg
329
338
  - setup/site/public/_static/site.css
330
339
  - setup/site/public/_static/utopia-background.svg
@@ -333,6 +342,7 @@ files:
333
342
  - setup/site/spec/spec_helper.rb
334
343
  - setup/site/spec/website_context.rb
335
344
  - setup/site/spec/website_spec.rb
345
+ - setup/site/tmp/Gemfile
336
346
  homepage: https://github.com/ioquatix/utopia
337
347
  licenses:
338
348
  - MIT
@@ -353,7 +363,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
353
363
  - !ruby/object:Gem::Version
354
364
  version: '0'
355
365
  requirements: []
356
- rubygems_version: 3.1.2
366
+ rubygems_version: 3.2.3
357
367
  signing_key:
358
368
  specification_version: 4
359
369
  summary: Utopia is a framework for building dynamic content-driven websites.