comradefy 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. data/README.markdown +10 -0
  2. data/bin/comradefy +9 -1
  3. data/lib/comradefy.rb +2 -2
  4. metadata +4 -4
@@ -1 +1,11 @@
1
1
  ☭ gэm iпsтall comгadэfy ☭
2
+
3
+ ## USAGE ##
4
+
5
+ To comradefy a word or sentence run:
6
+ <code>comradefy [your_input_here]</code>
7
+
8
+ Or you can comradefy stdin now via just:
9
+ <code>comradefy</code>
10
+
11
+ To stop stdin input use .\n (press dot and then enter on the new line)
@@ -6,5 +6,13 @@ require 'comradefy'
6
6
  if ARGV[0]
7
7
  puts Comradefy.report ARGV.join(' ')
8
8
  else
9
- puts Comradefy.report STDIN.read
9
+ source = ""
10
+ while input = STDIN.gets
11
+ if input == ".\n"
12
+ puts (Comradefy.report source).gsub!(/\s*☭\s*/,'')
13
+ break
14
+ else
15
+ source += input
16
+ end
17
+ end
10
18
  end
@@ -2,7 +2,7 @@ ENCODING = 'UTF-8'
2
2
 
3
3
  module Comradefy
4
4
  def self.swap_map
5
- { 'E' => 'Ǝ', 'e' => 'э', 'p' => 'р', 'P' => 'Р', 'b' => 'Ь', 't' => 'т', 'T' => 'Т', 'r' => 'г', 'm' => 'м',
5
+ { 'E' => 'Ǝ', 'e' => 'э', 'p' => 'р', 'P' => 'Р', 'b' => 'Ь', 't' => 'т', 'T' => 'Т', 'r' => 'г', 'm' => 'м',
6
6
  'M' => 'M', 'N' => 'И', 'y' => 'у', 'Y' => 'У', 'H' => 'Н', 'h' => 'н', 'n' => 'п', 'U' => 'Ц', 'u' => 'ц'}
7
7
  end
8
8
  def self.report(text)
@@ -11,7 +11,7 @@ module Comradefy
11
11
  end
12
12
  '☭ ' + changed_text + ' ☭'
13
13
  end
14
-
14
+
15
15
  def self.random_swap(char)
16
16
  (self.swap_map[char] && rand(2).even?) ? self.swap_map[char] : char
17
17
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
+ - 1
7
8
  - 0
8
- - 2
9
- version: 0.0.2
9
+ version: 0.1.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - tjbladez
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-29 00:00:00 -05:00
17
+ date: 2010-09-28 00:00:00 -05:00
18
18
  default_executable: bin/comradefy
19
19
  dependencies: []
20
20
 
@@ -32,7 +32,7 @@ files:
32
32
  - bin/comradefy
33
33
  - lib/comradefy.rb
34
34
  - README.markdown
35
- has_rdoc: true
35
+ has_rdoc: false
36
36
  homepage: http://github.com/tjbladez/comradefy
37
37
  licenses: []
38
38