statscloud 1.1.1 → 1.1.2

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
- SHA256:
3
- metadata.gz: 453bc5a93478f283118f53760a2e4d317991430fe3c456099cf4bba6c60980ed
4
- data.tar.gz: f92c79947fc8e0d8ce281e2ee53021aca4b5b256eb421dfb763f31520dfa5b7b
2
+ SHA1:
3
+ metadata.gz: 09e53f93e0256bdb1d7cca10342ca813c3f24ca2
4
+ data.tar.gz: 8908fbe41125fdd6360e67a1f14abc2118ae7a55
5
5
  SHA512:
6
- metadata.gz: f6570bb5634c9f84c47b8faad0d9c8fe0a38735cb5b82d84c0136bbacc5f48e4aaeb158f865991a2823ad332121849f3c15d4f4ee64f65dce23457c12aad549d
7
- data.tar.gz: ba903954aa9544c4314e6e5ff933f5cb9d6ccb26a1f6069cac1c10816657d7dcc35e7275f67f1f2fdd4c32331bf2e7ccd8f53bcc1c76dbbf0c0caa84566d0fa0
6
+ metadata.gz: c5bd4090110b99032c7994729bae102d56a53b1479ff8ca0dad5e94ab3e2512a5ca8fa29b48cf20678048d78f3891f5c777c4f5f87b7bcd42c27f31b60f63e8d
7
+ data.tar.gz: 8c56520587fb19179306cd19dd52d49b3ad9ab5f964ef53b42ce7f013f40565b15c6cccbab964796f76f3ed1c39b384cfceff52afaf4179b3e965fcd72e3eb96
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- statscloud (1.1.1)
4
+ statscloud (1.1.2)
5
5
  crc32 (~> 1.0.1)
6
6
  eventmachine (~> 1.2)
7
7
  fileutils
@@ -32,9 +32,9 @@ GEM
32
32
  httparty (0.16.3)
33
33
  mime-types (~> 3.0)
34
34
  multi_xml (>= 0.5.2)
35
- i18n (1.2.0)
35
+ i18n (1.5.2)
36
36
  concurrent-ruby (~> 1.0)
37
- jaro_winkler (1.5.1)
37
+ jaro_winkler (1.5.2)
38
38
  json (2.1.0)
39
39
  leon (1.1.2)
40
40
  logger (1.3.0)
@@ -44,8 +44,8 @@ GEM
44
44
  minitest (5.11.3)
45
45
  multi_xml (0.6.0)
46
46
  netrc (0.11.0)
47
- parallel (1.12.1)
48
- parser (2.5.3.0)
47
+ parallel (1.13.0)
48
+ parser (2.6.0.0)
49
49
  ast (~> 2.4.0)
50
50
  powerpack (0.1.2)
51
51
  rainbow (3.0.0)
@@ -87,7 +87,7 @@ GEM
87
87
  unf (0.1.4)
88
88
  unf_ext
89
89
  unf_ext (0.0.7.5)
90
- unicode-display_width (1.4.0)
90
+ unicode-display_width (1.4.1)
91
91
  websocket (1.2.8)
92
92
  websocket-client-simple (0.3.0)
93
93
  event_emitter
@@ -105,4 +105,4 @@ DEPENDENCIES
105
105
  statscloud!
106
106
 
107
107
  BUNDLED WITH
108
- 1.17.1
108
+ 1.16.0
@@ -19,7 +19,7 @@ module StatsCloud
19
19
 
20
20
  # Creates statscloud configuration file.
21
21
  def create_config_file
22
- copy_file ".statscloud_template.yml", ".statscloud.yml"
22
+ copy_file "statscloud_template.yml", File.join("config", "statscloud.yml")
23
23
  end
24
24
  end
25
25
  end
@@ -12,7 +12,7 @@ module StatsCloud
12
12
  def initialize_values
13
13
  @config = {}
14
14
  @source_mappings = { metrics: [], admins: [], dashboards: [], alerts: [] }
15
- update_config_file(".statscloud.yml")
15
+ update_config_file("statscloud.yml")
16
16
  end
17
17
 
18
18
  def generate_configuration(base_config)
@@ -49,7 +49,7 @@ module StatsCloud
49
49
  end
50
50
 
51
51
  def update_config_file(file)
52
- @config_file = file
52
+ @config_file = rails_environment ? config_dir_file(file) : file
53
53
  end
54
54
 
55
55
  def config_token
@@ -57,7 +57,7 @@ module StatsCloud
57
57
  end
58
58
 
59
59
  def env
60
- @env ||= @config["environment"] || ENV["RAILS_ENV"] || "default"
60
+ @env ||= @config["environment"] || rails_environment || "default"
61
61
  end
62
62
 
63
63
  def tags
@@ -89,6 +89,14 @@ module StatsCloud
89
89
  "statscloud.io support configured, dashboard URLs are \n#{(@cluster['grafanaDashboardsUrls'] || []).join("\n")}"
90
90
  end
91
91
 
92
+ def config_dir_file(file)
93
+ File.join("config", file)
94
+ end
95
+
96
+ def rails_environment
97
+ ENV["RAILS_ENV"]
98
+ end
99
+
92
100
  def statscloud_error(message)
93
101
  StatsCloud::ClientError.new(message)
94
102
  end
@@ -64,12 +64,13 @@ module StatsCloud
64
64
  end
65
65
 
66
66
  # Connects to the server and starts periodic sending events.
67
- def connect(register_connection_job)
67
+ def connect(register_connection_job = nil)
68
+ @register_connection_job ||= register_connection_job
68
69
  Thread.new do
69
70
  connect_client
70
71
  start_plugins
71
72
  flush_events_loop
72
- register_connection_job.start
73
+ @register_connection_job&.start
73
74
  end
74
75
  end
75
76
 
@@ -143,7 +144,7 @@ module StatsCloud
143
144
  eventmachine.run do
144
145
  eventmachine.add_periodic_timer(0.5) do
145
146
  @mutex.synchronize do
146
- flush_events if connected?
147
+ connected? ? flush_events : connect.join
147
148
  end
148
149
  end
149
150
  end
@@ -4,5 +4,5 @@ module StatsCloud
4
4
  # version of statscloud-ruby-client.
5
5
  #
6
6
  # Type: *String*
7
- VERSION = "1.1.1"
7
+ VERSION = "1.1.2"
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statscloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Ovcharov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-12-19 00:00:00.000000000 Z
11
+ date: 2019-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: crc32
@@ -213,8 +213,8 @@ files:
213
213
  - lib/statscloud/statscloud_client.rb
214
214
  - lib/statscloud/statsmeter_client.rb
215
215
  - lib/statscloud/version.rb
216
- - lib/templates/statscloud/.statscloud_template.yml
217
216
  - lib/templates/statscloud/statscloud_template.rb
217
+ - lib/templates/statscloud/statscloud_template.yml
218
218
  - statscloud.gemspec
219
219
  homepage: https://statscloud.io
220
220
  licenses:
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  version: '0'
238
238
  requirements: []
239
239
  rubyforge_project:
240
- rubygems_version: 2.7.7
240
+ rubygems_version: 2.5.1
241
241
  signing_key:
242
242
  specification_version: 4
243
243
  summary: StatsCloud service.