petasos 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/petasos/location.rb +15 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 45cc6ffc29777b7fb1148c81b873fb5deb7eb52bc452a4e8d709f192bea1f62b
|
4
|
+
data.tar.gz: 320bcf6171021b4c3f3f62ea9c8000e42c535af170acf96204af58aea6f3fc22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c896d71c01d7b60a6225660d528587f02026b6bf72e914b39bc1bacf623922e8dc5045f95b4473eb1fb4ac0e21897f1776a4e9e09942f2d17f2f3ad6b76ff884
|
7
|
+
data.tar.gz: 2583ee6f496c91ac49016071b41a89911dcdbe76a7fae07a024657bcade97fd238795c8b97be31c13f38d7196fa4c1e644e418408ca92b64441f4d1b55b31edf
|
data/lib/petasos/location.rb
CHANGED
@@ -21,10 +21,11 @@ class Petasos::Location
|
|
21
21
|
completed_files = YAML.load_file(completed_export_file_path)
|
22
22
|
|
23
23
|
process_lifecycle_hooks("after_export", pool, completed_files)
|
24
|
+
|
25
|
+
`mkdir -p logs`
|
26
|
+
`mv #{export_file_path} logs/`
|
27
|
+
`mv #{completed_export_file_path} logs/`
|
24
28
|
end
|
25
|
-
`mkdir -p logs`
|
26
|
-
`mv #{export_file_path} logs/`
|
27
|
-
`mv #{completed_export_file_path} logs/`
|
28
29
|
end
|
29
30
|
|
30
31
|
# get all filenames in this location that belong to this pool
|
@@ -46,7 +47,8 @@ class Petasos::Location
|
|
46
47
|
|
47
48
|
# update list of seen files
|
48
49
|
# unless the location opts out
|
49
|
-
|
50
|
+
# or the pool opts out
|
51
|
+
unless config["disable_seen"] or pool["disable_seen"]
|
50
52
|
update_seen_pool_files(pool, seen_pool_files + new_files)
|
51
53
|
end
|
52
54
|
end
|
@@ -121,7 +123,11 @@ class Petasos::Location
|
|
121
123
|
end
|
122
124
|
|
123
125
|
def read_seen_pool_files(pool)
|
124
|
-
|
126
|
+
unless config["disable_seen"] or pool["disable_seen"]
|
127
|
+
YAML.load_file(File.join(Dir.pwd, "seen_#{config["name"]}_#{pool["name"]}.yaml"))
|
128
|
+
else
|
129
|
+
[]
|
130
|
+
end
|
125
131
|
end
|
126
132
|
|
127
133
|
def update_seen_pool_files(pool, file_paths)
|
@@ -131,8 +137,10 @@ class Petasos::Location
|
|
131
137
|
|
132
138
|
def initialize_all_seen_pool_files
|
133
139
|
pools.each do |pool|
|
134
|
-
|
135
|
-
|
140
|
+
unless config["disable_seen"] or pool["disable_seen"]
|
141
|
+
yaml_path = "seen_#{config["name"]}_#{pool["name"]}.yaml"
|
142
|
+
write_yaml(yaml_path, []) unless File.file?(yaml_path)
|
143
|
+
end
|
136
144
|
end
|
137
145
|
end
|
138
146
|
|