synco 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,30 +1,15 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require_relative '../method'
3
+ # Released under the MIT License.
4
+ # Copyright, 2016-2024, by Samuel Williams.
5
+
6
+ require_relative "../method"
22
7
 
23
8
  module Synco
24
9
  module Methods
25
10
  class SCP < Method
26
11
  def default_command
27
- ['scp', '-pr']
12
+ ["scp", "-pr"]
28
13
  end
29
14
 
30
15
  def call(scope)
@@ -35,10 +20,10 @@ module Synco
35
20
  *@command,
36
21
  *arguments,
37
22
  # If the destination directory already exists, scp will create the source directory inside the destinatio directory. This behaviour means that running scp multiple times gives different results, i.e. the first time it will copy source/* to destination/*, but the second time you will end up with destination/source/*. Putting a dot after the first path alleviates this issue for some reason.
38
- scope.master_server.connection_string(directory, on: server) + '.',
23
+ scope.master_server.connection_string(directory, on: server) + ".",
39
24
  scope.target_server.connection_string(directory, on: server)
40
25
  )
41
26
  end
42
27
  end
43
28
  end
44
- end
29
+ end
@@ -1,30 +1,15 @@
1
- # Copyright, 2016, Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require_relative '../method'
3
+ # Released under the MIT License.
4
+ # Copyright, 2016-2024, by Samuel Williams.
5
+
6
+ require_relative "../method"
22
7
 
23
8
  module Synco
24
9
  module Methods
25
10
  class ZFS < Method
26
11
  def default_command
27
- ['zfs', '-rnv']
12
+ ["zfs", "-rnv"]
28
13
  end
29
14
 
30
15
  def call(scope, arguments: [])
@@ -57,4 +42,4 @@ module Synco
57
42
  end
58
43
  end
59
44
  end
60
- end
45
+ end
data/lib/synco/scope.rb CHANGED
@@ -1,29 +1,14 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require_relative 'script'
3
+ # Released under the MIT License.
4
+ # Copyright, 2016-2024, by Samuel Williams.
22
5
 
23
- require 'process/group'
6
+ require_relative "script"
24
7
 
25
- require 'console'
26
- require 'delegate'
8
+ require "process/group"
9
+
10
+ require "console"
11
+ require "delegate"
27
12
 
28
13
  module Synco
29
14
  class CommandFailure < RuntimeError
@@ -39,8 +24,6 @@ module Synco
39
24
  end
40
25
 
41
26
  class Runner
42
- include Console
43
-
44
27
  def initialize(*scripts)
45
28
  @scripts = scripts
46
29
  end
@@ -48,28 +31,26 @@ module Synco
48
31
  attr :scripts
49
32
 
50
33
  def call
51
- start_time = Time.now
52
-
53
- logger.info "===== Starting at #{start_time} ====="
34
+ Console.info(self, "Running scripts...")
54
35
 
55
36
  Process::Group.wait do |group|
56
37
  @scripts.each do |script|
57
38
  Fiber.new do
58
- ScriptScope.new(script, logger, group).call
39
+ ScriptScope.new(script, group).call
59
40
  end.resume
60
41
  end
61
42
  end
43
+ rescue => error
44
+ Console::Event::Failure.for(error).emit(self)
45
+ raise
62
46
  ensure
63
- end_time = Time.now
64
- logger.info "[Time]: (#{end_time - start_time}s)."
65
- logger.info "===== Finished backup at #{end_time} ====="
47
+ Console.info(self, "Finished running scripts.")
66
48
  end
67
49
  end
68
50
 
69
51
  class ScriptScope
70
- def initialize(script, logger, group)
52
+ def initialize(script, group)
71
53
  @script = script
72
- @logger = logger
73
54
  @group = group
74
55
 
75
56
  @current_server = ServerScope.new(@script.current_server, self)
@@ -77,7 +58,6 @@ module Synco
77
58
  end
78
59
 
79
60
  attr :script
80
- attr :logger
81
61
  attr :group
82
62
  attr :master_server
83
63
  attr :current_server
@@ -88,18 +68,17 @@ module Synco
88
68
 
89
69
  def call
90
70
  if @script.running_on_master?
91
- logger.info "We are the master server..."
71
+ Console.info(self, "We are the master server...")
92
72
  else
93
- logger.info "We are not the master server..."
94
- logger.info "Master server is #{@master}..."
73
+ Console.info(self, "We are not the master server...", master: @master)
95
74
  end
96
-
75
+
97
76
  @script.try(self) do
98
77
  # This allows events to run on the master server if specified, before running any backups.
99
78
 
100
79
  @master_server.try(master_target_server) do
101
80
  method.try(self) do
102
- logger.info "Running backups for server #{@current_server}..."
81
+ Console.info(self, "Running backups...", server: @current_server)
103
82
 
104
83
  run_servers(group)
105
84
  end
@@ -126,16 +105,15 @@ module Synco
126
105
  def run_servers(group)
127
106
  target_servers do |server|
128
107
  sync_scope = TargetScope.new(self, server)
129
-
130
- logger.info "===== Processing ====="
131
- logger.info "[Master]: #{master_server}"
132
- logger.info "[Target]: #{server}"
108
+
109
+ Console.info(self, "Running script...", master: @master_server, target: server)
133
110
 
134
111
  server.try(sync_scope) do
135
112
  @script.directories.each do |directory|
136
113
  directory_scope = DirectoryScope.new(sync_scope, directory)
137
-
138
- logger.info "[Directory]: #{directory}"
114
+
115
+ Console.info(self, "Processing directory...", directory: directory)
116
+
139
117
  directory.try(directory_scope) do
140
118
  method.call(directory_scope)
141
119
  end
@@ -146,9 +124,8 @@ module Synco
146
124
  end
147
125
 
148
126
  class LogPipe < DelegateClass(IO)
149
- def initialize(logger, level = :info)
127
+ def initialize(logger: Console, level: :info)
150
128
  @input, @output = IO.pipe
151
- @logger = logger
152
129
 
153
130
  super(@output)
154
131
 
@@ -177,10 +154,6 @@ module Synco
177
154
  @from = from
178
155
  end
179
156
 
180
- def logger
181
- @logger ||= @script_scope.logger
182
- end
183
-
184
157
  def group
185
158
  @group ||= @script_scope.group
186
159
  end
@@ -195,13 +168,14 @@ module Synco
195
168
  command = self.connection_command + ["--"] + command
196
169
  end
197
170
 
198
- logger.info("shell") {[command, options]}
171
+ Console::Event::Spawn.for(*command, **options).emit(self)
199
172
 
200
- options[:out] ||= LogPipe.new(logger)
201
- options[:err] ||= LogPipe.new(logger, :error)
173
+ options[:out] ||= LogPipe.new
174
+ options[:err] ||= LogPipe.new(level: :error)
202
175
 
203
176
  status = self.group.spawn(*command, **options)
204
- logger.debug{"Process finished: #{status}."}
177
+
178
+ Console.info(self, "Command completed.", status: status)
205
179
 
206
180
  options[:out].close
207
181
  options[:err].close
@@ -219,8 +193,8 @@ module Synco
219
193
  @target_server = ServerScope.new(target, script_scope, script_scope.current_server)
220
194
  end
221
195
 
222
- def run(*arguments)
223
- @target_server.run(*arguments)
196
+ def run(...)
197
+ @target_server.run(...)
224
198
  end
225
199
 
226
200
  attr :target_server
data/lib/synco/script.rb CHANGED
@@ -1,36 +1,21 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
20
-
21
- require_relative 'method'
22
- require_relative 'server'
23
- require_relative 'directory'
24
- require_relative 'controller'
25
-
26
- require 'socket'
27
-
28
- require 'process/group'
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2008-2024, by Samuel Williams.
5
+
6
+ require_relative "method"
7
+ require_relative "server"
8
+ require_relative "directory"
9
+ require_relative "controller"
10
+
11
+ require "socket"
12
+
13
+ require "process/group"
29
14
 
30
15
  module Synco
31
16
  # The main backup/synchronisation mechanism is the backup script. It specifies all servers and directories, and these are then combined specifically to produce the desired data replication behaviour.
32
17
  class Script < Controller
33
- def initialize(method: nil, servers: {}, directories: [], master: :master, logger: nil)
18
+ def initialize(method: nil, servers: {}, directories: [], master: :master)
34
19
  super()
35
20
 
36
21
  @method = method
@@ -87,7 +72,7 @@ module Synco
87
72
  else
88
73
  # Find a server config that specifies the local host
89
74
  @servers.values.find{|server| localhost?(server.host)}
90
- end || Server.new('localhost')
75
+ end || Server.new("localhost")
91
76
  end
92
77
 
93
78
  def current_server
data/lib/synco/server.rb CHANGED
@@ -1,32 +1,17 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require_relative 'controller'
22
- require_relative 'directory'
23
- require_relative 'shells/ssh'
3
+ # Released under the MIT License.
4
+ # Copyright, 2009-2024, by Samuel Williams.
24
5
 
25
- require 'shellwords'
6
+ require_relative "controller"
7
+ require_relative "directory"
8
+ require_relative "shells/ssh"
9
+
10
+ require "shellwords"
26
11
 
27
12
  module Synco
28
13
  class Server < Controller
29
- def initialize(name, root: '/', shell: nil, **options)
14
+ def initialize(name, root: "/", shell: nil, **options)
30
15
  super()
31
16
 
32
17
  @name = name
data/lib/synco/shell.rb CHANGED
@@ -1,24 +1,9 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require 'pathname'
3
+ # Released under the MIT License.
4
+ # Copyright, 2009-2024, by Samuel Williams.
5
+
6
+ require "pathname"
22
7
 
23
8
  module Synco
24
9
  # A shell provides access to a server, typically to run commands.
@@ -1,48 +1,33 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require_relative '../shell'
3
+ # Released under the MIT License.
4
+ # Copyright, 2011-2024, by Samuel Williams.
5
+
6
+ require_relative "../shell"
22
7
 
23
8
  module Synco
24
9
  module Shells
25
10
  # SSH shell provides access to a remote server using SSH.
26
11
  class SSH < Shell
27
12
  def default_command
28
- ['ssh']
13
+ ["ssh"]
29
14
  end
30
15
 
31
16
  def initialize(*command, arguments: [], port: nil, key: nil, user: nil, batch_mode: nil, **options)
32
17
  if port
33
- arguments << '-p' << port
18
+ arguments << "-p" << port
34
19
  end
35
20
 
36
21
  if key
37
- arguments << '-i' << key
22
+ arguments << "-i" << key
38
23
  end
39
24
 
40
25
  if user
41
- arguments << '-l' << user
26
+ arguments << "-l" << user
42
27
  end
43
28
 
44
29
  unless batch_mode.nil?
45
- arguments << '-o' << "BatchMode=#{batch_mode ? 'yes' : 'no'}"
30
+ arguments << "-o" << "BatchMode=#{batch_mode ? 'yes' : 'no'}"
46
31
  end
47
32
 
48
33
  super
data/lib/synco/version.rb CHANGED
@@ -1,23 +1,8 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
2
+
3
+ # Released under the MIT License.
4
+ # Copyright, 2008-2024, by Samuel Williams.
20
5
 
21
6
  module Synco
22
- VERSION = "1.2.0"
7
+ VERSION = "1.3.0"
23
8
  end
data/lib/synco.rb CHANGED
@@ -1,36 +1,20 @@
1
- # Copyright, 2016, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
1
+ # frozen_string_literal: true
20
2
 
21
- require 'yaml'
22
- require 'socket'
23
- require 'set'
24
- require 'logger'
3
+ # Released under the MIT License.
4
+ # Copyright, 2008-2024, by Samuel Williams.
25
5
 
26
- require_relative 'synco/version'
27
- require_relative 'synco/script'
28
- require_relative 'synco/scope'
6
+ require "yaml"
7
+ require "socket"
8
+ require "set"
29
9
 
30
- require 'fileutils'
31
- require 'optparse'
10
+ require_relative "synco/version"
11
+ require_relative "synco/script"
12
+ require_relative "synco/scope"
32
13
 
33
- require 'lockfile'
14
+ require "fileutils"
15
+ require "optparse"
16
+
17
+ require "lockfile"
34
18
 
35
19
  module Synco
36
20
  # Run a prepared backup script using a lockfile.
data/license.md ADDED
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright, 2008-2024, by Samuel Williams.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.