Skip to content

Commit

Permalink
zabbixapi gem cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Mackensen authored and Snehit Gajjar committed Feb 8, 2019
1 parent 82b41ce commit f67282e
Show file tree
Hide file tree
Showing 52 changed files with 907 additions and 950 deletions.
16 changes: 0 additions & 16 deletions .codeclimate.yml

This file was deleted.

14 changes: 6 additions & 8 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
inherit_from: .rubocop_todo.yml
AllCops:
DisplayCopNames: true

Metrics/AbcSize:
Max: 58 # TODO: Lower to 15
Expand Down Expand Up @@ -32,9 +33,12 @@ Metrics/ParameterLists:
Metrics/PerceivedComplexity:
Max: 10

Style/AccessModifierIndentation:
Layout/AccessModifierIndentation:
EnforcedStyle: outdent

Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space

Style/Documentation:
Enabled: false

Expand All @@ -50,11 +54,5 @@ Style/HashSyntax:
Style/RaiseArgs:
EnforcedStyle: compact

Style/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space

Style/SymbolArray:
EnforcedStyle: brackets

Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: 'comma'
26 changes: 0 additions & 26 deletions .rubocop_todo.yml

This file was deleted.

9 changes: 0 additions & 9 deletions .yardopts

This file was deleted.

9 changes: 2 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ group :development do
end

group :test do
gem 'coveralls'
gem 'rspec', '>= 3.4.4'
gem 'rubocop', '>= 0.38'
gem 'simplecov', '>= 0.9'
gem 'timecop'
gem 'webmock', '>= 2.0.3'
gem 'yardstick'
gem 'rspec', '>= 3.8'
gem 'rubocop', '>= 0.60'
end

gemspec
100 changes: 34 additions & 66 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,34 +1,20 @@
PATH
remote: .
specs:
<<<<<<< HEAD
zabbixapi (4.1.0)
=======
zabbixapi (3.2.1)
>>>>>>> 5e890f5... ETSOE-415 Update Gem Compatibility
ets_zabbixapi (4.1.0)
http (~> 2.0)
json (~> 2.0)

GEM
remote: https://rubygems.org/
specs:
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
ast (2.3.0)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
ast (2.4.0)
coderay (1.1.1)
coveralls (0.8.20)
json (>= 1.8, < 3)
simplecov (~> 0.14.1)
term-ansicolor (~> 1.3)
thor (~> 0.19.4)
tins (~> 1.6)
crack (0.4.3)
safe_yaml (~> 1.0.0)
diff-lcs (1.2.5)
docile (1.1.5)
diff-lcs (1.3)
domain_name (0.5.20180417)
unf (>= 0.0.5, < 1.0.0)
hashdiff (0.3.2)
http (2.2.2)
addressable (~> 2.3)
http-cookie (~> 1.0)
Expand All @@ -38,79 +24,61 @@ GEM
domain_name (~> 0.5)
http-form_data (1.0.3)
http_parser.rb (0.6.0)
jaro_winkler (1.5.2)
json (2.1.0)
method_source (0.8.2)
parser (2.4.0.0)
ast (~> 2.2)
powerpack (0.1.1)
parallel (1.12.1)
parser (2.5.3.0)
ast (~> 2.4.0)
powerpack (0.1.2)
pry (0.10.4)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
public_suffix (2.0.5)
rainbow (2.2.1)
public_suffix (3.0.3)
rainbow (3.0.0)
rake (11.3.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
rspec-mocks (~> 3.5.0)
rspec-core (3.5.4)
rspec-support (~> 3.5.0)
rspec-expectations (3.5.0)
rspec (3.8.0)
rspec-core (~> 3.8.0)
rspec-expectations (~> 3.8.0)
rspec-mocks (~> 3.8.0)
rspec-core (3.8.0)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-mocks (3.5.0)
rspec-support (~> 3.8.0)
rspec-mocks (3.8.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rubocop (0.48.1)
parser (>= 2.3.3.1, < 3.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.0)
rubocop (0.62.0)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parser (>= 2.5, != 2.5.1.1)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
rainbow (>= 2.2.2, < 4.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1)
safe_yaml (1.0.4)
simplecov (0.14.1)
docile (~> 1.1.0)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.0)
unicode-display_width (~> 1.4.0)
ruby-progressbar (1.10.0)
slop (3.6.0)
term-ansicolor (1.6.0)
tins (~> 1.0)
thor (0.19.4)
timecop (0.8.1)
tins (1.13.2)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.5)
unicode-display_width (1.2.1)
webmock (3.0.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
unicode-display_width (1.4.1)
yard (0.9.8)
yardstick (0.9.9)
yard (~> 0.8, >= 0.8.7.2)

PLATFORMS
ruby

DEPENDENCIES
bundler (~> 1.0)
coveralls
ets_zabbixapi!
jruby-openssl
pry
rake (~> 11.1)
rspec (>= 3.4.4)
rubocop (>= 0.38)
simplecov (>= 0.9)
timecop
webmock (>= 2.0.3)
rspec (>= 3.8)
rubocop (>= 0.60)
yard (>= 0.9)
yardstick
zabbixapi!

BUNDLED WITH
1.16.5
5 changes: 5 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!groovy

library 'ets_shared'

etsTestRubyUnit()
2 changes: 1 addition & 1 deletion examples/Usergroups.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ zbx.usergroups.add_user(
)

# set write and read permissions for UserGroup on all Hostgroups
zbx.usergroups.set_perms(
zbx.usergroups.permissions(
:usrgrpid => zbx.usergroups.get_or_create(:name => "Some user group"),
:hostgroupids => zbx.hostgroups.all.values, # kind_of Array
:permission => 3 # 2- read (by default) and 3 - write and read
Expand Down
2 changes: 1 addition & 1 deletion lib/zabbixapi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def self.current
# @param data [Hash]
# @return [Hash]
def query(data)
@client.api_request(:method => data[:method], :params => data[:params])
@client.api_request(method: data[:method], params: data[:params])
end

# Invalidate current authentication token
Expand Down
25 changes: 13 additions & 12 deletions lib/zabbixapi/basic/basic_func.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ def log(message)

# Compare two hashes for equality
#
# @param a [Hash]
# @param b [Hash]
# @param first_hash [Hash]
# @param second_hash [Hash]
# @return [Boolean]
def hash_equals?(a, b)
a_new = normalize_hash(a)
b_new = normalize_hash(b)
hash1 = a_new.merge(b_new)
hash2 = b_new.merge(a_new)
def hash_equals?(first_hash, second_hash)
normalized_first_hash = normalize_hash(first_hash)
normalized_second_hash = normalize_hash(second_hash)

hash1 = normalized_first_hash.merge(normalized_second_hash)
hash2 = normalized_second_hash.merge(normalized_first_hash)
hash1 == hash2
end

Expand Down Expand Up @@ -91,12 +92,12 @@ def parse_keys(data)

# Merge two hashes into a single new hash
#
# @param a [Hash]
# @param b [Hash]
# @param first_hash [Hash]
# @param second_hash [Hash]
# @return [Hash]
def merge_params(a, b)
new = a.dup
new.merge(b)
def merge_params(first_hash, second_hash)
new = first_hash.dup
new.merge(second_hash)
end
end
end
Loading

0 comments on commit f67282e

Please sign in to comment.