README.md in shift_cipher-0.1.1 vs README.md in shift_cipher-1.0.0

- old
+ new

@@ -1,14 +1,14 @@ # ShiftCipher -A simple shift cipher, also known as a caeser ciipher +A simple shift cipher, also known as a Caesar cipher ## Installation Add this line to your application's Gemfile: -```ruby +``` gem 'shift_cipher' ``` And then execute: @@ -18,30 +18,54 @@ $ gem install shift_cipher ## Usage -Initialise the Caeser cipher +Initialise the Caesar cipher -```ruby - cipher = ShiftCipher::Caeser.new(3) # initialised with an offset of 3 ('a' = 'd') ``` + cipher = ShiftCipher::Caesar.new(3) # initialised with an offset of 3 ('a' = 'd') +``` + or -```ruby - cipher = ShiftCipher::Caeser.new('d') # initialised with an offset of 3 ('a' = 'd') + ``` + cipher = ShiftCipher::Caesar.new(-3) # initialised with a negative offset of 3 ('a' = 'x') +``` +or + + +``` + cipher = ShiftCipher::Caesar.new('d') # initialised with an offset of 3 ('a' = 'd') +``` + Encrypt a message: -```ruby + +``` encrypted_message = cipher.encrypt('hello world') p encrypted_message # => "khoor zruog" ``` Decrypt a message: -```ruby + +``` decrypted_message = cipher.decrypt('khoor zruog') p decrypted_message # => "hello world" ``` + +### Using the CLI tool: + +```` + shift_cipher [options] text +```` + +#### Options + ```-h, --help``` Displays help message + ```-o, --offset OFFSET``` Sets the alphabet offset + ```-s, --start START``` Sets the starting letter of the shifted alphabet + ```-d, --decrypt``` Decrypts the given message Decrypt + ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.