{"id":15624737,"url":"https://github.com/xuanxu/telegraph","last_synced_at":"2025-10-26T18:50:46.987Z","repository":{"id":1171442,"uuid":"1065799","full_name":"xuanxu/telegraph","owner":"xuanxu","description":"Ruby gem to read and write Morse code","archived":false,"fork":false,"pushed_at":"2023-11-14T11:08:49.000Z","size":50,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-14T01:04:43.019Z","etag":null,"topics":["morse","morse-code","morsecode","ruby"],"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/xuanxu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-11-09T17:40:08.000Z","updated_at":"2023-08-03T22:21:09.000Z","dependencies_parsed_at":"2024-06-11T20:31:56.770Z","dependency_job_id":"31861170-2f72-42d3-9ad7-e5c22dafcd70","html_url":"https://github.com/xuanxu/telegraph","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/xuanxu/telegraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuanxu%2Ftelegraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuanxu%2Ftelegraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuanxu%2Ftelegraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuanxu%2Ftelegraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xuanxu","download_url":"https://codeload.github.com/xuanxu/telegraph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuanxu%2Ftelegraph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281155558,"owners_count":26452905,"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-10-26T02:00:06.575Z","response_time":61,"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":["morse","morse-code","morsecode","ruby"],"created_at":"2024-10-03T10:00:47.728Z","updated_at":"2025-10-26T18:50:46.931Z","avatar_url":"https://github.com/xuanxu.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Telegraph\n\nTelegraph is a Ruby gem that provides straightforward text-to-morse and morse-to-text translators\n\nIt uses as reference the document ['RECOMMENDATION ITU-R M.1677'](https://www.itu.int/rec/R-REC-M.1677-1-200910-I) from the International Telecommunication Union, Radiocommunication Sector (ITU-R), the United Nations agency for information and communication technology issues.\n\n[![Build Status](https://github.com/xuanxu/telegraph/actions/workflows/tests.yml/badge.svg)](https://github.com/xuanxu/telegraph/actions/workflows/tests.yml)\n[![Gem Version](https://badge.fury.io/rb/telegraph.svg)](https://badge.fury.io/rb/telegraph)\n\n## Getting started\n\nInstall the gem:\n\n```\n$ gem install telegraph\n```\n\nThen depending on your project you may:\n\nrequire the gem (if a ruby project):\n\n```ruby\n    require 'telegraph'\n```\n\nor add it to your Gemfile:\n\n```ruby\n    gem 'telegraph', :git =\u003e 'git://github.com/xuanxu/telegraph.git'\n```\n\n## Usage\n\nThe simplest way to read or write morse code is using directly the two methods defined in Telegraph:\n\n```ruby\n# Converts text to morse characters:\nTelegraph.text_to_morse(\"Hello world\")  #=\u003e \".... . .-.. .-.. ---       .-- --- .-. .-.. -..\"\n\n# Reads morse characters into text:\nTelegraph.morse_to_text(\".... . .-.. .-.. ---       .-- --- .-. .-.. -..\")  #=\u003e hello world\"\n```\n\nIn the Telegraph module you will find defined also the most commonly used prosigns:\n\n```ruby\n# Error sign:\nTelegraph::Error    #=\u003e \"........\"\n\n#The complete list of prosigns:\nTelegraph::Error\nTelegraph::Understood\nTelegraph::Invitation_to_transmit\nTelegraph::Wait\nTelegraph::End_of_work\nTelegraph::Starting_signal\n```\n\nAll the generated morse code will use the character '.' as short signal (aka dot) and the character '-' as long signal (aka dash).\n\nIf you need to write or read using different characters as short and long signals you can do it instantiating your own `Telegraph::MorseTransmission` class:\n\n```ruby\n# User defined dot \u0026 dash (:short and :long defaults to '.' and '-')\nmorser = Telegraph::MorseTransmission.new(:short =\u003e'x', :long =\u003e '3')\n```\n\nand then using the methods to read/write:\n\n```ruby\n# write morse code with custom signals\nmorser.text_to_morse(\"Hello world\")  #=\u003e \"xxxx x x3xx x3xx 333       x33 333 x3x x3xx 3xx\"\n\n# read morse code with custom signals\nmorser.morse_to_text(\"xxxx x x3xx x3xx 333       x33 333 x3x x3xx 3xx\")  #=\u003e hello world\"\nmorser.error    #=\u003e \"xxxxxxxx\"\n```\n\n== Credits\n\nAuthor:: Juanjo Bazán\nCopyright:: Copyright (c) 2013 - ∞ Juanjo Bazán\nLicense:: Released under the MIT license.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuanxu%2Ftelegraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxuanxu%2Ftelegraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuanxu%2Ftelegraph/lists"}