backenup 0.0.6 → 0.0.7

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/backenup.rb +33 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5861a4887a750effb5f81f9bf99fdbe89bc9c8b3
4
- data.tar.gz: 8820f9db6d5a45a4c298a42ce099f0dcb07f6140
3
+ metadata.gz: 76d389780e71f7211a2ac251a2c548e183b22a8a
4
+ data.tar.gz: 8ff90d63611c58d7ffc00f50b2f9e0e85e8c38e0
5
5
  SHA512:
6
- metadata.gz: 535ad6b216f85b0e06f148c1661f23b946cfc472ad0985c09b56d4ca5f08b5aac5b6aa022d5afdd7afaa24f745e9b87915e4695d7c5a09f4f7c77b7333e361c1
7
- data.tar.gz: d55a0e0985482ead0df34aa14e2afeff72bdb47a79a519ed3d87bafb371a7357b99ac0d5198e2128dac895926806dede87cfe73146028db4ee135c4041b89240
6
+ metadata.gz: 33672c2ad0e8f08e68ee765f391e85e0ec607db6204151077a4df8a0e990c74265ac57480f9f25c0c54f71ea6c5ea65f850f37033a057872ba2ecc8aa951b87e
7
+ data.tar.gz: 7eff004f52ec47fe0c24f16f0c4ad921ca1e9dec03bd140b391802a1237d455dd1e49d5396ad829bba7fa0343068348e81ac6a721a64aede92140396fdd1cf16
data/lib/backenup.rb CHANGED
@@ -45,13 +45,16 @@ module Backenup
45
45
  end
46
46
 
47
47
 
48
- def commit(message = nil, timeout = 600)
48
+ def commit(message = nil)
49
49
  message = default_message if message.nil?
50
50
 
51
51
  Dir.chdir self.base_path do
52
- @repo.git.timeout_after timeout do
53
- @repo.add "." # Add all new / modified files
54
- @repo.commit_all message # This handles any file that was deleted
52
+
53
+ with_timeout 0 do
54
+ with_max_size 0 do
55
+ @repo.add "." # Add all new / modified files
56
+ @repo.commit_all message # This handles any file that was deleted
57
+ end
55
58
  end
56
59
  end
57
60
 
@@ -67,6 +70,8 @@ module Backenup
67
70
  end
68
71
  end
69
72
 
73
+
74
+
70
75
 
71
76
  private
72
77
 
@@ -74,6 +79,30 @@ module Backenup
74
79
  Dir.mkdir self.storage_path unless File.exists?(self.storage_path)
75
80
  end
76
81
 
82
+
83
+ def with_timeout(seconds)
84
+ previous = Grit::Git.git_timeout
85
+ begin
86
+ Grit::Git.git_timeout = seconds
87
+ yield
88
+ ensure
89
+ Grit::Git.git_timeout = previous
90
+ end
91
+ end
92
+
93
+
94
+ def with_max_size(size)
95
+ previous = Grit::Git.git_max_size
96
+ begin
97
+ Grit::Git.git_max_size = size
98
+ yield
99
+ ensure
100
+ Grit::Git.git_max_size = previous
101
+ end
102
+ end
103
+
104
+
105
+
77
106
  end
78
107
 
79
108
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backenup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Lauber