Revert "Favor uname over user_agent"

This reverts commit 97931ceaed.
This commit is contained in:
Marcin Kulik 2013-10-13 12:28:58 +02:00
parent 97931ceaed
commit f86734bf50
2 changed files with 3 additions and 12 deletions

View File

@ -5,10 +5,10 @@ class AsciicastDecorator < ApplicationDecorator
THUMBNAIL_HEIGHT = 10 THUMBNAIL_HEIGHT = 10
def os def os
if uname.present? if user_agent.present?
os_from_uname
elsif user_agent.present?
os_from_user_agent os_from_user_agent
elsif uname.present?
os_from_uname
else else
'unknown' 'unknown'
end end

View File

@ -86,15 +86,6 @@ describe AsciicastDecorator do
it { should == 'unknown' } it { should == 'unknown' }
end end
context 'when user_agent and uname are present' do
before do
asciicast.user_agent = 'python-requests/2.0.0 CPython/2.7.5 Linux/3.11.3-201.fc19.x86_64'
asciicast.uname = 'Some t430u 3.5.0-18-generic #29-Ubuntu SMP'
end
it { should == 'Some' }
end
end end
describe '#terminal_type' do describe '#terminal_type' do