Skip to content
This repository has been archived by the owner on Feb 7, 2018. It is now read-only.

Commit

Permalink
Allow activesupport gems higher than 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Yurek committed Aug 12, 2013
1 parent 4cae4ec commit 4aaf834
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cocaine.gemspec
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |s|
s.add_development_dependency('bourne')
s.add_development_dependency('mocha')
s.add_development_dependency('rake')
s.add_development_dependency('active_support')
s.add_development_dependency('activesupport', ">= 3.0.0", "< 5.0")
s.add_development_dependency('pry')
end

2 changes: 1 addition & 1 deletion spec/cocaine/command_line_spec.rb
Expand Up @@ -211,7 +211,7 @@

it 'can still take something that does not respond to tty as a logger' do
output_buffer = StringIO.new
logger = ActiveSupport::BufferedLogger.new(output_buffer)
logger = best_logger.new(output_buffer)
logger.should_not respond_to(:tty?)
Cocaine::CommandLine.new("echo", "'Logging!' :foo", :logger => logger).run(:foo => "bar")
output_buffer.rewind
Expand Down
10 changes: 10 additions & 0 deletions spec/spec_helper.rb
Expand Up @@ -16,3 +16,13 @@
config.include StubOS
config.include UnsettingExitstatus
end

def best_logger
if ActiveSupport.const_defined?("Logger")
ActiveSupport::Logger
elsif ActiveSupport.const_defined?("BufferedLogger")
ActiveSupport::BufferedLogger
else
Logger
end
end

0 comments on commit 4aaf834

Please sign in to comment.