JSON parser ported from TypeScript to Ruby 3.3.9
MIT
Install all required gems for the project:
bundle install
Start the command-line interface for this library:
ruby bin/cli
Check your Ruby code for style and quality issues:
bundle exec rubocop
Automatically format your Ruby code to follow community standards:
bundle exec rubocop -x
Run the test suite to verify your code works as expected:
bundle exec rspec
Test Coverage: This project uses SimpleCov for test coverage reporting. Coverage reports are generated in the coverage/
directory and show current line coverage of 84.79%. Open coverage/index.html
in a browser to view detailed coverage reports.
To build the json-rb
gem locally for use in other projects without publishing:
mkdir -p pkg && gem build json_rb.gemspec --output pkg/json_rb-0.1.0.gem
This creates a json_rb-0.1.0.gem
file in the pkg/
directory.
Start the Grape-based API server:
bundle exec rackup api_grape/config.ru -p 8000 -s webrick
See api_rails/README.md for instructions on how to run the Rails API.
Start the Roda-based API server:
bundle exec rackup api_roda/config.ru -p 8000 -s webrick
Start the Sinatra-based API server:
The API will be available at http://localhost:8000.
bundle exec rackup api_sinatra/config.ru -p 8000 -s webrick
You can use the REST Client extension in VS Code to send requests to the API servers.
- Create a
.rest
file (seetestdata/
for examples). - Add a request, for example:
POST http://localhost:8000/api/v1/parse
Content-Type: application/json
{
"foo": "bar"
}
- Click "Send Request" above the request in VS Code to see the response.