Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature documentation #73

Merged
merged 13 commits into from
May 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
engines:
rubocop:
enabled: true
duplication:
enabled: true
config:
languages:
- ruby

ratings:
paths:
- "**.rb"

exclude_paths:
- examples/**/*
- spec/**/*
45 changes: 39 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,40 @@
.rvmrc
## Based on the templates from https://github.com/github/gitignore

## Ruby
*.gem
*.swp
.idea
.gemtags
pkg
test
*.rbc
/.config
/coverage/
/InstalledFiles
/measurement/
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/

## Specific to RubyMotion:
.dat*
.repl_history
build/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalization:
/.bundle/
/vendor/bundle
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
#Gemfile.lock
.ruby-version
.ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc
60 changes: 60 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
inherit_from: .rubocop_todo.yml

Metrics/AbcSize:
Max: 58 # TODO: Lower to 15

Metrics/BlockLength:
Max: 35
Exclude:
- spec/**/*.rb

Metrics/BlockNesting:
Max: 2

Metrics/CyclomaticComplexity:
Max: 10

Metrics/LineLength:
AllowURI: true
Enabled: false

Metrics/MethodLength:
CountComments: false
Max: 35 # TODO: Lower to 15

Metrics/ModuleLength:
Max: 150 # TODO: Lower to 100

Metrics/ParameterLists:
Max: 4
CountKeywordArgs: true

Metrics/PerceivedComplexity:
Max: 10

Style/AccessModifierIndentation:
EnforcedStyle: outdent

Style/Documentation:
Enabled: false

Style/DoubleNegation:
Enabled: false

Style/FrozenStringLiteralComment:
Enabled: false

Style/HashSyntax:
Enabled: false

Style/RaiseArgs:
EnforcedStyle: compact

Style/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space

Style/SymbolArray:
EnforcedStyle: brackets

Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: 'comma'
26 changes: 26 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-04-19 15:47:43 -0500 using RuboCop version 0.48.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
Style/AccessorMethodName:
Exclude:
- 'lib/zabbixapi/classes/usergroups.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly, IncludeTernaryExpressions.
# SupportedStyles: assign_to_condition, assign_inside_condition
Style/ConditionalAssignment:
Exclude:
- 'lib/zabbixapi/client.rb'

# Offense count: 2
# Cop supports --auto-correct.
Style/RescueModifier:
Exclude:
- 'lib/zabbixapi/classes/errors.rb'
40 changes: 30 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language:
- ruby
cache: bundler

language: ruby

addons:
postgresql: '9.5'
apt:
Expand All @@ -10,20 +12,31 @@ addons:
- php5-pgsql
- zabbix-frontend-php
- zabbix-server-pgsql

services:
- postgresql

rvm:
- 1.9.3
- 2.0
- 2.1
- 2.2
- 2.3
gemfile:
- Gemfile
- json-1.x.Gemfile
- 2.4
- ruby-head
- jruby-9.1.6.0
- jruby-head
- rbx-2

dist: trusty

sudo: required

bundler_args: --without development --retry=3 --jobs=3

before_install:
- gem update --system
- gem update bundler

before_script:
- sudo sed -i "s,;date.timezone =,date.timezone = 'US/Eastern'," /etc/php5/apache2/php.ini
- psql -c 'create database zabbix;' -U postgres
Expand All @@ -32,10 +45,17 @@ before_script:
- zcat /usr/share/doc/zabbix-server-pgsql/create.sql.gz | LC_ALL=C psql -U zabbix
- echo "$(curl -fsSL https://gist.githubusercontent.com/evtuhovich/9544441/raw/d661863063b76cc8e2599bc44d8595b1f86ece38/zabbix)" | sudo tee /etc/zabbix/web/zabbix.conf.php
- sudo service apache2 restart

script: "ZABBIX_HOST_URL=http://localhost/zabbix/api_jsonrpc.php bundle exec rspec spec/*"

env:
global:
- JRUBY_OPTS="$JRUBY_OPTS --debug"

matrix:
exclude:
# json 2.x requires ruby 2.x
- rvm: 1.9.3
gemfile: json-1.x.Gemfile
allow_failures:
- rvm: ruby-head
- rvm: jruby-head
- rvm: rbx-2
fast_finish: true

9 changes: 9 additions & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
--no-private
--protected
--tag authentication:"Authentication"
--markup markdown
-
CHANGELOG.md
LICENSE.md
README.md
examples/*.md
18 changes: 18 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
source 'https://rubygems.org'

gem 'jruby-openssl', platforms: :jruby
gem 'rake', '~> 11.1'
gem 'yard', '>= 0.9'

group :development do
gem 'pry'
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'
end

gemspec
88 changes: 82 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,50 @@ PATH
remote: .
specs:
zabbixapi (3.0.0)
json
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)
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)
json (2.0.3)
rake (12.0.0)
docile (1.1.5)
domain_name (0.5.20170404)
unf (>= 0.0.5, < 1.0.0)
hashdiff (0.3.2)
http (2.2.1)
addressable (~> 2.3)
http-cookie (~> 1.0)
http-form_data (~> 1.0.1)
http_parser.rb (~> 0.6.0)
http-cookie (1.0.3)
domain_name (~> 0.5)
http-form_data (1.0.1)
http_parser.rb (0.6.0)
json (2.1.0)
method_source (0.8.2)
parser (2.4.0.0)
ast (~> 2.2)
powerpack (0.1.1)
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)
rake (11.3.0)
rspec (3.5.0)
rspec-core (~> 3.5.0)
rspec-expectations (~> 3.5.0)
Expand All @@ -23,14 +59,54 @@ GEM
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)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.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)
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.4)
unicode-display_width (1.2.1)
webmock (3.0.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
yard (0.9.8)
yardstick (0.9.9)
yard (~> 0.8, >= 0.8.7.2)

PLATFORMS
ruby

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

BUNDLED WITH
1.14.3
1.14.6
2 changes: 1 addition & 1 deletion LICENSE → LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 Express 42
Copyright (c) 2015-2017 Express 42

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
Loading