Renshuu
Ruby wrapper for Renshuu, the Japanese learning platform.
Installation
bundle add renshuu
If Bundler is not being used to manage dependencies, install the gem by executing:
gem install renshuu
Usage
Configuration
The Renshuu gem can be configured either through environment variables or programmatically.
Environment variables
Name | Default | Description |
---|---|---|
‘RENSHUU_API_URL` | ‘api.renshuu.org` | URL to the Renshuu API |
‘RENSHUU_API_KEY` | Required | Used for authentication. You can find your user token on [Renshuu’s API page]. |
Programmatically
Renshuu.configure do |config|
config.api_url = '<CUSTOM_RENSHUU_URL>'
config.api_key = '<API_KEY>'
end
User profile
# Retrieves the user profile associated with the configured API key.
Renshuu::Profile.get
Kanji dictionary
# Searches the kanji dictionary
Renshuu::Kanji.search('eat')
Renshuu::Kanji.search('taberu')
Renshuu::Kanji.search('たべる')
# Retrieves a kanji from Renshuu's kanji dictionary
Renshuu::Kanji.get('紅')
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run bundle exec rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
.
Visual Studio Code workspace
The renshuu.code-workspace
file contains recommended settings and extensions to work with Visual Studio Code. Open the workspace by running code renshuu.code-workspace
.
Hot test runs
The development dependencies include Guard to run tests and generate documentation whenever you edit a file.
Run bundle exec guard
to start watching.
Contributing
Bug reports and pull requests are welcome on GitLab at gitlab.com/Richard-Degenne/renshuu. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Renshuu project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.