Page 1 of 2

hpwRuby

PostPosted: Tue Apr 21, 2009 12:42 pm
by HPW
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!
;-)

Re: hpwRuby

PostPosted: Tue Apr 21, 2009 2:38 pm
by dpayer
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.

PostPosted: Wed Apr 22, 2009 12:24 am
by HPW
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.

;-)

PostPosted: Fri Apr 24, 2009 11:06 pm
by HPW
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.

PostPosted: Tue Apr 28, 2009 12:20 pm
by HPW
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)

PostPosted: Wed Apr 29, 2009 5:59 pm
by Apoleo
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

PostPosted: Wed Apr 29, 2009 11:35 pm
by HPW
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)

PostPosted: Thu Apr 30, 2009 5:23 pm
by Apoleo
Hi, thanks for reply.
Code: Select all
puts <something>

It works perfect and I can use any method of the matrix class. :D

PostPosted: Fri May 01, 2009 10:35 am
by HPW
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.

PostPosted: Wed Aug 19, 2009 1:00 pm
by HPW
Just released a new hpwRuby 1.02:

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

Recompiled without Win32.Induc delphi virus

Re: hpwRuby

PostPosted: Wed Oct 12, 2016 9:35 am
by HPW
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

Re: hpwRuby

PostPosted: Thu Oct 13, 2016 6:14 pm
by Neosoft Support
Thank you Hans-Peter!

Re: hpwRuby

PostPosted: Fri Oct 14, 2016 7:07 am
by HPW
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

Re: hpwRuby

PostPosted: Tue Oct 18, 2016 2:24 am
by reinier maliepaard
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

Re: hpwRuby

PostPosted: Sat Oct 22, 2016 4:12 am
by HPW
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