emojifi_rb 0.0.2

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 74cb90fa40ea5ef034a965e8be63042a2bff9a49
4
+ data.tar.gz: a6d33bbe833d12d384b867bfe47901438cd9f6dd
5
+ SHA512:
6
+ metadata.gz: 7a73593e3921b767ea8264af7f32611a55814222f56008228928e59ee09e4f1034c9979acea5b6c9ca6ff22b82df0768538b3016804acb355dadc3e4b6c0694c
7
+ data.tar.gz: 5e84f64ec83a2e05debeead1d1c761a5765df9731ead7c0173ed122f0f0caf37e4cdea05f13550fb99df358fc155b8185ecb0eef4d5dcce0e0838b3a32338a1d
data/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'docopt', '~> 0.5.0'
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Daniel Martinez
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # EmojifiRb
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'emojifi_rb'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install emojifi_rb
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it ( https://github.com/[my-github-username]/emojifi_rb/fork )
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
data/bin/emojifi_rb ADDED
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'emojifi_rb'
4
+ require "docopt"
5
+
6
+ doc = <<DOCOPT
7
+ emojifi_rb.
8
+
9
+ With no options, emojifi_rb reads raw data from stdin and writes encoded data as a block of emojis to stdout.
10
+
11
+ Usage:
12
+ emojifi_rb <input>
13
+ emojifi_rb -D | --decode <input>
14
+ emojifi_rb -h | --help
15
+ emojifi_rb -v | --version
16
+
17
+ Options:
18
+ -h --help Show this screen.
19
+ -v --version Show version.
20
+ -D --decode Decode incoming emoji string into readable strings.
21
+
22
+ DOCOPT
23
+
24
+ begin
25
+ args = Docopt::docopt(doc)
26
+ if args.fetch "--decode"
27
+ puts EmojifiRb.decode args.fetch "<input>"
28
+ else
29
+ puts EmojifiRb.encode args.fetch "<input>"
30
+ end
31
+ rescue Docopt::Exit => e
32
+ puts e.message
33
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'emojifi_rb/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "emojifi_rb"
8
+ spec.version = EmojifiRb::VERSION
9
+ spec.authors = ["Daniel Martinez"]
10
+ spec.email = ["eduardodaniel2@gmail.com"]
11
+ spec.summary = %q{Procrastination level: I have a script that turns things into emojis!}
12
+ spec.description = %q{Procrastination level: I have a script that turns things into emojis! πŸ‘¨πŸ‘ΆπŸ‘΄πŸ‘ΉπŸ‘½πŸ‘Έ"}
13
+ spec.homepage = "https://github.com/edmt/emojifi_rb"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.6"
22
+ spec.add_development_dependency "rake", "~> 10.3"
23
+ spec.add_development_dependency "docopt", "~> 0.5"
24
+ end
@@ -0,0 +1,3 @@
1
+ module EmojifiRb
2
+ VERSION = "0.0.2"
3
+ end
data/lib/emojifi_rb.rb ADDED
@@ -0,0 +1,18 @@
1
+ require "emojifi_rb/version"
2
+
3
+ module EmojifiRb
4
+ EMOJI_INDEX = [9728,9729,9748,9924,9889,127744,127745,127746,127747,127748,127749,127750,127751,127752,10052,9925,127753,127754,127755,127756,127759,127761,127764,127763,127769,127765,127771,127775,127776,128336,128337,128338,128339,128340,128341,128342,128343,128344,128345,128346,128347,8986,8987,9200,9203,9800,9801,9802,9803,9804,9805,9806,9807,9808,9809,9810,9811,9934,127808,127799,127793,127809,127800,127801,127810,127811,127802,127803,127796,127797,127806,127805,127812,127792,127804,127807,127826,127820,127822,127818,127827,127817,127813,127814,127816,127821,127815,127825,127823,128064,128066,128067,128068,128069,128132,128133,128134,128135,128136,128100,128102,128103,128104,128105,128106,128107,128110,128111,128112,128113,128114,128115,128116,128117,128118,128119,128120,128121,128122,128123,128124,128125,128126,128127,128128,128129,128130,128131,128012,128013,128014,128020,128023,128043,128024,128040,128018,128017,128025,128026,128027,128028,128029,128030,128032,128033,128034,128036,128037,128038,128035,128039,128041,128031,128044,128045,128047,128049,128051,128052,128053,128054,128055,128059,128057,128058,128046,128048,128056,128062,128050,128060,128061,128544,128553,128562,128542,128565,128560,128530,128525,128548,128540,128541,128523,128536,128538,128567,128563,128515,128517,128518,128513,128514,128522,9786,128516,128546,128557,128552,128547,128545,128524,128534,128532,128561,128554,128527,128531,128549,128555,128521,128570,128568,128569,128573,128571,128575,128574,128572,128576,128581,128582,128583,128584,128586,128585,128587,128588,128589,128590,128591,127968,127969,127970,127971,127973,127974,127975,127976,127977,127978,127979,9962,9970,127980,127983,127984,127981,9875,127982,128507,128508,128509,128510,128511,128094,128095,128096,128097,128098,128099,128083,128085,128086,128081,128084,128082,128087,128088,128089,128090,128091,128092,128093,128176,128177,128185,128178,128179,128180,128181,128184,127464,127465,127466,127467,127468,127470,127471,127472,127479,127482,128293,128294,128295,128296,128297,128298,128299,128302,128303,128304,128305,128137,128138,127344,127345,127374,127358,127872,127873,127874,127876,127877,127884,127878,127880,127881,127885,127886,127891,127890,127887,127879,127888,127875,127882,127883,127889,128223,9742,128222,128241,128242,128221,128224,9993,128232,128233,128234,128235,128238,128240,128226,128227,128225,128228,128229,128230,128231,128288,128289,128290,128291,128292,10002,128186,128187,9999,128206,128188,128189,128190,128191,128192,9986,128205,128195,128196,128197,128193,128194,128211,128214,128212,128213,128215,128216,128217,128218,128219,128220,128203,128198,128202,128200,128201,128199,128204,128210,128207,128208,128209,127933,9918,9971,127934,9917,127935,127936,127937,127938,127939,127940,127942,127944,127946,128643,128647,9410,128644,128645,128663,128665,128652,128655,128674,9992,9973,128649,128640,128676,128661,128666,128658,128657,128659,9981,127359,128677,128679,128680,9832,9978,127904,127905,127906,127907,127908,127909,127910,127911,127912,127913,127914,127915,127916,127917,127918,126980,127919,127920,127921,127922,127923,127924,127183,127925,127926,127927,127928,127929,127930,127931,127932,12349,128247,128249,128250,128251,128252,128139,128140,128141,128142,128143,128144,128145,128146,128286,169,174,8482,8505,35,49,50,51,52,53,54,55,56,57,48,128287,128246,128243,128244,127828,127833,127856,127836,127838,127859,127846,127839,127841,127832,127834,127837,127835,127842,127843,127857,127858,127847,127830,127845,127840,127829,127831,127848,127849,127850,127851,127852,127853,127854,127855,127844,127860,9749,127864,127866,127861,127862,127863,127867,127865,8599,8600,8598,8601,10548,10549,8596,8597,11014,11015,10145,11013,9654,9664,9193,9194,9195,9196,128314,128315,128316,128317,11093,10060,10062,10071,8265,8252,10067,10068,10069,12336,10160,10175,10084,128147,128148,128149,128150,128151,128152,128153,128154,128155,128156,128157,128158,128159,9829,9824,9830,9827,128684,128685,9855,128681,9888,9940,9851,128690,128694,128697,128698,128704,128699,128701,128702,128700,128682,128683,10004,127377,127378,127379,127380,127381,127382,127383,127384,127385,127386,127489,127490,127538,127539,127540,127541,127542,127514,127543,127544,127545,127535,127546,12953,12951,127568,127569,10133,10134,10006,10135,128160,128161,128162,128163,128164,128165,128166,128167,128168,128169,128170,128171,128172,10024,10036,10035,9898,9899,128308,128309,128306,128307,11088,11036,11035,9643,9642,9725,9726,9723,9724,128310,128311,128312,128313,10055,128174,128175,8617,8618,128259,128266,128267,128268,128269,128270,128274,128275,128271,128272,128273,128276,9745,128280,128278,128279,128281,128282,128283,128284,128285,9989,9994,9995,9996,128074,128077,9757,128070,128071,128072,128073,128075,128079,128076,128078,128080]
5
+
6
+ def self.encode input
7
+ input.bytes
8
+ .map { |x| EMOJI_INDEX.fetch x }
9
+ .map { |x| [x].pack "U" }
10
+ .join
11
+ end
12
+
13
+ def self.decode input
14
+ input.codepoints
15
+ .map { |c| EMOJI_INDEX.index c }
16
+ .pack("U*").force_encoding("utf-8")
17
+ end
18
+ end
metadata ADDED
@@ -0,0 +1,97 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: emojifi_rb
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Daniel Martinez
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-08-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.6'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.6'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '10.3'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '10.3'
41
+ - !ruby/object:Gem::Dependency
42
+ name: docopt
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '0.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '0.5'
55
+ description: "Procrastination level: I have a script that turns things into emojis!
56
+ \U0001F468\U0001F476\U0001F474\U0001F479\U0001F47D\U0001F478\""
57
+ email:
58
+ - eduardodaniel2@gmail.com
59
+ executables:
60
+ - emojifi_rb
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - .gitignore
65
+ - Gemfile
66
+ - LICENSE.txt
67
+ - README.md
68
+ - Rakefile
69
+ - bin/emojifi_rb
70
+ - emojifi_rb.gemspec
71
+ - lib/emojifi_rb.rb
72
+ - lib/emojifi_rb/version.rb
73
+ homepage: https://github.com/edmt/emojifi_rb
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.3.0
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: 'Procrastination level: I have a script that turns things into emojis!'
97
+ test_files: []