audience-kit 0.1.0 → 0.2.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 +4 -4
- data/CHANGELOG.md +9 -1
- data/LICENSE +219 -21
- data/README.md +24 -9
- data/lib/audience-kit/event.rb +18 -0
- data/lib/audience-kit/venue.rb +18 -0
- data/lib/audience-kit/version.rb +1 -1
- data/lib/audience-kit.rb +44 -1
- data/sig/audience/kit.rbs +26 -1
- metadata +24 -27
- data/CODE_OF_CONDUCT.md +0 -84
- data/Gemfile +0 -16
- data/LICENSE.txt +0 -21
- data/Rakefile +0 -12
- data/bin/console +0 -15
- data/bin/setup +0 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f8725e7f93ac02aff7ab3a98961b43ccc102bd32747589b7696656d936ef9703
|
|
4
|
+
data.tar.gz: 642c773381040caeb6537d93c9a2a567a6f6642087a7ec46293965982e87b0ec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 10efb35cc8a4537fd0434827265bcdd473e45b4ee8f0d6df0e0f71492205c1f9eda4953c08415623239c4b850f5caf04250adcd4561cad08e0a6000b3ef6d793
|
|
7
|
+
data.tar.gz: 4458f0d02963b6a961aa3371d704094f14222cef2d398f2aaffef34b2b55a543c44c1a70aaf91b785ef52726e34c058dc5e1d4400eb8110c5193d377592665ed
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
## [
|
|
1
|
+
## [0.2.0] - 2026-11-25
|
|
2
|
+
|
|
3
|
+
First release under the AudienceKit SDK License 1.2 (0.1.x were MIT), published from GitHub Actions with
|
|
4
|
+
RubyGems trusted publishing.
|
|
5
|
+
|
|
6
|
+
- Require Ruby 3.2+ and Faraday 2.x
|
|
7
|
+
- Move `Event` and `Venue` under `Audience::Kit` and load them from `require "audience-kit"`
|
|
8
|
+
- Add `Audience::Kit.configure` (base URL, bearer token) and wrap HTTP errors in `Audience::Kit::Error`
|
|
9
|
+
- Add specs and GitHub Actions CI
|
|
2
10
|
|
|
3
11
|
## [0.1.0] - 2022-01-22
|
|
4
12
|
|
data/LICENSE
CHANGED
|
@@ -1,21 +1,219 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
in
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
AudienceKit SDK License
|
|
2
|
+
Version 1.2, November 2026
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2022-2026 Love Wins Media, Inc.
|
|
5
|
+
|
|
6
|
+
Summary (not part of the license): you may read, use, change and redistribute
|
|
7
|
+
this SDK, but only in applications that connect to AudienceKit as hosted by
|
|
8
|
+
Love Wins Media, Inc. Every other use is prohibited unless Love Wins Media, Inc.
|
|
9
|
+
permits it in writing and issues an audience ID or token for it. This is a
|
|
10
|
+
source-available license. It is not an open source license as the Open Source
|
|
11
|
+
Initiative defines the term. Nothing else is licensed: misrepresenting the
|
|
12
|
+
Licensor's work is prohibited, and changed versions may be made only in a fork,
|
|
13
|
+
after written notice to Love Wins Media, Inc.
|
|
14
|
+
|
|
15
|
+
The structure of this license follows the PolyForm licenses
|
|
16
|
+
(https://polyformproject.org), with the purpose limitation of a platform SDK
|
|
17
|
+
license: the software may be used only with the Licensor's hosted service.
|
|
18
|
+
|
|
19
|
+
1. Acceptance
|
|
20
|
+
|
|
21
|
+
In order to get any license under these terms, You must agree to them as
|
|
22
|
+
both strict obligations and conditions to all Your licenses.
|
|
23
|
+
|
|
24
|
+
2. Definitions
|
|
25
|
+
|
|
26
|
+
"Licensor" is Love Wins Media, Inc.
|
|
27
|
+
|
|
28
|
+
"Software" is the source code, object code, documentation and other files
|
|
29
|
+
distributed with this license, in the form the Licensor distributes them.
|
|
30
|
+
|
|
31
|
+
"You" is the individual or entity exercising rights under this license,
|
|
32
|
+
together with every organization that controls, is controlled by, or is
|
|
33
|
+
under common control with it ("Your company").
|
|
34
|
+
|
|
35
|
+
"Hosted Service" is the AudienceKit platform (its API, endpoints and
|
|
36
|
+
services) when operated by the Licensor or on the Licensor's behalf,
|
|
37
|
+
including at audiencekit.com and its subdomains, at the domains of the
|
|
38
|
+
audiences it serves, and in any development, staging or test instance the
|
|
39
|
+
Licensor provides for building against it.
|
|
40
|
+
|
|
41
|
+
"Permitted Application" is an application, website, service, script or
|
|
42
|
+
tool that uses the Software, or a Modification, only to connect to the
|
|
43
|
+
Hosted Service.
|
|
44
|
+
|
|
45
|
+
"Modification" is any work that is based on the Software or any part of it:
|
|
46
|
+
a changed, translated, ported or otherwise altered version, and any work
|
|
47
|
+
that includes or reproduces the Software or a substantial part of it, in
|
|
48
|
+
source or binary form. An application that only calls, links or depends on
|
|
49
|
+
the Software, without changing it, is not a Modification, but Sections 4 to
|
|
50
|
+
7 apply to its use of the Software.
|
|
51
|
+
|
|
52
|
+
"Audience Credential" is an audience ID, API key, access token, client ID
|
|
53
|
+
or similar credential that the Licensor issues.
|
|
54
|
+
|
|
55
|
+
3. Copyright license
|
|
56
|
+
|
|
57
|
+
The Licensor grants You a worldwide, royalty-free, non-exclusive copyright
|
|
58
|
+
license to use, copy, modify, publicly display and distribute the Software,
|
|
59
|
+
and to make, use and distribute Modifications and Permitted Applications,
|
|
60
|
+
in each case only for the Permitted Purpose in Section 4, or for a use the
|
|
61
|
+
Licensor permits under Section 6, and subject to this license. The right
|
|
62
|
+
to make Modifications is subject to Section 8.
|
|
63
|
+
|
|
64
|
+
4. Permitted Purpose
|
|
65
|
+
|
|
66
|
+
The only purpose this license permits is use with the Hosted Service:
|
|
67
|
+
developing, building, testing, distributing and running Permitted
|
|
68
|
+
Applications. Building and testing a Permitted Application against a
|
|
69
|
+
development or test instance the Licensor provides, or against test
|
|
70
|
+
doubles in Your own tests while developing it, is use with the Hosted
|
|
71
|
+
Service.
|
|
72
|
+
|
|
73
|
+
5. Prohibited uses
|
|
74
|
+
|
|
75
|
+
Any use of the Software or a Modification that Section 4 does not permit,
|
|
76
|
+
and that the Licensor has not permitted under Section 6, is prohibited.
|
|
77
|
+
That includes, without limitation:
|
|
78
|
+
|
|
79
|
+
a. using the Software or a Modification, in whole or in part, with any
|
|
80
|
+
other implementation, instance or deployment of the AudienceKit API or
|
|
81
|
+
of a compatible API, whether You, the Licensor's customer or any third
|
|
82
|
+
party hosts it, or with a proxy, emulator or service that stands in for
|
|
83
|
+
the Hosted Service;
|
|
84
|
+
b. using the Software or a Modification to build, test, benchmark or
|
|
85
|
+
operate such an implementation, or a product or service that replaces or
|
|
86
|
+
competes with the Hosted Service;
|
|
87
|
+
c. porting, extracting or adapting the Software, or substantial parts of
|
|
88
|
+
it, for use with any other service; and
|
|
89
|
+
d. removing, disabling, falsifying or circumventing how the Software
|
|
90
|
+
identifies an application or audience to the Hosted Service, including
|
|
91
|
+
any Audience Credential.
|
|
92
|
+
|
|
93
|
+
6. Other uses: written permission and an Audience Credential
|
|
94
|
+
|
|
95
|
+
A use that Section 4 does not permit is licensed only if, before that use
|
|
96
|
+
begins, You have both:
|
|
97
|
+
|
|
98
|
+
a. the Licensor's express permission for that use, in a written agreement
|
|
99
|
+
signed by an authorized officer of Love Wins Media, Inc. that describes
|
|
100
|
+
the use; and
|
|
101
|
+
b. an Audience Credential that the Licensor issued for that use, which You
|
|
102
|
+
must use only for that use and keep configured in the Software or
|
|
103
|
+
Modification You use, so that the use can be identified and its
|
|
104
|
+
compliance verified.
|
|
105
|
+
|
|
106
|
+
The Licensor may grant, refuse or set conditions on such permission at its
|
|
107
|
+
sole discretion. Permission is never implied from conduct, delay, access
|
|
108
|
+
to the source code, or the issue of an Audience Credential alone. It ends
|
|
109
|
+
when the written agreement ends or the Licensor revokes the Audience
|
|
110
|
+
Credential, and the written agreement controls where it differs from this
|
|
111
|
+
license.
|
|
112
|
+
|
|
113
|
+
7. No misrepresentation
|
|
114
|
+
|
|
115
|
+
You must not misrepresent the Software or the Licensor's work. In
|
|
116
|
+
particular, You must not:
|
|
117
|
+
|
|
118
|
+
a. claim or imply that You or anyone other than the Licensor wrote, owns
|
|
119
|
+
or originated the Software or any part of it;
|
|
120
|
+
b. remove, alter or obscure any copyright, authorship or license notice
|
|
121
|
+
in the Software;
|
|
122
|
+
c. present a Modification, or a work based on the Software, as the
|
|
123
|
+
Licensor's original work, or present the Software as Yours; or
|
|
124
|
+
d. claim or imply that the Licensor sponsors, endorses, approves or is
|
|
125
|
+
affiliated with You, a Modification or an application, unless the
|
|
126
|
+
Licensor has agreed to it in writing.
|
|
127
|
+
|
|
128
|
+
This prohibition is express. Any misrepresentation is a material breach
|
|
129
|
+
of this license and is not a use this license permits. It may also
|
|
130
|
+
violate laws on copyright management information, false designation of
|
|
131
|
+
origin, false endorsement or unfair competition, and nothing in this
|
|
132
|
+
license waives any right or remedy the Licensor has under them.
|
|
133
|
+
|
|
134
|
+
8. Modifications only in forks, after written notice
|
|
135
|
+
|
|
136
|
+
You may make a Modification only if both of these are true:
|
|
137
|
+
|
|
138
|
+
a. it is made and kept in a fork of the Licensor's own repository of the
|
|
139
|
+
Software, created with the fork function of the service where the
|
|
140
|
+
Licensor publishes that repository (for example, GitHub), so that the
|
|
141
|
+
fork shows its link to the Licensor's repository; and
|
|
142
|
+
b. before You make it, You give the Licensor written notice that names
|
|
143
|
+
You, gives a way to contact You, and identifies the fork. You may give
|
|
144
|
+
notice by opening an issue titled "Derived work notice" in the
|
|
145
|
+
Licensor's repository, or by any other written means the Licensor
|
|
146
|
+
accepts in writing.
|
|
147
|
+
|
|
148
|
+
A Modification made any other way is not licensed. An application that
|
|
149
|
+
only calls, links or depends on the unchanged Software is not a
|
|
150
|
+
Modification and needs no fork or notice.
|
|
151
|
+
|
|
152
|
+
9. Distribution and notices
|
|
153
|
+
|
|
154
|
+
You may distribute copies of the Software and Modifications, in source or
|
|
155
|
+
binary form, on their own or as part of Permitted Applications, if You:
|
|
156
|
+
|
|
157
|
+
a. include a copy of this license, or a notice that says where to find
|
|
158
|
+
it, and keep the copyright notices above;
|
|
159
|
+
b. license every Modification under this license, so that Sections 4 to 8
|
|
160
|
+
apply to it as they apply to the Software, and mark it as changed
|
|
161
|
+
from the Software; and
|
|
162
|
+
c. comply with Section 7.
|
|
163
|
+
|
|
164
|
+
A Permitted Application that includes the Software or a Modification may
|
|
165
|
+
carry its own license for the rest of its code, so long as the Software
|
|
166
|
+
and the Modification within it stay under this license and Sections 4 to
|
|
167
|
+
8 apply to the application's use of them.
|
|
168
|
+
|
|
169
|
+
10. Patent license and patent defense
|
|
170
|
+
|
|
171
|
+
The Licensor grants You a patent license for the Software that covers
|
|
172
|
+
patent claims the Licensor can license, or becomes able to license, that
|
|
173
|
+
You would infringe by using the Software as this license permits. If You
|
|
174
|
+
or Your company make any written claim that the Software infringes or
|
|
175
|
+
contributes to infringement of any patent, Your patent license for the
|
|
176
|
+
Software ends immediately.
|
|
177
|
+
|
|
178
|
+
11. No other rights
|
|
179
|
+
|
|
180
|
+
The licenses in Sections 3 and 10 are the only licenses granted. No other
|
|
181
|
+
license or right of any kind is granted, whether expressly, by
|
|
182
|
+
implication, by estoppel, by exhaustion or otherwise, and the Licensor
|
|
183
|
+
reserves every right this license does not expressly grant. This license
|
|
184
|
+
does not grant access
|
|
185
|
+
to the Hosted Service, which is governed by the Licensor's terms of
|
|
186
|
+
service, and does not grant any right to use the names, logos or
|
|
187
|
+
trademarks of the Licensor, of AudienceKit, or of any audience or
|
|
188
|
+
application, except to describe the origin of the Software as Section 9
|
|
189
|
+
requires.
|
|
190
|
+
|
|
191
|
+
12. Violations
|
|
192
|
+
|
|
193
|
+
The first time You are notified in writing that You have violated any of
|
|
194
|
+
these terms, or done anything with the Software that this license does not
|
|
195
|
+
permit, Your licenses can continue if You come into full compliance, and
|
|
196
|
+
stop the violating use, within 30 days of the notice. Otherwise all Your
|
|
197
|
+
licenses end immediately. The Licensor may also revoke any Audience
|
|
198
|
+
Credential used in a violation. Use of the Software after Your licenses end
|
|
199
|
+
is unlicensed. Sections 1, 2, 5, 7, 11, 13 and 14 survive the end of Your
|
|
200
|
+
licenses.
|
|
201
|
+
|
|
202
|
+
13. Disclaimer of warranty and limitation of liability
|
|
203
|
+
|
|
204
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OR CONDITION OF ANY
|
|
205
|
+
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
206
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. AS
|
|
207
|
+
FAR AS THE LAW ALLOWS, IN NO EVENT SHALL THE LICENSOR OR THE COPYRIGHT
|
|
208
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
209
|
+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
210
|
+
CONNECTION WITH THESE TERMS, THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
211
|
+
THE SOFTWARE.
|
|
212
|
+
|
|
213
|
+
14. Earlier versions
|
|
214
|
+
|
|
215
|
+
Copies of the Software that the Licensor released under the MIT License,
|
|
216
|
+
or under an earlier version of this license, before this version was
|
|
217
|
+
adopted remain available to their recipients under the terms they were
|
|
218
|
+
released with. The Software's README lists those releases. This version
|
|
219
|
+
applies to the Software from the first release that carries it.
|
data/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# Audience::Kit
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
|
3
|
+
Ruby bindings for the AudienceKit API. Requires Ruby 3.2 or newer.
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
@@ -22,22 +20,39 @@ Or install it yourself as:
|
|
|
22
20
|
|
|
23
21
|
## Usage
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
```ruby
|
|
24
|
+
require "audience-kit"
|
|
25
|
+
|
|
26
|
+
Audience::Kit.configure do |c|
|
|
27
|
+
c.token = ENV["AUDIENCE_KIT_TOKEN"] # optional bearer token
|
|
28
|
+
c.base_url = "https://api.audiencekit.io" # the default
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
Audience::Kit::Venue.find(1).data # => { "id" => 1, ... }
|
|
32
|
+
Audience::Kit::Event.find(42).data
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
HTTP failures raise `Audience::Kit::Error`.
|
|
26
36
|
|
|
27
37
|
## Development
|
|
28
38
|
|
|
29
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake
|
|
39
|
+
After checking out the repo, `cd ruby` and run `bin/setup` to install dependencies. Then, run `bundle exec rake` to run the specs and RuboCop. The specs measure coverage with SimpleCov (`coverage/index.html`); every line and branch of `lib/` is covered, and CI fails if a change leaves any uncovered. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
30
40
|
|
|
31
|
-
To install this gem onto your local machine, run `bundle exec rake install`.
|
|
41
|
+
To install this gem onto your local machine, run `bundle exec rake install`. The gem keeps its own version in `lib/audience-kit/version.rb`, separate from the Swift and Kotlin SDKs' `VERSION`. Releases publish themselves: once a change that raises the version (with a `CHANGELOG.md` entry) merges to `main`, the `release` job in `.github/workflows/ruby.yml` builds the gem and pushes it to [rubygems.org](https://rubygems.org/gems/audience-kit) with RubyGems trusted publishing (no API key is stored), then tags the commit `ruby-<version>`. Don't use `bundle exec rake release`, which would push a bare version tag that the Swift package's release tags share.
|
|
32
42
|
|
|
33
43
|
## Contributing
|
|
34
44
|
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
45
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/lwm-luminx/audience-kit-sdk (the gem lives in `ruby/`). This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/lwm-luminx/audience-kit-sdk/blob/main/ruby/CODE_OF_CONDUCT.md).
|
|
36
46
|
|
|
37
47
|
## License
|
|
38
48
|
|
|
39
|
-
|
|
49
|
+
Source-available under the [AudienceKit SDK License](LICENSE) 1.2 (`LicenseRef-AudienceKit-SDK-1.2`), © Love Wins
|
|
50
|
+
Media, Inc.: use it only in apps that connect to AudienceKit as hosted by Love Wins Media. Every other use is
|
|
51
|
+
prohibited without Love Wins Media's written permission and an audience ID or token issued for that use. No other
|
|
52
|
+
license is granted, misrepresenting the work is prohibited, and changed versions may be made only in a fork after
|
|
53
|
+
written notice. See the
|
|
54
|
+
[root README](../README.md#license) for details.
|
|
40
55
|
|
|
41
56
|
## Code of Conduct
|
|
42
57
|
|
|
43
|
-
Everyone interacting in the Audience::Kit project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/
|
|
58
|
+
Everyone interacting in the Audience::Kit project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/lwm-luminx/audience-kit-sdk/blob/main/ruby/CODE_OF_CONDUCT.md).
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Audience
|
|
4
|
+
module Kit
|
|
5
|
+
# A event fetched from the AudienceKit API; +data+ is the raw JSON hash.
|
|
6
|
+
class Event
|
|
7
|
+
attr_reader :data
|
|
8
|
+
|
|
9
|
+
def self.find(id)
|
|
10
|
+
new Kit.get("/v1/events/#{id}")["event"]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def initialize(data)
|
|
14
|
+
@data = data
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Audience
|
|
4
|
+
module Kit
|
|
5
|
+
# A venue fetched from the AudienceKit API; +data+ is the raw JSON hash.
|
|
6
|
+
class Venue
|
|
7
|
+
attr_reader :data
|
|
8
|
+
|
|
9
|
+
def self.find(id)
|
|
10
|
+
new Kit.get("/v1/venues/#{id}")["venue"]
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def initialize(data)
|
|
14
|
+
@data = data
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
data/lib/audience-kit/version.rb
CHANGED
data/lib/audience-kit.rb
CHANGED
|
@@ -1,10 +1,53 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "faraday"
|
|
4
|
+
|
|
3
5
|
require_relative "audience-kit/version"
|
|
4
6
|
|
|
5
7
|
module Audience
|
|
8
|
+
# Ruby client for the AudienceKit API.
|
|
9
|
+
#
|
|
10
|
+
# Audience::Kit.configure { |c| c.token = "..." }
|
|
11
|
+
# Audience::Kit::Venue.find(1).data
|
|
6
12
|
module Kit
|
|
7
13
|
class Error < StandardError; end
|
|
8
|
-
|
|
14
|
+
|
|
15
|
+
DEFAULT_BASE_URL = "https://api.audiencekit.io"
|
|
16
|
+
|
|
17
|
+
class << self
|
|
18
|
+
attr_writer :base_url, :token, :connection
|
|
19
|
+
|
|
20
|
+
def base_url
|
|
21
|
+
@base_url || ENV.fetch("AUDIENCE_KIT_BASE_URL", DEFAULT_BASE_URL)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def token
|
|
25
|
+
@token || ENV.fetch("AUDIENCE_KIT_TOKEN", nil)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def configure
|
|
29
|
+
yield self
|
|
30
|
+
@connection = nil
|
|
31
|
+
self
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def connection
|
|
35
|
+
@connection ||= Faraday.new(url: base_url) do |f|
|
|
36
|
+
f.headers["Authorization"] = "Bearer #{token}" if token
|
|
37
|
+
f.request :json
|
|
38
|
+
f.response :json
|
|
39
|
+
f.response :raise_error
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def get(path)
|
|
44
|
+
connection.get(path).body
|
|
45
|
+
rescue Faraday::Error => e
|
|
46
|
+
raise Error, e.message
|
|
47
|
+
end
|
|
48
|
+
end
|
|
9
49
|
end
|
|
10
50
|
end
|
|
51
|
+
|
|
52
|
+
require_relative "audience-kit/event"
|
|
53
|
+
require_relative "audience-kit/venue"
|
data/sig/audience/kit.rbs
CHANGED
|
@@ -1,6 +1,31 @@
|
|
|
1
1
|
module Audience
|
|
2
2
|
module Kit
|
|
3
3
|
VERSION: String
|
|
4
|
-
|
|
4
|
+
DEFAULT_BASE_URL: String
|
|
5
|
+
|
|
6
|
+
class Error < StandardError
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
attr_writer self.base_url: String?
|
|
10
|
+
attr_writer self.token: String?
|
|
11
|
+
attr_writer self.connection: untyped
|
|
12
|
+
|
|
13
|
+
def self.base_url: () -> String
|
|
14
|
+
def self.token: () -> String?
|
|
15
|
+
def self.configure: () { (singleton(Kit)) -> void } -> singleton(Kit)
|
|
16
|
+
def self.connection: () -> untyped
|
|
17
|
+
def self.get: (String path) -> untyped
|
|
18
|
+
|
|
19
|
+
class Event
|
|
20
|
+
attr_reader data: Hash[String, untyped]
|
|
21
|
+
def self.find: (untyped id) -> Event
|
|
22
|
+
def initialize: (Hash[String, untyped] data) -> void
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
class Venue
|
|
26
|
+
attr_reader data: Hash[String, untyped]
|
|
27
|
+
def self.find: (untyped id) -> Venue
|
|
28
|
+
def initialize: (Hash[String, untyped] data) -> void
|
|
29
|
+
end
|
|
5
30
|
end
|
|
6
31
|
end
|
metadata
CHANGED
|
@@ -1,57 +1,54 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: audience-kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
8
|
-
autorequire:
|
|
7
|
+
- Love Wins Media, Inc.
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: faraday
|
|
15
14
|
requirement: !ruby/object:Gem::Requirement
|
|
16
15
|
requirements:
|
|
17
|
-
- - "
|
|
16
|
+
- - "~>"
|
|
18
17
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
18
|
+
version: '2.9'
|
|
20
19
|
type: :runtime
|
|
21
20
|
prerelease: false
|
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
22
|
requirements:
|
|
24
|
-
- - "
|
|
23
|
+
- - "~>"
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
27
|
-
description:
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
version: '2.9'
|
|
26
|
+
description: |
|
|
27
|
+
Ruby client for AudienceKit, the platform behind Hot Mess. Source-available under the AudienceKit SDK License 1.2:
|
|
28
|
+
use it only with AudienceKit as hosted by Love Wins Media, Inc. See LICENSE.
|
|
30
29
|
executables: []
|
|
31
30
|
extensions: []
|
|
32
31
|
extra_rdoc_files: []
|
|
33
32
|
files:
|
|
34
33
|
- CHANGELOG.md
|
|
35
|
-
- CODE_OF_CONDUCT.md
|
|
36
|
-
- Gemfile
|
|
37
34
|
- LICENSE
|
|
38
|
-
- LICENSE.txt
|
|
39
35
|
- README.md
|
|
40
|
-
- Rakefile
|
|
41
|
-
- bin/console
|
|
42
|
-
- bin/setup
|
|
43
36
|
- lib/audience-kit.rb
|
|
37
|
+
- lib/audience-kit/event.rb
|
|
38
|
+
- lib/audience-kit/venue.rb
|
|
44
39
|
- lib/audience-kit/version.rb
|
|
45
40
|
- sig/audience/kit.rbs
|
|
46
|
-
homepage: https://audiencekit.
|
|
41
|
+
homepage: https://audiencekit.com
|
|
47
42
|
licenses:
|
|
48
|
-
-
|
|
43
|
+
- LicenseRef-AudienceKit-SDK-1.2
|
|
49
44
|
metadata:
|
|
50
45
|
allowed_push_host: https://rubygems.org
|
|
51
|
-
homepage_uri: https://audiencekit.
|
|
52
|
-
source_code_uri: https://github.com/
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
homepage_uri: https://audiencekit.com
|
|
47
|
+
source_code_uri: https://github.com/lwm-luminx/audience-kit-sdk/tree/main/ruby
|
|
48
|
+
documentation_uri: https://developer.audiencekit.com/sdks/ruby/
|
|
49
|
+
bug_tracker_uri: https://github.com/lwm-luminx/audience-kit-sdk/issues
|
|
50
|
+
changelog_uri: https://github.com/lwm-luminx/audience-kit-sdk/blob/main/ruby/CHANGELOG.md
|
|
51
|
+
rubygems_mfa_required: 'true'
|
|
55
52
|
rdoc_options: []
|
|
56
53
|
require_paths:
|
|
57
54
|
- lib
|
|
@@ -59,15 +56,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
59
56
|
requirements:
|
|
60
57
|
- - ">="
|
|
61
58
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: 2
|
|
59
|
+
version: '3.2'
|
|
63
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
64
61
|
requirements:
|
|
65
62
|
- - ">="
|
|
66
63
|
- !ruby/object:Gem::Version
|
|
67
64
|
version: '0'
|
|
68
65
|
requirements: []
|
|
69
|
-
rubygems_version: 3.
|
|
70
|
-
signing_key:
|
|
66
|
+
rubygems_version: 3.6.9
|
|
71
67
|
specification_version: 4
|
|
72
|
-
summary: AudienceKit SDK
|
|
68
|
+
summary: 'AudienceKit SDK for Ruby: an audience''s venues and events over the AudienceKit
|
|
69
|
+
API'
|
|
73
70
|
test_files: []
|
data/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
# Contributor Covenant Code of Conduct
|
|
2
|
-
|
|
3
|
-
## Our Pledge
|
|
4
|
-
|
|
5
|
-
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
6
|
-
|
|
7
|
-
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
8
|
-
|
|
9
|
-
## Our Standards
|
|
10
|
-
|
|
11
|
-
Examples of behavior that contributes to a positive environment for our community include:
|
|
12
|
-
|
|
13
|
-
* Demonstrating empathy and kindness toward other people
|
|
14
|
-
* Being respectful of differing opinions, viewpoints, and experiences
|
|
15
|
-
* Giving and gracefully accepting constructive feedback
|
|
16
|
-
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
17
|
-
* Focusing on what is best not just for us as individuals, but for the overall community
|
|
18
|
-
|
|
19
|
-
Examples of unacceptable behavior include:
|
|
20
|
-
|
|
21
|
-
* The use of sexualized language or imagery, and sexual attention or
|
|
22
|
-
advances of any kind
|
|
23
|
-
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
24
|
-
* Public or private harassment
|
|
25
|
-
* Publishing others' private information, such as a physical or email
|
|
26
|
-
address, without their explicit permission
|
|
27
|
-
* Other conduct which could reasonably be considered inappropriate in a
|
|
28
|
-
professional setting
|
|
29
|
-
|
|
30
|
-
## Enforcement Responsibilities
|
|
31
|
-
|
|
32
|
-
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
33
|
-
|
|
34
|
-
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
35
|
-
|
|
36
|
-
## Scope
|
|
37
|
-
|
|
38
|
-
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
39
|
-
|
|
40
|
-
## Enforcement
|
|
41
|
-
|
|
42
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at rickmark@outlook.com. All complaints will be reviewed and investigated promptly and fairly.
|
|
43
|
-
|
|
44
|
-
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
45
|
-
|
|
46
|
-
## Enforcement Guidelines
|
|
47
|
-
|
|
48
|
-
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
49
|
-
|
|
50
|
-
### 1. Correction
|
|
51
|
-
|
|
52
|
-
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
53
|
-
|
|
54
|
-
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
55
|
-
|
|
56
|
-
### 2. Warning
|
|
57
|
-
|
|
58
|
-
**Community Impact**: A violation through a single incident or series of actions.
|
|
59
|
-
|
|
60
|
-
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
61
|
-
|
|
62
|
-
### 3. Temporary Ban
|
|
63
|
-
|
|
64
|
-
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
65
|
-
|
|
66
|
-
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
67
|
-
|
|
68
|
-
### 4. Permanent Ban
|
|
69
|
-
|
|
70
|
-
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
71
|
-
|
|
72
|
-
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
73
|
-
|
|
74
|
-
## Attribution
|
|
75
|
-
|
|
76
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
|
|
77
|
-
available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
|
78
|
-
|
|
79
|
-
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
|
|
80
|
-
|
|
81
|
-
[homepage]: https://www.contributor-covenant.org
|
|
82
|
-
|
|
83
|
-
For answers to common questions about this code of conduct, see the FAQ at
|
|
84
|
-
https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
|
data/Gemfile
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
source "https://rubygems.org"
|
|
4
|
-
|
|
5
|
-
# Specify your gem's dependencies in audience-kit.gemspec
|
|
6
|
-
gemspec
|
|
7
|
-
|
|
8
|
-
group :development, :test do
|
|
9
|
-
gem "rake", "~> 13.0"
|
|
10
|
-
|
|
11
|
-
gem "rspec", "~> 3.0"
|
|
12
|
-
|
|
13
|
-
gem "rubocop", "~> 1.21"
|
|
14
|
-
|
|
15
|
-
gem 'overcommit'
|
|
16
|
-
end
|
data/LICENSE.txt
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 Rick Mark
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|
data/Rakefile
DELETED
data/bin/console
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
require "bundler/setup"
|
|
5
|
-
require "audience/kit"
|
|
6
|
-
|
|
7
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
|
8
|
-
# with your gem easier. You can also use a different console, if you like.
|
|
9
|
-
|
|
10
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
|
11
|
-
# require "pry"
|
|
12
|
-
# Pry.start
|
|
13
|
-
|
|
14
|
-
require "irb"
|
|
15
|
-
IRB.start(__FILE__)
|