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

Use cane #8

Merged
merged 3 commits into from
Jan 19, 2014
Merged
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
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
require 'bundler/gem_tasks'
require 'rspec/core/rake_task'
require 'cane/rake_task'
require 'cane/hashcheck'

RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = '--color'
end

Cane::RakeTask.new(:quality) do |t|
t.use Cane::HashCheck
end

task default: :spec
task default: :quality
12 changes: 7 additions & 5 deletions hi.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ Gem::Specification.new do |spec|
spec.add_dependency 'awesome_print', '~> 1.2.0'
spec.add_dependency 'thin', '~> 1.5.1'

spec.add_development_dependency 'coveralls', '~> 0.7.0'
spec.add_development_dependency 'pry', '~> 0.9.12.4'
spec.add_development_dependency 'rack-test', '~> 0.6.2'
spec.add_development_dependency 'rake', '~> 10.1.1'
spec.add_development_dependency 'rspec', '~> 2.14.1'
spec.add_development_dependency 'cane', '~> 2.6.1'
spec.add_development_dependency 'cane-hashcheck', '~> 1.2.0'
spec.add_development_dependency 'coveralls', '~> 0.7.0'
spec.add_development_dependency 'pry', '~> 0.9.12.4'
spec.add_development_dependency 'rack-test', '~> 0.6.2'
spec.add_development_dependency 'rake', '~> 10.1.1'
spec.add_development_dependency 'rspec', '~> 2.14.1'
end
1 change: 1 addition & 0 deletions lib/hi/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'hi/logger'

module Hi
# Main app; http server that prints requests as they come in
class App
attr_reader :port, :logger

Expand Down
1 change: 1 addition & 0 deletions lib/hi/logger.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'awesome_print'

module Hi
# Logger that uses puts for strings, awesome print for everything else
class Logger
def log(message)
print message unless testing
Expand Down
1 change: 1 addition & 0 deletions lib/hi/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require 'rack/request'

module Hi
# Wrapper for rack request that exposes headers and body string
class Request
extend Forwardable

Expand Down
1 change: 1 addition & 0 deletions lib/hi/server.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'thin'

module Hi
# Wrapper for Thin server with retries and a friendly error message
class Server
attr_reader :app

Expand Down