Compare commits
63 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
baa55a8eda | ||
|
|
4db892b66b | ||
|
|
8db84353e4 | ||
|
|
7f9b0eaca9 | ||
|
|
3e9c7cc8fb | ||
|
|
88fce2aa9e | ||
|
|
b9fa07e0e2 | ||
|
|
6723776d77 | ||
|
|
5179cd8159 | ||
|
|
198d829f42 | ||
|
|
5446d53d36 | ||
|
|
77e1fb9e71 | ||
|
|
cf468c1cfd | ||
|
|
6d538220a2 | ||
|
|
cf1632ef7a | ||
|
|
de74b4ec57 | ||
|
|
f7af2578a1 | ||
|
|
08ddb3bd7d | ||
|
|
bde981dad7 | ||
|
|
13f9ecc764 | ||
|
|
33adca56ea | ||
|
|
3ede22022f | ||
|
|
8bf88ab86e | ||
|
|
1e9e262ddf | ||
|
|
c03becb3a0 | ||
|
|
ffcccd85c7 | ||
|
|
175fbfb2c3 | ||
|
|
a9e9415fcc | ||
|
|
892ac6274d | ||
|
|
7ffe22d83c | ||
|
|
c0c2f10406 | ||
|
|
8cca11fdb1 | ||
|
|
91a5a025ca | ||
|
|
01e1710b79 | ||
|
|
2f0ad36b67 | ||
|
|
b84e5754d9 | ||
|
|
c6af1af8f6 | ||
|
|
8190c65f76 | ||
|
|
c921ef1b5b | ||
|
|
bfa00106fc | ||
|
|
9ee88a974d | ||
|
|
e11d502d4d | ||
|
|
24cb142c5e | ||
|
|
42503f1dfa | ||
|
|
3bf04c21ab | ||
|
|
dbb7e48c66 | ||
|
|
ed273dee14 | ||
|
|
b5542d5075 | ||
|
|
e21a63645c | ||
|
|
c79a1d69d0 | ||
|
|
971bcd6236 | ||
|
|
d1d6d35da9 | ||
|
|
97f5441ada | ||
|
|
e43f1ac171 | ||
|
|
fc275cad0a | ||
|
|
38731ced7e | ||
|
|
0e3f686bbd | ||
|
|
bd929a9ee0 | ||
|
|
436209c12f | ||
|
|
24d9881f20 | ||
|
|
74372af2f8 | ||
|
|
a94b90198a | ||
|
|
25da8c9323 |
14
LICENSE
Normal file
14
LICENSE
Normal file
@@ -0,0 +1,14 @@
|
||||
octocat, squirrel, shipit
|
||||
Copyright (c) 2013 GitHub Inc. All rights reserved.
|
||||
|
||||
bowtie, neckbeard, fu
|
||||
Copyright (c) 2013 37signals, LLC. All rights reserved.
|
||||
|
||||
feelsgood, finnadie, goberserk, godmode, hurtrealbad, rage 1-4, suspect
|
||||
Copyright (c) 2013 id Software. All rights reserved.
|
||||
|
||||
trollface
|
||||
Copyright (c) 2013 whynne@deviantart. All rights reserved.
|
||||
|
||||
All other images
|
||||
Copyright (c) 2013 Apple Inc. All rights reserved.
|
||||
27
MAINTAINING.md
Normal file
27
MAINTAINING.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Maintainers
|
||||
|
||||
## Releasing a new gem
|
||||
|
||||
If you are just adding new emoji or making a small fix, only increment the patch level "1.0.x". If you need to rename a ton of emojis or making any other radical (but still mostly backwards compatible changes), bump the minor version "1.x.x".
|
||||
|
||||
### Make a release commit
|
||||
|
||||
To prepare the release commit, edit the [gemoji.gemspec](https://github.com/github/gemoji/blob/master/gemoji.gemspec) `version` value. Then make a single commit with the description as "Gemoji 1.x.x". Finally, tag the commit with `v1.x.x`.
|
||||
|
||||
Example commit https://github.com/github/gemoji/commit/v1.0.0
|
||||
|
||||
```
|
||||
$ git ci -m "Gemoji 1.0.0"
|
||||
$ git tag v1.0.0
|
||||
$ git push
|
||||
$ git push --tags
|
||||
```
|
||||
|
||||
### Publish the gem
|
||||
|
||||
Build and push the new gem with
|
||||
|
||||
```
|
||||
$ gem build gemoji.gemspec
|
||||
$ gem push gemoji-1.0.0.gem
|
||||
```
|
||||
76
README.md
76
README.md
@@ -1,37 +1,67 @@
|
||||
Emoji
|
||||
=====
|
||||
gemoji
|
||||
======
|
||||
|
||||
Shared Emoji assets between GitHub, Campfire, and BCX.
|
||||
Emoji images and names. See the LICENSE for copyright information.
|
||||
|
||||
Contributing
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
### Designers
|
||||
Add `gemoji` to you Gemfile.
|
||||
|
||||
Drop a 64x64 png into `images/` and commit it.
|
||||
``` ruby
|
||||
gem 'gemoji'
|
||||
```
|
||||
|
||||
Deploying
|
||||
---------
|
||||
**Sync images**
|
||||
|
||||
### GitHub
|
||||
Images can be copied to your public directory with `rake emoji` in your Rails app. This is the recommended approach since the images will be available at a consistent location. This works best with cached formatted user content generated by tools like [html-pipeline](https://github.com/jch/html-pipeline).
|
||||
|
||||
1. Update `emoji` gem in Gemfile
|
||||
1. Rerun `rake emoji` in app root
|
||||
``` ruby
|
||||
# Rakefile
|
||||
load 'tasks/emoji.rake'
|
||||
```
|
||||
|
||||
### Campfire
|
||||
```
|
||||
$ rake emoji
|
||||
```
|
||||
|
||||
1. Push changes to 37signals/emoji
|
||||
2. Update emoji version in config/externals.yml
|
||||
3. Run `cap local externals:setup` in app root
|
||||
4. Run `rake emoji` in app root
|
||||
5. Run `Rails.cache.clear` in app console
|
||||
**Assets Precompiling**
|
||||
|
||||
### BCX
|
||||
If you must, you can manually add all the images to your asset load path.
|
||||
|
||||
1. Push changes to 37signals/emoji
|
||||
2. Run `bundle update emoji` in app root
|
||||
``` ruby
|
||||
# config/application.rb
|
||||
config.assets.paths << Emoji.images_path
|
||||
```
|
||||
|
||||
Todo
|
||||
----
|
||||
Then have them compiled to public on deploy.
|
||||
|
||||
- Figure out what's wrong with the symlinks removed in 97709f
|
||||
``` ruby
|
||||
# config/application.rb
|
||||
config.assets.precompile << "emoji/*.png"
|
||||
```
|
||||
|
||||
**WARNING** Since there are a ton of images, just adding the path may slow down other lookups if you aren't using it. Compiling all the emojis on deploy will add overhead to your deploy if even the images haven't changed. Theres just so many more superfluous files to iterate over. Also, the urls will be fingerprinted which may not be ideal for referencing from cached content.
|
||||
|
||||
|
||||
Example Rails Helper
|
||||
--------------------
|
||||
|
||||
This would allow emojifying content such as: `it's raining :cats: and :dogs:!`
|
||||
|
||||
See the [Emoji cheat sheet](http://www.emoji-cheat-sheet.com) for more examples.
|
||||
|
||||
```ruby
|
||||
module EmojiHelper
|
||||
def emojify(content)
|
||||
h(content).to_str.gsub(/:([a-z0-9\+\-_]+):/) do |match|
|
||||
if Emoji.names.include?($1)
|
||||
'<img alt="' + $1 + '" height="20" src="' + asset_path("emoji/#{$1}.png") + '" style="vertical-align:middle" width="20" />'
|
||||
else
|
||||
match
|
||||
end
|
||||
end.html_safe if content.present?
|
||||
end
|
||||
end
|
||||
```
|
||||
|
||||
7
Rakefile
Normal file
7
Rakefile
Normal file
@@ -0,0 +1,7 @@
|
||||
desc "Checks for missing aliases to unicode sources"
|
||||
task :unnamed do
|
||||
unicodes = Dir["./images/emoji/unicode/*.png"].map { |fn| File.basename(fn) }
|
||||
aliases = Dir["./images/emoji/*.png"].select { |fn| File.symlink?(fn) }.map { |fn| File.basename(fn) }
|
||||
used_unicodes = aliases.map { |name| File.basename(File.readlink("./images/emoji/#{name}")) }.uniq
|
||||
puts unicodes - used_unicodes
|
||||
end
|
||||
@@ -1,12 +0,0 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "emoji"
|
||||
s.version = "0.4.0"
|
||||
s.summary = "Emoji Assets"
|
||||
s.description = "Shared Emoji assets between GitHub, Campfire, and BCX."
|
||||
|
||||
s.authors = ["GitHub", "37signals"]
|
||||
s.email = "support@github.com"
|
||||
s.homepage = "https://github.com/github/emoji"
|
||||
|
||||
s.files = Dir["README.md", "images/**/*.png", "lib/**/*"]
|
||||
end
|
||||
12
gemoji.gemspec
Normal file
12
gemoji.gemspec
Normal file
@@ -0,0 +1,12 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "gemoji"
|
||||
s.version = "1.3.1"
|
||||
s.summary = "Emoji Assets"
|
||||
s.description = "Emoji assets"
|
||||
|
||||
s.authors = ["GitHub"]
|
||||
s.email = "support@github.com"
|
||||
s.homepage = "https://github.com/github/gemoji"
|
||||
|
||||
s.files = Dir["README.md", "images/**/*.png", "lib/**/*.rb", "lib/tasks/*.rake"]
|
||||
end
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e00e.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e421.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e50a.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e42c.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e532.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e534.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e01d.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e10c.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e431.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e04e.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e334.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e059.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e345.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e249.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e23f.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e23b.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e233.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e23a.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e235.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e239.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e238.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e234.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e232.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e237.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e236.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e502.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e410.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e154.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e533.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e51a.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e523.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e13a.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e310.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e436.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e14d.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e320.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e016.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e42a.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e13f.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e051.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e047.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e30c.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e209.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e325.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e34c.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e136.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e322.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e521.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e34b.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e21a.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e42e.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e32a.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e056.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e52f.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e01c.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e311.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e148.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e31b.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e306.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e426.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e001.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e339.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e11e.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e023.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e525.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e10f.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e01f.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e435.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e159.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e150.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e308.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e046.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e104.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e530.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e008.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e242.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e248.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e01b.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e04f.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e126.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e14a.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e132.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e030.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e52e.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e033.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e037.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e507.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e44a.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e146.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e41f.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e324.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e024.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e02d.png
|
||||
@@ -1 +0,0 @@
|
||||
unicode/e02e.png
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user