utopia 2.17.0 → 2.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/utopia/path.rb +10 -2
- data/lib/utopia/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 271df583d52d5b53718ed38a322b2ed66d73d1e8ecfe460f18961e156ce92d10
|
4
|
+
data.tar.gz: eaa41f80ca7244853bb1a08acc9ca0b1d76932e1cc3ebff58771fee1686eb4a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9d8cef96cde92e960559a9618d447512ec35905b75cb67a116899607181db2c7bc4de457fe7739a8aea20cd98f9f1e7ee56e33656cc84873aaacc1f4337e22a
|
7
|
+
data.tar.gz: 4b6df56fabfc179ca95c11db76e31689ec722c1bdd6d1f430e5ce8f0a2d613d390bcee7f22b4399f59311c7ed2dc1843a706da49fc63af03f745319b0e0c322b
|
data/lib/utopia/path.rb
CHANGED
@@ -237,6 +237,7 @@ module Utopia
|
|
237
237
|
return self.class.new(result)
|
238
238
|
end
|
239
239
|
|
240
|
+
# Returns the first path component.
|
240
241
|
def first
|
241
242
|
if absolute?
|
242
243
|
@components[1]
|
@@ -245,12 +246,19 @@ module Utopia
|
|
245
246
|
end
|
246
247
|
end
|
247
248
|
|
249
|
+
# Returns the last path component.
|
248
250
|
def last
|
249
|
-
@components
|
251
|
+
if @components != ['']
|
252
|
+
@components.last
|
253
|
+
end
|
250
254
|
end
|
251
255
|
|
256
|
+
# Pops the last path component.
|
252
257
|
def pop
|
253
|
-
|
258
|
+
# We don't want to convert an absolute path to a relative path.
|
259
|
+
if @components != ['']
|
260
|
+
@components.pop
|
261
|
+
end
|
254
262
|
end
|
255
263
|
|
256
264
|
# @return [String] the last path component without any file extension.
|
data/lib/utopia/version.rb
CHANGED
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.17.
|
4
|
+
version: 2.17.1
|
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-06-
|
11
|
+
date: 2020-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|