
Security News
MCP Steering Committee Launches Official MCP Registry in Preview
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
A collection of useful data about NANPA Rate Centers.
Data is currently sourced from Simple Maps and Local Calling Guide.
Install the gem and add to the application's Gemfile by executing:
bundle add rate_centers
If bundler is not being used to manage dependencies, install the gem by executing:
gem install rate_centers
# Load rate centers
RateCenter.load(:rate_centers, only: { us: [:ny, :ca], ca: [:on] }) # Loads rate centers in New York, California and Ontario, Canada
# RateCenter.load(:rate_centers, only: { us: { ny: [ "NWYRCYZN01" ], ca: [ "LSAN DA 01"] } }) # Loads only specific rate centers
# RateCenter.load(:rate_centers, only: { [ :us ] }) # Load all rate centers in US
# RateCenter.load(:rate_centers, only: { [ :ca ] }) # Load all rate centers in Canada
# RateCenter.load(:rate_centers, :all) # Load all rate centers
# RateCenter::RateCenter.all # returns all rate centers loaded
rate_center = RateCenter::RateCenter.find_by!(country: "US", region: "NY", name: "NWYRCYZN01")
rate_center.full_name # "New York City Zone 01"
rate_center.lata # 132
rate_center.ilec_name # "VERIZON NEW YORK, INC."
rate_center.lat # "40.739362"
rate_center.long # "-73.991043"
rate_center.closest_city.name # "Manhattan"
rate_center.closest_city.distance_km # 5.33
# Load cities
RateCenter.load(:cities, only: { us: [:ny, :ca], ca: [:on] }) # # Loads cities in New York, California and Ontario, Canada
# RateCenter.load(:cities, only: { us: { ny: [ "New York" ], ca: [ "Los Angeles"] } }) # Loads only specific cities
# RateCenter.load(:cities, only: { [ :us ] }) # Load all cities in US
# RateCenter.load(:rate_centers, only: { [ :ca ] }) # Load all rate centers in Canada
# RateCenter.load(:cities, :all) # Load all cities
# RateCenter::City.all # returns all cities loaded
city = RateCenter::City.find_by!(country: "US", region: "NY", name: "New York")
city.lat # "40.6943"
city.log # "-73.9249"
city.county # Queens
city.nearby_rate_centers.first(10).each do |rate_center|
puts "Rate Center: #{rate_center.name}, Distance: #{rate_center.distance_km} km"
end
# Rate Center: ADDISLEHPK, Distance: 7.5 km
# Rate Center: ALBEKEN TR, Distance: 7.5 km
# Rate Center: ANNADALE, Distance: 7.5 km
# Rate Center: ARDEN HTS, Distance: 7.5 km
# Rate Center: ARLINGTON, Distance: 7.5 km
# Rate Center: ARROCHAR, Distance: 7.5 km
# Rate Center: ARVERNE, Distance: 7.5 km
# Rate Center: ASTORIA, Distance: 7.5 km
# Rate Center: BATH BEACH, Distance: 7.5 km
# Rate Center: BAY RIDGE, Distance: 7.5 km
The data directory contains all the data as JSON files.
In order to pull data from the sources, run the following script
bin/update_data
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
Bug reports and pull requests are welcome on GitHub at https://github.com/somleng/rate_center.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that rate_center demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.
Research
/Security News
npm author Qix’s account was compromised, with malicious versions of popular packages like chalk-template, color-convert, and strip-ansi published.