emojidex 0.0.7 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +11 -10
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +11 -0
  5. data/.travis.yml +17 -0
  6. data/Gemfile +16 -10
  7. data/Guardfile +12 -0
  8. data/README.md +27 -5
  9. data/Rakefile +6 -32
  10. data/emoji/categories.json +64 -0
  11. data/emojidex.gemspec +13 -20
  12. data/lib/emojidex.rb +9 -4
  13. data/lib/emojidex/api/categories.rb +16 -0
  14. data/lib/emojidex/api/emoji.rb +26 -0
  15. data/lib/emojidex/api/search/emoji.rb +16 -0
  16. data/lib/emojidex/cache.rb +69 -0
  17. data/lib/emojidex/categories.rb +32 -0
  18. data/lib/emojidex/category.rb +14 -0
  19. data/lib/emojidex/client.rb +60 -0
  20. data/lib/emojidex/collection.rb +119 -0
  21. data/lib/emojidex/defaults.rb +13 -0
  22. data/lib/emojidex/emoji.rb +74 -0
  23. data/lib/emojidex/error.rb +15 -0
  24. data/lib/emojidex/extended.rb +15 -0
  25. data/lib/emojidex/service.rb +32 -0
  26. data/lib/emojidex/utf.rb +15 -0
  27. data/spec/api/categories_spec.rb +49 -0
  28. data/spec/api/emoji_spec.rb +89 -0
  29. data/spec/api/search/emoji_spec.rb +30 -0
  30. data/spec/categories_spec.rb +18 -0
  31. data/spec/client_spec.rb +24 -0
  32. data/spec/emoji_spec.rb +63 -0
  33. data/spec/extended_spec.rb +107 -0
  34. data/spec/spec_helper.rb +64 -0
  35. data/spec/support/Genshin.svg +126 -0
  36. data/spec/support/couple_kiss/0.svg +177 -0
  37. data/spec/support/couple_kiss/1.svg +177 -0
  38. data/spec/support/couple_kiss/10.svg +293 -0
  39. data/spec/support/couple_kiss/11.svg +235 -0
  40. data/spec/support/couple_kiss/12.svg +235 -0
  41. data/spec/support/couple_kiss/13.svg +235 -0
  42. data/spec/support/couple_kiss/14.svg +177 -0
  43. data/spec/support/couple_kiss/15.svg +177 -0
  44. data/spec/support/couple_kiss/2.svg +177 -0
  45. data/spec/support/couple_kiss/3.svg +235 -0
  46. data/spec/support/couple_kiss/4.svg +235 -0
  47. data/spec/support/couple_kiss/5.svg +235 -0
  48. data/spec/support/couple_kiss/6.svg +293 -0
  49. data/spec/support/couple_kiss/7.svg +235 -0
  50. data/spec/support/couple_kiss/8.svg +235 -0
  51. data/spec/support/couple_kiss/9.svg +235 -0
  52. data/spec/support/couple_kiss/animation.json +14 -0
  53. data/spec/support/fixtures/categories.json +14 -0
  54. data/spec/support/fixtures/category.json +5 -0
  55. data/spec/support/fixtures/emoji.json +28 -0
  56. data/spec/support/fixtures/emoji_detailed.json +41 -0
  57. data/spec/support/fixtures/search_emoji.json +21 -0
  58. data/spec/support/fixtures/single_emoji.json +19 -0
  59. data/spec/support/fixtures/single_emoji_detailed.json +30 -0
  60. data/spec/support/test1/animation.json +6 -0
  61. data/spec/support/test2/animation.json +6 -0
  62. data/spec/support/test3/animation.json +5 -0
  63. data/spec/utf_spec.rb +66 -0
  64. metadata +82 -104
  65. data/app/assets/images/emojidex/.keep +0 -0
  66. data/app/assets/images/emojidex/glyphicons-halflings-white.png +0 -0
  67. data/app/assets/images/emojidex/glyphicons-halflings.png +0 -0
  68. data/app/assets/javascripts/emojidex/application.js +0 -14
  69. data/app/assets/javascripts/emojidex/bootstrap.min.js +0 -7
  70. data/app/assets/javascripts/emojidex/cheat_sheet.js +0 -12
  71. data/app/assets/javascripts/emojidex/poe_pallet.js +0 -71
  72. data/app/assets/stylesheets/emojidex/application.css +0 -15
  73. data/app/assets/stylesheets/emojidex/bootstrap-responsive.min.css +0 -9
  74. data/app/assets/stylesheets/emojidex/bootstrap.min.css +0 -9
  75. data/app/assets/stylesheets/emojidex/cheat_sheet.css +0 -41
  76. data/app/controllers/emojidex/application_controller.rb +0 -7
  77. data/app/controllers/emojidex/cheat_sheet_controller.rb +0 -50
  78. data/app/helpers/emojidex/application_helper.rb +0 -4
  79. data/app/helpers/emojidex/cheat_sheet_helper.rb +0 -4
  80. data/app/views/emojidex/cheat_sheet/index.html.erb +0 -58
  81. data/app/views/layouts/emojidex/application.html.erb +0 -14
  82. data/bin/rails +0 -8
  83. data/config/routes.rb +0 -5
  84. data/lib/emojidex/engine.rb +0 -5
  85. data/lib/emojidex/version.rb +0 -3
  86. data/lib/generators/emojidex/install/install_generator.rb +0 -35
  87. data/lib/tasks/emojidex_tasks.rake +0 -4
  88. data/test/controllers/emojidex/cheat_sheet_controller_test.rb +0 -11
  89. data/test/dummy/README.rdoc +0 -28
  90. data/test/dummy/Rakefile +0 -6
  91. data/test/dummy/app/assets/images/.keep +0 -0
  92. data/test/dummy/app/assets/javascripts/application.js +0 -13
  93. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  94. data/test/dummy/app/controllers/application_controller.rb +0 -5
  95. data/test/dummy/app/controllers/concerns/.keep +0 -0
  96. data/test/dummy/app/helpers/application_helper.rb +0 -2
  97. data/test/dummy/app/mailers/.keep +0 -0
  98. data/test/dummy/app/models/.keep +0 -0
  99. data/test/dummy/app/models/concerns/.keep +0 -0
  100. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  101. data/test/dummy/bin/bundle +0 -3
  102. data/test/dummy/bin/rails +0 -4
  103. data/test/dummy/bin/rake +0 -4
  104. data/test/dummy/config.ru +0 -4
  105. data/test/dummy/config/application.rb +0 -23
  106. data/test/dummy/config/boot.rb +0 -5
  107. data/test/dummy/config/database.yml +0 -25
  108. data/test/dummy/config/environment.rb +0 -5
  109. data/test/dummy/config/environments/development.rb +0 -29
  110. data/test/dummy/config/environments/production.rb +0 -80
  111. data/test/dummy/config/environments/test.rb +0 -36
  112. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  113. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  114. data/test/dummy/config/initializers/inflections.rb +0 -16
  115. data/test/dummy/config/initializers/mime_types.rb +0 -5
  116. data/test/dummy/config/initializers/secret_token.rb +0 -12
  117. data/test/dummy/config/initializers/session_store.rb +0 -3
  118. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  119. data/test/dummy/config/locales/en.yml +0 -23
  120. data/test/dummy/config/routes.rb +0 -4
  121. data/test/dummy/lib/assets/.keep +0 -0
  122. data/test/dummy/log/.keep +0 -0
  123. data/test/dummy/public/404.html +0 -58
  124. data/test/dummy/public/422.html +0 -58
  125. data/test/dummy/public/500.html +0 -57
  126. data/test/dummy/public/favicon.ico +0 -0
  127. data/test/emojidex_test.rb +0 -7
  128. data/test/helpers/emojidex/cheat_sheet_helper_test.rb +0 -6
  129. data/test/integration/navigation_test.rb +0 -10
  130. data/test/test_helper.rb +0 -15
@@ -1,50 +0,0 @@
1
- require_dependency "emojidex/application_controller"
2
-
3
- module Emojidex
4
- class CheatSheetController < ApplicationController
5
- before_filter :init_datas
6
-
7
- def init_datas
8
- @poe_index = Emojidex::ApplicationController::POE_INDEX
9
- @categories = Array.new
10
- @divided_emojis = Array.new
11
- set_categories
12
- set_divided_emojis
13
- end
14
-
15
- def index
16
- @path = '/assets/poe/png64/'
17
- end
18
-
19
- def set_categories
20
- @poe_index.each do |item|
21
- @categories << item['category'] if !@categories.include?(item['category'])
22
- end
23
- end
24
-
25
- def set_divided_emojis
26
- @categories.each do |category|
27
- emojis = Array.new
28
- @poe_index.each do |emoji|
29
- if category == emoji['category']
30
- emojis << emoji
31
- end
32
- end
33
- @divided_emojis << emojis
34
- end
35
- end
36
-
37
- def poe_divided_emojis
38
- respond_to do |format|
39
- format.json {render :json => @divided_emojis}
40
- end
41
- end
42
-
43
- def poe_categories
44
- respond_to do |format|
45
- format.json {render :json => @categories}
46
- end
47
- end
48
-
49
- end
50
- end
@@ -1,4 +0,0 @@
1
- module Emojidex
2
- module ApplicationHelper
3
- end
4
- end
@@ -1,4 +0,0 @@
1
- module Emojidex
2
- module CheatSheetHelper
3
- end
4
- end
@@ -1,58 +0,0 @@
1
- <script>
2
- <% for i in 0..@categories.size - 1 %>
3
- <% @divided_emojis[i].each do |item| %>
4
- set_index('<%= item['name'] %>')
5
- <% end %>
6
- <% end %>
7
- </script>
8
-
9
- <div class="container">
10
- <div class="row-fluid">
11
- <div class="span12">
12
- <div class="row-fluid">
13
- <h2 class="text-center">Phantom Open Emoji Cheat Sheet</h2>
14
- </div>
15
- <hr style="border-style:solid;">
16
-
17
- <div class="row-fluid text-center">
18
- <input type="text" id="emoji_name">
19
- <input type="image" id="tooltip" src="/assets/poe/png20/grinning.png"
20
- data-html="true" data-ttoggle="popover" data-placement="bottom" data-animation="false">
21
- </div>
22
-
23
- <div class="row-fluid">
24
- <div class="span12">
25
-
26
- <% @categories.each_with_index do |category, i| %>
27
- <div class="row-fluid">
28
- <h3><%= category %></h3>
29
- </div>
30
- <div class="row-fluid">
31
-
32
- <% @divided_emojis[i].each_with_index do |item, j| %>
33
- <% if j % 2 == 0 and j != 0 %>
34
- </div>
35
- <div class="row-fluid mt-l">
36
- <% end %>
37
- <div class="span6">
38
- <div class="span2">
39
- <%= image_tag @path + item['name'] + '.png' %>
40
- </div>
41
- <div class="span10">
42
- <p class="icon-name">
43
- &nbsp;&nbsp;:<%= item['name'] %>:
44
- </p>
45
- </div>
46
- </div>
47
- <% end %>
48
-
49
- </div>
50
- <hr style="border-style:dashed;">
51
- <% end %>
52
-
53
- <hr style="border-style:solid;">
54
- </div>
55
- </div>
56
- </div>
57
- </div>
58
- </div>
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Emojidex</title>
5
- <%= stylesheet_link_tag "emojidex/application", media: "all" %>
6
- <%= javascript_include_tag "emojidex/application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
data/bin/rails DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
3
-
4
- ENGINE_ROOT = File.expand_path('../..', __FILE__)
5
- ENGINE_PATH = File.expand_path('../../lib/emojidex/engine', __FILE__)
6
-
7
- require 'rails/all'
8
- require 'rails/engine/commands'
data/config/routes.rb DELETED
@@ -1,5 +0,0 @@
1
- Emojidex::Engine.routes.draw do
2
- get "cheat_sheet" => "cheat_sheet#index"
3
- get "divided_emojis" => "cheat_sheet#poe_divided_emojis"
4
- get "categories" => "cheat_sheet#poe_categories"
5
- end
@@ -1,5 +0,0 @@
1
- module Emojidex
2
- class Engine < ::Rails::Engine
3
- isolate_namespace Emojidex
4
- end
5
- end
@@ -1,3 +0,0 @@
1
- module Emojidex
2
- VERSION = "0.0.1"
3
- end
@@ -1,35 +0,0 @@
1
- require 'rails/generators'
2
- require 'highline/import'
3
- require 'bundler'
4
- require 'bundler/cli'
5
-
6
- module Emojidex
7
- class InstallGenerator < Rails::Generators::Base
8
-
9
- def notify_about_routes
10
- insert_into_file File.join('config', 'routes.rb'), :after => "Application.routes.draw do\n" do
11
- %Q{
12
- mount Emojidex::Engine, :at => '/poe'
13
-
14
- }
15
- end
16
-
17
- unless options[:quiet]
18
- puts "*" * 50
19
- puts "We added the following line to your application's config/routes.rb file:"
20
- puts " "
21
- puts " mount Emojidex::Engine, :at => '/poe'"
22
- end
23
- end
24
-
25
- def complete
26
- unless options[:quiet]
27
- puts "*" * 50
28
- puts "Emojidex has been installed successfully. You're all ready to go!"
29
- puts " "
30
- puts "(、´・ω・)▄︻┻┳═一 Σ==!Enjoy!>"
31
- end
32
- end
33
-
34
- end
35
- end
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :emojidex do
3
- # # Task goes here
4
- # end
@@ -1,11 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Emojidex
4
- class CheatSheetControllerTest < ActionController::TestCase
5
- test "should get index" do
6
- get :index
7
- assert_response :success
8
- end
9
-
10
- end
11
- end
@@ -1,28 +0,0 @@
1
- == README
2
-
3
- This README would normally document whatever steps are necessary to get the
4
- application up and running.
5
-
6
- Things you may want to cover:
7
-
8
- * Ruby version
9
-
10
- * System dependencies
11
-
12
- * Configuration
13
-
14
- * Database creation
15
-
16
- * Database initialization
17
-
18
- * How to run the test suite
19
-
20
- * Services (job queues, cache servers, search engines, etc.)
21
-
22
- * Deployment instructions
23
-
24
- * ...
25
-
26
-
27
- Please feel free to use a different markup language if you do not plan to run
28
- <tt>rake doc:app</tt>.
data/test/dummy/Rakefile DELETED
@@ -1,6 +0,0 @@
1
- # Add your own tasks in files placed in lib/tasks ending in .rake,
2
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
-
4
- require File.expand_path('../config/application', __FILE__)
5
-
6
- Dummy::Application.load_tasks
File without changes
@@ -1,13 +0,0 @@
1
- // This is a manifest file that'll be compiled into application.js, which will include all the files
2
- // listed below.
3
- //
4
- // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
- // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
- //
7
- // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
- // compiled file.
9
- //
10
- // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
- // about supported directives.
12
- //
13
- //= require_tree .
@@ -1,13 +0,0 @@
1
- /*
2
- * This is a manifest file that'll be compiled into application.css, which will include all the files
3
- * listed below.
4
- *
5
- * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
- * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
- *
8
- * You're free to add application-wide styles to this file and they'll appear at the top of the
9
- * compiled file, but it's generally better to create a new file per style scope.
10
- *
11
- *= require_self
12
- *= require_tree .
13
- */
@@ -1,5 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- # Prevent CSRF attacks by raising an exception.
3
- # For APIs, you may want to use :null_session instead.
4
- protect_from_forgery with: :exception
5
- end
File without changes
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
File without changes
File without changes
File without changes
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
6
- <%= javascript_include_tag "application", "data-turbolinks-track" => true %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
- load Gem.bin_path('bundler', 'bundle')
data/test/dummy/bin/rails DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
data/test/dummy/bin/rake DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative '../config/boot'
3
- require 'rake'
4
- Rake.application.run
data/test/dummy/config.ru DELETED
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Rails.application
@@ -1,23 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- Bundler.require(*Rails.groups)
6
- require "emojidex"
7
-
8
- module Dummy
9
- class Application < Rails::Application
10
- # Settings in config/environments/* take precedence over those specified here.
11
- # Application configuration should go into files in config/initializers
12
- # -- all .rb files in that directory are automatically loaded.
13
-
14
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
- # config.time_zone = 'Central Time (US & Canada)'
17
-
18
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
- # config.i18n.default_locale = :de
21
- end
22
- end
23
-
@@ -1,5 +0,0 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
-
4
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
5
- $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -1,25 +0,0 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- development:
7
- adapter: sqlite3
8
- database: db/development.sqlite3
9
- pool: 5
10
- timeout: 5000
11
-
12
- # Warning: The database defined as "test" will be erased and
13
- # re-generated from your development database when you run "rake".
14
- # Do not set this db to the same as development or production.
15
- test:
16
- adapter: sqlite3
17
- database: db/test.sqlite3
18
- pool: 5
19
- timeout: 5000
20
-
21
- production:
22
- adapter: sqlite3
23
- database: db/production.sqlite3
24
- pool: 5
25
- timeout: 5000
@@ -1,5 +0,0 @@
1
- # Load the Rails application.
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the Rails application.
5
- Dummy::Application.initialize!
@@ -1,29 +0,0 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # In the development environment your application's code is reloaded on
5
- # every request. This slows down response time but is perfect for development
6
- # since you don't have to restart the web server when you make code changes.
7
- config.cache_classes = false
8
-
9
- # Do not eager load code on boot.
10
- config.eager_load = false
11
-
12
- # Show full error reports and disable caching.
13
- config.consider_all_requests_local = true
14
- config.action_controller.perform_caching = false
15
-
16
- # Don't care if the mailer can't send.
17
- config.action_mailer.raise_delivery_errors = false
18
-
19
- # Print deprecation notices to the Rails logger.
20
- config.active_support.deprecation = :log
21
-
22
- # Raise an error on page load if there are pending migrations
23
- config.active_record.migration_error = :page_load
24
-
25
- # Debug mode disables concatenation and preprocessing of assets.
26
- # This option may cause significant delays in view rendering with a large
27
- # number of complex assets.
28
- config.assets.debug = true
29
- end