
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
google_map_directions
Advanced tools
A wrapper gem for the google directions API. https://developers.google.com/maps/documentation/directions/
Add this line to your application's Gemfile:
gem 'google_map_directions'
And then execute:
$ bundle
Or install it yourself as:
$ gem install google_map_directions
Currently, this gem only pulls a single route from the google directions api. The ability to search through multiple routes will be added at a later date.
Setup:
directions = GoogleMapDirections::Directions.new('Soda Hall Berkeley CA', 'Foothill Berkeley CA')
You can check the status code to see if the request to the API was sucessful.
directions.status
If you want to parse the data yourself, you can grab the ruby representation of the JSON object
directions.json
There is a lot of basic information you can just get from the Directions object
directions.distance_as_string
directions.distance_in_meters
directions.destination_coordinates
directions.origin_coordinates
#The two coordinates methods return hashes that contain the latitude and longitude
directions.destination_coordinates["lat"]
directions.destination_coordinates["lng"]
directions.origin_address
directions.destination_address
directions.duration_as_string
directions.duration_in_seconds
The steps of the route can be pulled from the step method
directions.path_length
#Returns the number of steps in the routes
step1 = directions.step(0)
#Returns the first step of the path
step1.distance_as_string
step1.distance_in_meters
step1.duration_as_string
step1.duration_in_seconds
step1.end_location
step1.start_location
#The two coordinates methods return hashes that contain the latitude and longitude
step1.end_location["lat"]
step1.end_location["lng"]
step1.number
step1.HTML_instructions
Let me know of any bugs/additional features wanted.
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that google_map_directions demonstrated a not healthy version release cadence and project activity because the last version was released 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
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.