Permalink
Browse files

Travis config including 1.8.7, 1.9.2, 1.9.3, and JRuby.

  • Loading branch information...
petergoldstein committed Jul 31, 2012
1 parent 175b281 commit 57ae696b58bee6ee5701e24f31afc5ab25d6bb00
Showing with 41 additions and 6 deletions.
  1. +23 −0 .travis.yml
  2. +15 −0 gemfiles/Gemfile.mongoid-2.4.x
  3. +3 −6 test/test_helper.rb
View
@@ -0,0 +1,23 @@
+rvm:
+ - 1.8.7
+ - 1.9.2
+ - 1.9.3
+ - jruby-19mode
+gemfile:
+ - Gemfile
+ - gemfiles/Gemfile.mongoid-2.4.x
+env: SSL_CERT_DIR=/etc/ssl/certs
+matrix:
+ exclude:
+ - rvm: 1.8.7
+ gemfile: Gemfile
+ env: SSL_CERT_DIR=/etc/ssl/certs
+ - rvm: 1.9.2
+ gemfile: Gemfile
+ env: SSL_CERT_DIR=/etc/ssl/certs
+ - rvm: 1.9.3
+ gemfile: gemfiles/Gemfile.mongoid-2.4.x
+ env: SSL_CERT_DIR=/etc/ssl/certs
+ - rvm: jruby-19mode
+ gemfile: gemfiles/Gemfile.mongoid-2.4.x
+ env: SSL_CERT_DIR=/etc/ssl/certs
@@ -0,0 +1,15 @@
+source "http://rubygems.org"
+
+gemspec :path => '..'
+
+group :development, :test do
+ gem 'rake'
+ gem 'mongoid', '2.4.11'
+ gem 'bson_ext', :platforms => :ruby
+
+ gem 'rails'
+
+ platforms :jruby do
+ gem 'jruby-openssl'
+ end
+end
View
@@ -273,12 +273,9 @@ def street_lookups
end
def is_nan_coordinates?(coordinates)
- if defined?(::Float::NAN)
- coordinates == ([ Geocoder::Calculations::NAN ] * 2 )
- else
- return false unless coordinates.respond_to? :size
- coordinates.size == 2 && coordinates[0].nan? && coordinates[1].nan?
- end
+ return false unless coordinates.respond_to? :size # Should be an array
+ return false unless coordinates.size == 2 # Should have dimension 2
+ coordinates[0].nan? && coordinates[1].nan? # Both coordinates should be NaN
end
end

0 comments on commit 57ae696

Please sign in to comment.