rsync_wrapper 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: 1bca87d515e5e5fbf59592fde27ffd171e51757c
4
- data.tar.gz: d70b4de43a3fd3f22e48a16fe67b9882aa83e84a
3
+ metadata.gz: cba4bd6a73d13ae9dc92c566a2694e1197117a97
4
+ data.tar.gz: 2b83903b66a5022ce08aa433414901c85210876d
5
5
  SHA512:
6
- metadata.gz: 9f890de180a81cb136a347546db93b6613448fc58e46c960600c6fabb6da56fe0d53142e0da7c84cac7f4b88fd1dbe2a7670291275a3b06f6f716b8b263963f5
7
- data.tar.gz: a64832d767154d5b06a1b74225c2565b4f31419159f51a0690f6b1ec4112585682891c55a85d62b9da29bdb1c35c4cb71e7434d415b46a385952f237b619e9ff
6
+ metadata.gz: 1a8143497aa2eaa3c7f82c88ecf6f15d3ad46545d3bdc47f762971382f7d527ba4d2769cb430fe0739c92636919ef737b4da9a6301bde4a51ef50b1b910aadf6
7
+ data.tar.gz: 0f9d36b3ed59bdd9901db8a3aa916f1a3f36b0b80e02c163676ccfc45263b487aa301dc9800a17b19944693192446c755c4e0768eb589f7cfd68afd3826bd3ec
data/.gitignore CHANGED
@@ -9,3 +9,5 @@
9
9
  /tmp/
10
10
 
11
11
  spec/actual_sync.log
12
+
13
+ *.log
@@ -5,13 +5,19 @@ class Rsync
5
5
  raise ArgumentError, "#{k} is required" unless opts[k]
6
6
  @dirs[k] = opts[k]
7
7
  end
8
- @inclusions = opts[:include_extensions].map{|ext| "*.#{ext}"} || []
8
+ @inclusions = opts[:include_extensions] ? opts[:include_extensions].map{|ext| "*.#{ext}"} : []
9
9
  @exclusions = opts[:exclusions] || []
10
10
  if opts[:subdirs_only]
11
11
  @inclusions << '*/' # include subdirectories
12
12
  @exclusions << '*'
13
13
  end
14
- @logfile = opts[:log_dir] ? File.join(opts[:log_dir], "rsync-#{SecureRandom.uuid}.log") : opts[:logfile]
14
+ @logfile = if opts[:log_dir]
15
+ File.join(opts[:log_dir], "rsync-#{SecureRandom.uuid}.log")
16
+ elsif opts[:logfile]
17
+ opts[:logfile]
18
+ else
19
+ File.join(Dir.pwd, "rsync-#{SecureRandom.uuid}.log")
20
+ end
15
21
  end
16
22
 
17
23
  def sync! &block
@@ -51,6 +57,6 @@ class Rsync
51
57
  end
52
58
  end
53
59
 
54
- # File.delete @logfile
60
+ File.delete @logfile
55
61
  end
56
62
  end
@@ -1,3 +1,3 @@
1
1
  module RsyncWrapper
2
- VERSION = '1.0.0'
2
+ VERSION = '1.0.1'
3
3
  end
data/lib/rsync_wrapper.rb CHANGED
@@ -1,2 +1,3 @@
1
1
  require 'rsync_wrapper/version'
2
2
  require 'rsync_wrapper/rsync'
3
+ require 'securerandom'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsync_wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Huber
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-08-23 00:00:00.000000000 Z
11
+ date: 2017-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler