emojidex 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4893c39e085f721f6888fb84899b4749ef435134
4
- data.tar.gz: 10bf72c13623c7acf1c1c98fc68da7c133559a31
3
+ metadata.gz: 276dff0ca7ffb746ffc6c75d0138d6f6f63b2516
4
+ data.tar.gz: 62c8c3b0386fb62407bc2b847003ed0d542ce61c
5
5
  SHA512:
6
- metadata.gz: a11b74ed96b360150373b2a37934eaeebed32452c02dbc57b045498a8c41c37efdbd0299eb91b5076ff88e221143f6cb57602e2a3b3d7400844b68f0e76628d2
7
- data.tar.gz: 7033d1b7719e8b99360eef165fde88f04e7ff6c60646d12f27f513bec93471b4609453ff00897847b601dfac3b2b43cc6f4c47b783a681c49731429553f022dd
6
+ metadata.gz: 56ec17e506c7e7c3d418e25cad759610d973e403db41465ddc86c153678dd3cda6e72b7e5f87c303caced3f91123a5768a816ab14bfb68b335510975896029f6
7
+ data.tar.gz: 0a7d1020b60277df33755bd83b09a76fbbf7603823ab00910c315cafdb66b7b00f9e88529904638f665eff191f2ed184c8e1b755944efc6f07a828fc41008eba
data/emojidex.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'emojidex'
3
- s.version = '0.0.9'
3
+ s.version = '0.0.10'
4
4
  s.license = 'GPL-3, AGPL-3'
5
5
  s.summary = 'emojidex Ruby tools'
6
6
  s.description = 'emojidex emoji handling, search and lookup, listing and caching functionality and user info (favorites/etc).'
@@ -8,7 +8,7 @@ Gem::Specification.new do |s|
8
8
  s.email = 'info@emojidex.com'
9
9
  s.files = `git ls-files`.split("\n")
10
10
  s.require_paths = ['lib']
11
- s.homepage = 'http://dev.emojidex.com'
11
+ s.homepage = 'http://developer.emojidex.com'
12
12
 
13
13
  s.add_dependency 'faraday', '0.8.9'
14
14
  s.add_dependency 'faraday_middleware', '0.9.0'
@@ -33,7 +33,17 @@ module Emojidex
33
33
  _svg_check_copy(moji) if formats.include? :svg
34
34
  _raster_check_copy(moji, :png, sizes) if formats.include? :png
35
35
  end
36
- _update_index
36
+ cache_index
37
+ end
38
+
39
+ def cache_index(destination = nil)
40
+ destination = destination || @cache_dir
41
+ idx = Emojidex::Collection.new
42
+ idx.load_local_collection(destination) if FileTest.exist? "#{destination}/emoji.json"
43
+ idx.add_emoji @emoji.values
44
+ File.open("#{destination}/emoji.json", 'w') do |f|
45
+ f.write idx.emoji.values.to_json
46
+ end
37
47
  end
38
48
 
39
49
  private
@@ -56,14 +66,5 @@ module Emojidex
56
66
  FileUtils.cp_r src, @cache_dir if File.directory? src
57
67
  end
58
68
  end
59
-
60
- def _update_index
61
- idx = Emojidex::Collection.new
62
- idx.load_local_collection(@cache_dir) if FileTest.exist? "#{@cache_dir}/emoji.json"
63
- idx.add_emoji @emoji.values
64
- File.open("#{@cache_dir}/emoji.json", 'w') do |f|
65
- f.write idx.emoji.values.to_json
66
- end
67
- end
68
69
  end
69
70
  end
data/spec/utf_spec.rb CHANGED
@@ -63,4 +63,15 @@ describe Emojidex::UTF do
63
63
  FileUtils.rm_rf tmp_cache_path # cleanup
64
64
  end
65
65
  end
66
+
67
+ describe 'cache_index' do
68
+ it 'caches the collection index to the specified location' do
69
+ tmp_cache_path = File.expand_path('../support/tmpcache', __FILE__)
70
+ FileUtils.mkdir_p(tmp_cache_path)
71
+ utf.cache_index tmp_cache_path
72
+ expect(File.exist? tmp_cache_path + '/emoji.json').to be_truthy
73
+
74
+ FileUtils.rm_rf tmp_cache_path
75
+ end
76
+ end
66
77
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emojidex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei Kagetsuki
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2014-07-14 00:00:00.000000000 Z
14
+ date: 2014-07-16 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday
@@ -110,7 +110,7 @@ files:
110
110
  - spec/support/test2/animation.json
111
111
  - spec/support/test3/animation.json
112
112
  - spec/utf_spec.rb
113
- homepage: http://dev.emojidex.com
113
+ homepage: http://developer.emojidex.com
114
114
  licenses:
115
115
  - GPL-3, AGPL-3
116
116
  metadata: {}