{"id":15660496,"url":"https://github.com/willrax/motion-distance","last_synced_at":"2025-08-22T14:12:04.558Z","repository":{"id":11677200,"uuid":"14187297","full_name":"willrax/motion-distance","owner":"willrax","description":"Easy distance tracking for RubyMotion projects.","archived":false,"fork":false,"pushed_at":"2014-02-22T04:03:38.000Z","size":225,"stargazers_count":19,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-28T04:40:27.563Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willrax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-11-06T22:16:21.000Z","updated_at":"2024-12-31T15:24:09.000Z","dependencies_parsed_at":"2022-08-28T16:51:44.736Z","dependency_job_id":null,"html_url":"https://github.com/willrax/motion-distance","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/willrax/motion-distance","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willrax%2Fmotion-distance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willrax%2Fmotion-distance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willrax%2Fmotion-distance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willrax%2Fmotion-distance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willrax","download_url":"https://codeload.github.com/willrax/motion-distance/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willrax%2Fmotion-distance/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271198489,"owners_count":24717126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T13:22:00.812Z","updated_at":"2025-08-22T14:12:04.526Z","avatar_url":"https://github.com/willrax.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# motion-distance\n\nEasy distance tracking for RubyMotion projects.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem \"motion-distance\"\n\nAnd then execute:\n\n    $ bundle\n\n## Usage\n\nCreate a new instance of `Motion::Distance`.\n\nYou must also specify an activity type. This will help the OS know when to pause and resume updates that will help save battery.\n\n```ruby\n# CLActivityTypeOther,\n# CLActivityTypeAutomotiveNavigation,\n# CLActivityTypeFitness,\n# CLActivityTypeOtherNavigation,\n\n@distance = Motion::Distance.new\n@distance.activity_type = CLActivityTypeFitness\n```\n\nYou may also set a level of accuracy.\n\n```ruby\n# KCLLocationAccuracyBestForNavigation\n# KCLLocationAccuracyBest\n# KCLLocationAccuracyNearestTenMeters\n# KCLLocationAccuracyHundredMeters\n# KCLLocationAccuracyKilometer\n# KCLLocationAccuracyThreeKilometers\n\n@distance.accuracy = KCLLocationAccuracyBest\n```\n\nNow you can call `#get` to begin tracking any distance travelled. Each time the phone registers a location change\nyou'll recieve a hash that contains the total distance travelled and current location.\n\nDistance is always returned in meters.\n\n```ruby\n@distance.get do |location|\n  puts location[:total]\nend\n```\n\nYou can stop tracking location by calling:\n\n```ruby\n@distance.stop_updating\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillrax%2Fmotion-distance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillrax%2Fmotion-distance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillrax%2Fmotion-distance/lists"}