emojidex 0.2.0 → 0.2.1

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: a23e3b7d0fdb86b4577cb31f2f4d507dd2aab718
4
- data.tar.gz: c225211888f80285139ce2b5ab6722c7f56a3491
3
+ metadata.gz: 5410198fbf7a8a192c52c7f321bf0c82549a7076
4
+ data.tar.gz: fc92c715b7aa8f648adadfe0ed2212b280c8e449
5
5
  SHA512:
6
- metadata.gz: 0fde73983a81cbd08fb429a77a22c655329e16e4cbf8ff1d6bc43bdc8532ce39a85b8310df6d8a455d3845336728ded4147055b1e0059e044661e3b6a1bf117b
7
- data.tar.gz: 56b050497be82e6917e5954dea7d269869f5b78b3f6912aebd127f9c22ed29ce89e5ecbb6d0d5bbac3e606867fa77a268c3e9fcf3c86c66c3b24548ddf214361
6
+ metadata.gz: 575d1d4702c789d39b5189af25acead411053da281431cb4ac0d34ab79d9d26a4994249058f5246e9cd47173c1e0012dee779c0b9adb5988d67aa1268da2eb81
7
+ data.tar.gz: 6c4edaf23c04dbe9cb81f51ea21a53b4f3b2bcdfeedf5c43d54fdc56b0fe2f1b0ebefa803f27c4c46165e5a0753e5067f399698d1b65af50af81a3612cc580f7
data/emojidex.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'emojidex'
3
- s.version = '0.2.0'
3
+ s.version = '0.2.1'
4
4
  s.license = 'emojiOL'
5
5
  s.summary = 'emojidex Ruby tools'
6
6
  s.description = 'emojidex emoji handling, search and lookup, listing and caching functionality' \
@@ -84,7 +84,7 @@ module Emojidex
84
84
  @vector_source_path = @source_path if @vector_source_path.nil?
85
85
  src = "#{@vector_source_path}/#{moji.code}.svg"
86
86
  if File.exist? "#{src}"
87
- unless File.exist?("#{@cache_path}/#{moji.code}") &&
87
+ unless File.exist?("#{@cache_path}/#{moji.code}.svg") &&
88
88
  FileUtils.compare_file("#{src}", "#{@cache_path}/#{moji.code}.svg")
89
89
  FileUtils.cp("#{src}", @cache_path)
90
90
  end
@@ -6,7 +6,7 @@ module Emojidex
6
6
  # mixin module to enable static collections
7
7
  module StaticCollection
8
8
  def load_from_server(detailed = true, locale = '??')
9
- locale = Emojidex::EnvHelper.lang? if locale == '??'
9
+ locale = @locale || Emojidex::EnvHelper.lang? if locale == '??'
10
10
  begin
11
11
  res = Emojidex::Service::Transactor.get(@endpoint, detailed: detailed, locale: locale)
12
12
  rescue
@@ -10,7 +10,9 @@ module Emojidex
10
10
  def initialize(opts = {})
11
11
  super(opts)
12
12
  @endpoint = 'extended_emoji'
13
- load_from_server unless check_and_load_static('extended')
13
+ @locale = opts[:locale] || Emojidex::Defaults.locale
14
+ load_from_server((opts[:detailed] || true),
15
+ @locale) unless check_and_load_static('extended')
14
16
  @emoji
15
17
  end
16
18
  end
@@ -10,7 +10,8 @@ module Emojidex
10
10
  def initialize(opts = {})
11
11
  super(opts)
12
12
  @endpoint = 'utf_emoji'
13
- load_from_server unless check_and_load_static('utf')
13
+ @locale = opts[:locale] || Emojidex::Defaults.locale
14
+ load_from_server((opts[:detailed] || true), @locale) unless check_and_load_static('utf')
14
15
  @emoji
15
16
  end
16
17
  end
@@ -39,5 +39,9 @@ module Emojidex
39
39
  def self.system_cache_path
40
40
  ENV['EMOJI_CACHE'] || "#{ENV['HOME']}/.emojidex/"
41
41
  end
42
+
43
+ class << self
44
+ alias :locale :lang
45
+ end
42
46
  end
43
47
  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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rei Kagetsuki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-19 00:00:00.000000000 Z
11
+ date: 2016-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday