keyboard_convertor 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 (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/keyboard_convertor.rb +15 -0
  3. metadata +43 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4d43b3358dd23c3f334cbd0ae2b61442dca8a023
4
+ data.tar.gz: d9b7babdcfdaa16d6005038c6226bc879bae2370
5
+ SHA512:
6
+ metadata.gz: 63c84e4f3f822362ad46c96e7726af207321b5411da951e5dd835f48b0b189dae1917534749ab88edfe7805c9d216e0b306e50cf367f8db5db14f79543b6cac2
7
+ data.tar.gz: 4f8a60b1ea0c004ae8f4a69d499311237b12e2067f2872496c2567cd99bef5b8d89f0c20d1ec0bb841f13f5b55ba5c567ecd12b27f2aa45cdae03365ef69c5ef
@@ -0,0 +1,15 @@
1
+ require 'active_support'
2
+
3
+ class KeyboardConveror
4
+
5
+ RU_EN = { 'q' => 'й', 'w' => 'ц', 'e' => 'у', 'r' => 'к', 't' => 'е', 'y' => 'н', 'u' => 'г', 'i' => 'ш', 'o' => 'щ', 'p' => 'з', '[' => 'х', ']' => 'ъ', 'a' => 'ф', 's' => 'ы', 'd' => 'в', 'f' => 'а', 'g' => 'п', 'h' => 'р', 'j' => 'о', 'k' => 'л', 'l' => 'д', ';' => 'ж', '\'' => 'э', '\\' => 'ё', 'z' => 'я', 'x' => 'ч', 'c' => 'с', 'v' => 'м', 'b' => 'и', 'n' => 'т', 'm' => 'ь', ',' => 'б', '.' => 'ю', 'Q' => 'Й', 'W' => 'Ц', 'E' => 'У', 'R' => 'К', 'T' => 'Е', 'Y' => 'Н', 'I' => 'Ш', 'O' => 'Щ', 'P' => 'З', '{' => 'Х', '}' => 'Ъ', 'A' => 'Ф', 'S' => 'Ы', 'D' => 'В', 'F' => 'А', 'G' => 'П', 'H' => 'Р', 'J' => 'О', 'K' => 'Л', 'L' => 'Д', ':' => 'Ж', '"' => 'Э', '|' => 'Ё', 'Z' => 'Я', 'X' => 'Ч', 'C' => 'С', 'V' => 'М', 'B' => 'И', 'N' => 'Т', 'M' => 'Ь', '<' => 'Б', '>' => 'Ю'}
6
+
7
+ def convert(option)
8
+ data = KeyboardConveror.const_get("#{option[:from]}_#{option[:to]}".upcase)
9
+ new_word = option[:text].each_char.map do |char|
10
+ data[char].nil? ? char : data[char]
11
+ end
12
+ new_word.join('').force_encoding('UTF-8')
13
+ end
14
+
15
+ end
metadata ADDED
@@ -0,0 +1,43 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: keyboard_convertor
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Maksim Berjoza
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-05-30 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Converting from/to keyboard
14
+ email: maksim.berjoza@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/keyboard_convertor.rb
20
+ homepage: https://github.com/torbjon/keyboard_convertor
21
+ licenses: []
22
+ metadata: {}
23
+ post_install_message:
24
+ rdoc_options: []
25
+ require_paths:
26
+ - lib
27
+ required_ruby_version: !ruby/object:Gem::Requirement
28
+ requirements:
29
+ - - '>='
30
+ - !ruby/object:Gem::Version
31
+ version: '0'
32
+ required_rubygems_version: !ruby/object:Gem::Requirement
33
+ requirements:
34
+ - - '>='
35
+ - !ruby/object:Gem::Version
36
+ version: '0'
37
+ requirements: []
38
+ rubyforge_project:
39
+ rubygems_version: 2.0.3
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: KeyboardConvertor
43
+ test_files: []