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

updated to the latest ruby and rubygems #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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: 3 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
source :gemcutter
source "https://rubygems.org"

gem "sinatra"
gem "puma"
gem "choice"
gem "json"
gem "postgres", "=0.7.9.2008.01.28"
gem "pg"
gem "haml"
gem "bluecloth"
gem "text"
gem "levenshtein"
gem "hpricot"
gem "activesupport"
gem "htmlentities"
gem "text"
gem "chronic"
13 changes: 8 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
activesupport (3.2.11)
i18n (~> 0.6)
Expand All @@ -11,10 +11,10 @@ GEM
hpricot (0.8.6)
htmlentities (4.3.1)
i18n (0.6.1)
json (1.5.1)
levenshtein (0.2.2)
multi_json (1.5.0)
postgres (0.7.9.2008.01.28)
pg (0.18.4)
puma (3.4.0)
rack (1.2.1)
sinatra (1.2.0)
rack (~> 1.1)
Expand All @@ -33,8 +33,11 @@ DEPENDENCIES
haml
hpricot
htmlentities
json
levenshtein
postgres (= 0.7.9.2008.01.28)
pg
puma
sinatra
text

BUNDLED WITH
1.12.5
2 changes: 1 addition & 1 deletion config.ru
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application.

require 'dstk_server'
require_relative 'dstk_server'
run Sinatra::Application
21 changes: 21 additions & 0 deletions config/puma.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Change to match your CPU core count
workers 16
port 4567

# Min and Max threads per worker
threads 1, 2

app_dir = File.expand_path("../..", __FILE__)
shared_dir = File.expand_path("shared", app_dir)

# Default to production
rails_env = ENV['RAILS_ENV'] || "production"
environment rails_env

# Set up socket location
bind "unix://#{shared_dir}/sockets/puma.sock"

# Set master PID and state locations
pidfile "#{shared_dir}/pids/puma.pid"
state_path "#{shared_dir}/pids/puma.state"

4 changes: 2 additions & 2 deletions dstk_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ module DSTKConfig

# The location of the TIGER/Line database used by the US address geocoder
# For backwards compatibility, look for any of these versions, starting with the first
GEOCODER_DB_FILES = ['../geocoderdata/geocoder2012.db', '../geocoderdata/geocoder2011.db']
GEOCODER_DB_FILES = ['/dev/shm/geocoder2015.db', '../geocoderdata/geocoder2011.db']

# The location of the MaxMind database file holding IP to location mappings
ETHNICITY_OF_SURNAMES_FILE = '../dstkdata/ethnicityofsurnames.csv'

end
end
3 changes: 1 addition & 2 deletions dstk_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
require 'rubygems' if RUBY_VERSION < '1.9'
require 'sinatra'
require 'json'
require 'net/geoip'
require 'postgres'
require 'pg'
require 'hpricot'
require 'htmlentities'
require 'tempfile'
Expand Down
4 changes: 2 additions & 2 deletions genderfromname.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def one_only(name)

if female_hit and not male_hit
gender = 'f'
elsif male_hit and not female_hit:
elsif male_hit and not female_hit
gender = 'm'
end

Expand Down Expand Up @@ -2389,4 +2389,4 @@ def v1_rules(name)
'racquel' => 0.00843702508359597,
'shanice' => 0.00843702508359597,
'valeria' => 0.00843702508359597
}
}
8 changes: 4 additions & 4 deletions geodict_lib.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

require 'rubygems'

require 'postgres'
require 'pg'
require 'set'

# Some hackiness to include the library script, even if invoked from another directory
Expand Down Expand Up @@ -296,9 +296,9 @@ def is_city(text, text_starting_index, previous_result)
found_tokens = previous_result[:found_tokens]
found_tokens.each do |found_token|
type = found_token[:type]
if type == :COUNTRY:
if type == :COUNTRY
country_code = found_token[:code]
elsif type == :REGION:
elsif type == :REGION
region_code = found_token[:code]
end
end
Expand Down Expand Up @@ -430,7 +430,7 @@ def is_region(text, text_starting_index, previous_result)
candidate_dicts = []
all_candidate_dicts.each do |possible_dict|
candidate_country = possible_dict['country_code']
if candidate_country.downcase() == country_code.downcase():
if candidate_country.downcase() == country_code.downcase()
candidate_dicts << possible_dict
end
end
Expand Down
2 changes: 1 addition & 1 deletion street2coordinates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -893,4 +893,4 @@ def canonicalize_street_string(street_string)
puts '************'
end

end
end
4 changes: 2 additions & 2 deletions text2people.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
require File.join(File.expand_path(File.dirname(__FILE__)), 'dstk_config')
require File.join(File.expand_path(File.dirname(__FILE__)), 'geodict_lib')

require 'genderfromname'
require_relative './genderfromname'

CURRENT_YEAR = Time.now.year

Expand Down Expand Up @@ -297,4 +297,4 @@ def get_ethnicity_from_last_name(last_name)
puts '************'
end

end
end