statscloud 1.0.4 → 1.0.5

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: eb4636c428d2bdf3e787989de374e1419343363ee91b1abc3dd767dc4f4644a8
4
- data.tar.gz: 07666f855bad5d68797f24a2342b17875cfa5e99627ab10fe6f51e8995e1805a
3
+ metadata.gz: 5d9d7c865dacdf778f52f17b9faaa8d626b9b32d4426a249dd08d6774ca48287
4
+ data.tar.gz: 2f179fc402e2e4bb8297089be6f759ef641b78bd21f42b20015d6a7e5e24deaf
5
5
  SHA512:
6
- metadata.gz: 750eb1480dd06068bccfcd0bd54a783094c87e212dc04c957faa5b8f8c6cc6e2547628b3d6ea99203a7e629d709751d08b853e555f2402b82c676119b1318690
7
- data.tar.gz: 4f1f670bff40b26dd8c906afba20cd041ec9fba6bf53b77f5a2b769d6c086b7c849f15baf75cfa30c0bccc29b7823f9a0dcba3f63def7d7c075f3e7478a93d34
6
+ metadata.gz: b747c318463f76dcf2919a19e7dd474bb7eb35458cc90a43925ec45e5ebd907f4c17b14a3fa1f379e6206ea885ec3687d39869a19cc23760475ba36017a3131b
7
+ data.tar.gz: 933d056e27e42986cc46d817763157bf03db70139dbc36ed82f41a0c3afd50dffb4670b9c0b55e1bc92be250d3d8fd492a08af4c3e4f409302fffdc7d721395f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- statscloud (1.0.4)
4
+ statscloud (1.0.5)
5
5
  activesupport (>= 5.0.0.1)
6
6
  crc32 (~> 1.0.1)
7
7
  eventmachine (~> 1.2)
@@ -18,7 +18,7 @@ module StatsCloud
18
18
  # cluster api host.
19
19
  #
20
20
  # @api public
21
- def initialize(env, host = "https://cluster-api-v1.statscloud.statscloud.io")
21
+ def initialize(env, host = "https://cluster-api-v1.statscloud.agiliumlabs.cloud")
22
22
  @environment = env
23
23
  @host = host
24
24
  end
@@ -6,9 +6,10 @@ require_relative "logger_helper"
6
6
  module StatsCloud
7
7
  # This helper configures StatsCloud plugins.
8
8
  module PluginsHelper
9
- def check_plugins(plugins)
9
+ def build_plugins(plugins)
10
10
  plugins&.each do |plugin|
11
- plugin[:class_name] = check_plugin_gem_by_name(plugin_class_name_from_plugin(plugin))
11
+ plugin = plugin.is_a?(Hash) ? plugin : simple_plugin_config(plugin)
12
+ plugin[:class_name] = constantize_plugin_by_name(plugin_class_name_from_plugin(plugin))
12
13
  end
13
14
  end
14
15
 
@@ -20,11 +21,17 @@ module StatsCloud
20
21
 
21
22
  private
22
23
 
24
+ def simple_plugin_config(plugin)
25
+ {
26
+ name: plugin
27
+ }.with_indifferent_access
28
+ end
29
+
23
30
  def start_plugin(plugin, mutex)
24
31
  plugin[:class_name].start(self, mutex, plugin["settings"])
25
32
  end
26
33
 
27
- def check_plugin_gem_by_name(plugin_name)
34
+ def constantize_plugin_by_name(plugin_name)
28
35
  Object.const_get "StatsCloud::Plugin::#{plugin_name}"
29
36
  rescue NameError
30
37
  raise statscloud_error(no_plugin_error_message(plugin_name))
@@ -35,12 +42,7 @@ module StatsCloud
35
42
  end
36
43
 
37
44
  def plugin_class_name_from_plugin(plugin)
38
- plugin_name = get_plugin_name(plugin)
39
- plugin_name.split("-").map(&:capitalize).join
40
- end
41
-
42
- def get_plugin_name(plugin)
43
- plugin.is_a?(Hash) ? plugin["name"] : plugin
45
+ plugin["name"].split("-").map(&:capitalize).join
44
46
  end
45
47
 
46
48
  def statscloud_error(message)
@@ -123,7 +123,7 @@ module StatsCloud
123
123
  end
124
124
 
125
125
  def configure_statscloud_plugins
126
- @plugins = check_plugins(@config["plugins"])
126
+ @plugins = build_plugins(@config["plugins"])
127
127
  end
128
128
 
129
129
  def configure_cluster
@@ -4,5 +4,5 @@ module StatsCloud
4
4
  # version of statscloud-ruby-client.
5
5
  #
6
6
  # Type: *String*
7
- VERSION = "1.0.4"
7
+ VERSION = "1.0.5"
8
8
  end
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.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Ovcharov