spell_it 0.0.1

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. checksums.yaml +15 -0
  2. data/lib/spell_it/version.rb +8 -0
  3. data/lib/spell_it.rb +43 -0
  4. metadata +46 -0
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZWFmNzA3OTZhNTg2NGZiY2FlMDAxYTEwZWJmZDU2YTQ4MDJjNmU2MA==
5
+ data.tar.gz: !binary |-
6
+ YWVhMjBkNTA3MWZiZTQ2M2E3ZjQ3ZmFmNGZkMzZkODcxYmJkODQ5ZQ==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ NTEyYTlkYzVmMDEzMmVmMDk0YWM2YTdkYzdiODAyZTZmYzA3M2RmOWU1MWMx
10
+ ZjNhYzM4MzEyMDQ0MGQzOWJmYmEzZjkxMDQ2YjEwNGU3Nzg5MmNlNmRmZmRm
11
+ MTNlMDM4YTQ1M2NkOTFhNzVmZGJmNWZhZGEwOGYxODM3MGJjYzE=
12
+ data.tar.gz: !binary |-
13
+ OGU2Y2VkNzk2ZDljOGI0NDUwZmU3YzFiM2MxNWE0ZTA4MDhkMTgwYTZiNzQx
14
+ NTcwM2VmOTBkZGExYjU1ODlmNTVjYzY5MzlmM2QyMmFkNGY2ZjgwYjE3ZjU2
15
+ ZmY4ZThiNmE1OTQzYTk2NzI5ZGIxMzlhMDNkOWJkZjY2YTgwNDA=
@@ -0,0 +1,8 @@
1
+ module SpellIt
2
+ module VERSION
3
+ MAJOR = 0
4
+ MINOR = 0
5
+ TINY = 1
6
+ STRING = [MAJOR, MINOR, TINY].join('.')
7
+ end
8
+ end
data/lib/spell_it.rb ADDED
@@ -0,0 +1,43 @@
1
+ class SpellIt
2
+
3
+ ALPHABETS = {"a" => "Alfa", "b" => "Bravo", "c" => "Charlie", "d" => "Delta", "e" => "Echo", "f" => "Foxtrot", "g" => "Golf", "h" => "Hotel", "i" => "India", "j" => "Juliett", "k" => "Kilo", "l" => "Lima", "m" => "Mike", "n" => "November", "o" => "Oscar", "p" => "Papa", "q" => "Quebec", "r" => "Romeo", "s" => "Sierra", "t" => "Tango", "u" => "Uniform", "v" => "Victor", "w" => "Whiskey", "x" => "X-ray", "y" => "Yankee", "z" => "Zulu"}
4
+ NUMBERS = {"0" => "Zero", "1" => "One", "2" => "Two", "3" => "Three", "4" => "Four", "5" => "Five", "6" => "Six", "7" => "Seven", "8" => "Eight", "9" => "Nine"}
5
+ SYMBOLS = {"." => "Dot", "@" => "At Sign", "?" => "Question Mark", "!" => "Exclamation Mak", "&" => "Ampersand", "-" => "Minus", "_" => "Underscore", "*" => "Star", "$" => "Dollar", "#" => "Hash", "%" => "Percentage", "^" => "Caret", "~" => "Tilde", ";" => "Semicolon", ":" => "Colon", "(" => "Left Bracket", ")" => "Right Bracket", "|" => "Vertical Bar/Pipe", "+" => "Plus Sign", "," => "Comma"}
6
+
7
+ def initialize
8
+
9
+ end
10
+
11
+ def self.word(name, css_class = nil)
12
+ unless css_class
13
+ spell_table = spell_word_table_css
14
+ spell_table << "<table class = 'spellWordTable'>"
15
+ else
16
+ spell_table = "<table class = '#{css_class}'>"
17
+ end
18
+ spell_table << "<thead><tr><th colspan='2'>#{name}</th></tr></thead><tbody>"
19
+ name.split("").each do |letter|
20
+ if ALPHABETS.include? letter.downcase
21
+ spell_table << "<tr><td>#{letter}</td><td>#{ALPHABETS[letter]}</td></tr>"
22
+ elsif NUMBERS.include? letter.downcase
23
+ spell_table << "<tr><td>#{letter}</td><td>#{NUMBERS[letter]}</td></tr>"
24
+ elsif SYMBOLS.include? letter.downcase
25
+ spell_table << "<tr><td>#{letter}</td><td>#{SYMBOLS[letter]}</td></tr>"
26
+ else
27
+ spell_table << "<tr><td>#{letter}</td><td>Not a symbol</td></tr>"
28
+ end
29
+ end
30
+ spell_table << "</tbody></table>"
31
+ spell_table.html_safe
32
+ end
33
+
34
+ def self.spell_word_table_css
35
+ ret = "<style>"
36
+ ret << ".spellWordTable{display:inline-block;border:1px solid #444;margin:10px}"
37
+ ret << ".spellWordTable thead tr{background:#5d4485;color:#fff;}"
38
+ ret << ".spellWordTable td,.spellWordTable th{padding:3px 30px;border:1px solid #ddd;}"
39
+ ret << "</style>"
40
+ ret
41
+ end
42
+
43
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: spell_it
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Mohammed Shakeer
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-08-07 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Avoid confusion when spelling on the phone! Let us spell names, e-mail
14
+ addresses, foreign words and technical terms automatically for you.
15
+ email: mdshakeer91@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - lib/spell_it/version.rb
21
+ - lib/spell_it.rb
22
+ homepage: https://github.com/mdshakeer
23
+ licenses:
24
+ - N/A
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ! '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 2.1.11
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: Avoid confusion when spelling on the phone!
46
+ test_files: []