emojifyi 0.1.0 → 0.1.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 62fe2eff7c25aca820d46a6c21eb9f7fe979ebfc8d9496d9da919f96c99092e9
4
- data.tar.gz: 726a879997ccd169b6db181f5c6feaafd48baa732f087f505756df6bb0b14eb5
3
+ metadata.gz: a78e8e7c98fed141591d7d5efcde5e581c4c319e3eb53f9a2d4d758b8c250766
4
+ data.tar.gz: 12fadef0aba6cc61511820d2306a524f8eb57c26a38ce53fd95d98eaf74f91db
5
5
  SHA512:
6
- metadata.gz: 51b4163aa922ba4ca5a379fa218e021ea18052401f6e0ff22be415b0a9b46838db7c1fad738321dba8cd2cbd389dde4f819a12e6eb1ddfdfe231ef3bf5c282e7
7
- data.tar.gz: e82f122a6fef2c2604e7f1c7adf2e57724eb5f24d4ae3cee57f2e282d48af7dec7406a39d18c958e715bf1223cf2e48d6fc4cb355d4605cff0dfd7a961251dc2
6
+ metadata.gz: 4cd7dd83366122dbcdedf334ed19fc5e8322c318838b822c822f821d6c13051fc878148572971661f91beae462943c101a7e8464ecb31a1ac53c672d064340e9
7
+ data.tar.gz: 1f9fb349239ad4736f7af66ab6eb4c229b91c9af03e7270771c1baa91025feaeb6f023aac6f8e101bcb5908cc2d5815c047641f874a7f04c63cc531e2f833268
@@ -0,0 +1,48 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "net/http"
4
+ require "json"
5
+ require "uri"
6
+
7
+ module EmojiFYI
8
+ class Client
9
+ DEFAULT_BASE_URL = "https://emojifyi.com/api"
10
+
11
+ def initialize(base_url: DEFAULT_BASE_URL)
12
+ @base_url = base_url
13
+ end
14
+
15
+ def search(query)
16
+ get("/search/", q: query)
17
+ end
18
+
19
+ def entity(slug)
20
+ get("/emoji/#{slug}/")
21
+ end
22
+
23
+ def glossary_term(slug)
24
+ get("/glossary/#{slug}/")
25
+ end
26
+
27
+ def random
28
+ get("/random/")
29
+ end
30
+
31
+ private
32
+
33
+ def get(path, params = {})
34
+ uri = URI("#{@base_url}#{path}")
35
+ uri.query = URI.encode_www_form(params) unless params.empty?
36
+
37
+ response = Net::HTTP.get_response(uri)
38
+
39
+ unless response.is_a?(Net::HTTPSuccess)
40
+ raise Error, "HTTP #{response.code}: #{response.body}"
41
+ end
42
+
43
+ JSON.parse(response.body, symbolize_names: true)
44
+ end
45
+ end
46
+
47
+ class Error < StandardError; end
48
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module EmojiFYI
4
+ VERSION = "0.1.1"
5
+ end
data/lib/emojifyi.rb CHANGED
@@ -1,80 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "net/http"
4
- require "json"
5
- require "uri"
6
-
7
- # Ruby client for EmojiFYI REST API (emojifyi.com).
8
- #
9
- # client = EmojiFYI::Client.new
10
- # result = client.search("query")
11
- #
12
- module EmojiFYI
13
- class Client
14
- BASE_URL = "https://emojifyi.com"
15
-
16
- def initialize(base_url: BASE_URL)
17
- @base_url = base_url
18
- end
19
-
20
- def search(query)
21
- get("/api/v1/search/", q: query)
22
- end
23
-
24
- # List all categories.
25
- def list_categories
26
- get("/api/v1/categories/")
27
- end
28
-
29
- # Get category by slug.
30
- def get_category(slug)
31
- get("/api/v1/categories/#{slug}/")
32
- end
33
- # List all emojis.
34
- def list_emojis
35
- get("/api/v1/emojis/")
36
- end
37
-
38
- # Get emoji by slug.
39
- def get_emoji(slug)
40
- get("/api/v1/emojis/#{slug}/")
41
- end
42
- # List all faqs.
43
- def list_faqs
44
- get("/api/v1/faqs/")
45
- end
46
-
47
- # Get faq by slug.
48
- def get_faq(slug)
49
- get("/api/v1/faqs/#{slug}/")
50
- end
51
- # List all glossary.
52
- def list_glossary
53
- get("/api/v1/glossary/")
54
- end
55
-
56
- # Get term by slug.
57
- def get_term(slug)
58
- get("/api/v1/glossary/#{slug}/")
59
- end
60
- # List all stories.
61
- def list_stories
62
- get("/api/v1/stories/")
63
- end
64
-
65
- # Get story by slug.
66
- def get_story(slug)
67
- get("/api/v1/stories/#{slug}/")
68
- end
69
-
70
- private
71
-
72
- def get(path, **params)
73
- uri = URI.join(@base_url, path)
74
- uri.query = URI.encode_www_form(params) unless params.empty?
75
- response = Net::HTTP.get_response(uri)
76
- raise "HTTP #{response.code}" unless response.is_a?(Net::HTTPSuccess)
77
- JSON.parse(response.body)
78
- end
79
- end
80
- end
3
+ require_relative "emojifyi/version"
4
+ require_relative "emojifyi/client"
metadata CHANGED
@@ -1,30 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emojifyi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - FYIPedia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-21 00:00:00.000000000 Z
11
+ date: 2026-03-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
- description: Ruby client for the EmojiFYI REST API at emojifyi.com. Zero external
14
- dependencies.
15
- email: dev@fyipedia.com
13
+ description: API client for emojifyi.com. Emoji metadata, encoding, and Unicode Emoji
14
+ 16.0 lookup. Zero dependencies.
15
+ email:
16
+ - hello@fyipedia.com
16
17
  executables: []
17
18
  extensions: []
18
19
  extra_rdoc_files: []
19
20
  files:
20
21
  - lib/emojifyi.rb
22
+ - lib/emojifyi/client.rb
23
+ - lib/emojifyi/version.rb
21
24
  homepage: https://emojifyi.com
22
25
  licenses:
23
26
  - MIT
24
27
  metadata:
25
- source_code_uri: https://github.com/fyipedia/emojifyi-rb
26
- documentation_uri: https://emojifyi.com/api/v1/schema/
27
28
  homepage_uri: https://emojifyi.com
29
+ source_code_uri: https://github.com/fyipedia/emojifyi-rb
30
+ changelog_uri: https://github.com/fyipedia/emojifyi-rb/blob/main/CHANGELOG.md
31
+ documentation_uri: https://emojifyi.com/developers/
32
+ bug_tracker_uri: https://github.com/fyipedia/emojifyi-rb/issues
28
33
  post_install_message:
29
34
  rdoc_options: []
30
35
  require_paths:
@@ -43,5 +48,5 @@ requirements: []
43
48
  rubygems_version: 3.0.3.1
44
49
  signing_key:
45
50
  specification_version: 4
46
- summary: Ruby client for EmojiFYI API
51
+ summary: Emoji metadata, encoding, and Unicode Emoji 16.0 lookup
47
52
  test_files: []