dutiful 0.0.4 → 0.0.5

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: 5b2d24e92e594e4d002fa704e1905bcfdd5c00d8
4
- data.tar.gz: 4182128d6260adf521da67deb4954c2b924275e7
3
+ metadata.gz: 9c00f6adf9cb958ee907150a9f595fde8891baa9
4
+ data.tar.gz: 34d837f02c23f1e56cf255f10ae0caa073dcea0f
5
5
  SHA512:
6
- metadata.gz: 1e23b10f5b0fa954b90c0d0ae0230dc7b41c1550ee112e0cb276df866b2cdeefa1e816eaa66cc558827b8ae16fb6ab60214f9ec59870f384d7db66f53c48af83
7
- data.tar.gz: 647585ea6e8a09d29e41382823044ee770e4cdac4f5b29fe1e3565719b3cc88099769003d5a655e5cd6459ed86abad070ed2b07eacf317ff1bdfe86b9abcd2ff
6
+ metadata.gz: 5019d604d2774a9e1159a4c564e4aea202cac9afca3c9ebd045aef83033146312886e9d6f0736ac835739a673df4e31af6c2e9c94181f455eca7a2e42e083c20
7
+ data.tar.gz: 481bbb43ebb123e1b06524874b541dc8b83dcfd97d60a904addcadd14bdab41390723605b7db1f75e0c7afae683ba79ece951da74241bb302a3b464c128f0d89
data/db/dash.toml ADDED
@@ -0,0 +1,14 @@
1
+ [application]
2
+ name = 'Dash'
3
+
4
+ [[files]]
5
+ path = 'Library/Application Support/Dash/library.dash'
6
+
7
+ [[files]]
8
+ path = 'Library/Application Support/Dash/License/license.dash-license'
9
+
10
+ [[files]]
11
+ path = 'Library/Preferences/com.kapeli.dash.plist'
12
+
13
+ [[files]]
14
+ path = 'Library/Preferences/com.kapeli.dashdoc.plist'
@@ -0,0 +1,5 @@
1
+ [application]
2
+ name = 'Popcorn-Time'
3
+
4
+ [[files]]
5
+ path = 'Library/Application Support/Popcorn-Time/data/'
@@ -3,7 +3,12 @@ class Dutiful::ApplicationFile
3
3
 
4
4
  def initialize(path)
5
5
  @path = path
6
- @full_path = File.expand_path "~/#{path}"
6
+
7
+ if directory?
8
+ @full_path = "#{File.expand_path "~/#{path}"}/"
9
+ else
10
+ @full_path = File.expand_path "~/#{path}"
11
+ end
7
12
  end
8
13
 
9
14
  def backup_path
@@ -18,6 +23,10 @@ class Dutiful::ApplicationFile
18
23
  File.mtime full_path if exist?
19
24
  end
20
25
 
26
+ def directory?
27
+ path.chars.last == '/'
28
+ end
29
+
21
30
  def exist?
22
31
  File.exist? full_path
23
32
  end
@@ -18,7 +18,8 @@ class Dutiful::Storage
18
18
  end
19
19
 
20
20
  def create_dir(file)
21
- FileUtils.mkdir_p File.dirname "#{path}/#{file.path}".shellescape
21
+ FileUtils.mkdir_p File.dirname "#{path}/#{file.path}"
22
+ FileUtils.mkdir_p "/Users/bpinto/Dropbox/dutiful/Library/Application\ Support/Dash"
22
23
  end
23
24
 
24
25
  def exist?(file)
@@ -38,17 +39,26 @@ class Dutiful::Storage
38
39
 
39
40
  if file.exist?
40
41
  if file.has_backup? && file.backup_timestamp > file.timestamp
41
- Rsync.run file.backup_path.shellescape, file.full_path.shellescape
42
+ Rsync.run file.backup_path.shellescape, file.full_path.shellescape, '--recursive'
42
43
  else
43
- Rsync.run file.full_path.shellescape, file.backup_path.shellescape
44
+ Rsync.run file.full_path.shellescape, file.backup_path.shellescape, '--recursive'
44
45
  end
45
46
  else
46
- Rsync.run file.backup_path.shellescape, file.full_path.shellescape
47
+ Rsync.run file.backup_path.shellescape, file.full_path.shellescape, '--recursive'
47
48
  end
48
49
  end
49
50
 
50
51
  def synced?(file)
51
- FileUtils.identical? file.full_path, "#{path}/#{file.path}"
52
+ if file.directory?
53
+ Dir.glob("#{file.full_path}*").all? do |file_path|
54
+ filename = File.basename(file_path)
55
+ file_backup_path = path "#{file.path}#{filename}"
56
+
57
+ FileUtils.identical? file_path, file_backup_path
58
+ end
59
+ else
60
+ FileUtils.identical? file.full_path, "#{path}/#{file.path}"
61
+ end
52
62
  end
53
63
 
54
64
  private
@@ -1,3 +1,3 @@
1
1
  module Dutiful
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dutiful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno Pinto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-01 00:00:00.000000000 Z
11
+ date: 2015-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -106,10 +106,12 @@ files:
106
106
  - config/icloud.toml
107
107
  - db/brew.toml
108
108
  - db/bundler.toml
109
+ - db/dash.toml
109
110
  - db/dutiful.toml
110
111
  - db/fish.toml
111
112
  - db/git.toml
112
113
  - db/iterm2.toml
114
+ - db/popcorn-time.toml
113
115
  - db/the_silver_searcher.toml
114
116
  - db/tmux.toml
115
117
  - db/tmuxline.toml
@@ -148,5 +150,5 @@ rubyforge_project:
148
150
  rubygems_version: 2.4.5
149
151
  signing_key:
150
152
  specification_version: 4
151
- summary: dutiful-0.0.4
153
+ summary: dutiful-0.0.5
152
154
  test_files: []