Skip to content

Commit

Permalink
Prepare for upcoming changes in the twitter gem
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Mar 17, 2014
1 parent 83257c1 commit 3b86557
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Gemfile
@@ -1,6 +1,8 @@
source 'https://rubygems.org'

gem 'rake'
gem 'twitter', :git => 'https://github.com/sferik/twitter.git', :branch => 'http'
gem 'http', :git => 'https://github.com/tarcieri/http.git'
gem 'jruby-openssl', :platforms => :jruby

group :development do
Expand Down
12 changes: 6 additions & 6 deletions lib/t/cli.rb
Expand Up @@ -652,12 +652,12 @@ def status(status_id) # rubocop:disable CyclomaticComplexity
opts[:include_entities] = !!options['decode_uris']
status = client.status(status_id.to_i, opts)
location = if status.place?
if status.place.name && status.place.attributes && status.place.attributes[:street_address] && status.place.attributes[:locality] && status.place.attributes[:region] && status.place.country
[status.place.name, status.place.attributes[:street_address], status.place.attributes[:locality], status.place.attributes[:region], status.place.country].join(', ')
elsif status.place.name && status.place.attributes && status.place.attributes[:locality] && status.place.attributes[:region] && status.place.country
[status.place.name, status.place.attributes[:locality], status.place.attributes[:region], status.place.country].join(', ')
elsif status.place.full_name && status.place.attributes && status.place.attributes[:region] && status.place.country
[status.place.full_name, status.place.attributes[:region], status.place.country].join(', ')
if status.place.name && status.place.attributes && status.place.attributes['street_address'] && status.place.attributes['locality'] && status.place.attributes['region'] && status.place.country
[status.place.name, status.place.attributes['street_address'], status.place.attributes['locality'], status.place.attributes['region'], status.place.country].join(', ')
elsif status.place.name && status.place.attributes && status.place.attributes['locality'] && status.place.attributes['region'] && status.place.country
[status.place.name, status.place.attributes['locality'], status.place.attributes['region'], status.place.country].join(', ')
elsif status.place.full_name && status.place.attributes && status.place.attributes['region'] && status.place.country
[status.place.full_name, status.place.attributes['region'], status.place.country].join(', ')
elsif status.place.full_name && status.place.country
[status.place.full_name, status.place.country].join(', ')
elsif status.place.full_name
Expand Down
2 changes: 1 addition & 1 deletion spec/helper.rb
Expand Up @@ -74,5 +74,5 @@ def fixture(file)
end

def status_from_fixture(file)
Twitter::Status.new(JSON.parse(fixture(file).read, :symbolize_names => true))
Twitter::Status.new(JSON.parse(fixture(file).read))
end

0 comments on commit 3b86557

Please sign in to comment.