Compare commits
75 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
da797b13e3 | ||
|
|
9fa5dcd311 | ||
|
|
f2f80d4e8a | ||
|
|
315015e90e | ||
|
|
d815c7f9b7 | ||
|
|
5919a89968 | ||
|
|
3358ffbeb4 | ||
|
|
e46c8207fc | ||
|
|
ded4714831 | ||
|
|
8c15ced399 | ||
|
|
765df113e1 | ||
|
|
52210cece2 | ||
|
|
bcf62ad7cd | ||
|
|
db6bc0fb28 | ||
|
|
69e7ea119c | ||
|
|
1ebc4b1f74 | ||
|
|
a2e1d15d13 | ||
|
|
ffaef44107 | ||
|
|
10a29606b6 | ||
|
|
2f1da81b8c | ||
|
|
65616aa784 | ||
|
|
092e292fd5 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +0,0 @@
|
||||
Gemfile.lock
|
||||
14
LICENSE
Normal file
14
LICENSE
Normal file
@@ -0,0 +1,14 @@
|
||||
octocat, squirrel, shipit
|
||||
Copyright (c) 2012 GitHub Inc. All rights reserved.
|
||||
|
||||
bowtie, neckbeard
|
||||
Copyright (c) 2012 37signals, LLC. All rights reserved.
|
||||
|
||||
feelsgood, finnadie, goberserk, godmode, hurtrealbad, rage 1-4, suspect
|
||||
Copyright (c) 2012 id Software. All rights reserved.
|
||||
|
||||
trollface
|
||||
Copyright (c) 2012 whynne@deviantart. All rights reserved.
|
||||
|
||||
All other images
|
||||
Copyright (c) 2012 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
|
||||
```
|
||||
65
README.md
65
README.md
@@ -1,35 +1,58 @@
|
||||
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'
|
||||
```
|
||||
|
||||
### Others
|
||||
**Sync images**
|
||||
|
||||
Rerun `rake` to rebuild static assets and sprites. (Trying to make this step unnecessary)
|
||||
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).
|
||||
|
||||
Deploying
|
||||
---------
|
||||
**Assets Precompiling**
|
||||
|
||||
### GitHub
|
||||
If you must, you can manually add all the images to your asset load path.
|
||||
|
||||
1. Run `rake emoji` in app root
|
||||
``` ruby
|
||||
# config/application.rb
|
||||
config.assets.paths << Emoji.images_path
|
||||
```
|
||||
|
||||
### Campfire
|
||||
Then have them compiled to public on deploy.
|
||||
|
||||
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
|
||||
``` ruby
|
||||
# config/application.rb
|
||||
config.assets.precompile << "emoji/*.png"
|
||||
```
|
||||
|
||||
### BCX
|
||||
**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 many not be ideal for referencing from cached content.
|
||||
|
||||
1. Push changes to 37signals/emoji
|
||||
2. Run `bundle update emoji` in app root
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
37
Rakefile
37
Rakefile
@@ -1,32 +1,7 @@
|
||||
$:.unshift File.expand_path("../lib", __FILE__)
|
||||
|
||||
require 'emoji'
|
||||
require 'sprockets'
|
||||
require 'rake/clean'
|
||||
|
||||
Assets = Sprockets::Environment.new do |env|
|
||||
env.append_path Emoji.path
|
||||
env.append_path File.join(Emoji.path, 'assets')
|
||||
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
|
||||
|
||||
file "lib/emoji.png" do |f|
|
||||
Assets["emoji.png.erb"].write_to(f.name)
|
||||
end
|
||||
|
||||
file "lib/emoji.js" do |f|
|
||||
Assets["emoji.js.erb"].write_to(f.name)
|
||||
end
|
||||
|
||||
file "lib/emoji.css" do |f|
|
||||
Assets["emoji.css.erb"].write_to(f.name)
|
||||
end
|
||||
|
||||
assets = [
|
||||
"lib/emoji.png",
|
||||
"lib/emoji.js",
|
||||
"lib/emoji.css"
|
||||
]
|
||||
|
||||
assets.each { |asset| CLOBBER.include(asset) }
|
||||
|
||||
task :default => [:clobber] + assets
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "emoji"
|
||||
s.version = "0.3.1"
|
||||
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 = `git ls-files`.split("\n")
|
||||
|
||||
s.add_development_dependency "sprockets", "~> 2.0"
|
||||
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.0"
|
||||
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
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user