smartcardfyi 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 +7 -0
- data/lib/smartcardfyi/client.rb +80 -0
- data/lib/smartcardfyi/version.rb +5 -0
- data/lib/smartcardfyi.rb +4 -0
- metadata +52 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: fd807ae488d5e4bdefeb56590999efd54e6b6eb1a7645dde56dac58c9da9dc92
|
|
4
|
+
data.tar.gz: b4e9267d1ff21c51813f17fa748f6666bb77e52cb87c42fdb0859e22cd4570ea
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 6680003baec0594168412199344efd590c96a37856a7fdda45c84ba3dde8df7745c1e331bb9ccd149805286b368735e6b9708510da460439d8ef3f8b9253a91c
|
|
7
|
+
data.tar.gz: 45fe3d085785a49089085a5aa02d9b41f9e89ed846841d27b2247ea35f2e9b9889198adae3e857d08f1c9e61ac5be5387c5774d64c2ceabf7c27ce5e2f79b15f
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "net/http"
|
|
4
|
+
require "json"
|
|
5
|
+
require "uri"
|
|
6
|
+
|
|
7
|
+
module SmartCardFYI
|
|
8
|
+
class Client
|
|
9
|
+
DEFAULT_BASE_URL = "https://smartcardfyi.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 card(slug)
|
|
20
|
+
get("/card/#{slug}/")
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def platform(slug)
|
|
24
|
+
get("/platform/#{slug}/")
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def standard(slug)
|
|
28
|
+
get("/standard/#{slug}/")
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def manufacturer(slug)
|
|
32
|
+
get("/manufacturer/#{slug}/")
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def application(slug)
|
|
36
|
+
get("/application/#{slug}/")
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def form_factor(slug)
|
|
40
|
+
get("/form-factor/#{slug}/")
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def certification(slug)
|
|
44
|
+
get("/certification/#{slug}/")
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def glossary_term(slug)
|
|
48
|
+
get("/glossary/#{slug}/")
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def compare(slug_a, slug_b)
|
|
52
|
+
get("/compare/", a: slug_a, b: slug_b)
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def random
|
|
56
|
+
get("/random/")
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def openapi
|
|
60
|
+
get("/openapi.json")
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
private
|
|
64
|
+
|
|
65
|
+
def get(path, params = {})
|
|
66
|
+
uri = URI("#{@base_url}#{path}")
|
|
67
|
+
uri.query = URI.encode_www_form(params) unless params.empty?
|
|
68
|
+
|
|
69
|
+
response = Net::HTTP.get_response(uri)
|
|
70
|
+
|
|
71
|
+
unless response.is_a?(Net::HTTPSuccess)
|
|
72
|
+
raise Error, "HTTP #{response.code}: #{response.body}"
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
JSON.parse(response.body, symbolize_names: true)
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
class Error < StandardError; end
|
|
80
|
+
end
|
data/lib/smartcardfyi.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: smartcardfyi
|
|
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 smartcardfyi.com. Look up smart cards, platforms, form
|
|
14
|
+
factors, certifications, and applications. Zero dependencies.
|
|
15
|
+
email:
|
|
16
|
+
- hello@fyipedia.com
|
|
17
|
+
executables: []
|
|
18
|
+
extensions: []
|
|
19
|
+
extra_rdoc_files: []
|
|
20
|
+
files:
|
|
21
|
+
- lib/smartcardfyi.rb
|
|
22
|
+
- lib/smartcardfyi/client.rb
|
|
23
|
+
- lib/smartcardfyi/version.rb
|
|
24
|
+
homepage: https://smartcardfyi.com
|
|
25
|
+
licenses:
|
|
26
|
+
- MIT
|
|
27
|
+
metadata:
|
|
28
|
+
homepage_uri: https://smartcardfyi.com
|
|
29
|
+
source_code_uri: https://github.com/fyipedia/smartcardfyi-rb
|
|
30
|
+
changelog_uri: https://github.com/fyipedia/smartcardfyi-rb/blob/main/CHANGELOG.md
|
|
31
|
+
documentation_uri: https://smartcardfyi.com/developers/
|
|
32
|
+
bug_tracker_uri: https://github.com/fyipedia/smartcardfyi-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: Smart card platform and standard reference
|
|
52
|
+
test_files: []
|