utopia 2.29.0 → 2.30.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d937ad3119c430d7176a16586dfecf3ab19f0cb8d2d70c69f50c18a360b8c37
4
- data.tar.gz: a147415518db0cef9228839be5a175244dd796691ede91018c7db8027d123611
3
+ metadata.gz: f3c3c6cc3fbfe2d3fe338f2cb4a7a2627e4f3902afdcacec288c0e4d82a546ae
4
+ data.tar.gz: 4a23a23f1c3ba3cd45c5bf588680e5ac420b1f0ca29092f60d390d96dae41058
5
5
  SHA512:
6
- metadata.gz: b519b2fa1b49640fc564de7f8e500e52cf78d469b7989e6a6f697f206f3cdd2f73693db8ea217f15e56aa5811e5062107105bfbc301fbfef4cb1fe64f17229fa
7
- data.tar.gz: 950946fe97760b4763288515a0fb3158f091b0059431fd210fcfc99359d399bed0fe9e9f2a6e73863076d9f5ad000783a405135724c612dc029feef9bef1a4a3
6
+ metadata.gz: 85f12ff61bd22ba66672493754b7fbb52da46ca97c89ee43a14741564c44409fda1a2999ab5e7708fc06738e04afcf11399fabc31b6878df736d578dd364dbf8
7
+ data.tar.gz: 9265ce8f026dcac35133c93007862d32be76789d9e976788a80d5ec63007c0663bbf1406a1356f26665db403923d23f84272fb13838c6a7ce3eb0bc09b473f09
checksums.yaml.gz.sig CHANGED
Binary file
@@ -38,6 +38,27 @@ module Utopia
38
38
  super()
39
39
  end
40
40
 
41
+ # @returns [Path] The original request path, if known.
42
+ def request_path
43
+ Path[request.env["REQUEST_PATH"]]
44
+ end
45
+
46
+ protected def current_base_uri_path
47
+ self.current.node.uri_path
48
+ end
49
+
50
+ # Compute the relative path from the curent base uri (e.g. the node being rendered) to the request uri. This path can be used to ensure resources are loaded relative to a given path.
51
+ #
52
+ # | Relative To | Request Path | Base URI |
53
+ # |---------------|------------------------|--------------|
54
+ # | "/page" | "/index" | "" |
55
+ # | "/blog/entry" | "/blog/2025/05/my-cat" | "../.." |
56
+ #
57
+ # @returns [String] the base uri for the current page.
58
+ def base_uri(relative_to = self.current_base_uri_path)
59
+ Path[relative_to].dirname.shortest_path(request_path)
60
+ end
61
+
41
62
  def [] key
42
63
  @attributes[key]
43
64
  end
@@ -2,8 +2,9 @@
2
2
 
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2014-2025, by Samuel Williams.
5
+ # Copyright, 2025, by Olle Jonsson.
5
6
 
6
- require 'console'
7
+ require "console"
7
8
 
8
9
  module Utopia
9
10
  module Exceptions
@@ -60,7 +60,7 @@ module Utopia
60
60
  def extract_extensions(mime_types)
61
61
  mime_types.select{|mime_type| !mime_type.obsolete?}.each do |mime_type|
62
62
  mime_type.extensions.each do |ext|
63
- @extensions["." + ext] = mime_type.content_type
63
+ @extensions["." + ext] ||= mime_type.content_type
64
64
  end
65
65
  end
66
66
  end
@@ -70,28 +70,20 @@ module Utopia
70
70
 
71
71
  def expand(types)
72
72
  types.each do |type|
73
- current_count = @extensions.size
74
-
75
- begin
76
- case type
77
- when Symbol
78
- self.expand(MIME_TYPES[type])
79
- when Array
80
- @extensions["." + type[0]] = type[1]
81
- when String
82
- self.extract_extensions MIME::Types.of(type)
83
- when Regexp
84
- self.extract_extensions MIME::Types[type]
85
- when MIME::Type
86
- self.extract_extensions.call([type])
87
- end
88
- rescue
89
- raise ExpansionError.new("#{self.class.name}: Error while processing #{type.inspect}!")
90
- end
91
-
92
- if @extensions.size == current_count
93
- raise ExpansionError.new("#{self.class.name}: Could not find any mime type for #{type.inspect}")
73
+ case type
74
+ when Symbol
75
+ self.expand(MIME_TYPES[type])
76
+ when Array
77
+ @extensions["." + type[0]] = type[1]
78
+ when String
79
+ self.extract_extensions MIME::Types.of(type)
80
+ when Regexp
81
+ self.extract_extensions MIME::Types[type]
82
+ when MIME::Type
83
+ self.extract_extensions.call([type])
94
84
  end
85
+ rescue
86
+ raise ExpansionError.new("#{self.class.name}: Error while processing #{type.inspect}!")
95
87
  end
96
88
  end
97
89
  end
@@ -1,8 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2009-2024, by Samuel Williams.
4
+ # Copyright, 2009-2025, by Samuel Williams.
5
5
 
6
6
  module Utopia
7
- VERSION = "2.29.0"
7
+ VERSION = "2.30.1"
8
8
  end
data/license.md CHANGED
@@ -2,9 +2,10 @@
2
2
 
3
3
  Copyright, 2009-2025, by Samuel Williams.
4
4
  Copyright, 2015-2019, by Huba Nagy.
5
- Copyright, 2020, by Olle Jonsson.
5
+ Copyright, 2020-2025, by Olle Jonsson.
6
6
  Copyright, 2020, by Pierre Montelle.
7
7
  Copyright, 2020, by Michael Adams.
8
+ Copyright, 2025, by Matt Quinn.
8
9
 
9
10
  Permission is hereby granted, free of charge, to any person obtaining a copy
10
11
  of this software and associated documentation files (the "Software"), to deal
data/readme.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Utopia is a website generation framework which provides a robust set of tools to build highly complex dynamic websites. It uses the filesystem heavily for content and provides functions for interacting with files and directories as structure representing the website.
4
4
 
5
- [![Development Status](https://github.com/ioquatix/utopia/workflows/Test/badge.svg)](https://github.com/ioquatix/utopia/actions?workflow=Test)
5
+ [![Development Status](https://github.com/socketry/utopia/workflows/Test/badge.svg)](https://github.com/socketry/utopia/actions?workflow=Test)
6
6
 
7
7
  ## Features
8
8
 
@@ -13,23 +13,27 @@ Utopia is a website generation framework which provides a robust set of tools to
13
13
 
14
14
  ## Usage
15
15
 
16
- Please see the [project documentation](https://github.com/ioquatix/utopia) for more details.
16
+ Please see the [project documentation](https://socketry.github.io/utopia/) for more details.
17
17
 
18
- - [Getting Started](https://github.com/ioquatix/utopiaguides/getting-started/index) - This guide explains how to set up a `utopia` website for local development and deployment.
18
+ - [Getting Started](https://socketry.github.io/utopia/guides/getting-started/index) - This guide explains how to set up a `utopia` website for local development and deployment.
19
19
 
20
- - [Middleware](https://github.com/ioquatix/utopiaguides/middleware/index) - This guide gives an overview of the different Rack middleware used by Utopia.
20
+ - [Middleware](https://socketry.github.io/utopia/guides/middleware/index) - This guide gives an overview of the different Rack middleware used by Utopia.
21
21
 
22
- - [Server Setup](https://github.com/ioquatix/utopiaguides/server-setup/index) - This guide explains how to deploy a `utopia` web application.
22
+ - [Server Setup](https://socketry.github.io/utopia/guides/server-setup/index) - This guide explains how to deploy a `utopia` web application.
23
23
 
24
- - [Installing JavaScript Libraries](https://github.com/ioquatix/utopiaguides/integrating-with-javascript/index) - Utopia integrates with Yarn and provides a [bake task](https://github.com/ioquatix/bake) to simplify deployment packages distributed using `yarn` that implement the `dist` sub-directory convention.
24
+ - [Installing JavaScript Libraries](https://socketry.github.io/utopia/guides/integrating-with-javascript/index) - Utopia integrates with Yarn and provides a [bake task](https://github.com/ioquatix/bake) to simplify deployment packages distributed using `yarn` that implement the `dist` sub-directory convention.
25
25
 
26
- - [What is XNode?](https://github.com/ioquatix/utopiaguides/what-is-xnode/index) - This guide explains the `xnode` view layer and how it can be used to build efficient websites.
26
+ - [What is XNode?](https://socketry.github.io/utopia/guides/what-is-xnode/index) - This guide explains the `xnode` view layer and how it can be used to build efficient websites.
27
27
 
28
- - [Updating Utopia](https://github.com/ioquatix/utopiaguides/updating-utopia/index) - This guide explains how to update existing `utopia` websites.
28
+ - [Updating Utopia](https://socketry.github.io/utopia/guides/updating-utopia/index) - This guide explains how to update existing `utopia` websites.
29
29
 
30
30
  ## Releases
31
31
 
32
- Please see the [project releases](https://github.com/ioquatix/utopiareleases/index) for all releases.
32
+ Please see the [project releases](https://socketry.github.io/utopia/releases/index) for all releases.
33
+
34
+ ### v2.30.1
35
+
36
+ - Minor compatibility fixes.
33
37
 
34
38
  ### v2.27.0
35
39
 
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v2.30.1
4
+
5
+ - Minor compatibility fixes.
6
+
3
7
  ## v2.27.0
4
8
 
5
9
  - Improved error logging using `Console` gem.
@@ -61,7 +61,7 @@ end
61
61
  puts "Deploying to #{GIT_WORK_TREE} as #{DEPLOY_USER}:#{DEPLOY_GROUP}..."
62
62
  Dir.chdir(GIT_WORK_TREE) do
63
63
  sudo %W{git checkout -f}
64
- sudo %W{git submodule update -i}
64
+ sudo %W{git submodule update --init}
65
65
 
66
66
  if File.exist? "gems.rb"
67
67
  sudo %W{bundle install}
data/setup/site/Guardfile CHANGED
@@ -3,6 +3,7 @@
3
3
  group :development do
4
4
  guard :falcon, port: 9292 do
5
5
  watch("Gemfile.lock")
6
+ watch("gems.locked")
6
7
  watch("config.ru")
7
8
  watch(%r{^config|lib|pages/.*})
8
9
 
@@ -9,7 +9,7 @@
9
9
  <title>Utopia</title>
10
10
  <?r end ?>
11
11
 
12
- <base href="#{first.node.uri_path}"/>
12
+ <base href="#{document.base_uri}"/>
13
13
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
14
14
 
15
15
  <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous" />
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,11 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utopia
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.29.0
4
+ version: 2.30.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  - Huba Nagy
9
+ - Matt Quinn
9
10
  - Michael Adams
10
11
  - Olle Jonsson
11
12
  - Pierre Montelle
@@ -40,7 +41,7 @@ cert_chain:
40
41
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
41
42
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
42
43
  -----END CERTIFICATE-----
43
- date: 2025-03-08 00:00:00.000000000 Z
44
+ date: 1980-01-02 00:00:00.000000000 Z
44
45
  dependencies:
45
46
  - !ruby/object:Gem::Dependency
46
47
  name: bake
@@ -98,6 +99,20 @@ dependencies:
98
99
  - - "~>"
99
100
  - !ruby/object:Gem::Version
100
101
  version: '2.1'
102
+ - !ruby/object:Gem::Dependency
103
+ name: irb
104
+ requirement: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ type: :runtime
110
+ prerelease: false
111
+ version_requirements: !ruby/object:Gem::Requirement
112
+ requirements:
113
+ - - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: '0'
101
116
  - !ruby/object:Gem::Dependency
102
117
  name: mail
103
118
  requirement: !ruby/object:Gem::Requirement
@@ -303,12 +318,13 @@ files:
303
318
  - setup/site/public/readme.txt
304
319
  - setup/site/readme.md
305
320
  - setup/site/test/website.rb
306
- homepage: https://github.com/ioquatix/utopia
321
+ homepage: https://github.com/socketry/utopia
307
322
  licenses:
308
323
  - MIT
309
324
  metadata:
325
+ documentation_uri: https://socketry.github.io/utopia/
310
326
  funding_uri: https://github.com/sponsors/ioquatix/
311
- source_code_uri: https://github.com/ioquatix/utopia.git
327
+ source_code_uri: https://github.com/socketry/utopia.git
312
328
  rdoc_options: []
313
329
  require_paths:
314
330
  - lib
@@ -316,14 +332,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
316
332
  requirements:
317
333
  - - ">="
318
334
  - !ruby/object:Gem::Version
319
- version: '3.1'
335
+ version: '3.2'
320
336
  required_rubygems_version: !ruby/object:Gem::Requirement
321
337
  requirements:
322
338
  - - ">="
323
339
  - !ruby/object:Gem::Version
324
340
  version: '0'
325
341
  requirements: []
326
- rubygems_version: 3.6.2
342
+ rubygems_version: 3.7.0.dev
327
343
  specification_version: 4
328
344
  summary: Utopia is a framework for building dynamic content-driven websites.
329
345
  test_files: []
metadata.gz.sig CHANGED
Binary file