diff --git a/.rubocop.yml b/.rubocop.yml index 3e74cac..1671b8a 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,24 +1,27 @@ MethodLength: - Max: 200 + Max: 200 LineLength: - Max: 160 + Max: 160 + +AbcSize: + Max: 50 FileName: - Enabled: false + Enabled: false PerceivedComplexity: - Enabled: false + Enabled: false CyclomaticComplexity: - Enabled: false + Enabled: false ClassLength: - Enabled: false + Enabled: false IfUnlessModifier: - Enabled: false + Enabled: false RegexpLiteral: - Enabled: false + Enabled: false diff --git a/.travis.yml b/.travis.yml index 892d201..e9c82d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ notifications: on_failure: always email: recipients: - - mattjones@yieldbot.com + - sensu-plugin@sensu-plugin.io - rich.m.chatterton@gmail.com on_success: change on_failure: always diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d93c86..eb32033 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,36 +1,47 @@ -#### 0.1.0-alpha.1 +#Change Log +This project adheres to [Semantic Versioning](http://semver.org/). -* baseline release identical to **sensu-community-plugins** repo -* changed *check-procs* to *check-process* to better reflect its use -* basic yard coverage -* pinned dependencies -* built against 1.9.3, 2.0, 2.1 -* cryptographically signed +This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/) -#### 0.0.1-alpha.2 +## Unreleased][unreleased] -* bump Vagrant to Chef 6.6 -* update LICENSE and gemspec authors -* update README -* add required Ruby version *>= 1.9.3* -* add test/spec_help.rb +## 0.0.1 - 2015-05-01 -#### 0.0.1-alpha.3 +### Added +- initial release -* add proc-status-metrics -* change proc-status-metrics to process-status-metrics +#### 0.0.1.alpha.6 + +* add chef provisioner to Vagrantfile +* fix rubocop errors +* add metadata to gemspec + +#### 0.0.1.alpha.5 + +* add new check for process uptime metrics #### 0.0.1.alpha.4 * convert scrips to sys-proctable gem for platform independence -#### 0.0.1.alpha.5 +#### 0.0.1-alpha.3 -* add new check for process uptime metrics +* add proc-status-metrics +* change proc-status-metrics to process-status-metrics -#### 0.0.1.alpha.6 +#### 0.0.1-alpha.2 -* add chef provisioner to Vagrantfile -* fix rubocop errors -* add metadata to gemspec +* bump Vagrant to Chef 6.6 +* update LICENSE and gemspec authors +* update README +* add required Ruby version *>= 1.9.3* +* add test/spec_help.rb + +#### 0.1.0-alpha.1 +* baseline release identical to **sensu-community-plugins** repo +* changed *check-procs* to *check-process* to better reflect its use +* basic yard coverage +* pinned dependencies +* built against 1.9.3, 2.0, 2.1 +* cryptographically signed diff --git a/LICENSE b/LICENSE index 8fadc17..f661cbd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015 devsops@yieldbot.com +Copyright (c) 2015 Sensu-Plugins MIT License diff --git a/README.md b/README.md index 603bab5..aee6c54 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-process-checks/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-process-checks) [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-process-checks/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-process-checks) [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-process-checks.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-process-checks) +[ ![Codeship Status for sensu-plugins/sensu-plugins-process-checks](https://codeship.com/projects/feb27000-d25e-0132-6aab-4ad10baf29cc/status?branch=master)](https://codeship.com/projects/77521) ## Functionality @@ -23,30 +24,8 @@ ## Usage -#### Rubygems +### Installation -`gem install sensu-plugins-process-checks` - -#### Bundler - -Add *sensu-plugins-disk-checks* to your Gemfile and run `bundle install` or `bundle update` - -#### Chef - -Using the Sensu **sensu_gem** LWRP -``` -sensu_gem 'sensu-plugins-process-checks' do - options('--prerelease') - version '0.0.1.alpha.4' -end -``` - -Using the Chef **gem_package** resource -``` -gem_package 'sensu-plugins-process-checks' do - options('--prerelease') - version '0.0.1.alpha.4' -end -``` +[Installation and Setup](https://github.com/sensu-plugins/documentation/blob/master/user_docs/installation_instructions.md) ## Notes diff --git a/Rakefile b/Rakefile index 5ce0c83..c079757 100644 --- a/Rakefile +++ b/Rakefile @@ -21,7 +21,7 @@ YARD::Rake::YardocTask.new do |t| t.options = %w(--markup-provider=redcarpet --markup=markdown --main=README.md --files CHANGELOG.md) end -Rubocop::RakeTask.new +RuboCop::RakeTask.new RSpec::Core::RakeTask.new(:spec) do |r| r.pattern = FileList['**/**/*_spec.rb'] diff --git a/Vagrantfile b/Vagrantfile index 0d02727..fa91c8e 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -9,13 +9,8 @@ VAGRANTFILE_API_VERSION = '2' config_file = JSON.parse(File.read('../GIR/config/vagrant_config.json')) vagrant_config = config_file['config'] -# The vagrant boxes are provisioned by Chef. -# If this is nothing something you want to deal with then comment out the -# provisioner and chef and berkshelf lines. The boxes as they stand are -# fairly barebones but should contain enough for basic development and -# initial testing. Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - # Standard configuration details + # Standard configurtaion details config.vm.box_download_checksum = true config.vm.box_download_checksum_type = 'md5' config.vm.hostname = 'sensu-plugins-dev' @@ -91,7 +86,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| bsd9.ssh.shell = '/bin/sh' bsd9.vm.box = vagrant_config['bsd9']['box'] - # Use rsync in place of shared folders + # Use rsync as a shared folder bsd9.vm.synced_folder '.', '/vagrant', type: 'rsync' bsd9.vm.provision 'chef_zero' do |chef| chef.synced_folder_type = 'rsync' @@ -99,7 +94,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| vagrant_config['bsd9']['role'].each do |r| chef.add_role(r) end - # chef.add_recipe 'apache2' end end @@ -107,7 +101,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| bsd10.vm.guest = :freebsd bsd10.vm.box = vagrant_config['bsd10']['box'] - # Use rsync in place of shared folders + # Use rsync as a shared folder bsd10.vm.synced_folder '.', '/vagrant', type: 'rsync' bsd10.vm.provision 'chef_zero' do |chef| chef.synced_folder_type = 'rsync' @@ -115,7 +109,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| vagrant_config['bsd10']['role'].each do |r| chef.add_role(r) end - # chef.add_recipe 'apache2' end end end diff --git a/bin/metrics-process-status.rb b/bin/metrics-process-status.rb index e16c0fd..9af1ea5 100755 --- a/bin/metrics-process-status.rb +++ b/bin/metrics-process-status.rb @@ -112,7 +112,7 @@ def acquire_stats_for_pid(pid) # rubocop:disable all out = { "#{cmdline}" => {} } metric_names.each do |m| - line = proc_status_lines.select { |x| /^#{m}/.match(x) }.first + line = proc_status_lines.select { |x| /^#{m}/.match(x) }.first # rubocop:disable all val = line ? line.split("\t")[1].to_i : nil out[cmdline.to_s][m] = val end diff --git a/lib/sensu-plugins-process-checks.rb b/lib/sensu-plugins-process-checks.rb index a65e3e3..00ff492 100644 --- a/lib/sensu-plugins-process-checks.rb +++ b/lib/sensu-plugins-process-checks.rb @@ -1,7 +1,14 @@ +require 'sensu-plugins-process-checks/version' + +# Load the defaults + # -# Set gem version +# Default class # module SensuPluginsProcessChecks - # Gem version - VERSION = '0.0.1.alpha.5' + class << self + end + + class << self + end end diff --git a/lib/sensu-plugins-process-checks/version.rb b/lib/sensu-plugins-process-checks/version.rb new file mode 100644 index 0000000..90eac7e --- /dev/null +++ b/lib/sensu-plugins-process-checks/version.rb @@ -0,0 +1,28 @@ +require 'json' + +# encoding: utf-8 +module SensuPluginsProcessChecks + # This defines the version of the gem + module Version + MAJOR = 0 + MINOR = 0 + PATCH = 1 + + VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.') + + NAME = 'sensu-plugins-process-checks' + BANNER = "#{NAME} v%s" + + module_function + + def version + format(BANNER, VER_STRING) + end + + def json_version + { + 'version' => VER_STRING + }.to_json + end + end +end diff --git a/sensu-plugins-process-checks.gemspec b/sensu-plugins-process-checks.gemspec index 1d311d1..6463bab 100644 --- a/sensu-plugins-process-checks.gemspec +++ b/sensu-plugins-process-checks.gemspec @@ -11,7 +11,7 @@ end pvt_key = '~/.ssh/gem-private_key.pem' Gem::Specification.new do |s| - s.authors = ['Yieldbot, Inc. and contributors'] + s.authors = ['Sensu-Plugins and contributors'] s.cert_chain = ['certs/sensu-plugins.pem'] s.date = Date.today.to_s s.description = 'Sensu plugins for checking running processes' @@ -22,16 +22,19 @@ Gem::Specification.new do |s| s.license = 'MIT' s.metadata = { 'maintainer' => '@rmc3', 'development_status' => 'active', - 'production_status' => 'unstable - testing recommended' + 'production_status' => 'unstable - testing recommended', + 'release_draft' => 'false', + 'release_prerelease' => 'false' } s.name = 'sensu-plugins-sensu-plugins-process-checks' s.platform = Gem::Platform::RUBY + s.post_install_message = 'You can use the embedded Ruby by setting EMBEDDED_RUBY=true in /etc/default/sensu' s.require_paths = ['lib'] s.required_ruby_version = '>= 1.9.3' s.signing_key = File.expand_path(pvt_key) if $PROGRAM_NAME =~ /gem\z/ s.summary = 'Sensu plugins for checking running processes' s.test_files = s.files.grep(%r{^(test|spec|features)/}) - s.version = SensuPluginsProcessChecks::VERSION + s.version = SensuPluginsProcessChecks::Version::VER_STRING s.add_runtime_dependency 'english', '0.6.3' s.add_runtime_dependency 'sensu-plugin', '1.1.0' @@ -39,7 +42,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'sys-proctable', '0.9.6' s.add_development_dependency 'codeclimate-test-reporter', '~> 0.4' - s.add_development_dependency 'rubocop', '0.17.0' + s.add_development_dependency 'rubocop', '~> 0.30' s.add_development_dependency 'rspec', '~> 3.1' s.add_development_dependency 'bundler', '~> 1.7' s.add_development_dependency 'rake', '~> 10.0'