openvfs-rb 1.1.3-aarch64-linux → 1.2.0-aarch64-linux

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: e71f2e457e89c884f07adc61a0e5be0f9127fb94cf3d25020b18ba2d85f8bddf
4
- data.tar.gz: 650da0b2b13c2a8f458e206efd842aec9e09d88b7c4bb4ecd6bd36be0afcea43
3
+ metadata.gz: a4db97afacf8bbe0e6ec273be3bb729f76f3721bd5af98094ee282197cf4f99c
4
+ data.tar.gz: 2faec850f20fd2c89fa92389f090d6cd954908acfbce6058d27beacccec28e82
5
5
  SHA512:
6
- metadata.gz: 17117b9c3bac2071883daf9152cd2a243f6b0486a0a240ec0bbf27eaa22d8a2b844cfdddd35d7be3f3d3aebc7bf365a83152d1af0ceb1015342a17ee2b3844a8
7
- data.tar.gz: 4995d797583572b452353599999423e737fd71a8fc1e557266be970c458286507b559682ce02b48fa52fb8120cf8a4c283dcfa4a0eb37e376a6406ae4f90b83b
6
+ metadata.gz: f8e64aa3cc5e3d398516a30cd0a46fd8b2e94599a9ceb6ce170d11e9f96e329966efca583bcdfc4d8a4ccdfbef1f42aef3715fde10e4210af41f840411a0d222
7
+ data.tar.gz: 9786e6e612bdd0dbcb97471e0c7c196bf38118ab5452f1d83a38a03933789e893159965a8511c962490bca0f7780e1992b1a4c708049ca98e3ba7dd104bab894
Binary file
Binary file
Binary file
data/lib/openvfs/occ.rb CHANGED
@@ -12,8 +12,22 @@ end
12
12
 
13
13
  require "fileutils"
14
14
  require "securerandom"
15
+ require "uri"
15
16
 
16
17
  module OpenVFS
18
+ # What the engine calls itself, which is also where it reads its config.
19
+ # @parameter user [String] the user on the server.
20
+ # @parameter url [String] the server's base URL, whose host names the account with the user.
21
+ # @returns [String] the application name for that account.
22
+ def self.application_name_for(user, url) = "#{user}@#{URI(url.to_s).host}"
23
+
24
+ # The INI that application name resolves to, derived the way ConfigFile derives it.
25
+ # @parameter name [String] the application name; the current one by default.
26
+ # @returns [String] the config file for that name.
27
+ def self.config_path(name = application_name)
28
+ File.join(ENV.fetch("XDG_CONFIG_HOME", File.join(Dir.home, ".config")), name, "#{name.downcase}.cfg")
29
+ end
30
+
17
31
  # Writes the INI file AccountManager::restore and FolderMan::loadFolders read on start.
18
32
  #
19
33
  # The credential is not written here: credentials live in the keychain, so store it with Account#credential_manager.set("http/oauthtoken", credential) before starting.
@@ -21,12 +35,16 @@ module OpenVFS
21
35
  # @parameter path [String] The local directory to sync.
22
36
  # @parameter url [String] The server's base URL.
23
37
  # @parameter remote_path [String] The WebDAV path to sync against.
38
+ # @parameter user [String] The user on that server. With the server's host it names the account, which is the application name and so the config file.
24
39
  # @parameter uuid [String] The account's UUID; also names the keychain entry.
25
40
  # @parameter display_name [String] How the folder is named in logs.
26
41
  # @parameter space_id [String] The space to sync, if any.
27
42
  # @returns [String] The UUID the account was written under.
28
- def self.configure(path, url:, remote_path:, uuid: SecureRandom.uuid, display_name: path, space_id: "")
29
- config_path = File.join(Dir.home, ".config", "openvfs-rb", "openvfs-rb.cfg")
43
+ def self.configure(path, url:, remote_path:, user:, uuid: SecureRandom.uuid, display_name: path, space_id: "")
44
+ # One account per process, so the application name is the account's: it is what decides which config the engine reads, and OpenVFS.start reads it rather than being told.
45
+ self.application_name = application_name_for(user, url)
46
+
47
+ config_path = self.config_path
30
48
  FileUtils.mkdir_p(File.dirname(config_path))
31
49
  FileUtils.mkdir_p(path)
32
50
 
@@ -5,6 +5,6 @@
5
5
 
6
6
  module OpenVFS
7
7
  module Rb
8
- VERSION = "1.1.3"
8
+ VERSION = "1.2.0"
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openvfs-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.2.0
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Nathan Kidd