ask-github 0.1.3 → 0.1.4

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +33 -36
  3. data/lib/ask/github/version.rb +1 -1
  4. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f0e1e42270acf35d49dbe2b9ddacde65159b7aacc9812ec6936e663c32063e9
4
- data.tar.gz: 95ab525daa2236b18f8eacf1bcf6ff1d9159a3616a2c2b0337575a57c29d7be0
3
+ metadata.gz: 6ae01ffdb62eea1500c1e9544915704dbcc34d18f27124a82f3a3ee59c93e92b
4
+ data.tar.gz: 03a155f16c3e4409ea7383b7b071f0c55d7bd729ec553c70d8e92020e9b72d8f
5
5
  SHA512:
6
- metadata.gz: 93d4c3b6bcc51abdb61b6d2a088cf14184ccd8e6eb53a8bd7bf833611fb13cb6b5fb234568f4843aec0216feedffc7e9e6ffc1966552ce9d2c41c0be4d25ec31
7
- data.tar.gz: e157ba7fe7bc3565eaca177cf26e5d46cbf96fee8fac978c2313c1efce784d703e2c2b8a4f78359826992e0387e127c6a623ee44bd1b157570a93a27678df45f
6
+ metadata.gz: d40f074e53dd7d58e15dce513200921f23ac344fd2f1b505efb36a9d871b407993920dcfe39cf6ee925b7b67465aba444c24a156722bc2226614cd7e241df817
7
+ data.tar.gz: 03210c203eff7072f09d372ec8cf536cdf06ea013eb5f479728b35d08a23f1b96bff56a884eeee8a5d244a4409db41553955732479b2026262f09bc5605915c1
data/README.md CHANGED
@@ -1,8 +1,12 @@
1
1
  # ask-github
2
2
 
3
- GitHub service context for AI agents in the ask-rb ecosystem.
3
+ [![Gem Version](https://badge.fury.io/rb/ask-github.svg)](https://badge.fury.io/rb/ask-github)
4
4
 
5
- Provides an authenticated Octokit client, metadata constants for system prompts, and a structured error guide for common GitHub API issues.
5
+ GitHub service context for AI agents in the ask-rb ecosystem. It provides an
6
+ authenticated Octokit client for the GitHub REST API, metadata constants for
7
+ system prompts, and a structured error guide for common GitHub API issues.
8
+
9
+ ## Installation
6
10
 
7
11
  ```ruby
8
12
  gem "ask-github"
@@ -10,8 +14,6 @@ gem "ask-github"
10
14
 
11
15
  ## Quick Start
12
16
 
13
- ### Get an authenticated client
14
-
15
17
  ```ruby
16
18
  require "ask-github"
17
19
 
@@ -23,47 +25,42 @@ client.contents("owner/repo", path: "Gemfile")
23
25
  client.search_issues("query")
24
26
  ```
25
27
 
26
- The client is an `Octokit::Client` wrapped in a proxy that converts `Octokit::Unauthorized` into `Ask::Auth::InvalidCredential` with actionable error messages.
27
-
28
- ### Authentication
29
-
30
- The client resolves a GitHub token via `Ask::Auth.resolve(:github_token)`. Tokens can be provided through any configured auth provider:
31
-
32
- 1. **Environment variable:** `GITHUB_TOKEN`
33
- 2. **Credentials file:** `~/.ask/credentials.yml`
34
- 3. **Rails credentials:** `Rails.application.credentials.github_token`
35
- 4. **OAuth / Database:** Custom providers
28
+ ## Authentication
36
29
 
37
- Generate a token at [github.com/settings/tokens](https://github.com/settings/tokens) with the `repo` and `read:org` scopes.
30
+ `Ask::GitHub.client` resolves a token via `Ask::Auth.resolve(:github_token)`.
31
+ Set it in your environment:
38
32
 
39
- ## Context Constants
33
+ ```bash
34
+ export GITHUB_TOKEN=your_token_here
35
+ ```
40
36
 
41
- Use these constants to build system prompts for AI agents:
37
+ Or add it to `~/.ask/credentials.yml`:
42
38
 
43
- | Constant | Value |
44
- |---|---|
45
- | `Ask::GitHub::DESCRIPTION` | "GitHub — code hosting, issues, pull requests, actions, packages" |
46
- | `Ask::GitHub::DOCS_URL` | https://docs.github.com/en/rest |
47
- | `Ask::GitHub::OPENAPI_URL` | https://api.github.com/openapi.json |
48
- | `Ask::GitHub::AUTH_NAME` | `:github_token` |
49
- | `Ask::GitHub::GEM_NAME` | `"octokit"` |
50
- | `Ask::GitHub::GEM_VERSION` | `"~> 9.0"` |
51
- | `Ask::GitHub::QUICK_START` | Copy-paste Ruby code snippet |
39
+ ```yaml
40
+ github_token: your_token_here
41
+ ```
52
42
 
53
- ## Error Guide
43
+ Credentials can also come from Rails credentials, a database, or an OAuth
44
+ provider, depending on your `ask-auth` configuration. Generate a token at
45
+ [github.com/settings/tokens](https://github.com/settings/tokens) with the
46
+ `repo` and `read:org` scopes.
54
47
 
55
- `Ask::GitHub::Errors` provides structured knowledge for agents:
48
+ ## Key entry points
56
49
 
57
- ```ruby
58
- Ask::GitHub::Errors.for("Octokit::NotFound")
59
- # => { message: "...", action: "..." }
50
+ - `Ask::GitHub.client` - an authenticated `Octokit::Client` (auto-paginating,
51
+ `per_page: 100`, retry middleware). It is wrapped in a proxy that converts
52
+ `Octokit::Unauthorized` into `Ask::Auth::InvalidCredential`.
53
+ - `Ask::GitHub::Errors` - structured error knowledge for agents: guidance by
54
+ exception class, HTTP status code descriptions, and rate limit info.
55
+ - `Ask::GitHub::DESCRIPTION`, `DOCS_URL`, `AUTH_NAME`, `GEM_NAME`,
56
+ `GEM_VERSION`, and `QUICK_START` - metadata constants for system prompts.
60
57
 
61
- Ask::GitHub::Errors.status_code_description(404)
62
- # => "Not Found — Resource does not exist or is private."
58
+ ## Full documentation
63
59
 
64
- Ask::GitHub::Errors::RATE_LIMIT[:authenticated]
65
- # => "5,000 requests per hour"
66
- ```
60
+ The full ask-rb documentation lives at https://ask-rb.github.io/ask-docs.
61
+ [Services: GitHub](https://ask-rb.github.io/ask-docs/services/github) covers
62
+ ask-github in depth, including the client, error guide, and constants.
63
+ API reference: https://ask-rb.github.io/ask-docs/reference/api.
67
64
 
68
65
  ## Development
69
66
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  module GitHub
5
- VERSION = "0.1.3"
5
+ VERSION = "0.1.4"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '0.1'
18
+ version: 0.3.2
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: '0.1'
25
+ version: 0.3.2
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: octokit
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
160
160
  - !ruby/object:Gem::Version
161
161
  version: '0'
162
162
  requirements: []
163
- rubygems_version: 4.0.3
163
+ rubygems_version: 4.0.18
164
164
  specification_version: 4
165
165
  summary: GitHub service context for the ask-rb ecosystem
166
166
  test_files: []