logbrarian 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/logbrarian +3 -3
- data/lib/logbrarian/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9bbb6f7fd406d92d71c118afc97122773ed6ba0a
|
4
|
+
data.tar.gz: 7524c3b7d844c37995489cacc4031d4de040344c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b086b16555849baca2f1dec89bab0215cb2559e3dc46f43368f1e1c80b0df77298985941625d6073d73b12f3446c6da6de2ce13d433369188e434634b6a61996
|
7
|
+
data.tar.gz: b8492caf602b7fa0b30a8e9cfbe3a0deb89d7f5fa4cd209007be3cb07bf5fe69b9e2f8b660da12b7fd4055d03712a873100000204ee55c1dc3b9e54cfd065bd5
|
data/bin/logbrarian
CHANGED
@@ -52,11 +52,11 @@ begin
|
|
52
52
|
birthtime = File.birthtime(current_path)
|
53
53
|
rescue NotImplementedError
|
54
54
|
require 'yaml'
|
55
|
+
require 'date'
|
55
56
|
store_path = File.expand_path("~/.logbrarian.yml")
|
56
57
|
FileUtils.touch store_path
|
57
58
|
store = YAML.load_file(store_path) || Hash.new
|
58
|
-
|
59
|
-
birthtime = DateTime.parse(birth_string).to_time
|
59
|
+
birthtime = store[current_path] || Time.now
|
60
60
|
unless store.key?(current_path)
|
61
61
|
store[current_path] = birthtime
|
62
62
|
File.open(store_path, 'w') {|f| YAML.dump(store,f) }
|
@@ -78,7 +78,7 @@ if birthtime < options[:interval].ago
|
|
78
78
|
FileUtils.rm current_path
|
79
79
|
FileUtils.touch current_path
|
80
80
|
if store
|
81
|
-
store[current_path] = Time.now
|
81
|
+
store[current_path] = Time.now
|
82
82
|
File.open(store_path, 'w') {|f| YAML.dump(store,f) }
|
83
83
|
end
|
84
84
|
end
|
data/lib/logbrarian/version.rb
CHANGED