kisa 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: c0b75293126c2e9df380d8bb6d4952c074f016b7d2788ccb3d073c8a53a0932a
4
+ data.tar.gz: 8f07fbba425c0a3625b0cd82d9f07a716702d95da40d5decc7bc4da40d71d39d
5
+ SHA512:
6
+ metadata.gz: 8b6fc556bfed588ed931d1d6d979cb6d2d667ac001135ac21ce3003a8ab4963788f0e81cd50f76c476b1a09ff7640c162e2ab7df6a2a762a92b15fb9fad6d870
7
+ data.tar.gz: 8d549800b8a3db533cd9e361bd1edd305267cb31762e3a7dad430666ed582a711aa5ea709d129ea295050db44fab2923be5589d8728e2318c9375d6b4d44aab6
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2025 S-H-GAMELINKS
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/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # Kisa(岐佐)
2
+
3
+ Kisa(岐佐) is simple Mastodon API Library.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ gem install kisa
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```ruby
14
+ conn = Kisa.new(url: "https://your.mastodon.server", headers: {'Authorization' => 'token'})
15
+
16
+ conn.user_stream do |event_type, data|
17
+ puts event_type
18
+ puts data
19
+ end
20
+ ```
21
+
22
+ ## Development
23
+
24
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
25
+
26
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
27
+
28
+ ## Contributing
29
+
30
+ Bug reports and pull requests are welcome on GitHub at https://github.com/S-H-GAMELINKS/kisa.
31
+
32
+ ## License
33
+
34
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ task default: %i[]
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Kisa
4
+ VERSION = "0.1.0"
5
+ end
data/lib/kisa.rb ADDED
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'faraday'
4
+ require_relative "kisa/version"
5
+
6
+ class Kisa
7
+ class Error < StandardError; end
8
+
9
+ def initialize(url:, headers:)
10
+ raise ArgumentError if url.nil?
11
+ raise ArgumentError if headers.nil?
12
+
13
+ @conn = Faraday.new(url:, headers:)
14
+ end
15
+
16
+ def user_stream
17
+ @conn.get('/api/v1/streaming/user') do |res|
18
+ res.options.on_data = proc do |event_type, data|
19
+ yield(event_type, data)
20
+ end
21
+ end
22
+ end
23
+ end
data/sig/kisa.rbs ADDED
@@ -0,0 +1,4 @@
1
+ module Kisa
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,49 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: kisa
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - S-H-GAMELINKS
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies: []
12
+ description: Kisa(岐佐) is simple Mastodon API Library
13
+ email:
14
+ - gamelinks007@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - LICENSE.txt
20
+ - README.md
21
+ - Rakefile
22
+ - lib/kisa.rb
23
+ - lib/kisa/version.rb
24
+ - sig/kisa.rbs
25
+ homepage: https://github.com/S-H-GAMELINKS/kisa
26
+ licenses:
27
+ - MIT
28
+ metadata:
29
+ homepage_uri: https://github.com/S-H-GAMELINKS/kisa
30
+ source_code_uri: https://github.com/S-H-GAMELINKS/kisa
31
+ changelog_uri: https://github.com/S-H-GAMELINKS/kisa
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: 3.1.0
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubygems_version: 3.7.0.dev
47
+ specification_version: 4
48
+ summary: Kisa(岐佐) is simple Mastodon API Library
49
+ test_files: []