lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)

require 'date'
require_relative 'lib/sensu-plugins-elasticsearch'

# pvt_key = '~/.ssh/gem-private_key.pem'
Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
  s.authors                = ['Sensu Plugins and contributors']
  # s.cert_chain             = ['certs/sensu-plugins.pem']
  s.date                   = Date.today.to_s
  s.description            = 'This plugin provides native ElasticSearch instrumentation
                              for monitoring and metrics collection, including:
                              service health and metrics for cluster, node, and more.'
  s.email                  = '<sensu-users@googlegroups.com>'
  s.executables            = Dir.glob('bin/**/*.rb').map { |file| File.basename(file) }
  s.files                  = Dir.glob('{bin,lib}/**/*') + %w[LICENSE README.md CHANGELOG.md]
  s.homepage               = 'https://github.com/boutetnico/sensu-plugins-elasticsearch'
  s.license                = 'MIT'
  s.metadata               = { 'maintainer'         => 'sensu-plugin',
                               'development_status' => 'active',
                               'production_status'  => 'unstable - testing recommended',
                               'release_draft'      => 'false',
                               'release_prerelease' => 'false' }
  s.name                   = 'sensu-plugins-elasticsearch-boutetnico'
  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  = '>= 2.4.0'
  # s.signing_key            = File.expand_path(pvt_key) if $PROGRAM_NAME =~ /gem\z/
  s.summary                = 'Sensu plugins for elasticsearch'
  s.test_files             = s.files.grep(%r{^(test|spec|features)/})
  s.version                = SensuPluginsElasticsearch::Version::VER_STRING

  s.add_runtime_dependency 'aws-es-transport', '~> 0.1'
  s.add_runtime_dependency 'aws-sdk', ['>= 2.1.14', '< 2.5', '~> 2.1']
  s.add_runtime_dependency 'elasticsearch',     '~> 1.0.14'
  s.add_runtime_dependency 'rest-client', '2.1.0'
  s.add_runtime_dependency 'sensu-plugin', '~> 4.0'

  s.add_development_dependency 'bundler',                   '~> 2.2'
  s.add_development_dependency 'codeclimate-test-reporter', '~> 1.0'
  s.add_development_dependency 'github-markup',             '~> 3.0'
  s.add_development_dependency 'kitchen-docker',            '~> 2.10'
  s.add_development_dependency 'mixlib-shellout',           '~> 3.2'
  s.add_development_dependency 'pry',                       '~> 0.13'
  s.add_development_dependency 'rake',                      '~> 13.0'
  s.add_development_dependency 'redcarpet',                 '~> 3.5'
  s.add_development_dependency 'rspec',                     '~> 3.10'
  s.add_development_dependency 'rubocop',                   '~> 1.6'
  s.add_development_dependency 'test-kitchen',              '~> 2.8'
  s.add_development_dependency 'yard',                      '~> 0.9.25'
end
