Project

morse_code

0.0
No commit activity in last 3 years
No release in over 3 years
A small Library which converst morse codes back and forth
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.3
>= 0
 Project Readme

MorseCode

MorseCode is a small Library which enables the conversion of morse codes back and forth. As a GeoCaching advocat it is sometimes pretty usefull to add morse code abilities Ruby and your IRB. Only latin letters and arabic numbers are supported. It might change in the future.

Dependencies

Ruby >= 2.1

As this Library is using refinements please make sure that you're using a current Ruby version.

Installation

Add this line to your application's Gemfile:

gem 'morse_code'

And then execute:

$ bundle

Or install it yourself as:

$ gem install morse_code

Usage

The usage is pretty easy. Please make sure that your String is encoded with . (dit) and - (dah).

Morse Code to String

morse_code = MorseCode::Converter.new("..-. --- --- -... .- .-.")
morse_code.convert

Check if String is a valid Morse Code

MorseCode::Converter.new("foobar").valid?

Filter only Morse Codes from a String

MorseCode::Converter.new("$..-. --- --- -... .- .-.$").clean_text

String to Morse Code

using MorseCode::Refinements
"foobar".to_morse_code

License

MIT

Trouble?

Just write an issue!

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request