Skip to content

Commit

Permalink
update README.md and add LICENSE.md
Browse files Browse the repository at this point in the history
  • Loading branch information
YingRui Lu committed Oct 5, 2018
1 parent 9558061 commit 3bcc125
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 9 deletions.
21 changes: 21 additions & 0 deletions LICENSE.md
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018 Superiorlu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
67 changes: 58 additions & 9 deletions README.md
@@ -1,8 +1,6 @@
# MorseCode

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/morse_code`. To experiment with that code, run `bin/console` for an interactive prompt.

TODO: Delete this and the text above, and describe your gem
Simple Morse Code Encode and Decode Tool

## Installation

Expand All @@ -22,14 +20,65 @@ Or install it yourself as:

## Usage

TODO: Write usage instructions here
### Encode

```ruby
require 'morse_code'

content = 'I am Robot.'
encode_content = MorseCode::Encoder.new(content).encode
dit_dah = MorseCode::Encoder.new(content).dit_dah
puts encode_content
puts dit_dah

$> .. .- -- .-. --- -... --- - .-.-.-
$> DITDIT DITDAH DAHDAH DITDAHDIT DAHDAHDAH DAHDITDITDIT DAHDAHDAH DAH DITDAHDITDAHDITDAH
```

## Development
### Decode

```ruby
require 'morse_code'

content = '.. .- -- .-. --- -... --- - .-.-.-'
decode_content = MorseCode::Decoder.new(content).decode
puts decode_content
$> I A M R O B O T .

dit_dah = 'DITDIT DITDAH DAHDAH DITDAHDIT DAHDAHDAH DAHDITDITDIT DAHDAHDAH DAH DITDAHDITDAHDITDAH'
dit_dah_to = MorseCode::Decoder.new(dit_dah).dit_dah_to
puts dit_dah_to
$> I A M R O B O T .
```

### Contributing

#### Fork the Project

```shell
$ git https://github.com/superiorlu/morse_code.git
$ cd morse_code
$ git remote add upstream https://github.com/superiorlu/morse_code.git
```

#### Create a Toptic Branch

```shell
$ git checkout master
$ git pull upstream master
$ git checkout -b my-feature-branch
```

#### Run Test

```shell
$ bundle exec rake test
```

After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
#### Make a Pull Request

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
Click the `'Pull Request'` button and fill out the form.

## Contributing
### License

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/morse_code.
MIT License. See [LICENSE](https://github.com/superiorlu/morse_code/blob/master/LICENSE.md) for details.

0 comments on commit 3bcc125

Please sign in to comment.