statscloud 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ef41219d5c5e8f41a545baf7d6227891f8007f7eb29b08f70848a82bda775c9
4
- data.tar.gz: dfe3ca26a35f7e103db7f04ebcbce4200d397bcecabea2599a62539cec02e391
3
+ metadata.gz: 00ef058f3553e52eec23bd98630e643ab43a323f67684681994263010249d202
4
+ data.tar.gz: f56e77cd1509110497f847e69cb0180890325a567a09415c1b0a8fc3f6d052e2
5
5
  SHA512:
6
- metadata.gz: 67baa18a0d5a7a590cce861918d2a693256e118548d92033ed80d98f0154d99d38467f2b014554d20ecfb866955826ce669ebab4ac93ee5cb5ae7e90e4408ac5
7
- data.tar.gz: 8ca7bff390130ea5f43d4423590e45379d8c5d564b4fba2d258dacdb673c66df16fe2d83790e408def92055ce422d844bd42cc2842f22615f85b1258285fa798
6
+ metadata.gz: debc25c241c6b738f9638c04ea2fedad7ea4c8948978ef830acb4c28d141c7b50fc41e8046d07277072110adc7c6c35e44acf078dcd3b203b1750871fe06de77
7
+ data.tar.gz: e531513f320a1785c27cbaabfc7847b2ae91562c6a2d12bb60b11f979b74e81fd00a90e2d6438d5fedd5d44924b0acbc2504175e89c451c3334688d23294df88
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- statscloud (1.0.8)
5
- activesupport (~> 5.2)
4
+ statscloud (1.0.9)
6
5
  crc32 (~> 1.0.1)
7
6
  eventmachine (~> 1.2)
8
7
  fileutils
@@ -14,12 +13,6 @@ PATH
14
13
  GEM
15
14
  remote: https://rubygems.org/
16
15
  specs:
17
- activesupport (5.2.1.1)
18
- concurrent-ruby (~> 1.0, >= 1.0.2)
19
- i18n (>= 0.7, < 2)
20
- minitest (~> 5.1)
21
- tzinfo (~> 1.1)
22
- concurrent-ruby (1.1.3)
23
16
  crc32 (1.0.1)
24
17
  diff-lcs (1.3)
25
18
  domain_name (0.5.20180417)
@@ -32,15 +25,12 @@ GEM
32
25
  httparty (0.16.3)
33
26
  mime-types (~> 3.0)
34
27
  multi_xml (>= 0.5.2)
35
- i18n (1.1.1)
36
- concurrent-ruby (~> 1.0)
37
28
  json (2.1.0)
38
29
  leon (1.1.2)
39
- logger (1.2.8)
30
+ logger (1.3.0)
40
31
  mime-types (3.2.2)
41
32
  mime-types-data (~> 3.2015)
42
33
  mime-types-data (3.2018.0812)
43
- minitest (5.11.3)
44
34
  multi_xml (0.6.0)
45
35
  netrc (0.11.0)
46
36
  rake (10.5.0)
@@ -66,9 +56,6 @@ GEM
66
56
  httparty
67
57
  json
68
58
  websocket-client-simple (~> 0.3.0)
69
- thread_safe (0.3.6)
70
- tzinfo (1.2.5)
71
- thread_safe (~> 0.1)
72
59
  unf (0.1.4)
73
60
  unf_ext
74
61
  unf_ext (0.0.7.5)
@@ -89,7 +89,7 @@ module StatsCloud
89
89
  end
90
90
 
91
91
  def it_directory?(file_name, entry)
92
- File.directory?(file_name) && not_required_directory.exclude?(entry)
92
+ File.directory?(file_name) && !not_required_directory.include?(entry)
93
93
  end
94
94
 
95
95
  def it_config_file?(file_name, asset_selector)
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "fileutils"
4
- require "active_support/core_ext/numeric/time"
5
4
 
6
5
  module StatsCloud
7
6
  # This helper works to help log errors and info about StatsCloud service work.
@@ -37,7 +36,7 @@ module StatsCloud
37
36
  end
38
37
 
39
38
  def can_log?(last_log_at)
40
- last_log_at.nil? || Time.now - last_log_at > 10.minutes
39
+ last_log_at.nil? || Time.now.to_i - last_log_at > 600
41
40
  end
42
41
 
43
42
  def log_stop_logging(message_type)
@@ -45,11 +44,11 @@ module StatsCloud
45
44
  end
46
45
 
47
46
  def update_last_info_at
48
- @last_info_log_at = Time.now
47
+ @last_info_log_at = Time.now.to_i
49
48
  end
50
49
 
51
50
  def update_last_error_at
52
- @last_error_log_at = Time.now
51
+ @last_error_log_at = Time.now.to_i
53
52
  end
54
53
 
55
54
  def info_type
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "json"
4
- require "active_support/all"
5
4
 
6
5
  module StatsCloud
7
6
  # This helper works to parse response from the server to convenient object.
@@ -28,7 +27,7 @@ module StatsCloud
28
27
  private
29
28
 
30
29
  def parse_json(json, default = nil)
31
- JSON.parse(json).with_indifferent_access
30
+ JSON.parse(json)
32
31
  rescue JSON::ParserError
33
32
  default
34
33
  end
@@ -23,8 +23,8 @@ module StatsCloud
23
23
 
24
24
  def simple_plugin_config(plugin)
25
25
  {
26
- name: plugin
27
- }.with_indifferent_access
26
+ "name": plugin
27
+ }
28
28
  end
29
29
 
30
30
  def start_plugin(plugin, mutex)
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "leon"
4
- require "active_support/core_ext"
5
4
  require_relative "../errors/client_error"
6
5
 
7
6
  module StatsCloud
@@ -17,7 +16,7 @@ module StatsCloud
17
16
 
18
17
  def validate_configuration
19
18
  @app = @config["application"]
20
- raise error(app_name_missing_error_message) if @app.blank?
19
+ raise error(app_name_missing_error_message) if @app.nil? || @app.empty?
21
20
  end
22
21
 
23
22
  def config_environment(env)
@@ -62,7 +61,7 @@ module StatsCloud
62
61
  end
63
62
 
64
63
  def successful_message
65
- "statscloud.io support configured, dashboard URLs are \n #{(@cluster[:grafanaDashboardsUrls] || []).join("\n")}"
64
+ "statscloud.io support configured, dashboard URLs are \n #{(@cluster['grafanaDashboardsUrls'] || []).join("\n")}"
66
65
  end
67
66
 
68
67
  def statscloud_error(message)
@@ -158,13 +158,13 @@ module StatsCloud
158
158
  @cluster_client = create_cluster_client
159
159
  @cluster_client.deploy_cluster(@token, @app, @config)
160
160
  @cluster = @cluster_client.get_cluster(@token, @app).body
161
- @graphite_url = @cluster[:graphiteUrl]
161
+ @graphite_url = @cluster["graphiteUrl"]
162
162
  check_cluster_status(@cluster)
163
163
  log_info successful_message
164
164
  end
165
165
 
166
166
  def check_cluster_status(cluster)
167
- raise error(cluster_error_message) if cluster.nil? || cluster[:status][:status] == "ERROR"
167
+ raise error(cluster_error_message) if cluster.nil? || cluster["status"]["status"] == "ERROR"
168
168
  end
169
169
 
170
170
  def connect_to_cluster
@@ -181,7 +181,7 @@ module StatsCloud
181
181
  end
182
182
 
183
183
  def create_statsmeter_client(cluster, token, plugins, tags)
184
- host = cluster[:statsmeterUrl]
184
+ host = cluster["statsmeterUrl"]
185
185
  StatsCloud::StatsmeterClient.new(host, token, plugins, tags)
186
186
  end
187
187
  end
@@ -4,5 +4,5 @@ module StatsCloud
4
4
  # version of statscloud-ruby-client.
5
5
  #
6
6
  # Type: *String*
7
- VERSION = "1.0.8"
7
+ VERSION = "1.0.9"
8
8
  end
data/statscloud.gemspec CHANGED
@@ -33,7 +33,6 @@ Gem::Specification.new do |spec|
33
33
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
34
  spec.require_paths = ["lib"]
35
35
 
36
- spec.add_dependency "activesupport", "~> 5.2"
37
36
  spec.add_dependency "crc32", "~> 1.0.1"
38
37
  spec.add_dependency "eventmachine", "~> 1.2"
39
38
  spec.add_dependency "fileutils"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statscloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Ovcharov
@@ -10,20 +10,6 @@ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2018-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: activesupport
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '5.2'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '5.2'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: crc32
29
15
  requirement: !ruby/object:Gem::Requirement