standard_path 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/standard_path.rb +19 -2
- 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: fb25f68c9afbe80376afa4c0aa97b5044812be8fccc689aa22ebbbd9cb17744c
|
4
|
+
data.tar.gz: 31bf5bb8ed44a16b4370d6a38e9be7c539105a47356538bc8740b887ac49c774
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ab936cbdedf5fd9684127a3fa8bc5ca21de5bd54d2ff556c8ca8fb8f0fdbb68e5e2dcf44d8ae6531ca42d024e3b38169ff8830d22d2bd33094ef484b08870f6
|
7
|
+
data.tar.gz: 9d72136d45a8dbdf1b99a3a2ff774662d2742f31927f6b243fecbfb544484f1b5d6f60b7b2a548aa053678350355aee36902554fb9eb4fce2f83d4815afa0898
|
data/README.md
CHANGED
@@ -18,6 +18,8 @@ StandardPath.app_local_data(my_app)
|
|
18
18
|
|
19
19
|
## APIs
|
20
20
|
|
21
|
+
- `.os`
|
22
|
+
|
21
23
|
- `.desktop`
|
22
24
|
- `.documents`
|
23
25
|
- `.downloads`
|
@@ -29,3 +31,4 @@ StandardPath.app_local_data(my_app)
|
|
29
31
|
- `.app_local_data(name)`
|
30
32
|
- `.app_config(name)`
|
31
33
|
- `.app_cache(name)`
|
34
|
+
- `.app_temp(name)`
|
data/lib/standard_path.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# File : standard_path.rb
|
3
3
|
# Authors : Aoran Zeng <ccmywish@qq.com>
|
4
4
|
# Created on : <2023-05-19>
|
5
|
-
# Last modified : <2023-05-
|
5
|
+
# Last modified : <2023-05-29>
|
6
6
|
#
|
7
7
|
# stardard_path:
|
8
8
|
#
|
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
module StandardPath
|
13
13
|
|
14
|
-
VERSION = "0.1.
|
14
|
+
VERSION = "0.1.1"
|
15
15
|
|
16
16
|
OSes = ['Windows', 'macOS', 'Linux']
|
17
17
|
|
@@ -168,4 +168,21 @@ class << StandardPath
|
|
168
168
|
File.expand_path base
|
169
169
|
end
|
170
170
|
|
171
|
+
|
172
|
+
def app_temp(app, os = self.os)
|
173
|
+
base = case os
|
174
|
+
when 'Windows'
|
175
|
+
File.join "~/AppData/Local/Temp", app
|
176
|
+
when 'macOS'
|
177
|
+
# NOTE: I'm not sure if this dir is the most proper for macOS
|
178
|
+
# Please affirm or fix it if you are sure.
|
179
|
+
File.join "/tmp", app
|
180
|
+
when 'Linux'
|
181
|
+
File.join '/tmp', app
|
182
|
+
else
|
183
|
+
raise NotSupportedOS, "#{self.name} doesn't know about #{__method__} path of '#{os}' you specify"
|
184
|
+
end
|
185
|
+
File.expand_path base
|
186
|
+
end
|
187
|
+
|
171
188
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: standard_path
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aoran Zeng
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: 'Standard Path for corss-platform gems.
|
14
14
|
|