Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Tropo            Adam Kalsey
www.Tropo.com   akalsey@voxeo.com
  @tropo              @akalsey
http://www.flickr.com/photos/chefranden/
http://www.flickr.com/photos/malias/
http://www.flickr.com/photos/thatguyfromcchs08/
include Java
import java.lang.ArrayList
import javax.swing.JFrame

list = ArrayList.new
frame = JFrame.new("Ruby SWINGS!")...
http://www.flickr.com/photos/yakobusan/
http://www.flickr.com/photos/thisisbossi/
include_class 'java.lang.String'
include_class('java.lang.String')
{|package,name| "J#{name}"}
1. Download & unpack jRuby
2. ???
3. Profit
Demo Time
bin/gem install <package>
Demo Time
http://www.flickr.com/photos/oneaustin/
http://www.flickr.com/photos/underbiteman/
• Call       • Say
• Answer     • Ask
• Transfer   • Record
• Reject     • Conference
• Hangup
answer
say 'Yes, this works across
channels.'
hangup
Mozilla Rhino
Quercus




     JRuby


    Python
  Jython
answer

options = { :choices => '1 (1,sales), 2 (2 support)' }
result = ask 'Hi. For sales, say Sales or press 1. For
    ...
def ask (ttsOrUrl, options={})

 ...

      result = call.prompt(ttsOrUrl,
                           localOptions[:voice]...
public Map<String, Object> prompt(final String ttsOrUrl,
final String ttsResourceName, ...) {
    LOG.info(this + "->promp...
Call or SMS: (407) 374-9954


GTalk, XMPP: bartdemo@tropo.im


Twitter: @tropobart


http://github.com/voxeo/tropo-samples/
Tropo            Adam Kalsey
www.Tropo.com   akalsey@voxeo.com
  @tropo              @akalsey
Introduction to jRuby
Introduction to jRuby
Upcoming SlideShare
Loading in …5
×

Introduction to jRuby

1,411 views

Published on

jRuby allows a developer to run Ruby applications in a Java Virtual Machine. Adam Kalsey from Tropo explains why you'd want to do that, what jRuby can do for you, and show how Tropo uses jRuby in building a real-time communications cloud service. Includes how to deploy apps on jRuby, and some of the pitfalls to watch out for.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Introduction to jRuby

  1. 1. Tropo Adam Kalsey www.Tropo.com akalsey@voxeo.com @tropo @akalsey
  2. 2. http://www.flickr.com/photos/chefranden/
  3. 3. http://www.flickr.com/photos/malias/
  4. 4. http://www.flickr.com/photos/thatguyfromcchs08/
  5. 5. include Java import java.lang.ArrayList import javax.swing.JFrame list = ArrayList.new frame = JFrame.new("Ruby SWINGS!") list << frame list.each {|f| f.set_size(200,200) }
  6. 6. http://www.flickr.com/photos/yakobusan/
  7. 7. http://www.flickr.com/photos/thisisbossi/
  8. 8. include_class 'java.lang.String'
  9. 9. include_class('java.lang.String') {|package,name| "J#{name}"}
  10. 10. 1. Download & unpack jRuby 2. ??? 3. Profit
  11. 11. Demo Time
  12. 12. bin/gem install <package>
  13. 13. Demo Time
  14. 14. http://www.flickr.com/photos/oneaustin/
  15. 15. http://www.flickr.com/photos/underbiteman/
  16. 16. • Call • Say • Answer • Ask • Transfer • Record • Reject • Conference • Hangup
  17. 17. answer say 'Yes, this works across channels.' hangup
  18. 18. Mozilla Rhino Quercus JRuby Python Jython
  19. 19. answer options = { :choices => '1 (1,sales), 2 (2 support)' } result = ask 'Hi. For sales, say Sales or press 1. For support, say Support or press 2.', options if result.name == 'choice' case result.value when '1' say 'Your money is important to us.' when '2' say 'Your call will be ignored in the order received.' end end hangup
  20. 20. def ask (ttsOrUrl, options={}) ... result = call.prompt(ttsOrUrl, localOptions[:voice], localOptions[:recognizer], localOptions[:bargein], localOptions[:grammar], localOptions[:terminator], localOptions[:choiceConfidence], localOptions[:choiceMode], localOptions[:timeout]) if (result.get('event.name')) ...
  21. 21. public Map<String, Object> prompt(final String ttsOrUrl, final String ttsResourceName, ...) { LOG.info(this + "->prompt("" + ttsOrUrl + "", ... )"); Map<String, Object> retval = null; try { assertReady("prompt", Call.State.ANSWERED); if (!Strings.isEmpty(termChar) && Strings.isEmpty (grammar)) { log("termChar with no grammar. Setting grammar to equal termChar: " + termChar); grammar = termChar; termChar = null; } ...
  22. 22. Call or SMS: (407) 374-9954 GTalk, XMPP: bartdemo@tropo.im Twitter: @tropobart http://github.com/voxeo/tropo-samples/
  23. 23. Tropo Adam Kalsey www.Tropo.com akalsey@voxeo.com @tropo @akalsey

×