Skip to content

Commit

Permalink
document all the things!
Browse files Browse the repository at this point in the history
  • Loading branch information
jrbeilke committed Apr 19, 2017
1 parent 54f52da commit 6d4b46f
Show file tree
Hide file tree
Showing 57 changed files with 1,904 additions and 1,023 deletions.
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'
20 changes: 20 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-04-19 14:47:45 -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'
27 changes: 19 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
language:
- ruby

addons:
postgresql: '9.5'
apt:
Expand All @@ -10,18 +11,22 @@ 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.1.0
- jruby-head

dist: trusty

sudo: required

before_script:
Expand All @@ -32,10 +37,16 @@ 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
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: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ versions:
* Ruby 2.1
* Ruby 2.2
* Ruby 2.3
* Ruby 2.4
* JRuby 9.1.1.0

If something doesn't work on one of these versions, it's a bug.

Expand Down
26 changes: 25 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
require 'bundler/gem_tasks'
require 'bundler'
Bundler::GemHelper.install_tasks

require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)

task test: :spec

require 'rubocop/rake_task'
RuboCop::RakeTask.new

require 'yard'
YARD::Rake::YardocTask.new

require 'yardstick/rake/measurement'
Yardstick::Rake::Measurement.new do |measurement|
measurement.output = 'measurement/report.txt'
end

require 'yardstick/rake/verify'
Yardstick::Rake::Verify.new do |verify|
verify.threshold = 67.1
end

task default: [:spec, :rubocop, :verify_measurements]
Loading

0 comments on commit 6d4b46f

Please sign in to comment.