emojidex 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/emojidex.gemspec +7 -6
  3. data/lib/emojidex.rb +9 -1
  4. data/lib/emojidex/client.rb +53 -0
  5. data/lib/emojidex/data/categories.rb +42 -42
  6. data/lib/emojidex/data/category.rb +10 -10
  7. data/lib/emojidex/data/collection.rb +39 -21
  8. data/lib/emojidex/data/collection/asset_information.rb +19 -3
  9. data/lib/emojidex/data/collection/cache.rb +28 -33
  10. data/lib/emojidex/data/collection/moji_data.rb +13 -11
  11. data/lib/emojidex/data/collection/static_collection.rb +3 -3
  12. data/lib/emojidex/data/emoji.rb +54 -37
  13. data/lib/emojidex/data/emoji/asset_information.rb +86 -3
  14. data/lib/emojidex/data/extended.rb +2 -2
  15. data/lib/emojidex/data/utf.rb +2 -2
  16. data/lib/emojidex/defaults.rb +9 -1
  17. data/lib/emojidex/env_helper.rb +1 -2
  18. data/lib/emojidex/service/collection.rb +70 -31
  19. data/lib/emojidex/service/error.rb +1 -0
  20. data/lib/emojidex/service/indexes.rb +31 -10
  21. data/lib/emojidex/service/search.rb +5 -4
  22. data/lib/emojidex/service/transactor.rb +35 -19
  23. data/lib/emojidex/service/user.rb +80 -37
  24. data/lib/emojidex/service/user/history_item.rb +23 -0
  25. data/lib/emojidex/{data → util}/collection_checker.rb +2 -3
  26. metadata +10 -79
  27. data/.coveralls.yml +0 -1
  28. data/.gitignore +0 -12
  29. data/.rspec +0 -2
  30. data/.rubocop.yml +0 -18
  31. data/.travis.yml +0 -18
  32. data/Gemfile +0 -18
  33. data/Guardfile +0 -19
  34. data/README.md +0 -73
  35. data/spec/emojidex/data/categories_spec.rb +0 -19
  36. data/spec/emojidex/data/collection_checker_spec.rb +0 -72
  37. data/spec/emojidex/data/collection_spec.rb +0 -136
  38. data/spec/emojidex/data/emoji_spec.rb +0 -47
  39. data/spec/emojidex/data/extended_spec.rb +0 -118
  40. data/spec/emojidex/data/utf_spec.rb +0 -91
  41. data/spec/emojidex/service/collection_spec.rb +0 -20
  42. data/spec/emojidex/service/error_spec.rb +0 -17
  43. data/spec/emojidex/service/indexes_spec.rb +0 -62
  44. data/spec/emojidex/service/search_spec.rb +0 -87
  45. data/spec/emojidex/service/transactor_spec.rb +0 -11
  46. data/spec/emojidex/service/user_spec.rb +0 -128
  47. data/spec/spec_helper.rb +0 -18
  48. data/spec/support/Genshin.svg +0 -126
  49. data/spec/support/couple_kiss/0.svg +0 -177
  50. data/spec/support/couple_kiss/1.svg +0 -177
  51. data/spec/support/couple_kiss/10.svg +0 -293
  52. data/spec/support/couple_kiss/11.svg +0 -235
  53. data/spec/support/couple_kiss/12.svg +0 -235
  54. data/spec/support/couple_kiss/13.svg +0 -235
  55. data/spec/support/couple_kiss/14.svg +0 -177
  56. data/spec/support/couple_kiss/15.svg +0 -177
  57. data/spec/support/couple_kiss/2.svg +0 -177
  58. data/spec/support/couple_kiss/3.svg +0 -235
  59. data/spec/support/couple_kiss/4.svg +0 -235
  60. data/spec/support/couple_kiss/5.svg +0 -235
  61. data/spec/support/couple_kiss/6.svg +0 -293
  62. data/spec/support/couple_kiss/7.svg +0 -235
  63. data/spec/support/couple_kiss/8.svg +0 -235
  64. data/spec/support/couple_kiss/9.svg +0 -235
  65. data/spec/support/couple_kiss/animation.json +0 -14
  66. data/spec/support/fixtures/categories.json +0 -14
  67. data/spec/support/fixtures/category.json +0 -5
  68. data/spec/support/fixtures/emoji.json +0 -28
  69. data/spec/support/fixtures/emoji_detailed.json +0 -41
  70. data/spec/support/fixtures/search_emoji.json +0 -21
  71. data/spec/support/fixtures/single_emoji.json +0 -19
  72. data/spec/support/fixtures/single_emoji_detailed.json +0 -30
  73. data/spec/support/sample_collections/good/emoji.json +0 -30
  74. data/spec/support/sample_collections/good/mouth.svg +0 -49
  75. data/spec/support/sample_collections/good/nut_and_bolt.svg +0 -372
  76. data/spec/support/sample_collections/good/purple_heart.svg +0 -24
  77. data/spec/support/sample_collections/good/px32/mouth.png +0 -0
  78. data/spec/support/sample_collections/good/px32/nut_and_bolt.png +0 -0
  79. data/spec/support/sample_collections/good/px32/purple_heart.png +0 -0
  80. data/spec/support/sample_collections/good/px32/woman_with_bunny_ears.png +0 -0
  81. data/spec/support/sample_collections/good/woman_with_bunny_ears.svg +0 -90
  82. data/spec/support/sample_collections/missing_assets/emoji.json +0 -30
  83. data/spec/support/sample_collections/missing_assets/mouth.svg +0 -49
  84. data/spec/support/sample_collections/missing_assets/purple_heart.svg +0 -24
  85. data/spec/support/sample_collections/missing_assets/px32/mouth.png +0 -0
  86. data/spec/support/sample_collections/missing_assets/px32/nut_and_bolt.png +0 -0
  87. data/spec/support/sample_collections/missing_assets/px32/woman_with_bunny_ears.png +0 -0
  88. data/spec/support/sample_collections/missing_assets/woman_with_bunny_ears.svg +0 -90
  89. data/spec/support/sample_collections/missing_index/emoji.json +0 -23
  90. data/spec/support/sample_collections/missing_index/mouth.svg +0 -49
  91. data/spec/support/sample_collections/missing_index/nut_and_bolt.svg +0 -372
  92. data/spec/support/sample_collections/missing_index/purple_heart.svg +0 -24
  93. data/spec/support/sample_collections/missing_index/px32/mouth.png +0 -0
  94. data/spec/support/sample_collections/missing_index/px32/nut_and_bolt.png +0 -0
  95. data/spec/support/sample_collections/missing_index/px32/purple_heart.png +0 -0
  96. data/spec/support/sample_collections/missing_index/px32/woman_with_bunny_ears.png +0 -0
  97. data/spec/support/sample_collections/missing_index/woman_with_bunny_ears.svg +0 -90
@@ -0,0 +1,23 @@
1
+ require 'time'
2
+
3
+ module Emojidex
4
+ module Service
5
+ class HistoryItem
6
+ attr_accessor :emoji_code, :times_used, :last_used
7
+
8
+ def initialize(emoji_code, times_used, last_used)
9
+ @emoji_code = emoji_code
10
+ @times_used = times_used
11
+ @last_used = Time.parse last_used
12
+ end
13
+
14
+ def to_json(*a)
15
+ {
16
+ emoji_code: @emoji_code,
17
+ times_used: @times_used,
18
+ last_used: @last_used.iso8601
19
+ }.to_json(*a)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -2,7 +2,7 @@ require 'find'
2
2
  require_relative '../defaults.rb'
3
3
 
4
4
  module Emojidex
5
- module Data
5
+ module Util
6
6
  # Check collections for presence of image assets and discrepencies in emoji indexes.
7
7
  class CollectionChecker
8
8
  attr_reader :index_only, :asset_only
@@ -35,7 +35,7 @@ module Emojidex
35
35
 
36
36
  def create_file_list(dir, ext, prefix)
37
37
  result = {}
38
- return result unless Dir.exists?(dir)
38
+ return result unless Dir.exist?(dir)
39
39
  Dir.foreach(dir) do |file|
40
40
  result["#{prefix}#{File.basename(file, '.*')}".to_sym] =
41
41
  "#{prefix}#{file}" if File.extname(file) == ext
@@ -56,7 +56,6 @@ module Emojidex
56
56
 
57
57
  def create_svg_array(emoji, asset_files)
58
58
  result = []
59
- asset_file = asset_files[emoji.code.to_sym]
60
59
  result << "#{emoji.code}.svg" if asset_files[emoji.code.to_sym].nil?
61
60
  result
62
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emojidex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei Kagetsuki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-09 00:00:00.000000000 Z
11
+ date: 2016-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '0.9'
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: 0.9.1
22
+ version: 0.9.2
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '0.9'
30
30
  - - "~>"
31
31
  - !ruby/object:Gem::Version
32
- version: 0.9.1
32
+ version: 0.9.2
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: faraday_middleware
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '0.9'
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 0.9.1
42
+ version: 0.9.2
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: '0.9'
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: 0.9.1
52
+ version: 0.9.2
53
53
  description: emojidex emoji handling, search and lookup, listing and caching functionality
54
54
  and user info (favorites/etc).
55
55
  email: info@emojidex.com
@@ -57,17 +57,10 @@ executables: []
57
57
  extensions: []
58
58
  extra_rdoc_files: []
59
59
  files:
60
- - ".coveralls.yml"
61
- - ".gitignore"
62
- - ".rspec"
63
- - ".rubocop.yml"
64
- - ".travis.yml"
65
- - Gemfile
66
- - Guardfile
67
- - README.md
68
60
  - emoji/categories.json
69
61
  - emojidex.gemspec
70
62
  - lib/emojidex.rb
63
+ - lib/emojidex/client.rb
71
64
  - lib/emojidex/data/categories.rb
72
65
  - lib/emojidex/data/category.rb
73
66
  - lib/emojidex/data/collection.rb
@@ -75,7 +68,6 @@ files:
75
68
  - lib/emojidex/data/collection/cache.rb
76
69
  - lib/emojidex/data/collection/moji_data.rb
77
70
  - lib/emojidex/data/collection/static_collection.rb
78
- - lib/emojidex/data/collection_checker.rb
79
71
  - lib/emojidex/data/emoji.rb
80
72
  - lib/emojidex/data/emoji/asset_information.rb
81
73
  - lib/emojidex/data/extended.rb
@@ -88,69 +80,8 @@ files:
88
80
  - lib/emojidex/service/search.rb
89
81
  - lib/emojidex/service/transactor.rb
90
82
  - lib/emojidex/service/user.rb
91
- - spec/emojidex/data/categories_spec.rb
92
- - spec/emojidex/data/collection_checker_spec.rb
93
- - spec/emojidex/data/collection_spec.rb
94
- - spec/emojidex/data/emoji_spec.rb
95
- - spec/emojidex/data/extended_spec.rb
96
- - spec/emojidex/data/utf_spec.rb
97
- - spec/emojidex/service/collection_spec.rb
98
- - spec/emojidex/service/error_spec.rb
99
- - spec/emojidex/service/indexes_spec.rb
100
- - spec/emojidex/service/search_spec.rb
101
- - spec/emojidex/service/transactor_spec.rb
102
- - spec/emojidex/service/user_spec.rb
103
- - spec/spec_helper.rb
104
- - spec/support/Genshin.svg
105
- - spec/support/couple_kiss/0.svg
106
- - spec/support/couple_kiss/1.svg
107
- - spec/support/couple_kiss/10.svg
108
- - spec/support/couple_kiss/11.svg
109
- - spec/support/couple_kiss/12.svg
110
- - spec/support/couple_kiss/13.svg
111
- - spec/support/couple_kiss/14.svg
112
- - spec/support/couple_kiss/15.svg
113
- - spec/support/couple_kiss/2.svg
114
- - spec/support/couple_kiss/3.svg
115
- - spec/support/couple_kiss/4.svg
116
- - spec/support/couple_kiss/5.svg
117
- - spec/support/couple_kiss/6.svg
118
- - spec/support/couple_kiss/7.svg
119
- - spec/support/couple_kiss/8.svg
120
- - spec/support/couple_kiss/9.svg
121
- - spec/support/couple_kiss/animation.json
122
- - spec/support/fixtures/categories.json
123
- - spec/support/fixtures/category.json
124
- - spec/support/fixtures/emoji.json
125
- - spec/support/fixtures/emoji_detailed.json
126
- - spec/support/fixtures/search_emoji.json
127
- - spec/support/fixtures/single_emoji.json
128
- - spec/support/fixtures/single_emoji_detailed.json
129
- - spec/support/sample_collections/good/emoji.json
130
- - spec/support/sample_collections/good/mouth.svg
131
- - spec/support/sample_collections/good/nut_and_bolt.svg
132
- - spec/support/sample_collections/good/purple_heart.svg
133
- - spec/support/sample_collections/good/px32/mouth.png
134
- - spec/support/sample_collections/good/px32/nut_and_bolt.png
135
- - spec/support/sample_collections/good/px32/purple_heart.png
136
- - spec/support/sample_collections/good/px32/woman_with_bunny_ears.png
137
- - spec/support/sample_collections/good/woman_with_bunny_ears.svg
138
- - spec/support/sample_collections/missing_assets/emoji.json
139
- - spec/support/sample_collections/missing_assets/mouth.svg
140
- - spec/support/sample_collections/missing_assets/purple_heart.svg
141
- - spec/support/sample_collections/missing_assets/px32/mouth.png
142
- - spec/support/sample_collections/missing_assets/px32/nut_and_bolt.png
143
- - spec/support/sample_collections/missing_assets/px32/woman_with_bunny_ears.png
144
- - spec/support/sample_collections/missing_assets/woman_with_bunny_ears.svg
145
- - spec/support/sample_collections/missing_index/emoji.json
146
- - spec/support/sample_collections/missing_index/mouth.svg
147
- - spec/support/sample_collections/missing_index/nut_and_bolt.svg
148
- - spec/support/sample_collections/missing_index/purple_heart.svg
149
- - spec/support/sample_collections/missing_index/px32/mouth.png
150
- - spec/support/sample_collections/missing_index/px32/nut_and_bolt.png
151
- - spec/support/sample_collections/missing_index/px32/purple_heart.png
152
- - spec/support/sample_collections/missing_index/px32/woman_with_bunny_ears.png
153
- - spec/support/sample_collections/missing_index/woman_with_bunny_ears.svg
83
+ - lib/emojidex/service/user/history_item.rb
84
+ - lib/emojidex/util/collection_checker.rb
154
85
  homepage: http://developer.emojidex.com
155
86
  licenses:
156
87
  - emojiOL
@@ -171,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
102
  version: '0'
172
103
  requirements: []
173
104
  rubyforge_project:
174
- rubygems_version: 2.4.8
105
+ rubygems_version: 2.5.1
175
106
  signing_key:
176
107
  specification_version: 4
177
108
  summary: emojidex Ruby tools
@@ -1 +0,0 @@
1
- service_name: travis-ci
data/.gitignore DELETED
@@ -1,12 +0,0 @@
1
- *.swp
2
- *.swo
3
- *.orig
4
- Gemfile.lock
5
- *.gem
6
- spec/out/
7
- spec/support/tmpcache/
8
- tmp/
9
- .DS_Store
10
- .ruby-gemset
11
- .ruby-version
12
- coverage
data/.rspec DELETED
@@ -1,2 +0,0 @@
1
- --colour
2
- --format documentation
@@ -1,18 +0,0 @@
1
- AsciiIdentifiers:
2
- Enabled: false
3
-
4
- AsciiComments:
5
- Enabled: false
6
-
7
- AccessorMethodName:
8
- Enabled: false
9
-
10
- Style/DefWithParentheses:
11
- Enabled: false
12
-
13
- LineLength:
14
- Max: 99
15
-
16
- AllCops:
17
- Excludes:
18
- - 'Guardfile'
@@ -1,18 +0,0 @@
1
- language: ruby
2
-
3
- sudo: false
4
-
5
- rvm:
6
- - 2.0.0
7
- - 2.1
8
- - 2.2.3
9
- - ruby-head
10
- - rbx
11
- - jruby-head
12
-
13
- script:
14
- - bundle exec rspec
15
-
16
- addons:
17
- code_climate:
18
- repo_token: 1b416949c15b406b4606ead9dc3b29821f3700555aa869e359820a23b95c32a8
data/Gemfile DELETED
@@ -1,18 +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
- end
13
-
14
- group :test do
15
- gem 'rspec'
16
- gem 'emojidex-vectors', github: 'emojidex/emojidex-vectors'
17
- gem 'emojidex-rasters', github: 'emojidex/emojidex-rasters'
18
- end
data/Guardfile DELETED
@@ -1,19 +0,0 @@
1
- guard :rspec, cmd: "bundle exec rspec" do
2
- require "guard/rspec/dsl"
3
- dsl = Guard::RSpec::Dsl.new(self)
4
-
5
- # RSpec files
6
- rspec = dsl.rspec
7
- watch(rspec.spec_helper) { rspec.spec_dir }
8
- watch(rspec.spec_support) { rspec.spec_dir }
9
- watch(rspec.spec_files)
10
-
11
- # Ruby files
12
- ruby = dsl.ruby
13
- dsl.watch_spec_files_for(ruby.lib_files)
14
- end
15
-
16
- #guard :rubocop do
17
- # watch(%r{.+\.rb$})
18
- # watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
19
- #end
data/README.md DELETED
@@ -1,73 +0,0 @@
1
- [![Gem Version](https://badge.fury.io/rb/emojidex.png)](http://badge.fury.io/rb/emojidex)
2
- [![Build Status](https://travis-ci.org/emojidex/emojidex.png)](https://travis-ci.org/emojidex/emojidex)
3
- [![Code Climate](https://codeclimate.com/github/emojidex/emojidex.png)](https://codeclimate.com/github/emojidex/emojidex)
4
- [![Coverage Status](https://coveralls.io/repos/emojidex/emojidex/badge.svg?service=github)](https://coveralls.io/github/emojidex/emojidex)
5
- [![Inline docs](http://inch-ci.org/github/emojidex/emojidex.png?branch=master)](http://inch-ci.org/github/emojidex/emojidex)
6
- [![Gitter chat](https://badges.gitter.im/emojidex/emojidex.png)](https://gitter.im/emojidex/emojidex)
7
- emojidex
8
- ========
9
- emojidex core tools and scripts in Ruby. Provides a set of tools to utilize emojidex emoji right away in Ruby. Available as the "emojidex" gem.
10
-
11
- Usage
12
- =====
13
- The emojidex gem can be used either on-line or off-line. Offline components require you to bundle
14
- the assets you want to use by including either the emojidex-vectors gem for SVG assets or
15
- emojidex-rasters gem for PNG assets. Simply including "emojidex-vectors" or "emojidex-rasters" in
16
- your Gemfile or having the gem installed will enable this. Without one or both of these gems
17
- installed the off-line components will fall back to connecting to the emojidex service and, if
18
- they are unable to connect, will attempt to find the assets in the emojidex cache (usually found
19
- in $HOME/.emojidex).
20
-
21
- Off-line
22
- --------
23
- To use emojidex off-line you simply need to make an instance of one or more of the named
24
- collections in the 'emojidex/data' directory:
25
-
26
- For UTF (Unicode Standard) emoji:
27
- ```
28
- require 'emojidex/data/utf'
29
-
30
- emoji = Emojidex::Data::UTF.new
31
- ```
32
-
33
- For Extended (emojidex Original) emoji:
34
- ```
35
- require 'emojidex/data/extended'
36
-
37
- emoji = Emojidex::Data::Extended.new
38
- ```
39
-
40
- For all emoji in the cache (will include UTF and Extended if they have been cached):
41
- ```
42
- require 'emojidex/data/collection'
43
-
44
- emoji = Emojidex::Data::Collection.new
45
- ```
46
-
47
- For a combined set of UTF, Extended and Cached emoji:
48
- ```
49
- require 'emojidex/data/collection'
50
- require 'emojidex/data/utf'
51
- require 'emojidex/data/extended'
52
-
53
- emoji = Emojidex::Data::Collection.new
54
- emoji << Emojidex::Data::UTF.new
55
- emoji << Emojidex::Data::Extended.new
56
- ```
57
-
58
-
59
- On-line
60
- -------
61
- WIP
62
-
63
-
64
- Assets
65
- ======
66
- You can find Vectors here: [emojidex-vectors](https://github.com/emojidex/emojidex-vectors)
67
- You can find Rasters here: [emojidex-rasters](https://github.com/emojidex/emojidex-rasters)
68
-
69
- License
70
- =======
71
- emojidex and emojidex tools are licensed under the [emojidex Open License](https://www.emojidex.com/emojidex/emojidex_open_license).
72
-
73
- ©2013 the emojidex project / Genshin Souzou K.K. [Phantom Creation Inc.]
@@ -1,19 +0,0 @@
1
- require 'spec_helper'
2
-
3
- describe Emojidex::Data::Categories do
4
- let(:categories) { Emojidex::Data::Categories.new }
5
-
6
- describe '.initialize' do
7
- it 'initializes a new categories object' do
8
- expect(categories).to be_an_instance_of(Emojidex::Data::Categories)
9
- end
10
- end
11
-
12
- describe '.category' do
13
- it 'is a proper hash and can be referenced by key' do
14
- expect(categories.categories[:transportation].en).to eq('Transportation')
15
- expect(categories.categories[:transportation].ja).to eq('乗り物')
16
- end
17
- end
18
-
19
- end
@@ -1,72 +0,0 @@
1
- require 'spec_helper'
2
- require 'emojidex/data/collection_checker'
3
-
4
- describe Emojidex::Data::CollectionChecker do
5
-
6
- before(:all) do
7
- @sizes = [:px32]
8
- end
9
-
10
- let(:col_good) do
11
- sample_collection 'good'
12
- end
13
-
14
- let(:col_missing_assets) do
15
- sample_collection 'missing_assets'
16
- end
17
-
18
- let(:col_missing_index) do # just missing entries in index, not missing the actual index
19
- sample_collection 'missing_index'
20
- end
21
-
22
- describe 'Spec Collections' do
23
- it 'load cleanly' do
24
- expect(col_good).to be_an_instance_of(Emojidex::Data::Collection)
25
- expect(col_missing_assets).to be_an_instance_of(Emojidex::Data::Collection)
26
- expect(col_missing_index).to be_an_instance_of(Emojidex::Data::Collection)
27
- end
28
- end
29
-
30
- describe '.new' do
31
- it 'creates a valid CollectionChecker instance and checks a valid collection' do
32
- checker = Emojidex::Data::CollectionChecker.new(col_good, {sizes: @sizes})
33
-
34
- expect(checker).to be_an_instance_of(Emojidex::Data::CollectionChecker)
35
- expect(checker.index_only).to be_empty
36
- expect(checker.asset_only).to be_empty
37
- end
38
-
39
- it 'checks to see if a size of an asset exists' do
40
- checker = Emojidex::Data::CollectionChecker.new(col_good, {sizes: [:px64]})
41
-
42
- expect(checker).to be_an_instance_of(Emojidex::Data::CollectionChecker)
43
- expect(checker.index_only.size).to eq(4)
44
- expect(checker.asset_only).to be_empty
45
- end
46
-
47
- it 'checks for and identifies missing assets' do
48
- checker = Emojidex::Data::CollectionChecker.new(col_missing_assets, {sizes: @sizes})
49
-
50
- expect(checker.asset_only).to be_empty
51
- expect(checker.index_only.size).to eq(2)
52
- expect(checker.index_only).to eq(
53
- {nut_and_bolt: ["nut_and_bolt.svg"], purple_heart: ["px32/purple_heart.png"]})
54
- end
55
-
56
- it 'checks for and identifies missing index entries' do
57
- checker = Emojidex::Data::CollectionChecker.new(col_missing_index, {sizes: @sizes})
58
-
59
- expect(checker.index_only).to be_empty
60
- expect(checker.asset_only.size).to eq(1)
61
- expect(checker.asset_only).to eq(
62
- {purple_heart: ["purple_heart.svg", "px32/purple_heart.png"]})
63
- end
64
- it 'checks collections against a specified asset directory' do
65
- checker = Emojidex::Data::CollectionChecker.new([col_missing_index, col_missing_assets],
66
- {sizes: @sizes, asset_path: col_good.source_path})
67
-
68
- expect(checker.index_only).to be_empty
69
- expect(checker.asset_only).to be_empty
70
- end
71
- end
72
- end