coral_backup 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 61aaad4bb86a0e4205eb4e4574be67a521b2accd
4
- data.tar.gz: 3970c5f8a4e89bea6577c4abce51c8bccb720724
3
+ metadata.gz: 0b233b4d3c592438bd77271ed6327a6817a10d90
4
+ data.tar.gz: 1d2b304154bee8de69a706a84220b5ce5957570f
5
5
  SHA512:
6
- metadata.gz: 42002ea195e5462c7dff6666cfede499b841161e6f6776c08efdc4c93836ed2b85dfd26468277b1c65bde4ebae0eb2150eff07527c3245931a3036b7349608b9
7
- data.tar.gz: b1efb11c94048e41de5c284e33766ae053c4947993c9f6b7316500614f524241fa33b351754b49ab505fbc72ef2322098921bcad9d8443ede2be5b443b386dad
6
+ metadata.gz: 7017e286c0423852151822243860c57739ac924e7fcf41555b4d7ad7dc42bb8231742d7978180ea7e4870d77c16245c1b1fe1cf0e72f886c185466e44107bd64
7
+ data.tar.gz: 1e17234b53844be28540ec5a28176c55467a8239121c8ed235b016ca448b1badc2f3b484305076639258048ce704f09838f507e7085f9a8a58fe04d1633cfbb3
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
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
+ ![run](https://cloud.githubusercontent.com/assets/1025461/8147090/2d8be3bc-1299-11e5-8c46-50127cf74246.gif)
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
+ ![add](https://cloud.githubusercontent.com/assets/1025461/8147087/22e5ba1e-1299-11e5-91b2-1d39add9febb.gif)
31
+
32
+ ![info](https://cloud.githubusercontent.com/assets/1025461/8147088/2a55297e-1299-11e5-8a2d-222902419c6c.gif)
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 test` 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.
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 "rake/testtask"
2
+ require "rspec/core/rake_task"
3
3
 
4
- Rake::TestTask.new(:test) do |t|
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 => :test
6
+ task :default => :spec
data/coral_backup.gemspec CHANGED
@@ -24,5 +24,5 @@ Gem::Specification.new do |spec|
24
24
 
25
25
  spec.add_development_dependency "bundler", "~> 1.10"
26
26
  spec.add_development_dependency "rake", "~> 10.0"
27
- spec.add_development_dependency "minitest"
27
+ spec.add_development_dependency "rspec"
28
28
  end
@@ -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
- warn "ERROR: Wrong number of directories (#{file_selector.files.length} for 1):"
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
@@ -1,3 +1,3 @@
1
1
  module CoralBackup
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
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.1
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-14 00:00:00.000000000 Z
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: minitest
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