ok_health_check 0.0.4 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d840539f5e85feaf239b6c89b7e2ff7f9d6c60c2
4
- data.tar.gz: 2518624fbc5bad6a874a7eaa47887faae7f7aa6a
3
+ metadata.gz: dd2470acab9107799d28d34309237239acf6049f
4
+ data.tar.gz: 74bd3194bfb306c546ed2b825a4d8e1e1fae7d2d
5
5
  SHA512:
6
- metadata.gz: 16d5c5fb3ee6412655ff039f7a3b74d741b61093025ef3ca276e3a180be6ee60108e67df5b2126676724723c534c79af2bbd740a025948341a9d57849374216f
7
- data.tar.gz: 253613c1e31288f5829607bf8d627716304259fda6b1c9c94ca2e020aff361bc27268ac1d42285e815838566a7eed112971b44db3b37832ce8cdfbc89a36bb11
6
+ metadata.gz: 61ff3a6320a2bb21606341b5e57a7b9645c12f7283d59a326ef8f3651924b942733195f5c3bc26b4ef56463854d41953f052aaf57978277cf4b3f94752e05358
7
+ data.tar.gz: 8aeb1a9786ede72e50ad83790a7099d08a51080a293509a3eabd2f1731bbf0581f16df31670155ebc167548ed43a99d648a099d91223481f9703c502237e1162
data/Rakefile CHANGED
@@ -1,5 +1,11 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
- Dir.glob('tasks/**/*.rake').each(&method(:import))
3
+ begin
4
+ require 'rspec/core/rake_task'
4
5
 
6
+ RSpec::Core::RakeTask.new(:spec)
5
7
 
8
+ task :default => :spec
9
+ rescue LoadError
10
+ # no rspec available
11
+ end
@@ -1,6 +1,6 @@
1
1
  require "ok_health_check/version"
2
- require "ok_health_check/engine"
2
+ require "ok_health_check/server"
3
+ require "ok_health_check/railtie" if defined?(Rails)
3
4
 
4
5
  module OkHealthCheck
5
- require 'ok_health_check/healthcheck_controller'
6
6
  end
@@ -0,0 +1,11 @@
1
+ require 'rails'
2
+
3
+ module OkHealthCheck
4
+ class Railtie < ::Rails::Railtie
5
+ config.after_initialize do |app|
6
+ app.routes.prepend do
7
+ mount OkHealthCheck::Server.new, at: '/healthcheck'
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ module OkHealthCheck
2
+ class Server
3
+ def call(env)
4
+ [200, {"Content-Type" => 'text/html'}, ['OK']]
5
+ end
6
+ end
7
+ end
@@ -1,3 +1,3 @@
1
1
  module OkHealthCheck
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -7,10 +7,10 @@ Gem::Specification.new do |spec|
7
7
  spec.name = "ok_health_check"
8
8
  spec.version = OkHealthCheck::VERSION
9
9
  spec.authors = ["Nick Picciuto"]
10
- spec.email = ["nick@spartansystems.co"]
10
+ spec.email = ["napicciuto@gmail.com"]
11
11
  spec.summary = %q{Site health check}
12
12
  spec.description = %q{A simple gem to check the health of a site}
13
- spec.homepage = ""
13
+ spec.homepage = "https://github.com/spartansystems/ok_health_check"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_development_dependency "activesupport"
21
+ spec.add_development_dependency "rack"
22
22
  spec.add_development_dependency "rails"
23
23
  spec.add_development_dependency "bundler", "~> 1.7"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
@@ -1,8 +1,14 @@
1
1
  require 'spec_helper'
2
2
 
3
- describe HealthcheckController do
3
+ describe OkHealthCheck::Server do
4
+ include Rack::Test::Methods
5
+
6
+ def app
7
+ OkHealthCheck::Server.new
8
+ end
9
+
4
10
  it "check path displays ok" do
5
11
  get :show
6
- expect(response).to be_success
12
+ expect(last_response).to be_ok
7
13
  end
8
14
  end
data/spec/spec_helper.rb CHANGED
@@ -1 +1,9 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'rack/test'
1
5
  require 'ok_health_check'
6
+
7
+ # Requires supporting files with custom matchers and macros, etc,
8
+ # in ./support/ and its subdirectories.
9
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ok_health_check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Picciuto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-28 00:00:00.000000000 Z
11
+ date: 2015-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: activesupport
14
+ name: rack
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -82,7 +82,7 @@ dependencies:
82
82
  version: '0'
83
83
  description: A simple gem to check the health of a site
84
84
  email:
85
- - nick@spartansystems.co
85
+ - napicciuto@gmail.com
86
86
  executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
@@ -94,14 +94,13 @@ files:
94
94
  - Rakefile
95
95
  - config/routes.rb
96
96
  - lib/ok_health_check.rb
97
- - lib/ok_health_check/engine.rb
98
- - lib/ok_health_check/healthcheck_controller.rb
97
+ - lib/ok_health_check/railtie.rb
98
+ - lib/ok_health_check/server.rb
99
99
  - lib/ok_health_check/version.rb
100
100
  - ok_health_check.gemspec
101
101
  - spec/ok_health_check_spec.rb
102
102
  - spec/spec_helper.rb
103
- - tasks/rspec.rake
104
- homepage: ''
103
+ homepage: https://github.com/spartansystems/ok_health_check
105
104
  licenses:
106
105
  - MIT
107
106
  metadata: {}
@@ -1,15 +0,0 @@
1
- require 'rails'
2
-
3
- module OkHealthCheck
4
- class Engine < ::Rails::Engine
5
- isolate_namespace OkHealthCheck
6
-
7
- config.after_initialize do |app|
8
- if OkHealthCheck.mount_at
9
- app.routes.prepend do
10
- get 'healthcheck', to: 'healthcheck#show'
11
- end
12
- end
13
- end
14
- end
15
- end
@@ -1,5 +0,0 @@
1
- class HealthcheckController
2
- def show
3
- render plain: "OK"
4
- end
5
- end
data/tasks/rspec.rake DELETED
@@ -1,3 +0,0 @@
1
- require 'rspec/core/rake_task'
2
-
3
- RSpec::Core::RakeTask.new(:spec)