dutiful 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/db/dash.toml +14 -0
- data/db/popcorn-time.toml +5 -0
- data/lib/dutiful/application_file.rb +10 -1
- data/lib/dutiful/storage.rb +15 -5
- data/lib/dutiful/version.rb +1 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c00f6adf9cb958ee907150a9f595fde8891baa9
|
4
|
+
data.tar.gz: 34d837f02c23f1e56cf255f10ae0caa073dcea0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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'
|
@@ -3,7 +3,12 @@ class Dutiful::ApplicationFile
|
|
3
3
|
|
4
4
|
def initialize(path)
|
5
5
|
@path = path
|
6
|
-
|
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
|
data/lib/dutiful/storage.rb
CHANGED
@@ -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}"
|
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
|
-
|
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
|
data/lib/dutiful/version.rb
CHANGED
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
|
+
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-
|
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.
|
153
|
+
summary: dutiful-0.0.5
|
152
154
|
test_files: []
|