dutiful 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/db/brew.toml +5 -0
- data/db/git.toml +1 -0
- data/db/the_silver_searcher.toml +5 -0
- data/db/tmuxline.toml +5 -0
- data/db/z.toml +5 -0
- data/lib/dutiful/application.rb +6 -6
- data/lib/dutiful/application_file.rb +10 -6
- data/lib/dutiful/commands/list.rb +9 -1
- data/lib/dutiful/commands/sync.rb +3 -3
- data/lib/dutiful/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b2d24e92e594e4d002fa704e1905bcfdd5c00d8
|
4
|
+
data.tar.gz: 4182128d6260adf521da67deb4954c2b924275e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e23b10f5b0fa954b90c0d0ae0230dc7b41c1550ee112e0cb276df866b2cdeefa1e816eaa66cc558827b8ae16fb6ab60214f9ec59870f384d7db66f53c48af83
|
7
|
+
data.tar.gz: 647585ea6e8a09d29e41382823044ee770e4cdac4f5b29fe1e3565719b3cc88099769003d5a655e5cd6459ed86abad070ed2b07eacf317ff1bdfe86b9abcd2ff
|
data/db/brew.toml
ADDED
data/db/git.toml
CHANGED
data/db/tmuxline.toml
ADDED
data/db/z.toml
ADDED
data/lib/dutiful/application.rb
CHANGED
@@ -15,6 +15,10 @@ class Dutiful::Application
|
|
15
15
|
files.any? &:exist?
|
16
16
|
end
|
17
17
|
|
18
|
+
def has_backup?
|
19
|
+
files.any? &:has_backup?
|
20
|
+
end
|
21
|
+
|
18
22
|
def sync
|
19
23
|
files.each do |file|
|
20
24
|
if file.exist? || file.has_backup?
|
@@ -26,12 +30,8 @@ class Dutiful::Application
|
|
26
30
|
end
|
27
31
|
end
|
28
32
|
|
29
|
-
def
|
30
|
-
|
31
|
-
|
32
|
-
output << files.map do |file|
|
33
|
-
" #{file}" if file.exist? || file.has_backup?
|
34
|
-
end.compact.join("\n")
|
33
|
+
def synced?
|
34
|
+
files.all? &:synced?
|
35
35
|
end
|
36
36
|
|
37
37
|
def self.all
|
@@ -32,15 +32,19 @@ class Dutiful::ApplicationFile
|
|
32
32
|
|
33
33
|
def to_s
|
34
34
|
if exist?
|
35
|
-
return "#{path} ✔".green if synced?
|
36
|
-
|
37
35
|
if has_backup?
|
38
|
-
|
36
|
+
if synced?
|
37
|
+
"#{path} ✔".green
|
38
|
+
else
|
39
|
+
"#{path} (modified)".yellow
|
40
|
+
end
|
39
41
|
else
|
40
|
-
|
42
|
+
"#{path} (pending backup)".yellow
|
41
43
|
end
|
44
|
+
elsif has_backup?
|
45
|
+
"#{path} (pending restore)".yellow
|
46
|
+
else
|
47
|
+
"#{path} does not exist (skipping)".yellow
|
42
48
|
end
|
43
|
-
|
44
|
-
"#{path} (pending restore)".yellow if has_backup?
|
45
49
|
end
|
46
50
|
end
|
@@ -1,7 +1,15 @@
|
|
1
1
|
class Dutiful::Command::List < Clamp::Command
|
2
|
+
option ['-v', '--verbose'], :flag, 'Verbose mode'
|
3
|
+
|
2
4
|
def execute
|
3
5
|
puts "Storage: #{Dutiful::Config.storage.name}\n\n"
|
4
6
|
|
5
|
-
|
7
|
+
Dutiful::Application.each do |application|
|
8
|
+
puts "#{application.name}:\n" if application.exist? || application.has_backup? || verbose?
|
9
|
+
|
10
|
+
application.files.map do |file|
|
11
|
+
puts " #{file}" if file.exist? || file.has_backup? || verbose?
|
12
|
+
end.compact.join("\n")
|
13
|
+
end
|
6
14
|
end
|
7
15
|
end
|
@@ -5,7 +5,7 @@ class Dutiful::Command::Sync < Clamp::Command
|
|
5
5
|
puts "Storage: #{Dutiful::Config.storage.name}\n\n"
|
6
6
|
|
7
7
|
Dutiful::Application.each do |application|
|
8
|
-
puts "#{application.name}:\n"
|
8
|
+
puts "#{application.name}:\n" if application.exist? || application.has_backup? || verbose?
|
9
9
|
|
10
10
|
application.sync do |file, result|
|
11
11
|
if result
|
@@ -14,8 +14,8 @@ class Dutiful::Command::Sync < Clamp::Command
|
|
14
14
|
else
|
15
15
|
puts " #{file.path} ✖ - #{result.error}".red
|
16
16
|
end
|
17
|
-
|
18
|
-
puts " #{file.path} does not exist (skipping)".yellow
|
17
|
+
elsif verbose?
|
18
|
+
puts " #{file.path} does not exist (skipping)".yellow
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
data/lib/dutiful/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bruno Pinto
|
@@ -104,13 +104,17 @@ files:
|
|
104
104
|
- bin/dutiful
|
105
105
|
- config/dropbox.toml
|
106
106
|
- config/icloud.toml
|
107
|
+
- db/brew.toml
|
107
108
|
- db/bundler.toml
|
108
109
|
- db/dutiful.toml
|
109
110
|
- db/fish.toml
|
110
111
|
- db/git.toml
|
111
112
|
- db/iterm2.toml
|
113
|
+
- db/the_silver_searcher.toml
|
112
114
|
- db/tmux.toml
|
115
|
+
- db/tmuxline.toml
|
113
116
|
- db/vim.toml
|
117
|
+
- db/z.toml
|
114
118
|
- lib/dutiful.rb
|
115
119
|
- lib/dutiful/application.rb
|
116
120
|
- lib/dutiful/application_file.rb
|
@@ -144,5 +148,5 @@ rubyforge_project:
|
|
144
148
|
rubygems_version: 2.4.5
|
145
149
|
signing_key:
|
146
150
|
specification_version: 4
|
147
|
-
summary: dutiful-0.0.
|
151
|
+
summary: dutiful-0.0.4
|
148
152
|
test_files: []
|