openvfs-rb 1.1.3-x86_64-linux → 1.3.0-x86_64-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: 35e6366ee9253036439e71fa284e3d62949bc6c5ea5b0a35ddf2c1777916f82d
4
- data.tar.gz: 976b478578fb0749ccf7dd2ca0934a5401c13a88d0678b5de86d958e699ce7e5
3
+ metadata.gz: 7b742da612d58ae239f0daaae38e8fad592dc36724ee680168e38a8853551a3e
4
+ data.tar.gz: 308ae6d5dec8d3c7bae612697c15520b14bbb8fd90e5ea14a813db6269b4dfc3
5
5
  SHA512:
6
- metadata.gz: fa7382c3045cec1491ddfb0eecda2fe788cab9b16a2ab7baa5c3d943b4584062e8db0179872556dd4de26d960bc38706d48ca952ff48e336b961faeb10f64924
7
- data.tar.gz: 56c4865e208944e5621dde9d6530d6d216cb29b307cf9f31dc48c7c225a769a2a870503440f12f49452fb340f1ac235f5fa38491f0d1c58e08a9654331d1befe
6
+ metadata.gz: 13e167bdd9b51891da028466329c29239e8c82a1f0dd7c438cafcc60c6358a5107de436c26f008fa01cd55858e140ee9642f580b2a3e77f2c7e7e6193d672c11
7
+ data.tar.gz: a4f87762794c20d1bd49629c00f3bfbd0a77c1927b25efe144dd1d198e3adde809a6eb74bc386b82db9e968ce77cf524bd354691748056055d850f706d4a8438
Binary file
Binary file
Binary file
@@ -0,0 +1,50 @@
1
+ # This file contains fixed global exclude patterns
2
+
3
+ # Internal files
4
+ ].sync_journal.db*
5
+
6
+ *~
7
+ ~$*
8
+ .~lock.*
9
+ ~*.tmp
10
+ ]*.~*
11
+ ]Icon\r*
12
+ ].DS_Store
13
+ ].ds_store
14
+ ._*
15
+ ]Thumbs.db
16
+ # Windows desktop ini
17
+ ]Desktop.ini
18
+
19
+ .*.sw?
20
+ .*.*sw?
21
+
22
+ ].TemporaryItems
23
+ ].Trashes
24
+ ].DocumentRevisions-V100
25
+
26
+ # https://specifications.freedesktop.org/trash/1.0/
27
+ ].Trash-*[0-9]
28
+ ].Trash
29
+
30
+ .fseventd
31
+ .apdisk
32
+
33
+ .directory
34
+
35
+ *.part
36
+ *.filepart
37
+ *.crdownload
38
+
39
+ *.kate-swp
40
+ *.gnucash.tmp-*
41
+
42
+ .synkron.*
43
+ .sync.ffs_db
44
+ .symform
45
+ .symform-store
46
+ .fuse_hidden*
47
+ *.unison
48
+ .nfs*
49
+
50
+ My Saved Places.
data/lib/openvfs/occ.rb CHANGED
@@ -10,10 +10,29 @@ rescue LoadError
10
10
  require "openvfs/occ/occ"
11
11
  end
12
12
 
13
+ # The default exclude list, which the client loads before it will sync anything: SyncEngine::loadDefaultExcludes fails without it, and Folder's constructor then puts the folder in SyncResult::SetupError and returns, so the account connects and authenticates and nothing is ever scheduled or watched.
14
+ #
15
+ # It ships in the gem and is named here because ConfigFile::defaultExcludeFile falls back to the path the build installed it at, which is the build machine's and not any other's.
16
+ ENV["OPENCLOUD_SYNC_EXCLUDE_FILE"] ||= File.expand_path("occ/sync-exclude.lst", __dir__)
17
+
13
18
  require "fileutils"
14
19
  require "securerandom"
20
+ require "uri"
15
21
 
16
22
  module OpenVFS
23
+ # What the engine calls itself, which is also where it reads its config.
24
+ # @parameter user [String] the user on the server.
25
+ # @parameter url [String] the server's base URL, whose host names the account with the user.
26
+ # @returns [String] the application name for that account.
27
+ def self.application_name_for(user, url) = "#{user}@#{URI(url.to_s).host}"
28
+
29
+ # The INI that application name resolves to, derived the way ConfigFile derives it.
30
+ # @parameter name [String] the application name; the current one by default.
31
+ # @returns [String] the config file for that name.
32
+ def self.config_path(name = application_name)
33
+ File.join(ENV.fetch("XDG_CONFIG_HOME", File.join(Dir.home, ".config")), name, "#{name.downcase}.cfg")
34
+ end
35
+
17
36
  # Writes the INI file AccountManager::restore and FolderMan::loadFolders read on start.
18
37
  #
19
38
  # 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 +40,16 @@ module OpenVFS
21
40
  # @parameter path [String] The local directory to sync.
22
41
  # @parameter url [String] The server's base URL.
23
42
  # @parameter remote_path [String] The WebDAV path to sync against.
43
+ # @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
44
  # @parameter uuid [String] The account's UUID; also names the keychain entry.
25
45
  # @parameter display_name [String] How the folder is named in logs.
26
46
  # @parameter space_id [String] The space to sync, if any.
27
47
  # @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")
48
+ def self.configure(path, url:, remote_path:, user:, uuid: SecureRandom.uuid, display_name: path, space_id: "")
49
+ # 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.
50
+ self.application_name = application_name_for(user, url)
51
+
52
+ config_path = self.config_path
30
53
  FileUtils.mkdir_p(File.dirname(config_path))
31
54
  FileUtils.mkdir_p(path)
32
55
 
@@ -5,6 +5,6 @@
5
5
 
6
6
  module OpenVFS
7
7
  module Rb
8
- VERSION = "1.1.3"
8
+ VERSION = "1.3.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.3.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Nathan Kidd
@@ -53,6 +53,7 @@ files:
53
53
  - lib/openvfs/occ/3.3/occ.so
54
54
  - lib/openvfs/occ/3.4/occ.so
55
55
  - lib/openvfs/occ/4.0/occ.so
56
+ - lib/openvfs/occ/sync-exclude.lst
56
57
  - lib/openvfs/rb.rb
57
58
  - lib/openvfs/rb/version.rb
58
59
  - lib/openvfs/version.rb