user_space 5.1.210201 → 5.2.230101

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/user_space.rb +10 -5
  4. metadata +8 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c868edf8d004a22ff97fc912b5562df08524a5b7a0369531758e302ae9b323bf
4
- data.tar.gz: f1cd273b38bcb8209128ce601a9165404a287cecf9852678e9a20541c4d949e4
3
+ metadata.gz: 15bcbcaf8c33f6b4617fc2e741d1a92a76ec853c5c84d4fe1af2275eeb38c182
4
+ data.tar.gz: db186a8bb9e973a67a2bc7c60e45892f199b0b4f1f8a66f1429dc9bd9eb04a62
5
5
  SHA512:
6
- metadata.gz: dbd37a67613e70b2f8490d6c70962cf6e364f5e866b65b576109392c40b820cd84857a2edde91ba5d79e4bedab2ee12a12ba037e717b55e7dde9bc0dd71347f7
7
- data.tar.gz: b810e6a240efa6c022045e4b49b9b7de2a6e64fa8c0c9a60cdaf5e767383591441da1aae90781864ef0ad1ba85ff52d350dd6deb9aa701a34e9aa88c48132244
6
+ metadata.gz: 6e63e0fed526746c8a0d3b5c9c3871c07bf14cc60aa58420cdaa615199dc7ee4c3d2a03371edda251908f707de43e1053302870beaadf81171cb30397a34f041
7
+ data.tar.gz: c25f00f3e448e3d5ad0f68b2190e351d8dc8767cb8f6d834657c4db70279b1910ef08c0e5732d58cfa4477b51430e9f59919f596138d0f4c1b99a4cf8d642044
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # UserSpace
2
2
 
3
- * [VERSION 5.1.210201](https://github.com/carlosjhr64/user_space/releases)
3
+ * [VERSION 5.2.230101](https://github.com/carlosjhr64/user_space/releases)
4
4
  * [github](https://www.github.com/carlosjhr64/user_space)
5
5
  * [rubygems](https://rubygems.org/gems/user_space)
6
6
 
@@ -52,7 +52,7 @@ $ gem install user_space
52
52
 
53
53
  (The MIT License)
54
54
 
55
- Copyright (c) 2021 CarlosJHR64
55
+ Copyright (c) 2023 CarlosJHR64
56
56
 
57
57
  Permission is hereby granted, free of charge, to any person obtaining
58
58
  a copy of this software and associated documentation files (the
data/lib/user_space.rb CHANGED
@@ -3,15 +3,18 @@ require 'fileutils'
3
3
  #`ruby`
4
4
 
5
5
  class UserSpace
6
- VERSION = '5.1.210201'
6
+ VERSION = '5.2.230101'
7
7
  XDG = {
8
8
  'cache' => ENV['XDG_CACHE_HOME'] || File.expand_path('~/.cache'),
9
9
  'config' => ENV['XDG_CONFIG_HOME'] || File.expand_path('~/.config'),
10
10
  'data' => ENV['XDG_DATA_HOME'] || File.expand_path('~/.local/share'),
11
11
  }
12
12
 
13
- def self.appdir(lib='/lib')
14
- (_ = caller(1..2)[-1]&.split(':',2)&.fetch(0)) and File.dirname(File.dirname(File.expand_path(_)))&.chomp(lib)
13
+ APPDIR = lambda{
14
+ File.dirname(File.expand_path(_1)).sub(%r([/\\]lib$),'')}
15
+
16
+ def UserSpace.appdir(dir=File.dirname(caller(1..2)[-1].split(':',2).fetch(0)))
17
+ APPDIR[dir]
15
18
  end
16
19
 
17
20
  attr_reader :parser,:ext,:appname,:xdgbases,:appdir,:cfg
@@ -21,7 +24,8 @@ class UserSpace
21
24
  appname: File.basename($0),
22
25
  xdgbases: ['cache', 'config', 'data'],
23
26
  config: 'config')
24
- @parser,@ext,@appname,@xdgbases,@appdir,@cfg = parser,ext,appname,xdgbases,appdir,config
27
+ @parser,@ext,@appname,@xdgbases,@appdir,@cfg =
28
+ parser,ext,appname,xdgbases,appdir,config
25
29
  install
26
30
  end
27
31
 
@@ -93,7 +97,8 @@ class UserSpace
93
97
 
94
98
  # Saves config
95
99
  def config=(obj)
96
- dump = (@parser.respond_to?(:pretty_generate))? @parser.pretty_generate(obj) : @parser.dump(obj)
100
+ dump = (@parser.respond_to?(:pretty_generate))?
101
+ @parser.pretty_generate(obj) : @parser.dump(obj)
97
102
  File.open(config_file_name, 'w', 0600){|fh|fh.puts dump}
98
103
  end
99
104
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: user_space
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.210201
4
+ version: 5.2.230101
5
5
  platform: ruby
6
6
  authors:
7
- - carlosjhr64
8
- autorequire:
7
+ - CarlosJHR64
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-01 00:00:00.000000000 Z
11
+ date: 2023-01-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Maintains the user's cache, config, and data directories
@@ -24,7 +24,7 @@ homepage: https://github.com/carlosjhr64/user_space
24
24
  licenses:
25
25
  - MIT
26
26
  metadata: {}
27
- post_install_message:
27
+ post_install_message:
28
28
  rdoc_options: []
29
29
  require_paths:
30
30
  - lib
@@ -39,9 +39,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  requirements:
42
- - 'ruby: ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-linux]'
43
- rubygems_version: 3.2.3
44
- signing_key:
42
+ - 'ruby: ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [aarch64-linux]'
43
+ rubygems_version: 3.3.7
44
+ signing_key:
45
45
  specification_version: 4
46
46
  summary: Maintains the user's cache, config, and data directories with the gem-apps
47
47
  cache, config, and data files.