mrutkows closed pull request #336: Add Ruby to list of runtimes
URL: https://github.com/apache/incubator-openwhisk-website/pull/336
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/_includes/code/hello.rb b/_includes/code/hello.rb
new file mode 100644
index 0000000..c53d1e6
--- /dev/null
+++ b/_includes/code/hello.rb
@@ -0,0 +1,5 @@
+def main(params = {})
+  name = params["name"] || "stranger"
+  greeting = "Hello #{name}!"
+  { "greeting": greeting }
+end
diff --git a/_includes/code/manifest-for-helloRuby-1.yaml 
b/_includes/code/manifest-for-helloRuby-1.yaml
new file mode 100644
index 0000000..7f29ca2
--- /dev/null
+++ b/_includes/code/manifest-for-helloRuby-1.yaml
@@ -0,0 +1,5 @@
+packages:
+    default:
+        actions:
+            hello_ruby:
+                function: hello.rb
diff --git a/_includes/code/manifest-for-helloRuby-2.yaml 
b/_includes/code/manifest-for-helloRuby-2.yaml
new file mode 100644
index 0000000..97cfffc
--- /dev/null
+++ b/_includes/code/manifest-for-helloRuby-2.yaml
@@ -0,0 +1,11 @@
+packages:
+    default:
+        actions:
+            hello_ruby:
+                code: |
+                    def main(params = {})
+                      name = params["name"] || "stranger"
+                      greeting = "Hello #{name}!"
+                      { "greeting": greeting }
+                    end
+                runtime: ruby:2.5
diff --git a/_layouts/documentation.html b/_layouts/documentation.html
index f31ff68..7afb146 100644
--- a/_layouts/documentation.html
+++ b/_layouts/documentation.html
@@ -83,6 +83,12 @@
                         <li><a href="#php-runtime">PHP Runtime</a></li>
                         <li><a href="#php-additional-resources">Additional 
Resources</a></li>
                     </ul>
+                    <li class="index-menu-toggle"><a href="#ruby">Ruby</a></li>
+                    <ul class="index-menuitems">
+                        <li><a href="#ruby-actions">Creating and Invoking 
Action</a></li>
+                        <li><a href="#ruby-runtime">Ruby Runtime</a></li>
+                        <li><a href="#ruby-additional-resources">Additional 
Resources</a></li>
+                    </ul>
                     <!--li class="index-menu-toggle"><a 
href="#swift">Swift</a></li>
                     <ul class="index-menuitems">
                         <li><a href="#swift-actions">Creating and Invoking 
Action</a></li>
@@ -215,6 +221,13 @@ <h4>Runtimes</h4>
                                 openwhisk-runtime-java
                         </a>
                     </p>
+                    <p class="repo-title border-deeper-sky-blue">
+                        <a
+                            
href="https://github.com/apache/incubator-openwhisk-runtime-ruby";
+                            title="Apache openwhisk ruby runtime">
+                                openwhisk-runtime-ruby
+                        </a>
+                    </p>
                 </div>
                 <div class="project-structure-repo theme-darkgoldenrod">
                     <h4>Deployments</h4>
@@ -828,6 +841,7 @@ <h4>Actions</h4>
                     <li><a href="#python">Python</a> - OpenWhisk runtime for 
Python 2.7 and 3</li>
                     <li><a 
href="https://github.com/apache/incubator-openwhisk-runtime-swift/blob/master/README.md";>Swift</a>
 - OpenWhisk runtime for Swift 3 and 4</li>
                     <li><a href="#java">Java</a> - OpenWhisk runtime for Java 
8</li>
+                    <li><a href="#ruby">Ruby</a> - OpenWhisk runtime for Ruby 
2.5</li>
                 </ul>
 
                 <p>
@@ -1358,6 +1372,100 @@ <h5>Additional Resources</h5>
             </div>
         </main>
 
+        <main class="doc">
+            <div class="content">
+                <a class="indexable" id="ruby"></a>
+                <h4>Ruby</h4>
+                <p></p>
+                <a class="indexable" id="ruby-actions"></a>
+                <h5>Creating and Invoking Ruby actions</h5>
+                <p>
+                    Let's look at how to write a sample hello world action in 
Ruby. You can visit
+                    <a 
href="https://github.com/apache/incubator-openwhisk/blob/master/docs/actions-ruby.md#creating-and-invoking-ruby-actions";>Creating
 and Invoking Ruby actions</a>
+                    page for further details.
+                </p>
+                <p>
+                    <strong>Note:</strong> We will be using <i>wsk</i> CLI in 
this section. If you don't have it installed and configured,
+                    please refer to the section on <a 
href="#wsk-cli">Configure the wsk CLI</a> to configure it.
+                </p>
+                <ol>
+                    <li style="list-style-type: decimal">
+                        Create a file named <i>hello.rb</i>:
+                        <div class="terminal">
+{% highlight ruby linenos %}
+{% include code/hello.rb %}
+{% endhighlight %}
+                        </div>
+                    </li>
+                    <li style="list-style-type: decimal">
+                        Create an action called <i>hello_ruby</i> using 
<i>hello.rb</i>:
+                        <div class="terminal">
+{% highlight bash %}$ wsk action create hello_ruby hello.rb{% endhighlight %}
+                        </div>
+                        <div class="terminal">
+{% highlight bash %}ok: created action hello_ruby{% endhighlight %}
+                        </div>
+                    </li>
+                    <li style="list-style-type: decimal">
+                        Invoke an action <i>hello_ruby</i>:
+                        <div class="terminal">
+{% highlight bash %}$ wsk action invoke hello_ruby --blocking --result --param 
name World{% endhighlight %}
+                        </div>
+                        <div class="terminal">
+{% highlight yaml %}
+{
+    "greeting": "Hello World!"
+}
+{% endhighlight %}
+                        </div>
+                    </li>
+                    <!--TODO: wskdeploy doesn't support ruby yet, uncomment 
the following once this pull request has been merged and released: 
https://github.com/apache/incubator-openwhisk-wskdeploy/pull/983 -->
+                    <!--<li style="list-style-type: decimal">
+                        Deploy using <i>wskdeploy</i>:
+                        <p>
+                            <strong>Note:</strong> We will be using 
<i>wskdeploy</i> in this section. If you don't have the binary,
+                            please refer to the section on <a 
href="#wskdeploy">Whisk Deploy</a> to download it.
+                        </p>
+                        <ol>
+                            <li>
+                                Create <i>manifest.yaml</i> with the following 
YAML content:
+                                <div class="terminal">
+{% highlight yaml linenos %}
+{% include code/manifest-for-helloRuby-1.yaml %}
+{% endhighlight %}
+                                </div>
+                                Or
+                                <p></p>
+                                <div class="terminal">
+{% highlight yaml linenos %}
+{% include code/manifest-for-helloRuby-2.yaml %}
+{% endhighlight %}
+                                </div>
+                            </li>
+                            <li>
+                                Run deployment with <i>wskdeploy</i>:
+                                <div class="terminal">
+{% highlight bash %}$ wskdeploy -m manifest.yaml{% endhighlight %}
+                                </div>
+                            </li>
+                        </ol>
+                    </li>-->
+                </ol>
+                <a class="indexable" id="ruby-runtime"></a>
+                <h5>OpenWhisk Runtime for Ruby</h5>
+                <p>
+                    OpenWhisk supports <strong>Ruby 2.5</strong> runtime.
+                    If you wish to learn more about Ruby runtime, please visit
+                    <a 
href="https://github.com/apache/incubator-openwhisk-runtime-ruby/blob/master/README.md";>Ruby
 Runtime GitHub Repository</a>.
+                </p>
+                <a class="indexable" id="ruby-additional-resources"></a>
+                <h5>Additional Resources</h5>
+                <ul>
+                    <li>Coming soon...</li>
+                </ul>
+            </div>
+        </main>
+
         <!--main class="doc">
             <div class="content">
                 <a class="indexable" id="swift"></a>
diff --git a/_layouts/home.html b/_layouts/home.html
index 579b1fb..e8e53c7 100644
--- a/_layouts/home.html
+++ b/_layouts/home.html
@@ -58,7 +58,8 @@ <h4>Write functions in any language</h4>
                 <b><a 
href="https://github.com/apache/incubator-openwhisk-runtime-go";>Go</a></b>,
                 <b><a 
href="https://github.com/apache/incubator-openwhisk-runtime-java";>Scala</a></b>,
                 <b><a 
href="https://github.com/apache/incubator-openwhisk-runtime-python";>Python</a></b>,
-                <b><a 
href="https://github.com/apache/incubator-openwhisk-runtime-php";>PHP</a></b>.
+                <b><a 
href="https://github.com/apache/incubator-openwhisk-runtime-php";>PHP</a></b> and
+                <b><a 
href="https://github.com/apache/incubator-openwhisk-runtime-ruby";>Ruby</a></b>.
             </p>
             <p>
                 If you need languages or libraries the current 
"out-of-the-box" runtimes do not support, you can create and customize your own 
executables as Zip Actions which run on the <b><a 
href="https://github.com/apache/incubator-openwhisk-runtime-docker/blob/master/README.md";>Docker</a></b>
 runtime by using the <b><a 
href="https://github.com/apache/incubator-openwhisk-runtime-docker/blob/master/sdk/docker/README.md";>Docker
 SDK</a></b>.  Some examples of how to support other languages using Docker 
Actions include <b><a 
href="https://medium.com/openwhisk/openwhisk-and-rust-lang-24025734a834";>Rust</a></b>,
 and <b><a href="https://github.com/rainbyte/openwhisk-wrapper";>Haskell</a></b>.


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to