#Contributing
Contributions, issues and pull requests are welcome. Please visit the GitHub home for this project.
#License
This code is under the Eclipse v2 license
#Source
JRuby Scripting openHAB is hosted on GitHub.
#Development Environment Setup
The development process has been tested on MacOS, and Ubuntu. Other operating systems may work.
- Install Ruby 2.6.8 and JRuby 9.3.8.0 (or later)
- Fork the repo and clone it
- Install bundler
- Run
bundler installfrom inside of the repo directory - To avoid conflicts, the openHAB development instance can use custom ports by defining these environment variables:
OPENHAB_HTTP_PORTOPENHAB_HTTPS_PORTOPENHAB_SSH_PORTOPENHAB_LSP_PORT
- Run
bundle exec rake openhab:setupfrom inside of the repo directory. This will download a copy of openHAB local in your development environment, start it and prepare it for JRuby openHAB Scripting Development - Install pre-commit and then run
pre-commit installif you would like to install a git pre-commit hook to automatically run rubocop.
#Code Documentation
Code documentation is written in Yard and the current documentation for this project is available on GitHub pages.
#Development Process
- Create a branch for your contribution.
- Write your tests the project uses Behavior Driven Development with RSpec. The spec directory has many examples. Feel free ask in your PR if you need help.
- Write your code.
- Verify your tests now pass by running
bin/rspec spec/<your spec file>_spec.rb. This requires JRuby. - Update the documentation, run
bin/yardocto view the rendered documentation locally - Lint your code with
bundle exec rake lint:rubocopand ensure you have not created any Rubocop violations. - Submit your PR(s)!
If you get stuck or need help along the way, please open an issue.