catchat 1.0.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6f8a23a788bca2a344b34a0fd9b31afc6b7494e4
4
+ data.tar.gz: 418b915d1c40fad21c22e7af923bb99907e9bb98
5
+ SHA512:
6
+ metadata.gz: 69f68a3bc12cb5804cb917e57b1cb36e46ee4a8ef4743825b19b185373bf3f10acec65f1cdd4e6fca41b8792e0214ee3f77e247e6aa5e2a0eb5599407bdeeb72
7
+ data.tar.gz: 2887179cb28ee73bd1af8527ce3ba7b40b5b3fbd2f731abd365df600f62ce4eb83662d814b7f754f210dc60b3e77b8c8e330e2cb57d980b264870e2eb1a55f87
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'catchat'
4
+
5
+ puts Cat.meow
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'catchat'
4
+
5
+ case ARGV[0]
6
+ when nil
7
+ puts "Catify Usage Example:"
8
+ puts "ruby catify 'I want to talk to a cat'"
9
+ else
10
+ puts Cat.catify(ARGV[0])
11
+ end
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'catchat'
4
+
5
+ case ARGV[0]
6
+ when nil
7
+ puts "Humanize Usage Example:"
8
+ puts "ruby catify 'meow hiss purr'"
9
+ else
10
+ puts Cat.humanize(ARGV[0])
11
+ end
@@ -0,0 +1,19 @@
1
+ require_relative "catchat/translator"
2
+
3
+ class Cat
4
+
5
+ def self.meow
6
+ "MEEEOW!"
7
+ end
8
+
9
+ def self.catify(passage)
10
+ Translator.catify_passage(passage)
11
+ end
12
+
13
+ def self.humanize(passage)
14
+ Translator.humanize_passage(passage)
15
+ end
16
+
17
+ end
18
+
19
+
@@ -0,0 +1,47 @@
1
+ DICTIONARY = {
2
+ 'a' => 'purr',
3
+ 'b' => 'meow',
4
+ 'c' => 'purrrr',
5
+ 'd' => 'hiss',
6
+ 'e' => 'tail-swish',
7
+ 'f' => 'bite',
8
+ 'g' => 'puuuur',
9
+ 'h' => 'meeeeow',
10
+ 'i' => 'meeeeooooow',
11
+ 'j' => 'sad-eyes',
12
+ 'k' => 'eat',
13
+ 'l' => 'laser-pointer',
14
+ 'm' => 'sit-in-bag',
15
+ 'n' => 'hissss',
16
+ 'o' => 'scratch',
17
+ 'p' => 'pounce',
18
+ 'q' => 'hide',
19
+ 'r' => 'antisocial',
20
+ 's' => 'sleep',
21
+ 't' => 'paw',
22
+ 'u' => 'chase',
23
+ 'v' => 'roll',
24
+ 'w' => 'jump',
25
+ 'x' => 'chomp',
26
+ 'y' => 'mew',
27
+ 'z' => 'mmmmmeeeeowww',
28
+ '1' => 'meow?',
29
+ '2' => 'snuggle',
30
+ '3' => 'nap',
31
+ '4' => 'catnip',
32
+ '5' => 'purrpurrpurrrr',
33
+ '6' => 'sniff',
34
+ '7' => 'meeeeoww',
35
+ '8' => 'hisss!',
36
+ '9' => 'run-away',
37
+ '0' => 'puuuuuuur',
38
+ '!' => 'puur',
39
+ '?' => 'hiss!',
40
+ '.' => 'FOOOOOOD',
41
+ ',' => 'burrow',
42
+ '#' => 'rub',
43
+ '$' => 'pet',
44
+ ':' => 'stare',
45
+ ';' => 'meooow',
46
+ '/' => 'attack-dog'
47
+ }
@@ -0,0 +1,33 @@
1
+ require_relative 'dictionary'
2
+
3
+ class Translator
4
+
5
+ @@dictionary = DICTIONARY
6
+
7
+ ###Human To Cat
8
+ def self.catify_letter(letter)
9
+ return @@dictionary[letter]
10
+ end
11
+
12
+ def self.catify_word(word)
13
+ word.split('').map{|l| Translator.catify_letter(l)}.join(' ')
14
+ end
15
+
16
+ def self.catify_passage(passage)
17
+ passage.downcase.split(' ').map{|w| Translator.catify_word(w)}.join(' ')
18
+ end
19
+
20
+ ###Cat To Human
21
+ def self.humanize_letter(letter)
22
+ return @@dictionary.key(letter)
23
+ end
24
+
25
+ def self.humanize_word(word)
26
+ word.split(' ').map{|l| Translator.humanize_letter(l)}.join('')
27
+ end
28
+
29
+ def self.humanize_passage(passage)
30
+ passage.downcase.split(' ').map{|w| Translator.humanize_word(w)}.join(' ')
31
+ end
32
+
33
+ end
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: catchat
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Shawn Wilkinson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-04-16 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: The number one gem for human-cat communication
14
+ email: shawnwilkinson11@gmail.com
15
+ executables:
16
+ - catchat
17
+ - humanize
18
+ - catify
19
+ extensions: []
20
+ extra_rdoc_files: []
21
+ files:
22
+ - bin/catchat
23
+ - bin/catify
24
+ - bin/humanize
25
+ - lib/catchat.rb
26
+ - lib/catchat/dictionary.rb
27
+ - lib/catchat/translator.rb
28
+ homepage: http://www.shawnwilkinson.io
29
+ licenses:
30
+ - MIT
31
+ metadata: {}
32
+ post_install_message:
33
+ rdoc_options: []
34
+ require_paths:
35
+ - lib
36
+ required_ruby_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ required_rubygems_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ requirements: []
47
+ rubyforge_project:
48
+ rubygems_version: 2.4.8
49
+ signing_key:
50
+ specification_version: 4
51
+ summary: Finally a gem for cats!
52
+ test_files: []