status_page_vi 0.2.0 → 0.3.0
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbf1ec4d07bf5abd84b075d045f821bac681c8d78a706a30707b576e6ca41a29
|
4
|
+
data.tar.gz: 0f2d5634ed5e00aa48dee45c974cb5de34f11edfbb628a7965596c3e3b866481
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9730a25f4d9adf100bfe4dc27f39f80e03db1eb0370d654dc2226167dedefd7dd777272ce60395a472923bc380cecc483d83f4d9c276cabf8fb6e8a79a7e393e
|
7
|
+
data.tar.gz: f119e266ffeafe27f174851b473cadc1fbf6e19bb20c0d3af1298c8a05a614396e86109e7cd79115360fd3aff4a2efa8075bb12bb58720dad03fcc41c5d2ca74
|
@@ -23,7 +23,7 @@ module StatusPageVi
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def update_storage(data)
|
26
|
-
File.delete(cache_file_path) if File.
|
26
|
+
File.delete(cache_file_path) if File.exist?(cache_file_path)
|
27
27
|
write_to_service_file(data)
|
28
28
|
end
|
29
29
|
|
@@ -31,14 +31,14 @@ module StatusPageVi
|
|
31
31
|
|
32
32
|
def collection
|
33
33
|
@collection ||= begin
|
34
|
-
JSON.parse(File.read
|
34
|
+
JSON.parse(File.read(cache_file_path))
|
35
35
|
rescue Errno::ENOENT
|
36
36
|
{}
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
40
|
def write_to_service_file(data)
|
41
|
-
Dir.mkdir("cache") unless Dir.exists?("cache")
|
41
|
+
Dir.mkdir("#{__dir__}/../../../cache") unless Dir.exists?("#{__dir__}/../../../cache")
|
42
42
|
File.open(cache_file_path, "w") { |file| file.write(data.to_json) }
|
43
43
|
end
|
44
44
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module StatusPageVi
|
2
2
|
class BackupService < BaseService
|
3
3
|
def self.backup(path, resource)
|
4
|
-
resources(resource).each do |
|
4
|
+
resources(resource).each do |resource_class|
|
5
5
|
FileUtils.cp(
|
6
|
-
|
7
|
-
"#{path}/#{
|
6
|
+
resource_class.cache_file_path,
|
7
|
+
"#{path}/#{resource_class.name.split("::").last}.json"
|
8
8
|
)
|
9
9
|
end
|
10
10
|
end
|
data/status_page_vi.gemspec
CHANGED