blefyi 0.1.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0dece516d65305a6a46d01eeb8eecf1c86e6754ef44528a1e210d659cf434eca
4
+ data.tar.gz: b0be1450de4e2d4e6bc2c57fe28e05a5db5ab06c1b4ff8d3227f2486880e8f55
5
+ SHA512:
6
+ metadata.gz: 374ac48fd622513e2b7420b8b1b37db222d64c5e43b3ea12bfb4b1ad9c20638276d2980dcdbb454591828a62e4138fc3464d18829dd3aef7fbdd6de4b1d4fc9a
7
+ data.tar.gz: c304ffd0b49ab08d116b743a5ee887c0d92377ccda876719f4c2128de8239ee98f748d32f3a4c3bf00d8c021fb8f3ec08baef30ef9a10e2599f0ffcf6a7c2771
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "net/http"
4
+ require "json"
5
+ require "uri"
6
+
7
+ module BLEFYI
8
+ class Client
9
+ DEFAULT_BASE_URL = "https://blefyi.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 chip(slug)
20
+ get("/chip/#{slug}/")
21
+ end
22
+
23
+ def profile(slug)
24
+ get("/profile/#{slug}/")
25
+ end
26
+
27
+ def version(slug)
28
+ get("/version/#{slug}/")
29
+ end
30
+
31
+ def beacon(slug)
32
+ get("/beacon/#{slug}/")
33
+ end
34
+
35
+ def usecase(slug)
36
+ get("/usecase/#{slug}/")
37
+ end
38
+
39
+ def manufacturer(slug)
40
+ get("/manufacturer/#{slug}/")
41
+ end
42
+
43
+ def glossary_term(slug)
44
+ get("/glossary/#{slug}/")
45
+ end
46
+
47
+ def compare(slug_a, slug_b)
48
+ get("/compare/", a: slug_a, b: slug_b)
49
+ end
50
+
51
+ def random
52
+ get("/random/")
53
+ end
54
+
55
+ def openapi
56
+ get("/openapi.json")
57
+ end
58
+
59
+ private
60
+
61
+ def get(path, params = {})
62
+ uri = URI("#{@base_url}#{path}")
63
+ uri.query = URI.encode_www_form(params) unless params.empty?
64
+
65
+ response = Net::HTTP.get_response(uri)
66
+
67
+ unless response.is_a?(Net::HTTPSuccess)
68
+ raise Error, "HTTP #{response.code}: #{response.body}"
69
+ end
70
+
71
+ JSON.parse(response.body, symbolize_names: true)
72
+ end
73
+ end
74
+
75
+ class Error < StandardError; end
76
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BLEFYI
4
+ VERSION = "0.1.0"
5
+ end
data/lib/blefyi.rb ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "blefyi/version"
4
+ require_relative "blefyi/client"
metadata ADDED
@@ -0,0 +1,52 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: blefyi
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - FYIPedia
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-03-21 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: API client for blefyi.com. Look up BLE chips, GATT profiles, beacon formats,
14
+ protocol versions, and manufacturers. Zero dependencies.
15
+ email:
16
+ - hello@fyipedia.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - lib/blefyi.rb
22
+ - lib/blefyi/client.rb
23
+ - lib/blefyi/version.rb
24
+ homepage: https://blefyi.com
25
+ licenses:
26
+ - MIT
27
+ metadata:
28
+ homepage_uri: https://blefyi.com
29
+ source_code_uri: https://github.com/fyipedia/blefyi-rb
30
+ changelog_uri: https://github.com/fyipedia/blefyi-rb/blob/main/CHANGELOG.md
31
+ documentation_uri: https://blefyi.com/developers/
32
+ bug_tracker_uri: https://github.com/fyipedia/blefyi-rb/issues
33
+ post_install_message:
34
+ rdoc_options: []
35
+ require_paths:
36
+ - lib
37
+ required_ruby_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '3.0'
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ requirements: []
48
+ rubygems_version: 3.0.3.1
49
+ signing_key:
50
+ specification_version: 4
51
+ summary: Bluetooth Low Energy chip and profile reference
52
+ test_files: []