Skip to content

Commit

Permalink
Merge pull request #1 from locaweb/update-heartcheck-version
Browse files Browse the repository at this point in the history
Changing heartcheck to 2.0 to add support to ruby 2.7 remove support to ruby < 2.3
  • Loading branch information
pmnhaes authored Mar 13, 2020
2 parents 230a45e + 736816c commit 78188ef
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 18 deletions.
14 changes: 14 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Documentation:
Enabled: false

Style/MultilineOperationIndentation:
Enabled: false

Style/Encoding:
Enabled: false

AllCops:
# Include gemspec and Rakefile
Include:
- '**/*.gemspec'
- '**/Rakefile'
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
language: ruby
rvm:
- "1.9.3"
- "2.0.0"
- "2.1.0"
- "2.2.4"
- "2.3.0"
install: bundle install -j 4 --retry 3
script:
- RAILS_ENV=test bundle exec rspec spec
matrix:
include:
- rvm: 2.3
- rvm: 2.4
- rvm: 2.5
- rvm: 2.6
- rvm: 2.7
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Change Log
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/).

## [1.0.0] - 2020-03-11
## Changed
- Add support for ruby 2.7
- Remove support for ruby < 2.3
- Change required version for gem heartcheck to fit for newer supported ruby versions

## [0.1.0] - 2015-07-08
## Changed
- A plugin to check CAS accessibility connection with heartcheck
22 changes: 14 additions & 8 deletions heartcheck-cas.gemspec
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
# frozen_string_literal: true

lib = File.expand_path('lib', __dir__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'heartcheck/cas/version'

Gem::Specification.new do |spec|
spec.name = "heartcheck-cas"
spec.name = 'heartcheck-cas'
spec.version = Heartcheck::Cas::VERSION
spec.authors = ["andrerocker"]
spec.email = ["[email protected]"]
spec.authors = ['andrerocker']
spec.email = ['[email protected]']

spec.summary = 'cas checkers to heartcheck'
spec.description = 'Provides cas checkers to heartcheck'
spec.homepage = 'http://github.com/locaweb/heartcheck-cas'
spec.license = "MIT"
spec.license = 'MIT'
spec.files = Dir.glob('lib/**/*')
spec.require_paths = ["lib"]
spec.require_paths = ['lib']

spec.required_ruby_version = '>= 2.3'

spec.add_dependency 'heartcheck', '~> 2.0'

spec.add_development_dependency 'bundler', '> 1.6'
spec.add_development_dependency 'pry-nav', '~> 0.2.4'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.3'
spec.add_development_dependency 'pry-nav', '~> 0.2.4'
spec.add_dependency 'heartcheck', '~> 1.0'
spec.add_development_dependency 'rubocop'
end
5 changes: 4 additions & 1 deletion lib/heartcheck/cas/http_client.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# enconding: utf-8
require 'net/http'
require 'openssl'

module Heartcheck
module Cas
class HttpClient
Expand All @@ -12,7 +15,7 @@ def post(url, params)
request.set_form_data(params)
base_client(uri).request(request)
end

def base_client(uri)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme.eql?('https')
Expand Down
2 changes: 1 addition & 1 deletion lib/heartcheck/cas/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Heartcheck
module Cas
VERSION = "0.1.0"
VERSION = "1.0.0"
end
end
6 changes: 4 additions & 2 deletions spec/heartcheck/cas/http_client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
describe '#post' do
context 'make a post request' do
it 'should create a hastebin document' do
response = described_class.post('http://hastebin.com/documents', {data: "Bacon"})
response = described_class.post(
'https://reqbin.com/echo/post/json', { data: 'Bacon' }
)
expect(response.code).to eq "200"
expect(response.body).to match /key/
expect(response.body).to match /success/
end
end
end
Expand Down

0 comments on commit 78188ef

Please sign in to comment.