haltia 24.0.0.dev.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c6016219f53c2249cbb6d1ce2775f28867821d9c68f62df894b1d90f1c3a1ada
4
+ data.tar.gz: acdcc9376f3e47f72b3fdbf08c2bdc364e6c0286cfa9c0a94b5d9826436d516a
5
+ SHA512:
6
+ metadata.gz: 84e1f928e92890ed51ef8c96372e07ab1471700a1391e2c0d02472f8b715fda877559c948d6dedf07591103367e8555197d8a7820d42a6ec6e00f3011abc5c87
7
+ data.tar.gz: e9213444a725587df4cf62fac7e9dd57a1aeae31f38f5e85d534403f6565e4852ff2db89c06b674bb107ac5f3d4fcb88527f185ed49c4af680214e02360efb2b
data/AUTHORS ADDED
@@ -0,0 +1 @@
1
+ * Arto Bendiken <arto@haltia.ai>
data/CHANGES.md ADDED
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## 24.0.0.dev.0 - 2024-01-23
9
+
10
+ ### Added
11
+
12
+ - `Haltia::SDK.licensee`
13
+ - `Haltia::SDK.version`
data/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # Haltia.AI Software Development Kit (SDK) for Ruby
2
+
3
+ [![License](https://img.shields.io/badge/license-Public%20Domain-blue.svg)](https://unlicense.org)
4
+ [![Compatibility](https://img.shields.io/badge/ruby-2.6%2B-blue)](https://rubygems.org/gems/haltia)
5
+ [![Package](https://img.shields.io/gem/v/haltia)](https://rubygems.org/gems/haltia)
6
+
7
+ ## Prerequisites
8
+
9
+ - [Ruby](https://ruby-lang.org) 2.6+
10
+ with [FFI](https://github.com/ffi/ffi/wiki)
11
+
12
+ - [Haltia.AI SDK](https://sdk.haltia.ai) 24.0+
13
+
14
+ ## Installation
15
+
16
+ ```shell
17
+ $ gem install haltia
18
+ ```
19
+
20
+ ## Examples
21
+
22
+ ### Importing the library
23
+
24
+ ```ruby
25
+ require 'haltia'
26
+ ```
data/UNLICENSE ADDED
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <https://unlicense.org/>
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 24.0.0.dev.0
@@ -0,0 +1,17 @@
1
+ # This is free and unencumbered software released into the public domain.
2
+
3
+ module Haltia::SDK
4
+ # const char* haiGetLicenseeString()
5
+ begin
6
+ attach_function :haiGetLicenseeString, [], :string
7
+ rescue FFI::NotFoundError => err
8
+ warn err
9
+ end
10
+
11
+ # const char* haiGetVersionString()
12
+ begin
13
+ attach_function :haiGetVersionString, [], :string
14
+ rescue FFI::NotFoundError => err
15
+ warn err
16
+ end
17
+ end # Haltia::SDK
data/lib/haltia/sdk.rb ADDED
@@ -0,0 +1,68 @@
1
+ # This is free and unencumbered software released into the public domain.
2
+
3
+ require 'ffi'
4
+
5
+ ##
6
+ # The Haltia.AI Software Development Kit (SDK) for Ruby.
7
+ module Haltia
8
+ ##
9
+ # Foreign-function interface (FFI) bindings for the Haltia.AI SDK native
10
+ # library.
11
+ module SDK
12
+ MACOS_APP_PATH = 'Applications/Haltia.AI.app'
13
+ MACOS_APP_SUBPATH = 'Contents/Frameworks/HaltiaAI.framework/HaltiaAI'
14
+ MACOS_SDK_DYLIB = 'libHaltiaAI.dylib'
15
+
16
+ ##
17
+ # Returns the name and email of who the loaded SDK build is licensed to.
18
+ #
19
+ # The licensee string format is "J. Random Hacker <jhacker@example.com>".
20
+ #
21
+ # @return [#to_s]
22
+ def self.licensee
23
+ self.haiGetLicenseeString()
24
+ end
25
+
26
+ ##
27
+ # Returns the full version string for the loaded SDK build.
28
+ #
29
+ # The version string format is "24.0.0-dev.123 (2024-01-31)".
30
+ #
31
+ # Note that this version is likely to be different from the Ruby SDK
32
+ # library version. The two are compatible so long as the two initial
33
+ # major components of the version string are equivalent for both.
34
+ #
35
+ # @return [#to_s]
36
+ def self.version
37
+ self.haiGetVersionString()
38
+ end
39
+
40
+ ##
41
+ # Returns a list of platform-specific paths where to look for the SDK.
42
+ #
43
+ # @return [Array<String>]
44
+ def self.paths
45
+ result = []
46
+ case RUBY_PLATFORM
47
+ when /darwin/ # macOS
48
+ result << ENV['HALTIA_SDK'] if ENV['HALTIA_SDK']
49
+ result << [ENV['HALTIA_APP'], MACOS_APP_SUBPATH].join('/') if ENV['HALTIA_APP']
50
+ result << [ENV['HOME'], MACOS_APP_PATH, MACOS_APP_SUBPATH].join('/') if ENV['HOME']
51
+ result << ['', MACOS_APP_PATH, MACOS_APP_SUBPATH].join('/')
52
+ result << MACOS_SDK_DYLIB
53
+
54
+ when /linux/ # Linux
55
+ %w(libHaltiaAI.so)
56
+
57
+ when /bccwin|cygwin|djgpp|mingw|mswin|wince/i # Windows
58
+ %w(HaltiaAI.dll)
59
+ end
60
+ result.uniq # remove duplicates
61
+ end
62
+
63
+ extend ::FFI::Library
64
+ ffi_lib self.paths
65
+ end # SDK
66
+ end # Haltia
67
+
68
+ require 'haltia/sdk/abi'
data/lib/haltia.rb ADDED
@@ -0,0 +1,3 @@
1
+ # This is free and unencumbered software released into the public domain.
2
+
3
+ require 'haltia/sdk'
metadata ADDED
@@ -0,0 +1,131 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: haltia
3
+ version: !ruby/object:Gem::Version
4
+ version: 24.0.0.dev.0
5
+ platform: ruby
6
+ authors:
7
+ - Haltia.AI
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-01-23 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '13'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '13'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '3.12'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '3.12'
41
+ - !ruby/object:Gem::Dependency
42
+ name: yard
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0.9'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0.9'
55
+ - !ruby/object:Gem::Dependency
56
+ name: know
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: ffi
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.16'
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: 1.16.3
79
+ type: :runtime
80
+ prerelease: false
81
+ version_requirements: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - "~>"
84
+ - !ruby/object:Gem::Version
85
+ version: '1.16'
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: 1.16.3
89
+ description: ''
90
+ email: support@haltia.ai
91
+ executables: []
92
+ extensions: []
93
+ extra_rdoc_files: []
94
+ files:
95
+ - AUTHORS
96
+ - CHANGES.md
97
+ - README.md
98
+ - UNLICENSE
99
+ - VERSION
100
+ - lib/haltia.rb
101
+ - lib/haltia/sdk.rb
102
+ - lib/haltia/sdk/abi.rb
103
+ homepage: https://sdk.haltia.ai
104
+ licenses:
105
+ - Unlicense
106
+ metadata:
107
+ bug_tracker_uri: https://github.com/HaltiaAI/haltia.rb/issues
108
+ changelog_uri: https://github.com/HaltiaAI/haltia.rb/blob/master/CHANGES.md
109
+ documentation_uri: https://github.com/HaltiaAI/haltia.rb/blob/master/README.md
110
+ homepage_uri: https://sdk.haltia.ai
111
+ source_code_uri: https://github.com/HaltiaAI/haltia.rb
112
+ post_install_message:
113
+ rdoc_options: []
114
+ require_paths:
115
+ - lib
116
+ required_ruby_version: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - ">="
119
+ - !ruby/object:Gem::Version
120
+ version: '2.6'
121
+ required_rubygems_version: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">"
124
+ - !ruby/object:Gem::Version
125
+ version: 1.3.1
126
+ requirements: []
127
+ rubygems_version: 3.0.3.1
128
+ signing_key:
129
+ specification_version: 4
130
+ summary: Haltia.AI Software Development Kit (SDK) for Ruby
131
+ test_files: []