keyboard_convertor 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/keyboard_convertor.rb +5 -6
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d43b3358dd23c3f334cbd0ae2b61442dca8a023
4
- data.tar.gz: d9b7babdcfdaa16d6005038c6226bc879bae2370
3
+ metadata.gz: 1101a39f60420a70fc6e20e9b019d962b5a07531
4
+ data.tar.gz: 324cc192680830cc57c5608cc75d6742502aa39c
5
5
  SHA512:
6
- metadata.gz: 63c84e4f3f822362ad46c96e7726af207321b5411da951e5dd835f48b0b189dae1917534749ab88edfe7805c9d216e0b306e50cf367f8db5db14f79543b6cac2
7
- data.tar.gz: 4f8a60b1ea0c004ae8f4a69d499311237b12e2067f2872496c2567cd99bef5b8d89f0c20d1ec0bb841f13f5b55ba5c567ecd12b27f2aa45cdae03365ef69c5ef
6
+ metadata.gz: 9957a81e60368e04f753b0be16efbe25726b15ced665bdc0783353abed83557293e378466c9873207523b2e327c22c0038f207e6f89ffd6b8f190a5af66af673
7
+ data.tar.gz: 27e38712972f7173e5273a0edbedea0e9f5f3d7fcdd74ad36c234d009c9c8a84c96d3f0e611305d85b000b36436aa69a2cccdab240eba6766dcfe18c14514191
@@ -1,12 +1,11 @@
1
- require 'active_support'
2
-
3
- class KeyboardConveror
1
+ # coding: utf-8
2
+ class String
4
3
 
5
4
  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
5
 
7
- def convert(option)
8
- data = KeyboardConveror.const_get("#{option[:from]}_#{option[:to]}".upcase)
9
- new_word = option[:text].each_char.map do |char|
6
+ def convert_keyboard(option)
7
+ data = String.const_get("#{option[:from]}_#{option[:to]}".upcase)
8
+ new_word = self.each_char.map do |char|
10
9
  data[char].nil? ? char : data[char]
11
10
  end
12
11
  new_word.join('').force_encoding('UTF-8')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: keyboard_convertor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maksim Berjoza