Source language: Translate to:

hpwRuby

Questions about NeoBook PlugIns

Moderator: Neosoft Support

hpwRuby

Postby HPW » Tue Apr 21, 2009 12:42 pm

Just released initial hpwRuby 1.0:

http://www.hpwsoft.de/anmeldung/html1/n ... ook22.html

hpwRubyConnect - Connect to the ruby-interpreter-DLL.
hpwRubyEval - Call a ruby-function and get a console-output and a return-string.

For a start into the language: http://www.ruby-lang.org/

Happy object-oriented scripting!
;-)
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwRuby

Postby dpayer » Tue Apr 21, 2009 2:38 pm

HPW wrote:Just released initial hpwRuby 1.0:

http://www.hpwsoft.de/anmeldung/html1/n ... ook22.html

hpwRubyConnect - Connect to the ruby-interpreter-DLL.
hpwRubyEval - Call a ruby-function and get a console-output and a return-string.

For a start into the language: http://www.ruby-lang.org/

Happy object-oriented scripting!
;-)


I sense there is a story behind your interest in Ruby. I know you have been a strong NewLisp advocate, what has drawn you to Ruby? Do you see some advantages of this language for your work or have you been able to solve problems with it that NewLisp was unable to solve as easily?

Thanks for your input and your willingness to share your talents with us all.

David P.
User avatar
dpayer
 
Posts: 1382
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby HPW » Wed Apr 22, 2009 12:24 am

I sense there is a story behind your interest in Ruby. I know you have been a strong NewLisp advocate, what has drawn you to Ruby?


Well, you know my major credo: Use the right tool to get the job done.

On my job I was first an autocad-user and gets involved with autolisp.
Lisp outside of autocad brings me to neobook/newLISP.
My newLISP interest is still strong
(Even hpwRuby supports a newLISP interface)
(A separate newLISP-Ruby interface is also in development)

Now is there a (relativ new) kid on the block: Google Sketchup
In its latest release it gets quite powerfull and its price is much more competitive than ACAD.
And it supports a scripting language! Which? Bingo: Ruby

So now starts the brainstorming: What tool for which job? What makes where sense.

Lots of new ideas!
hpwRuby is a first start in this context.

;-)
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby HPW » Fri Apr 24, 2009 11:06 pm

I upload a new zip with hpwRuby 1.0:

http://www.hpwsoft.de/anmeldung/html1/n ... ook22.html

Changed the used runtime-packer for a better vista-compatibility.
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby HPW » Tue Apr 28, 2009 12:20 pm

Just released a new hpwRuby 1.01:

http://www.hpwsoft.de/anmeldung/html1/n ... ook22.html

3 new callback-function exported from the plugin to allow ruby to call neobook
neobookPlayAction, neobookGetVar and neobookSetVar (See demo how to use them in ruby)

(The ruby extension Win32API.so is used here which shows how ruby can be used to call windows DLL's)
(Various other ruby libraries can offer much other interesting stuff)
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Apoleo » Wed Apr 29, 2009 5:59 pm

Hi,

I'm really interested in this plugin. I've begun to study Ruby to do little things. One of them is to create matrices.

To do this, it's necessary to include the Matrix class:

http://www.ruby-doc.org/stdlib/libdoc/m ... atrix.html

Code: Select all
require 'matrix'

The console returns : No such file to load -- matrix

So I try to put, in the same location the pub is, the libraries matrix.rb and e2mmap.rb. Now when I call to require 'matrix' the result is:
Code: Select all
Ruby> require 'matrix'
Return> True

The same result in the FXRI - Instant Ruby Enlightenment tool.
Code: Select all
irb(main):001:0> require 'matrix'
=> true

The problem comes when I want to create a new matrix, i.e.: Matrix[[1,2],[3,4]]

The 'FXRI' tool returns:
Code: Select all
irb(main):002:0> Matrix[[1,2],[3,4]]
=> Matrix[[1, 2], [3, 4]]


However, in Neobook the result is completly different:
Code: Select all
Ruby> Matrix[[1,2],[3,4]]
Return> True

I think, it return the result of last successful command action.

I know the access violation is commented and when I create the matrix the access violation is thrown

:!: Access violation at address 1000A8B1 in module 'msvcrt-ruby18.dll'. Read of address 00000040

Maybe other files are needed (libraries, bin,...) to run correctly any command on hpwRuby?

Finally, I must say thanks for this plugin!!

Saludos
User avatar
Apoleo
 
Posts: 88
Joined: Sat May 14, 2005 1:17 pm
Location: Sevilla, España

Postby HPW » Wed Apr 29, 2009 11:35 pm

First I test it with the test-app of the used delphi-compinent:

http://www.sourcepole.com/2006/9/1/embedding-ruby-in-kylix-delphi


Same result. So no direkt plugin-problem.
(Note: The author has abandoned the project because of the end of kylix-developement)

After some more thinking the problem seems to be that the matrix return is not processed properly.

But you can use it a bit different:

Code: Select all
require 'matrix'
puts Matrix[[1,2],[3,4]]  ** 2


returns on console: Matrix[[7, 10], [15, 22]]
(same as in fxri of V1.86)

(Of cource the librarys must be found)
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby Apoleo » Thu Apr 30, 2009 5:23 pm

Hi, thanks for reply.
Code: Select all
puts <something>

It works perfect and I can use any method of the matrix class. :D
User avatar
Apoleo
 
Posts: 88
Joined: Sat May 14, 2005 1:17 pm
Location: Sevilla, España

Postby HPW » Fri May 01, 2009 10:35 am

For those who want to avoid the ShowErrors "False" in the connect-button-action of the demo, can use the same solution:

Code: Select all
hpwRubyEval "puts @neobookPlayAction = Win32API.new([#34][hpwRubyDllName][#34], [#34]neobookPlayAction[#34], [#91]'P'[#93], 'P')" "[RubyConsole]" "[RubyReturn]"
hpwRubyEval "puts @neobookGetVar = Win32API.new([#34][hpwRubyDllName][#34], [#34]neobookGetVar[#34], [#91]'P'[#93], 'P')" "[RubyConsole]" "[RubyReturn]"
hpwRubyEval "puts @neobookSetVar = Win32API.new([#34][hpwRubyDllName][#34], [#34]neobookSetVar[#34], [#91]'P','P'[#93], 'P')" "[RubyConsole]" "[RubyReturn]"


So not the code itself was throwing the access violation, it was the processing of the return value.
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Postby HPW » Wed Aug 19, 2009 1:00 pm

Just released a new hpwRuby 1.02:

http://www.hpwsoft.de/anmeldung/html1/n ... ook22.html

Recompiled without Win32.Induc delphi virus
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwRuby

Postby HPW » Wed Oct 12, 2016 9:35 am

Just released a new hpwRuby 1.03:

http://www.hpwsoft.de/anmeldung/html1/n ... ook22.html

Bugfix: No more crash for ruby code without return-value

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwRuby

Postby Neosoft Support » Thu Oct 13, 2016 6:14 pm

Thank you Hans-Peter!
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: hpwRuby

Postby HPW » Fri Oct 14, 2016 7:07 am

Hello,

Unfortunatly the used delphi-ruby-component is currently not aktively developed.
http://blog.sourcepole.ch/2006/09/01/em ... ix-delphi/
So the plugin works only with the provided Dll-Version 1.8
The normal ruby-distribution is on Version 2.3.1

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Re: hpwRuby

Postby reinier maliepaard » Tue Oct 18, 2016 2:24 am

Hello,

Mayby useful for users of the Ruby plugin with the old DLL-version 1.8 of Hans-Peter Wickern two online sources:

1. https://www.tutorialspoint.com/ruby/ which covers Ruby 1.8.5
2. http://ruby-doc.com/docs/ProgrammingRuby/ which covers Ruby 1.6

After some experiments with the Ruby plugin of Hans-Peter, I can say that the plugin is excellent and worth working with it, extending your Neobook applications very easily.

Thanks Hans-Peter!

Best regards,
Reinier
reinier maliepaard
 
Posts: 30
Joined: Sat Jan 17, 2009 2:53 pm

Re: hpwRuby

Postby HPW » Sat Oct 22, 2016 4:12 am

Just upload a new hpwRuby 1.03a:

http://www.hpwsoft.de/anmeldung/html1/n ... ook22.html

New rhm_hpwRuby.pub provided by Reinier Maliepaard with more ruby samples.

Thanks to Reinier for providing the samples.

Regards
Hans-Peter
User avatar
HPW
 
Posts: 2519
Joined: Fri Apr 01, 2005 11:24 pm
Location: Germany

Next

Return to PlugIn Discussions

Who is online

Users browsing this forum: No registered users and 2 guests