https://github.com/ruby-processing/pconstants
Explore using processing PConstants with JRuby
https://github.com/ruby-processing/pconstants
constants java jruby jrubyart propane
Last synced: 2 months ago
JSON representation
Explore using processing PConstants with JRuby
- Host: GitHub
- URL: https://github.com/ruby-processing/pconstants
- Owner: ruby-processing
- License: gpl-3.0
- Created: 2017-07-03T12:34:39.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-10T13:27:40.000Z (almost 8 years ago)
- Last Synced: 2024-12-26T11:28:38.966Z (4 months ago)
- Topics: constants, java, jruby, jrubyart, propane
- Language: Java
- Homepage: https://ruby-processing.github.io/PConstants
- Size: 98.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PConstants
Exploring using processing [PConstants][pconstants] with JRuby, here is simple project that could help you to understand [propane][propane] and [JRubyArt][jruby_art].
Here only compile the PConstants.java (it has no external dependencies)
### Use simplicity of a custom Rakefile
```
rake
```### Or Use polyglot maven directly to create a java library
Read more about [polyglot maven here][polyglot]```bash
mvn package
```### The use ruby minitest to test and explore PConstants
```bash
cd test
jruby has_constants_test.rb
```What we confirm in the test that under JRuby `PConstants` is seen as a ruby module, and we only need to include the module to implement the interface. But it could have possible namespace issues.
### To experiment with different type of java constants
```bash
git checkout final_class # for PConstants as a final class (better practice than using an interface, but still frowned on)
# or
git checkout enum # Where there are enum version of seleceted PConstants (the use of global enum is also considered non-ideal)
# or for alternative means of accessing enums using :constant_missing, makes no sens to me
git checkout constant_missing # does not seem to me to have any advantages over include module method[pconstants]:https://github.com/processing/processing/blob/master/core/src/processing/core/PConstants.java
[propane]:https://ruby-processing.github.io/propane/
[jruby_art]:https://ruby-processing.github.io/JRubyArt/
[polyglot]:https://github.com/takari/polyglot-maven