coral_backup 0.2.1 → 0.2.2
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 +4 -4
- data/.rspec +2 -0
- data/README.md +9 -1
- data/Rakefile +3 -7
- data/coral_backup.gemspec +1 -1
- data/lib/coral_backup/cli.rb +21 -0
- data/lib/coral_backup/file_selector.rb +2 -7
- data/lib/coral_backup/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b233b4d3c592438bd77271ed6327a6817a10d90
|
4
|
+
data.tar.gz: 1d2b304154bee8de69a706a84220b5ce5957570f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7017e286c0423852151822243860c57739ac924e7fcf41555b4d7ad7dc42bb8231742d7978180ea7e4870d77c16245c1b1fe1cf0e72f886c185466e44107bd64
|
7
|
+
data.tar.gz: 1e17234b53844be28540ec5a28176c55467a8239121c8ed235b016ca448b1badc2f3b484305076639258048ce704f09838f507e7085f9a8a58fe04d1633cfbb3
|
data/.rspec
ADDED
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Coral Backup creates incremental backups of files that can be restored at a later date.
|
4
4
|
|
5
|
+

|
6
|
+
|
5
7
|
## Installation
|
6
8
|
|
7
9
|
```
|
@@ -23,13 +25,19 @@ $ gem install coral_backup
|
|
23
25
|
|
24
26
|
* `-d`, `--dry-run`: Show what would have been backed up, but do not back them up
|
25
27
|
|
28
|
+
### Demo
|
29
|
+
|
30
|
+

|
31
|
+
|
32
|
+

|
33
|
+
|
26
34
|
## Dependencies
|
27
35
|
|
28
36
|
* rsync 3.X.X binary
|
29
37
|
|
30
38
|
## Development
|
31
39
|
|
32
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake
|
40
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec coral` to use the gem in this directory, ignoring other installed copies of this gem.
|
33
41
|
|
34
42
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
35
43
|
|
data/Rakefile
CHANGED
@@ -1,10 +1,6 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
|
-
require "
|
2
|
+
require "rspec/core/rake_task"
|
3
3
|
|
4
|
-
|
5
|
-
t.libs << "test"
|
6
|
-
t.libs << "lib"
|
7
|
-
t.test_files = FileList['test/**/*_test.rb']
|
8
|
-
end
|
4
|
+
RSpec::Core::RakeTask.new(:spec)
|
9
5
|
|
10
|
-
task :default => :
|
6
|
+
task :default => :spec
|
data/coral_backup.gemspec
CHANGED
data/lib/coral_backup/cli.rb
CHANGED
@@ -3,6 +3,15 @@ require "thor"
|
|
3
3
|
|
4
4
|
module CoralBackup
|
5
5
|
class CLI < Thor
|
6
|
+
OSX_VOLUME_ROOT_EXCLUSIONS = %w[
|
7
|
+
.DocumentRevisions-V100
|
8
|
+
.fseventsd
|
9
|
+
.Spotlight-V100
|
10
|
+
.TemporaryItems
|
11
|
+
.Trashes
|
12
|
+
.VolumeIcon.icns
|
13
|
+
]
|
14
|
+
|
6
15
|
def initialize(*args)
|
7
16
|
super
|
8
17
|
@settings = Settings.new
|
@@ -43,6 +52,9 @@ module CoralBackup
|
|
43
52
|
destination << "/" unless destination.end_with?("/")
|
44
53
|
|
45
54
|
@settings.add(action_name, source, destination, exclusions)
|
55
|
+
rescue RuntimeError => e
|
56
|
+
warn "ERROR: #{e}"
|
57
|
+
exit 1
|
46
58
|
end
|
47
59
|
|
48
60
|
desc "delete <ACTION>", "Delete the backup action"
|
@@ -96,6 +108,15 @@ module CoralBackup
|
|
96
108
|
args << Pathname.new(exclusion).relative_path_from(Pathname.new(source)).to_s
|
97
109
|
end
|
98
110
|
|
111
|
+
if RUBY_PLATFORM.match(/darwin/)
|
112
|
+
if File.expand_path("..", source) == "/Volumes"
|
113
|
+
OSX_VOLUME_ROOT_EXCLUSIONS.each do |vr_exclusion|
|
114
|
+
args << "--exclude"
|
115
|
+
args << vr_exclusion
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
99
120
|
args << source
|
100
121
|
args << new_destination
|
101
122
|
|
@@ -57,13 +57,8 @@ module CoralBackup
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
unless file_selector.files.length == 1
|
61
|
-
|
62
|
-
file_selector.files.each do |e|
|
63
|
-
warn e
|
64
|
-
end
|
65
|
-
exit 1
|
66
|
-
end
|
60
|
+
raise "Wrong number of files (#{file_selector.files.length} for 1)" unless file_selector.files.length == 1
|
61
|
+
|
67
62
|
file_selector.files[0]
|
68
63
|
end
|
69
64
|
end
|
data/lib/coral_backup/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coral_backup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OTSUKA Tatsuya
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '10.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -75,6 +75,7 @@ extensions: []
|
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
77
|
- ".gitignore"
|
78
|
+
- ".rspec"
|
78
79
|
- ".travis.yml"
|
79
80
|
- Gemfile
|
80
81
|
- LICENSE
|