fliptext 0.1.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 (6) hide show
  1. checksums.yaml +15 -0
  2. data/LICENSE.md +20 -0
  3. data/README.md +24 -0
  4. data/bin/fliptext +5 -0
  5. data/lib/fliptext.rb +79 -0
  6. metadata +50 -0
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YWE5NDIzZjk2ODQxODRlNzM2N2U3ZGFiYWRjNjg1MzlmYmY5MDFjMQ==
5
+ data.tar.gz: !binary |-
6
+ MzVjOWE2M2FhNjNlNTllOWFhNjFiOTE1YWM0OTBjYmQyNmU0OTUzNA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MzJhYjk0ZGI0Y2MyYjhiMDkyNmU4MThhNDVkMTJmZTIyMWQyNzJlM2FkZTcx
10
+ ODY0MmQzZjE3ZDUyNjI4YTdiZTMxYTkyMDYyYmRiNGYzYjdmMGMyNTExNjE0
11
+ NmI4NGQ3MThhYTYwNzMyYjM4OTc5MmFmZjc2YTVjMDI0YmE4OTU=
12
+ data.tar.gz: !binary |-
13
+ MmNiODRhYWEyZTk2Nzk3NTk2Y2RjMDZjOWZmMWU1ZDBkM2NjODIxODQyMTJh
14
+ ZWZjMzY3YmQyYTE3YTBjZTI4ODI0YzUyNzcxMTU2YmNmMmZhMjcxNTIwOTk4
15
+ ZDYzZDNjODE4NmQwOTZjNGFiODNmMzZiNThiNTYzMzVlZTE1ZGI=
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Romain Berger <romain@romainberger.com>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,24 @@
1
+ # FlipText
2
+
3
+ Very useful gem to flip text. Output in your shell and copy to clipoard so you can write reversed commit messages and whatnot.
4
+
5
+ ## nsɐbǝ
6
+
7
+ ````
8
+ $ fliptext Hello world
9
+ ɥǝןןo ʍoɹןp
10
+ ```
11
+
12
+ ## ıusʇɐןןɐʇıou
13
+
14
+ ````
15
+ $ gem install fliptext
16
+ ```
17
+
18
+ ## ʍɥʎ pıp ʎon po ʇɥɐʇ?
19
+
20
+ That was just to try Ruby and see how to make a gem.
21
+
22
+ ## qʎ
23
+
24
+ [@ɹoɯɐıu__qǝɹbǝɹ](http://twitter.com/romain__berger)
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
3
+ require 'fliptext'
4
+
5
+ FlipText.flip(ARGV.join(' '))
@@ -0,0 +1,79 @@
1
+ # encoding: UTF-8
2
+
3
+ class FlipText
4
+
5
+ VERSION = '0.1.1'
6
+
7
+ CONVERT_MAP = {
8
+ 'A' => "\u0250",
9
+ 'B' => 'q',
10
+ 'C' => "\u0254",
11
+ 'D' => 'p',
12
+ 'E' => "\u01DD",
13
+ 'F' => "\u025F",
14
+ 'G' => 'b',
15
+ 'H' => "\u0265",
16
+ 'I' => "\u0131",
17
+ 'J' => "\u0638",
18
+ 'K' => "\u029E",
19
+ 'L' => "\u05DF",
20
+ 'M' => "\u026F",
21
+ 'N' => 'u',
22
+ 'O' => 'o',
23
+ 'P' => 'd',
24
+ 'Q' => 'b',
25
+ 'R' => "\u0279",
26
+ 'S' => 's',
27
+ 'T' => "\u0287",
28
+ 'U' => 'n',
29
+ 'V' => "\u028C",
30
+ 'W' => "\u028D",
31
+ 'X' => 'x',
32
+ 'Y' => "\u028E",
33
+ 'Z' => 'z',
34
+ 'a' => "\u0250",
35
+ 'b' => 'q',
36
+ 'c' => "\u0254",
37
+ 'd' => 'p',
38
+ 'e' => "\u01DD",
39
+ 'f' => "\u025F",
40
+ 'g' => 'b',
41
+ 'h' => "\u0265",
42
+ 'i' => "\u0131",
43
+ 'j' => "\u0638",
44
+ 'k' => "\u029E",
45
+ 'l' => "\u05DF",
46
+ 'm' => "\u026F",
47
+ 'n' => 'u',
48
+ 'o' => 'o',
49
+ 'p' => 'd',
50
+ 'q' => 'b',
51
+ 'r' => "\u0279",
52
+ 's' => 's',
53
+ 't' => "\u0287",
54
+ 'u' => 'n',
55
+ 'v' => "\u028C",
56
+ 'w' => "\u028D",
57
+ 'x' => 'x',
58
+ 'y' => "\u028E",
59
+ 'z' => 'z',
60
+ '?' => "\u00BF",
61
+ "\u00BF" => '?',
62
+ '!' => "\u00A1",
63
+ "'" => ',',
64
+ ',' => "'",
65
+ '.' => "\u02D9",
66
+ '_' => "\u203E",
67
+ ';' => "\u061B"
68
+ }
69
+
70
+ # Flip a text
71
+ def self.flip(text)
72
+ flipped = text.gsub(/[a-z0-9]/i, CONVERT_MAP)
73
+
74
+ `printf "#{flipped}" | pbcopy` if RUBY_PLATFORM =~ /darwin/
75
+ `printf "#{flipped}" | xclip` if RUBY_PLATFORM =~ /linux/
76
+ puts flipped
77
+ end
78
+
79
+ end
metadata ADDED
@@ -0,0 +1,50 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fliptext
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Romain Berger
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-06-20 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: sʇndıp bǝɯ ʇo ɟןıd ʇǝxʇ
14
+ email: romain@romainberger.com
15
+ executables:
16
+ - fliptext
17
+ extensions: []
18
+ extra_rdoc_files:
19
+ - README.md
20
+ - LICENSE.md
21
+ files:
22
+ - lib/fliptext.rb
23
+ - README.md
24
+ - LICENSE.md
25
+ - bin/fliptext
26
+ homepage: https://github.com/romainberger/fliptext
27
+ licenses: []
28
+ metadata: {}
29
+ post_install_message:
30
+ rdoc_options:
31
+ - --charset=UTF-8
32
+ require_paths:
33
+ - lib
34
+ required_ruby_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ requirements: []
45
+ rubyforge_project:
46
+ rubygems_version: 2.0.3
47
+ signing_key:
48
+ specification_version: 4
49
+ summary: FlipText
50
+ test_files: []