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: c9d24059cae69a30fb375e840247768dec6be9f40a4f03c7b90779e5cd586f2c
4
- data.tar.gz: 8ff6ffb52ccbc8c13e052bfc710752233f16a418765efc0eb3a3af5bdc51af97
3
+ metadata.gz: fbf1ec4d07bf5abd84b075d045f821bac681c8d78a706a30707b576e6ca41a29
4
+ data.tar.gz: 0f2d5634ed5e00aa48dee45c974cb5de34f11edfbb628a7965596c3e3b866481
5
5
  SHA512:
6
- metadata.gz: d0f0d8c3f75e134c7e3e41359df0874e9e38c94f9a51017b65bdca6826bf5ae251a8fb902ab220fb8fd40dfaef643d1db582f1e6194497a08b9b30d4a2e8c320
7
- data.tar.gz: a86a49f78a9b9ea32cca3df09dae0b9507d74f57f7f2e954836d95801bdd7c727fea3e62b1ac43e77c1f00a5685a5db4535e235681949b76711967be0c17e241
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.exists?(cache_file_path)
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 cache_file_path)
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 |resource|
4
+ resources(resource).each do |resource_class|
5
5
  FileUtils.cp(
6
- resource.cache_file_path,
7
- "#{path}/#{resource.name.split("::").last}.json"
6
+ resource_class.cache_file_path,
7
+ "#{path}/#{resource_class.name.split("::").last}.json"
8
8
  )
9
9
  end
10
10
  end
@@ -2,7 +2,8 @@ module StatusPageVi
2
2
  class BaseService
3
3
  def self.resources(resource_name)
4
4
  return StatusPageVi::RESOURCES.values if resource_name == "ALL"
5
- [ resource_name ]
5
+
6
+ [resource_name]
6
7
  end
7
8
  end
8
9
  end
@@ -1,3 +1,3 @@
1
1
  module StatusPageVi
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -1,4 +1,3 @@
1
-
2
1
  lib = File.expand_path("../lib", __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require "status_page_vi/version"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: status_page_vi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Cherednichenko