jsonrpc-middleware 0.1.0 → 0.3.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/.aiexclude +5 -0
- data/.claude/commands/document.md +105 -0
- data/.claude/docs/yard.md +602 -0
- data/.claude/settings.local.json +2 -1
- data/.env.example +5 -0
- data/.tool-versions +1 -1
- data/CHANGELOG.md +38 -2
- data/CLAUDE.md +114 -0
- data/README.md +42 -102
- data/Rakefile +59 -1
- data/examples/README.md +38 -0
- data/examples/procedures.rb +6 -1
- data/examples/rack/Gemfile.lock +6 -6
- data/examples/rack/README.md +26 -1
- data/examples/rack/app.rb +1 -1
- data/examples/rack-echo/Gemfile.lock +6 -6
- data/examples/rack-echo/README.md +23 -1
- data/examples/rack-single-file/README.md +37 -0
- data/examples/rack-single-file/config.ru +54 -0
- data/examples/rails/.gitignore +21 -0
- data/examples/rails/Gemfile +15 -0
- data/examples/rails/Gemfile.lock +261 -0
- data/examples/rails/README.md +32 -0
- data/examples/rails/Rakefile +8 -0
- data/examples/rails/app/controllers/application_controller.rb +4 -0
- data/examples/rails/app/controllers/jsonrpc_controller.rb +44 -0
- data/examples/rails/bin/dev +4 -0
- data/examples/rails/bin/rails +6 -0
- data/examples/rails/bin/rake +6 -0
- data/examples/rails/bin/setup +28 -0
- data/examples/rails/config/application.rb +47 -0
- data/examples/rails/config/boot.rb +5 -0
- data/examples/rails/config/credentials.yml.enc +1 -0
- data/examples/rails/config/environment.rb +7 -0
- data/examples/rails/config/environments/development.rb +42 -0
- data/examples/rails/config/environments/production.rb +60 -0
- data/examples/rails/config/environments/test.rb +44 -0
- data/examples/rails/config/initializers/cors.rb +18 -0
- data/examples/rails/config/initializers/filter_parameter_logging.rb +10 -0
- data/examples/rails/config/initializers/inflections.rb +18 -0
- data/examples/rails/config/initializers/jsonrpc.rb +62 -0
- data/examples/rails/config/locales/en.yml +31 -0
- data/examples/rails/config/puma.rb +40 -0
- data/examples/rails/config/routes.rb +14 -0
- data/examples/rails/config.ru +8 -0
- data/examples/rails/public/robots.txt +1 -0
- data/examples/rails-single-file/README.md +23 -0
- data/examples/rails-single-file/config.ru +71 -0
- data/examples/rails-single-file-routing/README.md +53 -0
- data/examples/rails-single-file-routing/config.ru +62 -0
- data/examples/sinatra-classic/Gemfile +9 -0
- data/examples/sinatra-classic/Gemfile.lock +95 -0
- data/examples/sinatra-classic/README.md +32 -0
- data/examples/sinatra-classic/app.rb +52 -0
- data/examples/sinatra-classic/config.ru +6 -0
- data/examples/sinatra-modular/Gemfile +9 -0
- data/examples/sinatra-modular/Gemfile.lock +95 -0
- data/examples/sinatra-modular/README.md +32 -0
- data/examples/sinatra-modular/app.rb +57 -0
- data/examples/sinatra-modular/config.ru +6 -0
- data/lib/jsonrpc/batch_request.rb +67 -2
- data/lib/jsonrpc/batch_response.rb +56 -0
- data/lib/jsonrpc/configuration.rb +156 -14
- data/lib/jsonrpc/error.rb +83 -2
- data/lib/jsonrpc/errors/internal_error.rb +14 -2
- data/lib/jsonrpc/errors/invalid_params_error.rb +13 -1
- data/lib/jsonrpc/errors/invalid_request_error.rb +8 -0
- data/lib/jsonrpc/errors/method_not_found_error.rb +8 -0
- data/lib/jsonrpc/errors/parse_error.rb +8 -0
- data/lib/jsonrpc/helpers.rb +212 -21
- data/lib/jsonrpc/middleware.rb +211 -5
- data/lib/jsonrpc/notification.rb +58 -0
- data/lib/jsonrpc/parser.rb +30 -0
- data/lib/jsonrpc/railtie/method_constraint.rb +35 -0
- data/lib/jsonrpc/railtie.rb +58 -0
- data/lib/jsonrpc/request.rb +68 -1
- data/lib/jsonrpc/response.rb +76 -0
- data/lib/jsonrpc/validator.rb +67 -6
- data/lib/jsonrpc/version.rb +11 -1
- data/lib/jsonrpc.rb +56 -1
- metadata +53 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be698b3797653f7d1139c034b97f4be0895cc181f840c4fe3d9edfb9624fb0a2
|
4
|
+
data.tar.gz: 3276fd9d13964cf6fe92f9a64ffe5bfac21bef767b3fde94328bc744ca2c8731
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4da3b7c0bd1fedc61baa9b8c4e9dc7fbd90c60c3e8509a676bd72b35d224a5928280bb56c5c4a7c92a40e5958544b81544e8461a551be818b8dd41b433416c0
|
7
|
+
data.tar.gz: cd7f389f4bf622cd9191c19dbba17890fa260259bd590d8d4bf9629dfc49f7573a05b772f25050c283fedc3b7f1d3899828ae1009a3b5deb52bc9911264c94ab
|
@@ -0,0 +1,105 @@
|
|
1
|
+
# Document
|
2
|
+
|
3
|
+
Generates documentation for Ruby code using YARD with 100% coverage enforcement.
|
4
|
+
|
5
|
+
## Commands
|
6
|
+
|
7
|
+
Generate documentation:
|
8
|
+
```bash
|
9
|
+
bundle exec rake yard
|
10
|
+
```
|
11
|
+
|
12
|
+
Format YARD comments:
|
13
|
+
```bash
|
14
|
+
bundle exec rake yard:format
|
15
|
+
```
|
16
|
+
|
17
|
+
Verify 100% documentation coverage:
|
18
|
+
```bash
|
19
|
+
bundle exec rake verify_measurements
|
20
|
+
```
|
21
|
+
|
22
|
+
Check for documentation quality issues:
|
23
|
+
```bash
|
24
|
+
bundle exec rake yard:junk
|
25
|
+
```
|
26
|
+
|
27
|
+
Generate coverage report:
|
28
|
+
```bash
|
29
|
+
bundle exec rake yardstick_measure
|
30
|
+
```
|
31
|
+
|
32
|
+
## Configuration
|
33
|
+
|
34
|
+
Requires `.yardstick.yml` in project root with 100% threshold:
|
35
|
+
```yaml
|
36
|
+
threshold: 100
|
37
|
+
rules:
|
38
|
+
ApiTag::Presence: { enabled: true }
|
39
|
+
ApiTag::Inclusion: { enabled: true }
|
40
|
+
ApiTag::ProtectedMethod: { enabled: true }
|
41
|
+
ApiTag::PrivateMethod: { enabled: true }
|
42
|
+
ExampleTag: { enabled: true }
|
43
|
+
ReturnTag: { enabled: true }
|
44
|
+
Summary::Presence: { enabled: true }
|
45
|
+
Summary::Delimiter: { enabled: true }
|
46
|
+
```
|
47
|
+
|
48
|
+
## Coverage Report
|
49
|
+
|
50
|
+
After running measurement, check detailed line-by-line issues:
|
51
|
+
```bash
|
52
|
+
cat measurements/report.txt
|
53
|
+
```
|
54
|
+
|
55
|
+
Report shows specific file, line number, method, and documentation issues that need fixing.
|
56
|
+
|
57
|
+
## Documentation Standards
|
58
|
+
|
59
|
+
### Required Tags
|
60
|
+
- Every public/private method, class, and module requires `@api public` or `@api private`
|
61
|
+
- All parameters: `@param name [Type] Description`
|
62
|
+
- All returns: `@return [Type] Description` (use `[void]` if no return)
|
63
|
+
- Examples required for all public methods: `@example Description`
|
64
|
+
- Error conditions: `@raise [ExceptionClass] When this occurs`
|
65
|
+
|
66
|
+
### Type Notation
|
67
|
+
- Use `String` not `string`
|
68
|
+
- Arrays: `Array<String>` for string arrays
|
69
|
+
- Hashes: `Hash{String=>Object}` for hash types
|
70
|
+
- Use `Boolean` not `bool`, `Integer` not `int`
|
71
|
+
- Nullable types: `String, nil` or `String|nil`
|
72
|
+
|
73
|
+
### Formatting Rules
|
74
|
+
- Blank lines required between YARD tag groups
|
75
|
+
- Exception: `@param` and `@option` tags can be grouped together
|
76
|
+
- Wrap class/method names in `+` markers: `+PrivateKey+`
|
77
|
+
- Cross-reference related methods: `@see #other_method`
|
78
|
+
|
79
|
+
### Documentation Structure
|
80
|
+
```ruby
|
81
|
+
# Brief one-line summary ending with period.
|
82
|
+
#
|
83
|
+
# @api public
|
84
|
+
#
|
85
|
+
# @example Description of example
|
86
|
+
# code_example
|
87
|
+
# result # => expected_output
|
88
|
+
#
|
89
|
+
# @param name [Type] Description
|
90
|
+
# @param other [Type] Other description
|
91
|
+
#
|
92
|
+
# @return [Type] Description
|
93
|
+
#
|
94
|
+
# @raise [ExceptionClass] When this exception occurs
|
95
|
+
#
|
96
|
+
def method_name
|
97
|
+
end
|
98
|
+
```
|
99
|
+
|
100
|
+
## Integration
|
101
|
+
|
102
|
+
Documentation verification is included in the quality assurance pipeline:
|
103
|
+
```bash
|
104
|
+
bundle exec rake qa
|
105
|
+
```
|