Skip to content

Commit

Permalink
Add task to download Unicode 6.3 names list
Browse files Browse the repository at this point in the history
This list contains textual descriptions for emoji characters.
  • Loading branch information
mislav committed Jun 27, 2014
1 parent 07e15fd commit 0845c38
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,2 @@
.ruby-version
db/NamesList.txt
7 changes: 6 additions & 1 deletion Rakefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ end


namespace :db do namespace :db do
desc %(Generate Emoji data files needed for development) desc %(Generate Emoji data files needed for development)
task :generate => ['db/Category-Emoji.json'] task :generate => ['db/Category-Emoji.json', 'db/NamesList.txt']
end end


emoji_plist = '/System/Library/Input Methods/CharacterPalette.app/Contents/Resources/Category-Emoji.plist' emoji_plist = '/System/Library/Input Methods/CharacterPalette.app/Contents/Resources/Category-Emoji.plist'
nameslist_url = 'http://www.unicode.org/Public/6.3.0/ucd/NamesList.txt'


task 'db/Category-Emoji.json' do |t| task 'db/Category-Emoji.json' do |t|
system "plutil -convert json -r '#{emoji_plist}' -o '#{t.name}'" system "plutil -convert json -r '#{emoji_plist}' -o '#{t.name}'"
end end

file 'db/NamesList.txt' do |t|
system "curl -fsSL '#{nameslist_url}' -o '#{t.name}'"
end

0 comments on commit 0845c38

Please sign in to comment.