Tuscany SCA Native Samples - Ruby Calculator Sample
This is a very simple sample to show how an SCA composite can wire
together two Ruby components to implement a Calculator service and invoke
the service via a local client.
There are two sub projects in this workspace:
- sample.calculator
This contains the Ruby scripts and SCDL artifacts for the SCA Calculator
composite implementing the sample Calculator.
- sample.calculator.client
A sample client which does a local call to the Calculator service.
Additionally, there is the sample.calculator.app.composite file. This
describes the configuration of the SCA Calculator composite deployed to the SCA
runtime.
Building the Ruby samples on Linux and Mac OS X
If using the binary distribution the samples are built and installed in
<tuscany_sca_install_dir>/samples - go directly to Running the samples on Linux and Mac OS X.
- The following environment variables are required:
- TUSCANY_SCACPP=<path to installed Tuscany SCA>
- TUSCANY_SDOCPP=<path to installed Tuscany SDO>
- As the Ruby Calculator sample is based on Ruby scripts, a specific compilation step is not necessary -
only deployment is required. Deploy the Ruby samples only with the following command sequence:
- cd <tuscany_sca_install_dir>/samples
- ./configure --enable-ruby --enable-cpp=no --prefix=$TUSCANY_SCACPP/samples
- make install
NOTE: If you don't provide the --prefix configure option, it will by default install into
/usr/local/tuscany/sca/samples/RubyCalculator
Running the Ruby Calculator sample on Linux and Mac OS X
- The Ruby Calculator sample requires the following extension:
Please follow the documentation to ensure you have this extension built and installed
on your system
- The following environment variables are required:
- TUSCANY_SCACPP=<path to installed Tuscany SCA>
- TUSCANY_SDOCPP=<path to installed Tuscany SDO>
- Run the sample with the following commands:
- cd <tuscany_sca_install_dir>/samples/RubyCalculator/deploy/sample.calculator.client
- ./runclient.sh
Building the Ruby Calculator sample on Windows
If using the binary distribution the samples are built and installed in
<tuscany_sca_install_dir>\samples - go directly to Running the samples on Windows.
- The following environment variables are required:
- TUSCANY_SCACPP=<path to installed Tuscany SCA>
- TUSCANY_SDOCPP=<path to installed Tuscany SDO>
- As this sample is based on Ruby scripts, a specific compilation step is not necessary -
only deployment is required. Deploy the sample with the following commands:
- cd <tuscany_sca_install_dir>\samples\RubyCalculator
- deploy.bat
Running the Ruby Calculator sample on Windows
- The Ruby Calculator sample requires the following extension:
Please follow the documentation to ensure you have this extension built and installed
on your system
- The following environment variables are required:
- TUSCANY_SCACPP=<path to installed Tuscany SCA>
- TUSCANY_SDOCPP=<path to installed Tuscany SDO>
- Run the sample with the following commands:
- cd <tuscany_sca_install_dir>\samples\RubyCalculator\deploy\sample.calculator.client
- runclient.bat