lex-health 0.1.0 → 0.1.1

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: c4be3a4b0f0ef799e3fc2db38ea95e1d5522e184fd0433bce64ad30905543142
4
- data.tar.gz: 5095b66029faf430a2b2f995ab1a77e7ca37cf8382bf7da47e44a9bdb1f949bf
3
+ metadata.gz: 4ce775857c216326a67307d19fbbdbd7b728b3f528041f60026310d3f1b57f59
4
+ data.tar.gz: 89a62746f34936499b4d4a4fbfa4be4db00e3eba5f037cbe1356b48007854ab7
5
5
  SHA512:
6
- metadata.gz: 8729e7a2242b0c6e7adc8474717a2e43b1d2b7473669a1d8b7a3aa05ac1640e5ad49308b52386df84fa65922013d9f819ce798c7c5fcdc5c86f9b78721c16db0
7
- data.tar.gz: 5bff8c5455b5b85ff769d4dae2b4aa57a97e0664f354ee872d969a23dadc41c3af11744ea5799eb05c043713885cbb8ff3867c59d72fa79d75d4fb12592ef922
6
+ metadata.gz: 418817d7bed99e8dd710600a98bdde35ee5d19d494ed7c77fa561f685b6d4f9bf5dbd4be77c3b5b5bc61b41bf6bb819a8e167dda3ee1efca741e2fcd330ee434
7
+ data.tar.gz: de7d737ec53ca7ede4a0eb0530e23719fc029b32669a7d7c1d477f8ca8305ad4b79631c01d1e7c9c10635e035a1eec9fdba86dd5d346794849c89c48ceba7f5e
@@ -17,6 +17,7 @@ Style/Documentation:
17
17
  Enabled: false
18
18
  AllCops:
19
19
  TargetRubyVersion: 2.5
20
+ NewCops: enable
20
21
  Style/FrozenStringLiteralComment:
21
22
  Enabled: false
22
23
  Naming/FileName:
@@ -6,55 +6,58 @@ PATH
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.4.0)
10
- codecov (0.1.16)
9
+ ast (2.4.1)
10
+ codecov (0.2.2)
11
+ colorize
11
12
  json
12
13
  simplecov
13
- url
14
- diff-lcs (1.3)
14
+ colorize (0.8.1)
15
+ diff-lcs (1.4.4)
15
16
  docile (1.3.2)
16
- jaro_winkler (1.5.4)
17
- json (2.3.0)
18
- parallel (1.19.1)
19
- parser (2.7.0.4)
20
- ast (~> 2.4.0)
17
+ json (2.3.1)
18
+ parallel (1.19.2)
19
+ parser (2.7.1.4)
20
+ ast (~> 2.4.1)
21
21
  rainbow (3.0.0)
22
22
  rake (13.0.1)
23
+ regexp_parser (1.7.1)
23
24
  rexml (3.2.4)
24
25
  rspec (3.9.0)
25
26
  rspec-core (~> 3.9.0)
26
27
  rspec-expectations (~> 3.9.0)
27
28
  rspec-mocks (~> 3.9.0)
28
- rspec-core (3.9.1)
29
- rspec-support (~> 3.9.1)
30
- rspec-expectations (3.9.0)
29
+ rspec-core (3.9.2)
30
+ rspec-support (~> 3.9.3)
31
+ rspec-expectations (3.9.2)
31
32
  diff-lcs (>= 1.2.0, < 2.0)
32
33
  rspec-support (~> 3.9.0)
33
34
  rspec-mocks (3.9.1)
34
35
  diff-lcs (>= 1.2.0, < 2.0)
35
36
  rspec-support (~> 3.9.0)
36
- rspec-support (3.9.2)
37
- rubocop (0.80.1)
38
- jaro_winkler (~> 1.5.1)
37
+ rspec-support (3.9.3)
38
+ rubocop (0.88.0)
39
39
  parallel (~> 1.10)
40
- parser (>= 2.7.0.1)
40
+ parser (>= 2.7.1.1)
41
41
  rainbow (>= 2.2.2, < 4.0)
42
+ regexp_parser (>= 1.7)
42
43
  rexml
44
+ rubocop-ast (>= 0.1.0, < 1.0)
43
45
  ruby-progressbar (~> 1.7)
44
- unicode-display_width (>= 1.4.0, < 1.7)
45
- rubocop-md (0.3.1)
46
+ unicode-display_width (>= 1.4.0, < 2.0)
47
+ rubocop-ast (0.2.0)
48
+ parser (>= 2.7.0.1)
49
+ rubocop-md (0.4.0)
46
50
  rubocop (~> 0.60)
47
- rubocop-performance (1.5.2)
48
- rubocop (>= 0.71.0)
49
- rubocop-rspec (1.38.1)
50
- rubocop (>= 0.68.1)
51
+ rubocop-performance (1.7.1)
52
+ rubocop (>= 0.82.0)
53
+ rubocop-rspec (1.42.0)
54
+ rubocop (>= 0.87.0)
51
55
  ruby-progressbar (1.10.1)
52
56
  simplecov (0.18.5)
53
57
  docile (~> 1.1)
54
58
  simplecov-html (~> 0.11)
55
59
  simplecov-html (0.12.2)
56
- unicode-display_width (1.6.1)
57
- url (0.3.2)
60
+ unicode-display_width (1.7.0)
58
61
 
59
62
  PLATFORMS
60
63
  ruby
@@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
23
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
24
  end
25
- spec.bindir = 'exe'
26
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
26
  spec.require_paths = ['lib']
28
27
 
@@ -6,18 +6,17 @@ module Legion::Extensions::Health
6
6
  def self.update(hostname:, **opts)
7
7
  item = Legion::Data::Model::Node.where(name: hostname).first
8
8
 
9
- if item.nil?
10
- return { success: true, hostname: hostname, **opts } if insert(hostname: hostname, **opts)
11
-
12
- return { success: false, hostname: hostname, **opts }
13
- end
9
+ return { success: insert(hostname: hostname, **opts), hostname: hostname, **opts } if item.nil?
14
10
 
15
11
  if opts.key?(:timestamp) && !item.values[:updated].nil? && item.values[:updated] > Time.parse(opts[:timestamp])
16
- return { success: false, reason: 'entry already updated', hostname: hostname, db_updated: item.values[:updated], **opts }
12
+ return { success: false,
13
+ reason: 'entry already updated',
14
+ hostname: hostname,
15
+ db_updated: item.values[:updated],
16
+ **opts }
17
17
  end
18
18
 
19
- item.update(active: 1, status: opts[:status], name: hostname)
20
- { success: true, hostname: hostname, **opts }
19
+ { success: item.update(active: 1, status: opts[:status], name: hostname), hostname: hostname, **opts }
21
20
  end
22
21
 
23
22
  def self.insert(hostname:, status: 'unknown', **opts)
@@ -1,7 +1,7 @@
1
1
  module Legion
2
2
  module Extensions
3
3
  module Health
4
- VERSION = '0.1.0'.freeze
4
+ VERSION = '0.1.1'.freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lex-health
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miverson
8
- autorequire:
9
- bindir: exe
8
+ autorequire:
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-26 00:00:00.000000000 Z
11
+ date: 2020-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -131,12 +131,6 @@ extra_rdoc_files: []
131
131
  files:
132
132
  - ".circleci/config.yml"
133
133
  - ".gitignore"
134
- - ".idea/.rakeTasks"
135
- - ".idea/lex-health.iml"
136
- - ".idea/misc.xml"
137
- - ".idea/modules.xml"
138
- - ".idea/vagrant.xml"
139
- - ".idea/workspace.xml"
140
134
  - ".rspec"
141
135
  - ".rubocop.yml"
142
136
  - Gemfile
@@ -163,7 +157,7 @@ metadata:
163
157
  homepage_uri: https://bitbucket.org/legion-io/lex-health
164
158
  source_code_uri: https://bitbucket.org/legion-io/lex-heartbeat
165
159
  changelog_uri: https://bitbucket.org/legion-io/lex-heartbeat/CHANGELOG.md
166
- post_install_message:
160
+ post_install_message:
167
161
  rdoc_options: []
168
162
  require_paths:
169
163
  - lib
@@ -178,8 +172,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
172
  - !ruby/object:Gem::Version
179
173
  version: '0'
180
174
  requirements: []
181
- rubygems_version: 3.0.8
182
- signing_key:
175
+ rubygems_version: 3.1.2
176
+ signing_key:
183
177
  specification_version: 4
184
178
  summary: Legion::Extensions::Health
185
179
  test_files: []
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <Settings><!--This file was automatically generated by Ruby plugin.
3
- You are allowed to:
4
- 1. Remove rake task
5
- 2. Add existing rake tasks
6
- To add existing rake tasks automatically delete this file and reload the project.
7
- --><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build lex-health-0.1.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install lex-health-0.1.0.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install lex-health-0.1.0.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v0.1.0 and build and push lex-health-0.1.0.gem to rubygems.org" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
@@ -1,38 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="RUBY_MODULE" version="4">
3
- <component name="ModuleRunConfigurationManager">
4
- <shared />
5
- </component>
6
- <component name="NewModuleRootManager">
7
- <content url="file://$MODULE_DIR$" />
8
- <orderEntry type="inheritedJdk" />
9
- <orderEntry type="sourceFolder" forTests="false" />
10
- <orderEntry type="library" scope="PROVIDED" name="ast (v2.4.0, RVM: ruby-2.6.3) [gem]" level="application" />
11
- <orderEntry type="library" scope="PROVIDED" name="bundler (v2.1.4, RVM: ruby-2.6.3) [gem]" level="application" />
12
- <orderEntry type="library" scope="PROVIDED" name="chef (v15.8.23, RVM: ruby-2.6.3) [gem]" level="application" />
13
- <orderEntry type="library" scope="PROVIDED" name="codecov (v0.1.16, RVM: ruby-2.6.3) [gem]" level="application" />
14
- <orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, RVM: ruby-2.6.3) [gem]" level="application" />
15
- <orderEntry type="library" scope="PROVIDED" name="docile (v1.3.2, RVM: ruby-2.6.3) [gem]" level="application" />
16
- <orderEntry type="library" scope="PROVIDED" name="jaro_winkler (v1.5.4, RVM: ruby-2.6.3) [gem]" level="application" />
17
- <orderEntry type="library" scope="PROVIDED" name="json (v2.3.0, RVM: ruby-2.6.3) [gem]" level="application" />
18
- <orderEntry type="library" scope="PROVIDED" name="parallel (v1.19.1, RVM: ruby-2.6.3) [gem]" level="application" />
19
- <orderEntry type="library" scope="PROVIDED" name="parser (v2.7.0.4, RVM: ruby-2.6.3) [gem]" level="application" />
20
- <orderEntry type="library" scope="PROVIDED" name="rainbow (v3.0.0, RVM: ruby-2.6.3) [gem]" level="application" />
21
- <orderEntry type="library" scope="PROVIDED" name="rake (v13.0.1, RVM: ruby-2.6.3) [gem]" level="application" />
22
- <orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.4, RVM: ruby-2.6.3) [gem]" level="application" />
23
- <orderEntry type="library" scope="PROVIDED" name="rspec (v3.9.0, RVM: ruby-2.6.3) [gem]" level="application" />
24
- <orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.9.1, RVM: ruby-2.6.3) [gem]" level="application" />
25
- <orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.9.0, RVM: ruby-2.6.3) [gem]" level="application" />
26
- <orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.9.1, RVM: ruby-2.6.3) [gem]" level="application" />
27
- <orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.9.2, RVM: ruby-2.6.3) [gem]" level="application" />
28
- <orderEntry type="library" scope="PROVIDED" name="rubocop (v0.80.1, RVM: ruby-2.6.3) [gem]" level="application" />
29
- <orderEntry type="library" scope="PROVIDED" name="rubocop-md (v0.3.2, RVM: ruby-2.6.3) [gem]" level="application" />
30
- <orderEntry type="library" scope="PROVIDED" name="rubocop-performance (v1.5.2, RVM: ruby-2.6.3) [gem]" level="application" />
31
- <orderEntry type="library" scope="PROVIDED" name="rubocop-rspec (v1.38.1, RVM: ruby-2.6.3) [gem]" level="application" />
32
- <orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.10.1, RVM: ruby-2.6.3) [gem]" level="application" />
33
- <orderEntry type="library" scope="PROVIDED" name="simplecov (v0.18.5, RVM: ruby-2.6.3) [gem]" level="application" />
34
- <orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.12.2, RVM: ruby-2.6.3) [gem]" level="application" />
35
- <orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v1.6.1, RVM: ruby-2.6.3) [gem]" level="application" />
36
- <orderEntry type="library" scope="PROVIDED" name="url (v0.3.2, RVM: ruby-2.6.3) [gem]" level="application" />
37
- </component>
38
- </module>
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="JavaScriptSettings">
4
- <option name="languageLevel" value="ES6" />
5
- </component>
6
- <component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.6.3" project-jdk-type="RUBY_SDK" />
7
- </project>
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/lex-health.iml" filepath="$PROJECT_DIR$/.idea/lex-health.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,7 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VagrantProjectSettings">
4
- <option name="instanceFolder" value="" />
5
- <option name="provider" value="" />
6
- </component>
7
- </project>
@@ -1,13 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="CoverageOptionsProvider">
4
- <option name="myAddOrReplace" value="0" />
5
- </component>
6
- <component name="Git.Settings">
7
- <option name="PUSH_AUTO_UPDATE" value="true" />
8
- <option name="ROOT_SYNC" value="DONT_SYNC" />
9
- </component>
10
- <component name="PropertiesComponent">
11
- <property name="settings.editor.selected.configurable" value="reference.settingsdialog.project.vagrant" />
12
- </component>
13
- </project>