-
-
Save redsquirrel/6e4af716d36893fd5b2b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I need a gem. Call it whatever you like, but when you're done with this exercise, all I want you to give me is a gem file. | |
Also, your gem should not depend on any other gems. (Depending on a testing framework like RSpec acceptable.) | |
Inside the gem, there should be 2 functions. Both functions take a string and a list of words. For example: | |
obfuscate("big string of big words is bigger", ["big", "words"]) | |
report("big string of big words is bigger", ["big", "words"]) | |
"obfuscate" returns the string with all words from the list obfuscated. For example: | |
obfuscate("big string of big words is bigger", ["big", "words"]) | |
=> "*** string of *** ***** is bigger" | |
"report" returns a hash that contains the list of words and their associated frequency in the string. For example: | |
report("big string of big words is bigger", ["big", "words"]) | |
=> {"big" => 2, "words" => 1} | |
The functions could be at the top-level or namespaced. Your call. | |
Thanks. |
Yeah, exactly like that. Nice job.
…On Wed, Jun 20, 2012 at 9:11 AM, Alfonso Rush < ***@***.*** > wrote:
Ah...more like this (version 5)?
https://rubygems.org/gems/obfu_report/versions/
https://github.com/thefonso/obfu_report
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/6e4af716d36893fd5b2b
I didn't put this into a gem but I just wanted to take a stab at solving it.
https://gist.github.com/3764829
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ah...more like this (version 5)?
https://rubygems.org/gems/obfu_report/versions/
https://github.com/thefonso/obfu_report