Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade gems and fix errors according to changes from upstream #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/okcomputer/grape/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ class Api < ::Grape::API
formatter :txt, ->(object, env){ object.to_text }
formatter :html, ->(object, env){ object.to_text }

error_formatter :json, ->(message, backtrace, options, env) { { error: message.to_s }.to_json }
error_formatter :txt, ->(message, backtrace, options, env) { message }
error_formatter :html, ->(message, backtrace, options, env) { message }
error_formatter :json, ->(message, backtrace, options, env, original_exception) { { error: message.to_s }.to_json }
error_formatter :txt, ->(message, backtrace, options, env, original_exception) { message }
error_formatter :html, ->(message, backtrace, options, env, original_exception) { message }

rescue_from OkComputer::Registry::CheckNotFound do |exception|
error!(exception, 404)
Expand Down
2 changes: 1 addition & 1 deletion lib/okcomputer/grape/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Okcomputer
module Grape
VERSION = "0.1.0"
VERSION = "0.1.1"
end
end
10 changes: 5 additions & 5 deletions okcomputer-grape.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

spec.add_runtime_dependency "grape"
spec.add_runtime_dependency "okcomputer", ">= 1.6.6"
spec.add_runtime_dependency "grape", "~> 1"
spec.add_runtime_dependency "okcomputer", "~> 1"

spec.add_development_dependency "bundler", "~> 1.11"
spec.add_development_dependency "rake", "~> 10.0"
spec.add_development_dependency "bundler", "~> 1.0"
spec.add_development_dependency "rake", "~> 12.0"
spec.add_development_dependency "rspec", "~> 3.0"
spec.add_development_dependency "rack-test"
spec.add_development_dependency "rack-test", "~> 1.0"
end
4 changes: 2 additions & 2 deletions spec/okcomputer/grape/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ def app
it "returns a 404 if the check does not exist" do
get "/non-existent", format: :txt

last_response.body.should == "No check registered with 'non-existent'"
last_response.body.should == "No matching check"
last_response.status.should == 404
end

it "returns a JSON 404 if the check does not exist" do
get "/non-existent", format: :json
last_response.body.should == { error: "No check registered with 'non-existent'" }.to_json
last_response.body.should == { error: "No matching check" }.to_json
last_response.status.should == 404
end
end
Expand Down