emojidex-converter 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/emojidex-converter.gemspec +6 -5
- data/lib/emojidex/converter.rb +2 -1
- metadata +13 -107
- data/.gitignore +0 -23
- data/.rspec +0 -2
- data/.rubocop.yml +0 -11
- data/.travis.yml +0 -22
- data/Gemfile +0 -21
- data/Guardfile +0 -21
- data/README.md +0 -60
- data/Rakefile +0 -8
- data/spec/converter_spec.rb +0 -70
- data/spec/spec_helper.rb +0 -14
- data/spec/support/collection/aubergine.svg +0 -160
- data/spec/support/collection/car.svg +0 -78
- data/spec/support/collection/emoji.json +0 -72
- data/spec/support/collection/family.svg +0 -1028
- data/spec/support/collection/family/0/man(bk).svg +0 -246
- data/spec/support/collection/family/0/man(br).svg +0 -246
- data/spec/support/collection/family/0/man(p).svg +0 -246
- data/spec/support/collection/family/0/man(wh).svg +0 -246
- data/spec/support/collection/family/0/man(ye).svg +0 -246
- data/spec/support/collection/family/0/man.svg +0 -246
- data/spec/support/collection/family/0/woman(bk).svg +0 -237
- data/spec/support/collection/family/0/woman(br).svg +0 -237
- data/spec/support/collection/family/0/woman(p).svg +0 -237
- data/spec/support/collection/family/0/woman(wh).svg +0 -237
- data/spec/support/collection/family/0/woman(ye).svg +0 -237
- data/spec/support/collection/family/0/woman.svg +0 -237
- data/spec/support/collection/family/1/man(bk).svg +0 -169
- data/spec/support/collection/family/1/man(br).svg +0 -169
- data/spec/support/collection/family/1/man(p).svg +0 -169
- data/spec/support/collection/family/1/man(wh).svg +0 -169
- data/spec/support/collection/family/1/man(ye).svg +0 -169
- data/spec/support/collection/family/1/man.svg +0 -169
- data/spec/support/collection/family/1/woman(bk).svg +0 -239
- data/spec/support/collection/family/1/woman(br).svg +0 -239
- data/spec/support/collection/family/1/woman(p).svg +0 -239
- data/spec/support/collection/family/1/woman(wh).svg +0 -239
- data/spec/support/collection/family/1/woman(ye).svg +0 -239
- data/spec/support/collection/family/1/woman.svg +0 -239
- data/spec/support/collection/family/2/boy(bk).svg +0 -198
- data/spec/support/collection/family/2/boy(br).svg +0 -198
- data/spec/support/collection/family/2/boy(p).svg +0 -198
- data/spec/support/collection/family/2/boy(wh).svg +0 -198
- data/spec/support/collection/family/2/boy(ye).svg +0 -198
- data/spec/support/collection/family/2/boy.svg +0 -198
- data/spec/support/collection/family/2/girl(bk).svg +0 -191
- data/spec/support/collection/family/2/girl(br).svg +0 -191
- data/spec/support/collection/family/2/girl(p).svg +0 -191
- data/spec/support/collection/family/2/girl(wh).svg +0 -191
- data/spec/support/collection/family/2/girl(ye).svg +0 -191
- data/spec/support/collection/family/2/girl.svg +0 -191
- data/spec/support/collection/family/3/boy(bk).svg +0 -176
- data/spec/support/collection/family/3/boy(br).svg +0 -176
- data/spec/support/collection/family/3/boy(p).svg +0 -176
- data/spec/support/collection/family/3/boy(wh).svg +0 -176
- data/spec/support/collection/family/3/boy(ye).svg +0 -176
- data/spec/support/collection/family/3/boy.svg +0 -176
- data/spec/support/collection/family/3/girl(bk).svg +0 -187
- data/spec/support/collection/family/3/girl(br).svg +0 -187
- data/spec/support/collection/family/3/girl(p).svg +0 -187
- data/spec/support/collection/family/3/girl(wh).svg +0 -187
- data/spec/support/collection/family/3/girl(ye).svg +0 -187
- data/spec/support/collection/family/3/girl.svg +0 -187
- data/spec/support/collection/family/4/baby(bk).svg +0 -184
- data/spec/support/collection/family/4/baby(br).svg +0 -184
- data/spec/support/collection/family/4/baby(p).svg +0 -184
- data/spec/support/collection/family/4/baby(wh).svg +0 -184
- data/spec/support/collection/family/4/baby(ye).svg +0 -184
- data/spec/support/collection/family/4/baby.svg +0 -184
- data/spec/support/collection/heartbeat/0.svg +0 -121
- data/spec/support/collection/heartbeat/1.svg +0 -126
- data/spec/support/collection/heartbeat/2.svg +0 -128
- data/spec/support/collection/heartbeat/3.svg +0 -128
- data/spec/support/collection/heartbeat/4.svg +0 -121
- data/spec/support/collection/heartbeat/5.svg +0 -128
- data/spec/support/collection/heartbeat/6.svg +0 -126
- data/spec/support/collection/heartbeat/7.svg +0 -126
- data/spec/support/collection/heartbeat/animation.json +0 -17
- data/spec/support/collection/heartbeat/heartbeat.svg +0 -29
- data/spec/support/collection/kiss.svg +0 -2375
- data/spec/support/collection/kiss/0.svg +0 -177
- data/spec/support/collection/kiss/1.svg +0 -177
- data/spec/support/collection/kiss/10.svg +0 -293
- data/spec/support/collection/kiss/11.svg +0 -235
- data/spec/support/collection/kiss/12.svg +0 -235
- data/spec/support/collection/kiss/13.svg +0 -235
- data/spec/support/collection/kiss/14.svg +0 -177
- data/spec/support/collection/kiss/15.svg +0 -177
- data/spec/support/collection/kiss/2.svg +0 -177
- data/spec/support/collection/kiss/3.svg +0 -235
- data/spec/support/collection/kiss/4.svg +0 -235
- data/spec/support/collection/kiss/5.svg +0 -235
- data/spec/support/collection/kiss/6.svg +0 -293
- data/spec/support/collection/kiss/7.svg +0 -235
- data/spec/support/collection/kiss/8.svg +0 -235
- data/spec/support/collection/kiss/9.svg +0 -235
- data/spec/support/collection/kiss/animation.json +0 -25
- data/spec/support/collection/kiss/animation.json~ +0 -25
- data/spec/support/collection/woman.svg +0 -83
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5cd2c03d99c8b2235189043092449c21b4b4dff
|
4
|
+
data.tar.gz: 865f7aa27189251852a78413db26baf296d12d00
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30fbcec13207ceade07e5660f140d1cd037f93e71fbd707e12ae90e975e1312432550788d74e632aa2559699845fdc215092ccad0540954b063167013c6e04a9
|
7
|
+
data.tar.gz: ff0fdf6cc68e1fb237440de05bc40e87611939a298e5cf9ff11a8007f43c391911b7c3da2e99b005e9b8e94dd177b4dfbca6d697cfe9ea2c630871e391465eaa
|
data/emojidex-converter.gemspec
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'emojidex-converter'
|
3
|
-
s.version = '0.
|
3
|
+
s.version = '0.4.0'
|
4
4
|
s.license = 'emojiOL'
|
5
5
|
s.summary = 'Image conversion modules for emojidex'
|
6
6
|
s.description = 'Adds the convert method to Emojidex::Collection and Emojidex::Emoji, which\
|
7
7
|
allows you to convert an emoji collection or a single emoji to the specified\
|
8
8
|
image format.'
|
9
9
|
s.authors = ['Rei Kagetsuki', 'Rika Yoshida']
|
10
|
-
s.email =
|
11
|
-
s.files =
|
12
|
-
|
10
|
+
s.email = 'info@emojidex.com'
|
11
|
+
s.files = Dir.glob('lib/**/*.rb') +
|
12
|
+
['emojidex-converter.gemspec']
|
13
|
+
s.homepage = 'https://github.com/emojidex/emojidex-converter'
|
13
14
|
|
14
15
|
s.add_dependency 'rsvg2'
|
15
16
|
s.add_dependency 'rmagick'
|
@@ -17,6 +18,6 @@ Gem::Specification.new do |s|
|
|
17
18
|
s.add_dependency 'rapngasm'
|
18
19
|
s.add_dependency 'nokogiri'
|
19
20
|
s.add_dependency 'cairo'
|
20
|
-
s.add_dependency 'emojidex', '~> 0.
|
21
|
+
s.add_dependency 'emojidex', '~> 0.5', '~> 0.5.0'
|
21
22
|
s.add_dependency 'phantom_svg'
|
22
23
|
end
|
data/lib/emojidex/converter.rb
CHANGED
@@ -15,6 +15,7 @@ module Emojidex
|
|
15
15
|
@destination = File.expand_path(override[:destination] || ENV['EMOJI_CACHE'] || './')
|
16
16
|
@noisy = override[:noisy] || false
|
17
17
|
@max_threads = override[:max_threads] || @sizes.length
|
18
|
+
@skip_components = override[:skip_components] || false
|
18
19
|
puts "Converting to #{@sizes.length} sizes with #{@max_threads}, outputting to #{@destination}." if @noisy
|
19
20
|
end
|
20
21
|
|
@@ -73,7 +74,7 @@ module Emojidex
|
|
73
74
|
end
|
74
75
|
|
75
76
|
def process_components(moji, size_code, size, out_dir)
|
76
|
-
moji.
|
77
|
+
moji.customizations.each do |combo|
|
77
78
|
for i in 0..(combo.components.length - 1)
|
78
79
|
combo.components[i].each do |component|
|
79
80
|
Dir.mkdir("#{out_dir}/#{combo.base}") unless Dir.exist? "#{out_dir}/#{combo.base}"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emojidex-converter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rei Kagetsuki
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-04-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rsvg2
|
@@ -101,14 +101,20 @@ dependencies:
|
|
101
101
|
requirements:
|
102
102
|
- - "~>"
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 0.
|
104
|
+
version: '0.5'
|
105
|
+
- - "~>"
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: 0.5.0
|
105
108
|
type: :runtime
|
106
109
|
prerelease: false
|
107
110
|
version_requirements: !ruby/object:Gem::Requirement
|
108
111
|
requirements:
|
109
112
|
- - "~>"
|
110
113
|
- !ruby/object:Gem::Version
|
111
|
-
version: 0.
|
114
|
+
version: '0.5'
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 0.5.0
|
112
118
|
- !ruby/object:Gem::Dependency
|
113
119
|
name: phantom_svg
|
114
120
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,116 +133,16 @@ description: |-
|
|
127
133
|
Adds the convert method to Emojidex::Collection and Emojidex::Emoji, which\
|
128
134
|
allows you to convert an emoji collection or a single emoji to the specified\
|
129
135
|
image format.
|
130
|
-
email:
|
131
|
-
- zero@genshin.org
|
132
|
-
- nazuki@genshin.org
|
136
|
+
email: info@emojidex.com
|
133
137
|
executables: []
|
134
138
|
extensions: []
|
135
139
|
extra_rdoc_files: []
|
136
140
|
files:
|
137
|
-
- ".gitignore"
|
138
|
-
- ".rspec"
|
139
|
-
- ".rubocop.yml"
|
140
|
-
- ".travis.yml"
|
141
|
-
- Gemfile
|
142
|
-
- Guardfile
|
143
|
-
- README.md
|
144
|
-
- Rakefile
|
145
141
|
- emojidex-converter.gemspec
|
146
142
|
- lib/emojidex/converter.rb
|
147
143
|
- lib/emojidex/preprocessor.rb
|
148
144
|
- lib/emojidex_converter.rb
|
149
|
-
|
150
|
-
- spec/spec_helper.rb
|
151
|
-
- spec/support/collection/aubergine.svg
|
152
|
-
- spec/support/collection/car.svg
|
153
|
-
- spec/support/collection/emoji.json
|
154
|
-
- spec/support/collection/family.svg
|
155
|
-
- spec/support/collection/family/0/man(bk).svg
|
156
|
-
- spec/support/collection/family/0/man(br).svg
|
157
|
-
- spec/support/collection/family/0/man(p).svg
|
158
|
-
- spec/support/collection/family/0/man(wh).svg
|
159
|
-
- spec/support/collection/family/0/man(ye).svg
|
160
|
-
- spec/support/collection/family/0/man.svg
|
161
|
-
- spec/support/collection/family/0/woman(bk).svg
|
162
|
-
- spec/support/collection/family/0/woman(br).svg
|
163
|
-
- spec/support/collection/family/0/woman(p).svg
|
164
|
-
- spec/support/collection/family/0/woman(wh).svg
|
165
|
-
- spec/support/collection/family/0/woman(ye).svg
|
166
|
-
- spec/support/collection/family/0/woman.svg
|
167
|
-
- spec/support/collection/family/1/man(bk).svg
|
168
|
-
- spec/support/collection/family/1/man(br).svg
|
169
|
-
- spec/support/collection/family/1/man(p).svg
|
170
|
-
- spec/support/collection/family/1/man(wh).svg
|
171
|
-
- spec/support/collection/family/1/man(ye).svg
|
172
|
-
- spec/support/collection/family/1/man.svg
|
173
|
-
- spec/support/collection/family/1/woman(bk).svg
|
174
|
-
- spec/support/collection/family/1/woman(br).svg
|
175
|
-
- spec/support/collection/family/1/woman(p).svg
|
176
|
-
- spec/support/collection/family/1/woman(wh).svg
|
177
|
-
- spec/support/collection/family/1/woman(ye).svg
|
178
|
-
- spec/support/collection/family/1/woman.svg
|
179
|
-
- spec/support/collection/family/2/boy(bk).svg
|
180
|
-
- spec/support/collection/family/2/boy(br).svg
|
181
|
-
- spec/support/collection/family/2/boy(p).svg
|
182
|
-
- spec/support/collection/family/2/boy(wh).svg
|
183
|
-
- spec/support/collection/family/2/boy(ye).svg
|
184
|
-
- spec/support/collection/family/2/boy.svg
|
185
|
-
- spec/support/collection/family/2/girl(bk).svg
|
186
|
-
- spec/support/collection/family/2/girl(br).svg
|
187
|
-
- spec/support/collection/family/2/girl(p).svg
|
188
|
-
- spec/support/collection/family/2/girl(wh).svg
|
189
|
-
- spec/support/collection/family/2/girl(ye).svg
|
190
|
-
- spec/support/collection/family/2/girl.svg
|
191
|
-
- spec/support/collection/family/3/boy(bk).svg
|
192
|
-
- spec/support/collection/family/3/boy(br).svg
|
193
|
-
- spec/support/collection/family/3/boy(p).svg
|
194
|
-
- spec/support/collection/family/3/boy(wh).svg
|
195
|
-
- spec/support/collection/family/3/boy(ye).svg
|
196
|
-
- spec/support/collection/family/3/boy.svg
|
197
|
-
- spec/support/collection/family/3/girl(bk).svg
|
198
|
-
- spec/support/collection/family/3/girl(br).svg
|
199
|
-
- spec/support/collection/family/3/girl(p).svg
|
200
|
-
- spec/support/collection/family/3/girl(wh).svg
|
201
|
-
- spec/support/collection/family/3/girl(ye).svg
|
202
|
-
- spec/support/collection/family/3/girl.svg
|
203
|
-
- spec/support/collection/family/4/baby(bk).svg
|
204
|
-
- spec/support/collection/family/4/baby(br).svg
|
205
|
-
- spec/support/collection/family/4/baby(p).svg
|
206
|
-
- spec/support/collection/family/4/baby(wh).svg
|
207
|
-
- spec/support/collection/family/4/baby(ye).svg
|
208
|
-
- spec/support/collection/family/4/baby.svg
|
209
|
-
- spec/support/collection/heartbeat/0.svg
|
210
|
-
- spec/support/collection/heartbeat/1.svg
|
211
|
-
- spec/support/collection/heartbeat/2.svg
|
212
|
-
- spec/support/collection/heartbeat/3.svg
|
213
|
-
- spec/support/collection/heartbeat/4.svg
|
214
|
-
- spec/support/collection/heartbeat/5.svg
|
215
|
-
- spec/support/collection/heartbeat/6.svg
|
216
|
-
- spec/support/collection/heartbeat/7.svg
|
217
|
-
- spec/support/collection/heartbeat/animation.json
|
218
|
-
- spec/support/collection/heartbeat/heartbeat.svg
|
219
|
-
- spec/support/collection/kiss.svg
|
220
|
-
- spec/support/collection/kiss/0.svg
|
221
|
-
- spec/support/collection/kiss/1.svg
|
222
|
-
- spec/support/collection/kiss/10.svg
|
223
|
-
- spec/support/collection/kiss/11.svg
|
224
|
-
- spec/support/collection/kiss/12.svg
|
225
|
-
- spec/support/collection/kiss/13.svg
|
226
|
-
- spec/support/collection/kiss/14.svg
|
227
|
-
- spec/support/collection/kiss/15.svg
|
228
|
-
- spec/support/collection/kiss/2.svg
|
229
|
-
- spec/support/collection/kiss/3.svg
|
230
|
-
- spec/support/collection/kiss/4.svg
|
231
|
-
- spec/support/collection/kiss/5.svg
|
232
|
-
- spec/support/collection/kiss/6.svg
|
233
|
-
- spec/support/collection/kiss/7.svg
|
234
|
-
- spec/support/collection/kiss/8.svg
|
235
|
-
- spec/support/collection/kiss/9.svg
|
236
|
-
- spec/support/collection/kiss/animation.json
|
237
|
-
- spec/support/collection/kiss/animation.json~
|
238
|
-
- spec/support/collection/woman.svg
|
239
|
-
homepage: http://dev.emojidex.com
|
145
|
+
homepage: https://github.com/emojidex/emojidex-converter
|
240
146
|
licenses:
|
241
147
|
- emojiOL
|
242
148
|
metadata: {}
|
@@ -256,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
162
|
version: '0'
|
257
163
|
requirements: []
|
258
164
|
rubyforge_project:
|
259
|
-
rubygems_version: 2.
|
165
|
+
rubygems_version: 2.6.11
|
260
166
|
signing_key:
|
261
167
|
specification_version: 4
|
262
168
|
summary: Image conversion modules for emojidex
|
data/.gitignore
DELETED
@@ -1,23 +0,0 @@
|
|
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
|
-
|
19
|
-
*.swp
|
20
|
-
*.swo
|
21
|
-
spec/out/
|
22
|
-
tmp/
|
23
|
-
.DS_Store
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
source 'http://rubygems.org'
|
2
|
-
|
3
|
-
gemspec
|
4
|
-
|
5
|
-
group :development do
|
6
|
-
gem 'rb-inotify', require: false
|
7
|
-
gem 'rb-fsevent', require: false
|
8
|
-
gem 'guard'
|
9
|
-
gem 'guard-rspec'
|
10
|
-
gem 'rubocop'
|
11
|
-
gem 'guard-rubocop'
|
12
|
-
|
13
|
-
# gem 'emojidex', path: '../emojidex'
|
14
|
-
gem 'emojidex', '~> 0.4.2'
|
15
|
-
#gem 'emojidex-vectors', path: '../emojidex-vectors', require: false
|
16
|
-
gem 'emojidex-vectors', require: false
|
17
|
-
end
|
18
|
-
|
19
|
-
group :test do
|
20
|
-
gem 'rspec'
|
21
|
-
end
|
data/Guardfile
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
group :red_green_refactor, halt_on_fail: true do
|
2
|
-
guard :rspec, cmd: "bundle exec rspec" do
|
3
|
-
require "guard/rspec/dsl"
|
4
|
-
dsl = Guard::RSpec::Dsl.new(self)
|
5
|
-
|
6
|
-
# RSpec files
|
7
|
-
rspec = dsl.rspec
|
8
|
-
watch(rspec.spec_helper) { rspec.spec_dir }
|
9
|
-
watch(rspec.spec_support) { rspec.spec_dir }
|
10
|
-
watch(rspec.spec_files)
|
11
|
-
|
12
|
-
# Ruby files
|
13
|
-
ruby = dsl.ruby
|
14
|
-
dsl.watch_spec_files_for(ruby.lib_files)
|
15
|
-
end
|
16
|
-
|
17
|
-
guard :rubocop, all_on_start: false do
|
18
|
-
watch(%r{.+\.rb$})
|
19
|
-
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
20
|
-
end
|
21
|
-
end
|
data/README.md
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
[![Build Status](https://travis-ci.org/Genshin/emojidex-converter.svg)](https://travis-ci.org/Genshin/emojidex-converter)
|
2
|
-
Emojidex Converter
|
3
|
-
==================
|
4
|
-
A set of tools for converting emoji arrays to and from vectors [SVG] and rasters [PNG].
|
5
|
-
|
6
|
-
This tool is primarily for internal use. You can find converted assets here:
|
7
|
-
* Vectors: [emojidex-vectors](https://github.com/emojidex/emojidex-vectors)
|
8
|
-
* Rasters: [emojidex-rasters](https://github.com/emojidex/emojidex-rasters)
|
9
|
-
|
10
|
-
or on-line from the asset repository or CDN, [see documentation here](http://developer.emojidex.com/#assets)
|
11
|
-
|
12
|
-
Requirements
|
13
|
-
------------
|
14
|
-
Uses Phantom SVG, which in turn uses rapngasm.
|
15
|
-
rapngasm requires libapngasm to build, see instructions [here](https://github.com/apngasm/rapngasm).
|
16
|
-
|
17
|
-
Usage
|
18
|
-
-----
|
19
|
-
**Instantiation:**
|
20
|
-
The default destination will be your local emojidex cache (set with environment variable $EMOJI_CACHE, defaults to $HOME/.emojidex/cache) or the current directory if $EMOJI_CACHE is not set.
|
21
|
-
- You can specify the destination manually with an options hash key of :destination.
|
22
|
-
- You can sepcify your own sizes using a :sizes hash. The keys to the hash become the directory names.
|
23
|
-
|
24
|
-
```ruby
|
25
|
-
converter = Emojidex::Converter.new(destination: "/output/destination/file/path", sizes: {super_huge: 2000, px12: 12})
|
26
|
-
|
27
|
-
# Sizes and output destination can be changed after initialization:
|
28
|
-
converter.destination = '/new/destination'
|
29
|
-
converter.sizes = {superTiny: 3, '720p': 720}
|
30
|
-
```
|
31
|
-
|
32
|
-
**Pre-process SVG frames into animated SVGs:**
|
33
|
-
Used to compile folders with SVG frames and animation.json files into single key-framed SVG files. The pre-processor should be run on every collection directory with sub-directories containing SVG animation sources before rasterization.
|
34
|
-
```ruby
|
35
|
-
converter.preprocess('/path/to/collection')
|
36
|
-
```
|
37
|
-
|
38
|
-
**Convert an array of emoji with vector sources to rasters:**
|
39
|
-
The emoji array is an array of Emojidex::Emoji objects.
|
40
|
-
```ruby
|
41
|
-
converter.rasterize(emoji_array, '/directory/with/SVG/sources')
|
42
|
-
```
|
43
|
-
|
44
|
-
**Convert an Emojidex::Collection:**
|
45
|
-
Emojidex::Collection objects contain references to their source directories so you only need to pass the collection object.
|
46
|
-
```ruby
|
47
|
-
converer.convert_collection(collection)
|
48
|
-
```
|
49
|
-
|
50
|
-
Contributing
|
51
|
-
------------
|
52
|
-
Fork, edit, commit, push, pull request!
|
53
|
-
emojidex-converter is a very primitivate, fairly single-purpose tool. If you can think of any features that could extend its functionality we'd love to see it!
|
54
|
-
|
55
|
-
License
|
56
|
-
=======
|
57
|
-
emojidex and emojidex tools are licensed under the
|
58
|
-
[emojidex Open License](https://www.emojidex.com/emojidex/emojidex_open_license).
|
59
|
-
|
60
|
-
©2013 the emojidex project / Genshin Souzou K.K. [Phantom Creation Inc.]
|
data/Rakefile
DELETED
data/spec/converter_spec.rb
DELETED
@@ -1,70 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Emojidex::Converter do
|
4
|
-
let(:converter) do
|
5
|
-
@destination = File.expand_path('../support/tmp/out', __FILE__)
|
6
|
-
FileUtils.remove_entry_secure(@destination, true)
|
7
|
-
Emojidex::Converter.new(destination: @destination)
|
8
|
-
end
|
9
|
-
|
10
|
-
describe '.new' do
|
11
|
-
it 'successfully creates a new Converter object' do
|
12
|
-
expect(converter).to be_an_instance_of(Emojidex::Converter)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
describe '.sizes' do
|
17
|
-
it 'is a hash of size codes and sizes in px' do
|
18
|
-
expect(converter.sizes).to be_an_instance_of(Hash)
|
19
|
-
expect(converter.sizes.size).to eq(Emojidex::Defaults.sizes.size)
|
20
|
-
end
|
21
|
-
|
22
|
-
it 'overrides sizes when passed in initialization' do
|
23
|
-
conv = Emojidex::Converter.new(sizes: { px200: 200, px1024: 1024, way_too_big: 20_000_000 })
|
24
|
-
expect(conv.sizes).to eq(px200: 200, px1024: 1024, way_too_big: 20_000_000)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe '.preprocess' do
|
29
|
-
it 'preprocesses folders with SVG frame and animation.json files into frame-animated SVGs' do
|
30
|
-
setup_working_collection
|
31
|
-
converter.preprocess("#{@collection_out_path}")
|
32
|
-
expect(File.exist?("#{@collection_out_path}/heartbeat.svg")).to be true
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
describe '.rasterize' do
|
37
|
-
it 'converts base SVG from the source directory to PNG in the destination directory' do
|
38
|
-
setup_working_collection
|
39
|
-
converter.preprocess("#{@collection_out_path}")
|
40
|
-
converter.rasterize([Emojidex::Data::Emoji.new(code: 'kiss')],
|
41
|
-
"#{@collection_out_path}")
|
42
|
-
|
43
|
-
expect(File.exist?("#{@destination}/ldpi/kiss.png")).to be true
|
44
|
-
expect(File.exist?("#{@destination}/mdpi/kiss.png")).to be true
|
45
|
-
expect(File.exist?("#{@destination}/hdpi/kiss.png")).to be true
|
46
|
-
expect(File.exist?("#{@destination}/xhdpi/kiss.png")).to be true
|
47
|
-
expect(File.exist?("#{@destination}/px8/kiss.png")).to be true
|
48
|
-
expect(File.exist?("#{@destination}/px16/kiss.png")).to be true
|
49
|
-
expect(File.exist?("#{@destination}/px32/kiss.png")).to be true
|
50
|
-
expect(File.exist?("#{@destination}/px64/kiss.png")).to be true
|
51
|
-
expect(File.exist?("#{@destination}/px128/kiss.png")).to be true
|
52
|
-
expect(File.exist?("#{@destination}/px256/kiss.png")).to be true
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
describe '.rasterize_collection' do
|
57
|
-
it 'converts an emojidex collection' do
|
58
|
-
setup_working_collection
|
59
|
-
converter.preprocess(@collection_out_path)
|
60
|
-
collection = Emojidex::Data::Collection.new(local_load_path: @collection_out_path)
|
61
|
-
processed_collection = converter.rasterize_collection(collection)
|
62
|
-
|
63
|
-
expect(File.exist?("#{@destination}/ldpi/kiss.png")).to be_truthy
|
64
|
-
expect(File.exist?("#{@destination}/emoji.json")).to be_truthy
|
65
|
-
|
66
|
-
processed_collection.generate_checksums
|
67
|
-
expect(processed_collection.emoji.values.first.checksums[:png][:ldpi]).to be_truthy
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|