[MacRuby-devel] MacRuby Book expectations

2011-02-04 Thread Jean-Denis Muys

On 4 févr. 2011, at 05:53, "Perry E. Metzger"  wrote:
> 
> On Thu, 3 Feb 2011 17:35:08 -0800 Matt Aimonetti
>  wrote:
>> I don't really aim for this book to be a Cocoa book, but a MacRuby
>> book which is really hard since it's like writing a book about
>> Objective-C without covering Cocoa in depth.
> 
> It does make it a bit harder to use, though, for someone coming at
> this without an extensive Cocoa background...
> 
> -- 
> Perry E. Metzger  [email protected]
> 

I am at the other end of the spectrum: I am an experienced Cocoa/Objective-C 
programmer and a Ruby newbie.

I strongly believe that I am in the demographics for the book.

I don't expect the MacRuby book to teach me Ruby. Quite often, when reading the 
book (in its current form), I feel I don't understand the code snippets, simply 
because I don't know Ruby. What I do then, is put aside the MacRuby book, pull 
out a generic Ruby book (or Google), and research that part of Ruby I don't 
understand.

Granted, this slows me down considerably in my reading of the book, but I 
believe this is the correct way for me to learn.

I would suggest the converse is valid for experienced Ruby programmers. When 
you feel you don't understand some Cocoa bit, you can go to Apple documentation 
(on the web or from Xcode), and research it. It's rather good.

I don't think it is reasonable to expect that a MacRuby book should teach you 
Cocoa.That would be a different book, possibly titled "Cocoa Programming with 
MacRuby".

The example of Core Data is a good example. Core Data is a framework that I had 
a hard time understanding in the first place, irrespective of the language. 
Full books have been written about Core Data. It is not reasonable to expect 
the MacRuby book to teach you Core Data.

So what are *my* expectations for a MacRuby book?

I expect the book to address two facets of software development with MacRuby:

- How to integrate MacRuby in my software development tool set on the Mac. This 
includes  topics such as:
  • Using Xcode with MacRuby (other IDEs too when applicable).
  • How to use MacRuby to develop Cocoa Apps.
  • How to "add" MacRuby code to an Objective-C Cocoa App.
  • How to "add" Objective-C code to a MacRuby Cocoa App.
  • How to take advantage of Ruby's dynamisms in Cocoa. How to fix bugs without 
restarting the application for example.
  • How to debug (breakpoint, step, trace) MacRuby code in a Cocoa app from 
Xcode
  • How to add a REPL (Read Eval Print Loop) to a Cocoa app
  • How to expose a Ruby evaluator to a Cocoa app (for kind of Spreadsheet-like 
features for example)
  • How to use standard Ruby libraries (are these called gems?) in a Cocoa app.
  • The dynamic runtime: what it can bring you, how to use it…
  • Interface builder and MacRuby: outlets, actions, bindings.
  • Key-Value Coding and Observing. How does it fit with Ruby's introspection 
feature.

- How to take advantage of/cope with the idiomatic differences between Ruby and 
Objective-C/Cocoa. From adopting an Objective-C style to a full Ruby style (was 
that HotCocoa's goal?), the spectrum is quite large I guess. No size fits all. 
But a cookbook approach could be useful. Select a number of typical Ruby 
idioms, discuss when they would be interesting to use in a Cocoa context, and 
how to do so. Core Data and ORM might be a large such example. A smaller 
example would be using map/apply/reduce with Cocoa's collections: how do they 
fit with Cocoa's iteration facilities…

But I don't expect the book to:
- teach me about Cocoa: I already know that stuff. I don't need it.
- teach me about Ruby: I don't know that stuff, and I really need it, but I can 
find it elsewhere.

For those two needs, the book could possibly help with footnotes and/or 
sidebars with pointers to the relevant literature. This is not easy to write. 
It is difficult for the author to anticipate that such and such point under 
discussion uses some construct that might be foreign to some reader but not 
others. This probably requires readers of all possible profiles to point those 
out.

Such a book would then benefit both populations of experienced programmers. It 
would probably not be the book for an absolute beginner. But that would be 
another book altogether (I would love such a book to teach programming to 
children/teenagers).

Jean-Denis



___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Xcode 4 is out... any plan to integrate soon?

2011-03-16 Thread Jean-Denis Muys

On 16 mars 2011, at 13:14, Nick Ludlam mailto:[email protected]>>
 wrote:

Message: 5
Date: Wed, 16 Mar 2011 12:13:56 +
From: Nick Ludlam mailto:[email protected]>>
To: "MacRuby development discussions."
mailto:[email protected]>>
Subject: Re: [MacRuby-devel] Xcode 4 is out... any plan to integrate
soon?
Message-ID: 
<[email protected]>
Content-Type: text/plain; charset=us-ascii

On 16 Mar 2011, at 11:17, David Frantz wrote:

Speaking of XCode is there a public mailing list for XCode 4? That is 
something similar to [MacRuby-devel] that covers usage, bugs and other issues 
the new IDE is sure to bring.  Apple might have something open to all users but 
I've had zero luck finding it

There'a forum, rather than a list. https://devforums.apple.com/community/xcode4

Nick

There is also a mailing list: 
http://lists.apple.com/mailman/listinfo/xcode-users

Jean-Denis

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] MacRuby-devel Digest, Vol 37, Issue 51

2011-03-31 Thread Jean-Denis Muys

On 31 mars 2011, at 05:56, 
Bryan Harrison  wrote:

> Message: 6
> Date: Wed, 30 Mar 2011 20:43:27 -0700
> From: Bryan Harrison 
> To: [email protected]
> Subject: [MacRuby-devel] Tyro Needs Ruby vs. O-C Advice
> Message-ID: 
> Content-Type: text/plain; charset="windows-1252"
> 
> I've decided to use an upcoming sabbatical to teach myself OS X and iOS 
> programming.  My background includes OS X systems administration and web 
> development, mostly using the Apache/MySQL/PHP model.  I'm familiar with OOP 
> concepts and have trifled with any number of languages from C to AppleScript, 
> but am not fluent in any object oriented language.  I've been exploring Xcode 
> 4 for a week and feel conversant with the IDE if not yet able to accomplish 
> anything with it.
> 
> So?  I understand that Cocoa is a given, but today's million dollar question 
> is Objective-C or MacRuby?  I'm a blank slate with regard to both and so 
> could use some good advice.  For example?
> 
> What are the advantages of MacRuby over Objective-C?
> 
> What are the advantage of O-C over Ruby?
> 
> Is Xcode's support for O-C significantly better than it's handling of Ruby?  
> Do I care?
> 
> At this point I'm primarily interested in OS X development, but iOS clearly 
> needs to run a close second.  What's the current status of Ruby development 
> for iOS and is it likely to go anywhere in the nearish future?
> 
> Any thoughts on the longer-term prospects of either language?
> 
> Any thoughts from anybody will be much appreciated.
> 
> Thanks,
> Bryan

I will be blunt: stay away from MacRuby and go with Objective-C.

Before I get burned at the stake on this list, let me explain why. This stems 
from an assumption I made from you question about your goal:

Assumption: your goal is to become proficient in Cocoa [touch] programming as 
fast as possible, starting from basically zero.

If that assumption is wrong, then the conclusion might be too.

MacRuby is very good already, but it's a far less treaded route. As a result, 
you will have to load your brain with additional burden, always a difficult 
proposition when learning:

- Less applicable resources for learning: less examples, less books, less blog 
posts, less people to help you out.
- So you will need to translate every example and snippet from Objective-C to 
Ruby. This means you will effectively need to learn two languages instead of 
one at the same time, together with Cocoa.
- You will need to translate every one of your question from Ruby to 
Objective-C when posting to stackoverflow or Apple's forum, or risk getting no 
answer. Sure you can stay in this list, but that's one less resource.
- Every time you face a difficult roadblock, you will necessarily have to 
wonder "Is this me? Or is this MacRuby?". To answer that question for certain, 
you will then port your code to Objective-C to make sure.
- You will face less understanding development tools. When you have an issue 
with them, the official answer will be "MacRuby development is not supported". 
With Xcode 4 being immature by itself, you probably don't want to add an 
immature MacRuby to the mix.

Now the MacRuby journey might taste a lot better, depending on you. And if for 
you "the reward is the _journey_", you might consider it.

On the practical details, what has been said still applies, with two small 
corrections:

- You also have ahead of time compilation with MacRuby. But arguably, you don't 
care about that when learning.
- The job market for iOS programming is thriving, and for Mac programming is 
getting a lot better. Sure, Ruby programmers are also in demand, but it's not 
clear to me which market is actually better. One thing is for sure: demand for 
iOS Ruby programmers is zero.

Jean-Denis



___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] Configuring IDE to use MacRuby?

2011-10-20 Thread Jean-Denis MUYS
Hi,

Out of curiosity, I tried to set up a few IDEs other than Xcode to use for 
MacRuby development, and I have mostly failed. I would appreciate any 
advice/suggestion.

- TextMate: Success. I found some rather complex recipes on the net. Mine is 
much simpler: go to Preferences > Advanced > Shell Variables and add a shell 
variable named TM_RUBY with value of '/usr/local/bin/macruby'.

- Komodo IDE: Failure. I chose Preferences > Languages > Ruby, clicked the 
"Browse" button and selected macruby in '/usr/local/bin/'. Komodo IDE accepted 
it, but reported the following error:

"The Ruby debugger extension does not work with the version of Ruby select or 
that is on your path. You need to use Ruby version 1.8.2 or later. You can get 
Ruby from the Ruby home page at http://www.ruby-lang.org";

I suspected their debugger extension expects the ruby debugger to be named 
rubyd and not macrubyd. So I dup'ed macrubyd and renamed the copy to rubyd. 
However, this didn't improve the situation.

My Google fu failed to locate any useful suggestion on the net.

- RubyMine: Failure. I chose Preferences > Ruby SDK and Gems, clicked "Add 
SDK…" > "Specify other" and chose 
/Library/Frameworks/MacRuby.framework/Versions/0.10/usr/bin/macruby, as per 
some instructions I found on the net. However, RubyMine then displays an error 
message in large friendly red letters:

"Rubygems not installed for SDK: ruby-1.9.2-p0. Please download and install 
rubygems."

Any suggestion? Or is there no other working option than Xcode and TextMate?

Thanks,

Jean-Denis

PS: I am really a Ruby beginner, and I am not used to Ruby configurations, gems 
and the like. I will gladly take suggestions to RTFM.



___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] MacRuby: The Definitive Guide

2011-11-03 Thread Jean-Denis MUYS

On 3 nov. 2011, at 13:28, Matt Aimonetti 
mailto:[email protected]>>
 wrote:

Date: Wed, 2 Nov 2011 19:46:42 -0700
From: Matt Aimonetti mailto:[email protected]>>
To: "MacRuby development discussions."
mailto:[email protected]>>
Subject: [MacRuby-devel] MacRuby: The Definitive Guide
Message-ID:
mailto:CAFGi+5eZNN=ks7q8opssne2pc0sdty+2g_pdfl5vwm9suaa...@mail.gmail.com>>
Content-Type: text/plain; charset="utf-8"

Hey guys, if you pre ordered the hard copy of my book, it should arrive in
a few days (just got mine).
Otherwise you can buy from O'Reilly:
http://shop.oreilly.com/product/063692723.do or Amazon:
http://amzn.to/tVx4ng (cheaper)
Digital versions are available on the iBooks and Kindle marketplaces and
available in a all included format package on the O'Reilly website.

I would sincerely appreciate if some of you could leave reviews on Amazon
or O'Reilly, especially if my writing managed to help you out in the past.


Thanks,

- Matt

I just posted the following review to the Amazon page:

If you are:

- a Ruby developer who would like to learn Cocoa and program for the Mac

or

- a Cocoa Mac developer who would like to learn programming with Ruby

then you could do a lot worse than reading Matt Aimonetti's book. It gets 
exactly what's useful by focusing on programming for Mac, on the Mac, using 
MacRuby. So it doesn't want to teach you Ruby or Cocoa. There are other books 
for that. Instead it focuses on the specific stuff:

- What's different when programming in Ruby from programming in Objective-C
- How to use Mac tools, e.g. Xcode, to develop in Ruby for the Mac
- How the MacRuby runtime is using and integrates with the Objective-C runtime
- How to call Ruby code from Objective-C and back
- How to benefit from the interpreted nature of Ruby within a Cocoa app

and so on.

A very interesting look into what the future of Mac programming (and hopefully 
iOS). It helped me get up to speed very quickly with MacRuby (now included with 
OS X Lion) and saved me a *lot* of time, probably weeks. I am an inexperienced 
Ruby programmer, but a seasoned Cocoa programmer. I think that it would be 
equally useful to an experienced Ruby programmer getting started with Mac 
development.

Highly recommended

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] MacRuby promise

2011-11-14 Thread Jean-Denis MUYS
Reading from many messages on this list, I get the impression that MacRuby 
users are more often than not Ruby programmers coming to Mac programming.

I come from the opposite side: I am an experienced Cocoa developer and Ruby 
newbie.

I came to MacRuby for one major reason (and perhaps a few secondary reasons): 
to speed up development of my Mac applications.

My vision of speeding up Mac development is basically to finally reach again 
what I had almost 20 years ago when I was programming in Macintosh Common Lisp 
on the Mac for the Mac: developing within a running application, without having 
to quit it, dynamically adding or modifying classes or methods through a 
read-eval-print loop.

Yet, after having read through Matt's book, this is not what I got. On the 
contrary, my workflow is at the opposite end of the spectrum: 
built-run-test-quit loop, similar to what I'm used to with Objective-C. Except 
it's even worse: at least, typos are caught early with Objective-C. With 
MacRuby, they aren't, and quite often, I spend a considerable time reaching the 
point I'm working on before I get an exception from my typo.

Since MacRuby *does* have a REPL in the macirb terminal program, I really hope 
I missed something (that unfortunately is not described in Matt's book): what 
would be an efficient workflow developing a MacRuby Macintosh application with 
Xcode?

For example, I see that all Ruby code is loaded in rb_main.rb by walking 
through the app bundle resource directory and calling require(path) on all 
found ruby files.

Would it be possible to require again those files after they have been 
modified, without quitting the application? Yes it would still require building 
the app after each change in order to copy the changed ruby files back into the 
app bundle, but at least Xcode is happy to do so without requiring the app to 
quit (just don't ask it to "Run").

Even better, would it be possible to optionally require the ruby files from the 
source directory rather than from the app bundle (during development) based on 
some scheme or configuration dependent symbol? Then building the app would not 
even be necessary after changes limited to Ruby source code.

I would envision MacRuby Xcode templates to include such improvements in 
rb_main.rb, and also to add a "Debug" menu of some sort to the built app from 
which the developer could select a command to reload any/all changed Ruby file. 
This could even be automated using File System events.

The workflow loop would then become:

1- test some app action
2- notice a bug. Don't quit. Switch to Xcode.
3- change the relevant Ruby file
4- save
5- there is no step 5

I can't see any reason why this would not possible, and even easy, Ruby newbie 
as I may be. To me, this is the major MacRuby promise, and that promise is not 
kept yet.

Am I out of my mind?

Thanks.

Jean-Denis

(and add a Ruby console/listener to the built app too, in which the REPL is 
working in the context of the running app).
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] MacRuby promise

2011-11-14 Thread Jean-Denis MUYS

On 14 nov. 2011, at 17:54, 
mailto:[email protected]>>
 wrote:

Date: Mon, 14 Nov 2011 08:53:14 -0800
From: Nat Brown mailto:[email protected]>>
To: "MacRuby development discussions."
mailto:[email protected]>>
Subject: Re: [MacRuby-devel] MacRuby promise
Message-ID:
mailto:cag9ekxucdh03nx8numzzrdb2c9a7yhtnwaguzrf0ovowhce...@mail.gmail.com>>
Content-Type: text/plain; charset="iso-8859-1"

this would certainly be useful, but frankly i think that having proper
debugger-integration support in xcode (see
http://www.macruby.org/trac/ticket/1208 and issue 3037631 in
http://bugreporter.apple.com) would go 
dramatically farther towards making
macruby useful. edit-and-continue would be great, but setting a breakpoint:
priceless. thx, n@

This is a false dichotomy: my suggestion and yours are orthogonal (except 
perhaps for resource allocation consideration).

You are right of course that proper debugging is desirable (MCL also had that 
20 years ago), perhaps more so than what I am suggesting, but I'm going for the 
low-hanging fruits here. Moreover, adding Ruby debugging to Xcode would require 
Apple willingness to evolve Xcode which, given the glacial pace of Xcode 4 bug 
fixing and almost total deafness to developer requests, is far too much to ask. 
What I describe on the other hand, require no such cooperation. I probably even 
could implement a rough bare bone version.

Jean-Denis



___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] MacRuby promise delivered

2011-11-15 Thread Jean-Denis MUYS
Following up on my Friday suggestion, I am happy to announce that I implemented 
a first version a Xcode MacRuby projects that dynamically reloads Ruby source 
code into a running application, allowing for a very dynamic incremental 
programming style.

go to https://github.com/jdmuys/MacRubyReload to download the project. The 
ReadMe.markDown text file gives full instructions.

Hopefully MacRuby Xcode templates can evolve to automatically provide a similar 
facility.

This is all very simple and very primitive. There is a lot of room for 
improvement. I also apologize for my Ruby style: I probably haven't written 
more than 100 or so lines of Ruby code overall yet.

I hope this gets the ball rolling.

Jean-Denis

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] rubyfying Cocoa iterators

2011-11-16 Thread Jean-Denis MUYS
I have this ordered Core Data to-many relation named "operations" that I want 
to iterate over. I wrote:

self.operations.each { | operation | operation.doSomething }

However this fails because self.operations returns an NSOrderedSet and 
NSOrderedSet doesn't have an 'each' method.

I was able to use the 'enumerateObjectsUsingBlock' method of NSOrderedSet which 
is working fine.

My question is: what would be the MacRuby way to add an 'each' method to 
NSOrderedSet?

Thanks,

Jean-Denis



___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] symbol not found: _rb_str_freeze

2011-11-16 Thread Jean-Denis MUYS
Hi,

I have a big showstopper with my app: sequel with the mysql gem fails with the 
following error message:

dyld: Symbol not found: _rb_str_freeze
Referenced from: /Library/Frameworks/MacRuby.frameword/[…]/mysql_api.bundle

This is mentioned on the net on the sequel project back in february. The 
diagnostic of the sequel developer was that this is a bug in MacRuby.

I am using MacRuby nightly latest as of November 17, 2011, which reports its 
version as 0.12
I have mysql gem version 2.8.1
I have sequel gem version 3.29.0

Steps to reproduce in macirb:

require 'ruby gems'
require 'sequel'
DB = Sequel.connect(:adapter => 'mysql', :user => 'root', :host => 
'localhost', :database => 'test', :password => 'your password')
DB.tables

Is there any workaround/ easy fix?

I would appreciate any suggestion, including of alternate gems to use.

Jean-Denis

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] MacRuby-devel Digest, Vol 45, Issue 26

2011-11-17 Thread Jean-Denis MUYS
Thanks for your answer. I followed your advice, and indeed, it works quite 
nicely. However, in the meantime, I filed a ticket reporting the bug to the 
MacRuby project. And the bug is already fixed (thanks Watson1978). A commit has 
been added today with the fix. The latest nightly doesn't yet include the fix, 
but tomorrow's should. So I built MacRuby from source, and I can confirm that 
the short sample session that I quoted yesterday now works fine. I can't 
preclude other bugs to show up downstream, but I have no reason to suspect so.

So I now have two working options, between MCPKit and Sequel. MacRuby at its 
best.

For reference, the short version of the recipe for MCPKit is:

- Download the source code for Sequel Pro and open the included Xcode project. 
Sequel Pro uses Interface Builder plugins which are not support in Xcode 4. 
However, we won't build Sequel Pro, and it's OK here to use Xcode 4. I used 
Xcode 4.2

- Out of the 8 or so targets included in the Sequel Pro Xcode project, choose 
the framework target named MCPKit

- As of today, this target specifies an old SDK. In the target settings, switch 
the SDK to the latest SDK (10.7 under Lion for me).

- As of today, this target is set up as incompatible with GC. This doesn't work 
with MacRuby. Switch that target setting to "Supported". This setting is 
"Objective-C Garbage Collection" in the "Apple LLVM Compiler 3.0 - Language" 
section.

- The "Installation Directory" setting (in the "deployment" section) is set for 
installing the framework as a private framework in the application bundle. This 
works for me. If you want to install the framework system-wide, you'll have to 
change this.

- Build the target and copy the output package (MCPKit.framework) to your 
MacRuby source code directory.

- You can close the Sequel Pro Xcode project. Switch to your MacRuby Xcode 
project.

- Go to your app target "Build Phases" tab, and open the "Link Binary With 
Libraries" section. Click the + button to add the framework. In the library 
selection sheet, click "Add Other…" and select the MCPKit.framework package.

- Click the big + button at the bottom right of the Build Phases pane to add a 
new Copy Files phase. Select "Frameworks" in the new Copy Phase destination pop 
up menu. Drag the MCPKit.framework from your project source list to the Copy 
Phase file list (or alternatively use the + button).

- That's it.

This recipe actually works for any external private framework.

Jean-Denis



On 16 nov. 2011, at 19:28, 
mailto:[email protected]>>
 wrote:

Message: 3
Date: Wed, 16 Nov 2011 17:29:18 +
From: Steve Clarke mailto:[email protected]>>
To: "MacRuby development discussions."
mailto:[email protected]>>
Subject: Re: [MacRuby-devel] symbol not found: _rb_str_freeze
Message-ID: 
<[email protected]<mailto:[email protected]>>
Content-Type: text/plain; charset=windows-1252

Hi Jean-Denis,

I can't answer your question directly but I may be able to help a bit. I also 
want to use mysql with `MacRuby.  I tried mysql gem version 2.8.1 and hit 
problems I couldn't work around.  I also tried ruby-mysql 2.9.4.  I did get 
that to work after some mods, but it was very slow to load and didn't seem 
totally reliable.

I then decided to use an Objective-C framework that accesses SQL.  Sequel Pro 
contains such a framework called MCPKit and it's open source.  This means no 
gems so it loads v quickly.  However, the version of MCPKit that I downloaded 
had manual memory management so wouldn't link with a MacRuby app.  I don't know 
much about Objective-C but I thought I would just try recompiling MCPKit with 
ARC and garbage collection.  To my surprise and delight it worked.  I'm afraid 
I don't know how robust this approach is likely to be.  Maybe I've just been 
lucky.  It would be interesting to hear from someone who understands memory 
management better than me.

Steve


On 16 Nov 2011, at 15:33, Jean-Denis MUYS wrote:

Hi,

I have a big showstopper with my app: sequel with the mysql gem fails with the 
following error message:

dyld: Symbol not found: _rb_str_freeze
Referenced from: /Library/Frameworks/MacRuby.frameword/[?]/mysql_api.bundle

This is mentioned on the net on the sequel project back in february. The 
diagnostic of the sequel developer was that this is a bug in MacRuby.

I am using MacRuby nightly latest as of November 17, 2011, which reports its 
version as 0.12
I have mysql gem version 2.8.1
I have sequel gem version 3.29.0

Steps to reproduce in macirb:

require 'ruby gems'
require 'sequel'
DB = Sequel.connect(:adapter => 'mysql', :user => 'root', :host => '

Re: [MacRuby-devel] MacRuby-devel Digest, Vol 46, Issue 24

2011-12-21 Thread Jean-Denis MUYS

On 21 déc. 2011, at 00:43, David Frantz
 wrote:

Date: Tue, 20 Dec 2011 18:43:40 -0500
From: David Frantz mailto:[email protected]>>
To: "MacRuby development discussions."
mailto:[email protected]>>
Subject: Re: [MacRuby-devel] A Future for MacRuby
Message-ID: 
mailto:[email protected]>>
Content-Type: text/plain; charset="us-ascii"

The XCode integration is actually something that I find bothersome, especially 
the reliance upon nibs or whatever they are called.

Neither Xcode, nor Cocoa rely on NIB files. At all. Everything you can do with 
a nib file, you can do without. A nib file is nothing but a collection of 
objects that have been serialized to a disk file, and that can be resurrected 
at run time. period. Your perception is wrong, and I am afraid you may pass 
judgement based on that misunderstanding.

 As an IDE goes XCode has never really been professional level, though I know 
that statement frustrates many it is very much true.

I have precisely the opposite opinion, Xcode's bug non withstanding.


As to nibs well the whole thing is just very obtuse and frustrating to me.

Clearly, you misunderstand them. NIB files, as collections of pre-built and 
serialized objects are very useful. I use them all the time.

   Mind you my background is not the same as many here, being focused on 
industrial automation, but if find the use of nibs and Interface builder to be 
very taxing and not very object Oriented.

NIB file is the most object-oriented approach to User-Interface construction 
that can be. What can be more object-oriented than serializing objects? It runs 
circle around code generation for example (or worse, code attachment, Visual 
Basic style).

 MacRuby would likely generate a lot more interest if they moved away from the 
interface builder approach to GUI development.

MacRuby is neither here nor there. As a language. it's completely neutral 
regarding how you design your app's user interface. MacRuby neither helps with, 
nor impede, either of:

- using NIB files
- using plain Cocoa code
- using layers over Cocoa code, whatever they may be (HotCocoa being a 
MacRuby-specific instance)

I for one will keep using NIB files for GUI construction, and for as many other 
use as possible. It's the most flexible approach to date, the easiest to 
localize and to evolve. In contrast, when I learned HotCocoa, I found that it 
brought very little benefit, at a significant learning cost.

  I know this will result in many arrows coming my way, but really folks lets 
be objective here IB is a very strange departure from most GUI development 
systems.

IB? Are you sure? What is so special about IB? IB is an application that let's 
you draw view layouts (and a bit more). Sure it has limitations that I'd like 
to see removed, especially in Xcode 4 (I wish I could zoom in and out for 
example).

But I suspect you were still referring to NIB files, not to IB. So what are 
*most* GUI development systems that you are referring to? I have looked at 
many, and I found all those that I had to work with far inferior to this simple 
and sound idea of serializing objects.

Jean-Denis


___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] MacRuby-devel Digest, Vol 46, Issue 25

2011-12-21 Thread Jean-Denis MUYS

On 21 déc. 2011, at 11:13, Jeff Hemmelgarn
 wrote:

Date: Tue, 20 Dec 2011 23:57:53 -0500
From: Jeff Hemmelgarn mailto:[email protected]>>
To: "MacRuby development discussions."
mailto:[email protected]>>
Subject: Re: [MacRuby-devel] A Future for MacRuby
Message-ID: 
<[email protected]>
Content-Type: text/plain; charset=us-ascii

I guess my main angst is with the the direction and philosophy of the project.

One vision of MacRuby has it being a fully compatible ruby implementation, that 
happens to be built on the Objective-C runtime and have good integration to all 
of the libraries provided by Apple, but wrap the guts so that everything is a 
ruby object.  This is basically how I see the JRuby project.  Access to java 
libraries and code, but regular ruby runs correctly.

Another vision of MacRuby is instead an Apple-centric tool that exposes it's 
Objective-C underpinnings in non-compatile ways.  I am talking about using 
named parameters and having classes like NSMutableArray in the class hierarchy, 
at least.  There may be other things that I am not aware of.
[…]
Jeff Hemmelgarn

For me, about the only value proposition for MacRuby is to enable the 
development of Mac applications using the Ruby language.

That's it.

Behind that deceptive mission statement, there hide a number of key features:

On the "Mac applications" side:

- integration with Cocoa frameworks, with as little transmogrification as 
possible: check. Very good.
- bridging with Objective-C, both to enable multi-language development, and the 
use of 3rd party libraries: check. Rather good (but for the understandable 
limitation to require GC).
- integration with Mac development tools: from good to poor. Good for IB, Ok 
for Xcode templates, poor for debugging

On the "Ruby language" side:

- enabling the use of Ruby gems: reasonably OK, though some are expected to be 
incompatible. The main issue in that case is that there is no clear path to 
follow when facing an issue with a gem. Is this a bug with the gem? Is this a 
bug with MacRuby? How to find out? How to fix or work around it?
- enabling the dynamic ("interpreted") REPL style of software development in a 
MacApp: not checked. Not done at all, though some recent experiments from me 
and others (Dynamic MacRuby Reload) showed that a lot is possible.

Overall, my attempt to use MacRuby for my current MacApp application is: very 
disappointing. Despite Dynamic MacRuby Reload being very useful. There are two 
main reasons for that:

- First and foremost, the lack of a debugger is killing me and my productivity. 
I ended up defining an Objective-C routine, PrintAndBreak, that takes an object 
as a parameter, prints it address, and breaks into GDB. From there I can at 
least inspect that object before continuing. But I still can't step, and the 
stack trace seen from Objective-C is mostly useless. So that's not enough. The 
end result is that for more and more methods, especially the most algorithmic 
ones, I switched to Objective-C

- Second, my application needs to talk to a mySQL server. That was originally a 
big incentive to use MacRuby: the promise of using some Ruby mySQL gem was so 
very enticing. I found the impressive 'sequel' gem. However, it turns out it 
crashed MacRuby. I found on the net that that incompatibility was known for 
month. I managed to reduce the incompatibility to one MacRuby routine, and file 
a ticket to MacRuby. The next day, the incompatibility was fixed. Happy ending? 
Not so fast. It then turned out that the sequel-MacRuby combination fails for 
mySQL tables that have column names with diacritical characters (fail. not 
crash. Empty results are returned). I didn't have time to investigate that 
second issue. I don't even know if it's MacRuby related. I simply switched over 
to MCPKit, an Objective-C mySQL library.

As a result of these two issues, my MacRuby app is now 80% Objective-C. For me, 
that's a MacRuby failure. The perspective is still there, but not the reward.

At the very least, the reward will not be there until we have some debugging 
facilities. And for that, I can't see how we can achieve this without Apple (or 
perhaps somehow including macrubyd outside in).

Jean-Denis

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] Xcode templates not installed

2012-01-12 Thread Jean-Denis MUYS
Hi,

I updated my Xcode version to the latest I could find, and the good news is 
that my MacRuby projects continue to build and run. However, there are no Ruby 
template to be found.

I figured that reinstalling MacRuby would fix that. So I downloaded the latest 
nightly build and installed it.

Still no Ruby template to be found.

I checked the MacRuby installer list of files, and indeed, it copies templates 
to /Developer/Library/Xcode/Templates/...

However this doesn't work any more with the latest versions of Xcode. In order 
to better accommodate the MAS, Xcode is now a fully stand alone application, 
whose bundle contains a Developer directory that replaces /Developer.

So it looks like the MacRuby installer doesn't install the templates in the 
right locations for the latest versions of Xcode.

I then copied over all the MacRuby templates that are listed in the installer 
file list to their corresponding locations in the Xcode bundle.

It doesn't work: Still no Ruby template to be found.

So I suppose something else must be done to install templates for Xcode to see 
them.

What did I miss?

Of course, another explanation might be that MacRuby templates are now 
incompatible with the latest Xcode. I hope that's not the case.

Thanks for any idea.

Jean-Denis

PS: the Xcode version I am mentioning might still be under NDA, so I stayed 
intentionally vague about it. Feel free to slap me on the wrist. However, I'm 
still interested in all the steps required to install new templates to the 
latest version of Xcode that is not under NDA.

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] MacRuby Xcode templates DO load

2012-01-12 Thread Jean-Denis MUYS
Contrary to what I stated in my earlier message, MacRuby templates did show up 
within the latest Xcode as soon as I had copied them in their locations (which 
the MacRuby installer doesn't do correctly).

I also checked that I could alternatively copy them to 
~/Library/Developer/Xcode/Templates/

I apologize for the confusion.

Jean-Denis

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] RubyMotion: Ruby for iOS

2012-05-04 Thread Jean-Denis MUYS
One solution would be some provision with an escrow, with the commitment that 
should Laurent's company go out of business (for business reasons or bus-hit 
reasons), then the full source code would reverse to be open-source under such 
and such license.

But clearly, adopting RubyMotion for a professional product is a significant 
business risk (even if shared by other similar products), and that should be 
addressed somehow. Saying that whatever you purchase will continue to work "as 
is" is not enough. As a simple example, RubyMotion's "GC" doesn't handle retain 
cycles yet. I suppose it will, sooner than later, but for the time being, the 
product is not complete. That's fine for exploring and developing. It's not for 
releasing.

 In the meantime, many (most?) of us will purchase RubyMotion, if only for the 
pleasure of hacking with Ruby on iOS :-)

Jean-Denis

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] MacRuby.h not found

2012-06-12 Thread Jean-Denis MUYS
Hello,

After installing, in order:

- Xcode 4.3.3 (update of 4.3.2)
- Xcode 4.5DP1
- MacRuby 0.12 binary distribution

I create a new MacRuby project (so some MacRuby template is found), but Xcode 
4.3.3 fails to compile the main.m file. It chokes on "#import 
" with the error "MacRuby/MacRuby.h file not found".

I checked that the MacRuby framework appear in my project and is listed in the 
"Link Binary With Libraries" build phases.

However, it appears in red in both places and file inspector says it's located 
at "Library/Frameworks/MacRuby.framework", "Relative to Developer Directory".

I'm not sure which is the "Developer Directory" (how can I find out?), but 
MacRuby.framework sure doesn't appear in my ~/Developer directory. Inspecting 
the MacRuby installer logs shows that it installed it right in 
/Library/Frameworks, not in any developer directory. This is confirmed by a 
search of MacRuby.framework using the mdfind command: MacRuby.framework is only 
to be found in  /Library/Frameworks.

xcode-select -print-path reports /Applications/Xcode433.app/Developer, but 
MacRuby.framework doesn't appear in 
/Applications/Xcode433.app/Developer/Library/Frameworks.

I tried to replace the MacRuby.framework from the template by the one that is 
located in /Library/Frameworks. The project now shows it in black, not red, so 
it's found now. However, I still have the exact same compiler error.

Looking at the Xcode target settings, I found that the Framework Search Paths 
setting points to the Frameworks directory within Xcode433.

This seems to suggest that the installer installed MacRuby.framework in the 
wrong location: /Library instead of the currently-selected Xcode directory.

What would be the next step in my case? Is it enough to copy over 
MacRuby.framework to /Applications/Xcode433.app/Developer/Library/Frameworks?

Thanks,

Jean-Denis


PS: to be complete:

Calling "macruby --version" in the terminal reports "MacRuby 0.12 (ruby 1.9.2) 
[universal-darwin10.0, x86_64]", but if I recall correctly, so did the rather 
old nightly build I had installed previously.

Calling "which macruby" reports /usr/local/bin/macruby, which is consistent 
with the MacRuby installer.



[Logo Kleegroup]
Klee Group is a great place to work – Il fait bon travailler à Klee Group
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] MacRuby.h not found

2012-06-12 Thread Jean-Denis MUYS
I am not sure this is really the right thing to do, but copying the 
MacRuby.framework directory back inside the Xcode.app bundle solved my issue. 
This even lets me work indifferently with Xcode 4.3.3 and Xcode 45DP1.

I used the ditto command, e.g.:

sudo ditto /Library/Frameworks/MacRuby.framework 
/Applications/Xcode45-DP1.app/Contents/Developer/Library/Frameworks/MacRuby.framework

Regards,

Jean-Denis


On 12 juin 2012, at 13:27, Jean-Denis Muys wrote:

> Hello,
> 
> After installing, in order:
> 
> - Xcode 4.3.3 (update of 4.3.2)
> - Xcode 4.5DP1
> - MacRuby 0.12 binary distribution
> 
> I create a new MacRuby project (so some MacRuby template is found), but Xcode 
> 4.3.3 fails to compile the main.m file. It chokes on "#import 
> " with the error "MacRuby/MacRuby.h file not found".
> 
> I checked that the MacRuby framework appear in my project and is listed in 
> the "Link Binary With Libraries" build phases.
> 
> However, it appears in red in both places and file inspector says it's 
> located at "Library/Frameworks/MacRuby.framework", "Relative to Developer 
> Directory".
> 
> I'm not sure which is the "Developer Directory" (how can I find out?), but 
> MacRuby.framework sure doesn't appear in my ~/Developer directory. Inspecting 
> the MacRuby installer logs shows that it installed it right in 
> /Library/Frameworks, not in any developer directory. This is confirmed by a 
> search of MacRuby.framework using the mdfind command: MacRuby.framework is 
> only to be found in  /Library/Frameworks.
> 
> xcode-select -print-path reports /Applications/Xcode433.app/Developer, but 
> MacRuby.framework doesn't appear in 
> /Applications/Xcode433.app/Developer/Library/Frameworks.
> 
> I tried to replace the MacRuby.framework from the template by the one that is 
> located in /Library/Frameworks. The project now shows it in black, not red, 
> so it's found now. However, I still have the exact same compiler error.
> 
> Looking at the Xcode target settings, I found that the Framework Search Paths 
> setting points to the Frameworks directory within Xcode433.
> 
> This seems to suggest that the installer installed MacRuby.framework in the 
> wrong location: /Library instead of the currently-selected Xcode directory.
> 
> What would be the next step in my case? Is it enough to copy over 
> MacRuby.framework to /Applications/Xcode433.app/Developer/Library/Frameworks?
> 
> Thanks,
> 
> Jean-Denis
> 
> 
> PS: to be complete:
> 
> Calling "macruby --version" in the terminal reports "MacRuby 0.12 (ruby 
> 1.9.2) [universal-darwin10.0, x86_64]", but if I recall correctly, so did the 
> rather old nightly build I had installed previously.
> 
> Calling "which macruby" reports /usr/local/bin/macruby, which is consistent 
> with the MacRuby installer.
> 
> 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] macgem 'undefined method' error

2012-06-12 Thread Jean-Denis MUYS
Hi,

When executing:

macgem install sequel

I get:

Fetching: sequel-3.36.1.gem (  4%)ERROR:  While executing gem … 
(NoMethodError)
undefined method `to_str' for #

I have no idea whether the issue is with MacRuby or sequel.

Any suggestion?

Thanks,

Jean-Denis


[Logo Kleegroup]
Klee Group is a great place to work – Il fait bon travailler à Klee Group
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] macgem 'undefined method' error

2012-06-12 Thread Jean-Denis MUYS
OK, when I "sudo" that command, the error goes away.

Sorry about the waste of bandwidth.

Maybe the error message could be more explicit…

Jean-Denis


On 12 juin 2012, at 14:41, Jean-Denis Muys wrote:

> Hi,
> 
> When executing:
> 
>macgem install sequel
> 
> I get:
> 
>Fetching: sequel-3.36.1.gem (  4%)ERROR:  While executing gem … 
> (NoMethodError)
>undefined method `to_str' for #
> 
> I have no idea whether the issue is with MacRuby or sequel.
> 
> Any suggestion?
> 
> Thanks,
> 
> Jean-Denis
> 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] problem using gems with MacRuby 0.12

2012-06-12 Thread Jean-Denis MUYS
Hi again,

It seems there is some issue with MacRuby installing gems, as they don't seem 
to be made available to macirb:

sudo macgem install --remote progressbar

succeeds.

macgem list --local

mentions progressbar just fine

macirb
irb(main):001:0> require 'progressbar'
LoadError: no such file to load -- progressbar

The same try using the regular gem and irb works fine. I really don't know what 
to do here. Any help welcome.

Jean-Denis



[Logo Kleegroup]
Klee Group is a great place to work – Il fait bon travailler à Klee Group
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] MacRuby.h not found

2012-06-12 Thread Jean-Denis MUYS
This is happening under Lion 10.7.4.

Jean-Denis


On 12 juin 2012, at 15:55, 
Watson  wrote:

> Date: Tue, 12 Jun 2012 20:31:21 +0900
> From: Watson 
> To: "MacRuby development discussions."
>   
> Subject: Re: [MacRuby-devel] MacRuby.h not found
> Message-ID:
>   
> Content-Type: text/plain; charset=windows-1252
> 
> Hi,
> 
> MacRuby does not support Mountain Lion yet.
> Please use MacRuby with Lion or Snow Leopard.
> 
> 
> Thanks
> 
> 2012/6/12 Jean-Denis MUYS :
>> Hello,
>> 
>> After installing, in order:
>> 
>> - Xcode 4.3.3 (update of 4.3.2)
>> - Xcode 4.5DP1
>> - MacRuby 0.12 binary distribution
>> 
>> I create a new MacRuby project (so some MacRuby template is found), but 
>> Xcode 4.3.3 fails to compile the main.m file. It chokes on "#import 
>> " with the error "MacRuby/MacRuby.h file not found".
>> 
>> I checked that the MacRuby framework appear in my project and is listed in 
>> the "Link Binary With Libraries" build phases.
>> 
>> However, it appears in red in both places and file inspector says it's 
>> located at "Library/Frameworks/MacRuby.framework", "Relative to Developer 
>> Directory".
>> 
>> I'm not sure which is the "Developer Directory" (how can I find out?), but 
>> MacRuby.framework sure doesn't appear in my ~/Developer directory. 
>> Inspecting the MacRuby installer logs shows that it installed it right in 
>> /Library/Frameworks, not in any developer directory. This is confirmed by a 
>> search of MacRuby.framework using the mdfind command: MacRuby.framework is 
>> only to be found in ?/Library/Frameworks.
>> 
>> xcode-select -print-path reports /Applications/Xcode433.app/Developer, but 
>> MacRuby.framework doesn't appear in 
>> /Applications/Xcode433.app/Developer/Library/Frameworks.
>> 
>> I tried to replace the MacRuby.framework from the template by the one that 
>> is located in /Library/Frameworks. The project now shows it in black, not 
>> red, so it's found now. However, I still have the exact same compiler error.
>> 
>> Looking at the Xcode target settings, I found that the Framework Search 
>> Paths setting points to the Frameworks directory within Xcode433.
>> 
>> This seems to suggest that the installer installed MacRuby.framework in the 
>> wrong location: /Library instead of the currently-selected Xcode directory.
>> 
>> What would be the next step in my case? Is it enough to copy over 
>> MacRuby.framework to /Applications/Xcode433.app/Developer/Library/Frameworks?
>> 
>> Thanks,
>> 
>> Jean-Denis
>> 
>> 
>> PS: to be complete:
>> 
>> Calling "macruby --version" in the terminal reports "MacRuby 0.12 (ruby 
>> 1.9.2) [universal-darwin10.0, x86_64]", but if I recall correctly, so did 
>> the rather old nightly build I had installed previously.
>> 
>> Calling "which macruby" reports /usr/local/bin/macruby, which is consistent 
>> with the MacRuby installer.
>> 
>> 
>> 
>> [Logo Kleegroup]
>> Klee Group is a great place to work ? Il fait bon travailler ? Klee Group
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] MacRuby-devel Digest, Vol 52, Issue 7

2012-06-12 Thread Jean-Denis MUYS
Arf,

OK, thanks. My mistake then. My reduction was incorrect. Indeed when I require 
'ruby gems' first in macirb, there is no issue.

But the issue remains in my MacRuby app.

I get the following error when the app launches:

/path/to/rb_main.rb:14: in `': no such file to load -- sequel 
(LoadError)

rb_main.rb read:

framework 'Cocoa'
require 'ruby gems'
require 'sequel' # line 14

Of course I have installed the sequel gem with macgem, and I checked that I can 
require it in macirb (after rubygems).

I suspect this is related to my install issue I described earlier. copying the 
MacRuby.framework from /Library/Frameworks to within Xcode wasn't good enough 
after all.

(and again, this is all under Lion 10.7.4)

So I am back to square one. Any suggestion for installing MacRuby 0.12?

Regards,

Jean-Denis


On 12 juin 2012, at 15:55, 
mailto:[email protected]>>
Watson mailto:[email protected]>> wrote:

Message: 6
Date: Tue, 12 Jun 2012 22:52:36 +0900
From: Watson mailto:[email protected]>>
To: "MacRuby development discussions."
mailto:[email protected]>>
Subject: Re: [MacRuby-devel] problem using gems with MacRuby 0.12
Message-ID:
mailto:CAL5q=w7wulyjnvmcxrhkyncqndvrbaffyzukpiwj0iaapme...@mail.gmail.com>>
Content-Type: text/plain; charset=windows-1252

Hi,


MacRuby does not load `rubygems' automatically.
So, you need 'require "rubygems"' before loading gem which you want.

Please refer to http://macruby.macosforge.org/trac/ticket/855


Thanks

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] gem not loading in MacRuby app

2012-06-13 Thread Jean-Denis MUYS
This is a followup to my problems migrating to Xcode 4.3.3 and MacRuby 0.12 
under Lion 10.7.4.

Situation as of yesterday:

- MacRuby 0.12 installer installed in /Library/Frameworks instead of within 
Xcode 4.3.3 bundle
- MacRuby project template links MacRuby frameworks from within Xcode 4.3.3 
bundle where it's missing
- Worked around by copying the MacRuby framework back to within Xcode 4.3.3 
bundle using the ditto command.

New problem:

My MacRuby app fails to load its gems, which it claims are not found.

So it seems the workaround is not so good. Perhaps the gems are looked for 
relative to the framework location?

So I reversed the workaround and patched the MacRuby project instead:

- I removed MacRuby.framework referring to the /Developer location (which 
happens to be within Xcode)
- I added MacRuby.framework from /Library/Frameworks
- I added "/Library/Frameworks" to the target settings "Framework Search Paths"

And now my app can find its gems.

I am still uncomfortable with my installation problem. Where is the MacRuby 
installer supposed to install the framework anyway? Why didn't it? Or is the 
Xcode project template that is wrong?

At least I can go on working.

Of course, next is another issue, apparently unrelated, so I'll write it up in 
another post.

Regards,

Jean-Denis


[Logo Kleegroup]
Klee Group is a great place to work – Il fait bon travailler à Klee Group
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] mysql gem fails to install

2012-06-13 Thread Jean-Denis MUYS
Hello again,

One of the gem I use is mysql. It used to work. I still have forensic evidence 
of that in the older place where gems were installed (deep within 
/Library/Frameworks).

Now it doesn't install. Here is the full terminal transcript:

Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.

/Library/Frameworks/MacRuby.framework/Versions/0.12/usr/bin/macruby 
extconf.rb
checking for mysql_ssl_set()... yes
checking for rb_str_set_len()... yes
checking for rb_thread_start_timer()... no
checking for mysql.h... yes
i686-apple-darwin11-llvm-gcc-4.2: conftest.m: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: no input files
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Library/Frameworks/MacRuby.framework/Versions/0.12/usr/bin/macruby
--with-mysql-config
--without-mysql-config
/Library/Frameworks/MacRuby.framework/Versions/0.12/usr/lib/ruby/1.9.2/mkmf.rb:1987:in
 `mkmf_failed': *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Library/Frameworks/MacRuby.framework/Versions/0.12/usr/bin/macruby
--with-mysql-config
--without-mysql-config
 (SystemExit)
from 
/Library/Frameworks/MacRuby.framework/Versions/0.12/usr/lib/ruby/1.9.2/mkmf.rb:2077:in
 `block'
from 
/Library/Ruby/Gems/MacRuby/0.12/gems/mysql-2.8.1/ext/mysql_api/extconf.rb:75:in 
`'


Gem files will remain installed in 
/Library/Ruby/Gems/MacRuby/0.12/gems/mysql-2.8.1 for inspection.
Results logged to 
/Library/Ruby/Gems/MacRuby/0.12/gems/mysql-2.8.1/ext/mysql_api/gem_make.out

I checked the mkmf.log for more info. Here is its full content:

have_func: checking for mysql_ssl_set()...  yes

"/usr/bin/gcc-4.2 -o conftest 
-I/Library/Frameworks/MacRuby.framework/Versions/0.12/usr/include/ruby-1.9.2/universal-darwin10.0
 
-I/Library/Frameworks/MacRuby.framework/Versions/0.12/usr/include/ruby-1.9.2/ruby/backward
 -I/Library/Frameworks/MacRuby.framework/Versions/0.12/usr/include/ruby-1.9.2 
-I.  -I/opt/local/include/mysql5/mysql  -pipe -fPIC-D_P1003_1B_VISIBLE 
-DSIGNAL_WITH_VIO_CLOSE -DSIGNALS_DONT_BREAK_READ -DIGNORE_SIGHUP_SIGQUIT  
-DDONT_DECLARE_CXA_PURE_VIRTUAL -fobjc-gc-only -arch x86_64 -fexceptions 
-fno-common -pipe -O3 -g -Wall -fobjc-gc

I tried to execute the call to gcc-4.2 in there. gcc replies "no input files".

the mkmf.rb file mentioned is a MacRuby file and the gem installs fine using 
the regular "gem" command, so I suspect the problem is MacRuby's (especially 
since I had installed no so long ago), but I am not enough of a rubyist to go 
further.

Any suggestion?

Thanks,

Jean-Denis






[Logo Kleegroup]
Klee Group is a great place to work - Il fait bon travailler ? Klee Group
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] MacRuby-devel Digest, Vol 56, Issue 5

2012-10-18 Thread Jean-Denis MUYS

On 17 oct. 2012, at 23:03, 
mailto:[email protected]>>
 wrote:

I'm afraid setting the variable again in Xcode is not an option. I was hoping 
to pick up $CATALINA_HOME to find out where a user had installed tomcat.

So where and when is that environment variable set?

If you can instruct your user to set it in the global environment, then you 
should be able to pick it up from any process. The global environment is 
defined in the file /etc/launchd.conf, and it makes sense for a variable such 
as  CATALINA_HOME to be defined there.

Otherwise, best would be to let the tomcat team change their install procedure 
to either change /etc/launchd.conf, or to call `launchctl setenv CATALINA_HOME 
/path/to/tomcat` sometime when tomcat launches.

Last, you can still parse the configuration file that sets CATALINA_HOME, 
whether it's ~/.profile, ~/.bash_rc or whatever.

Note: user environment used to be defined in ~/.MacOSX/environment.plist, but 
it seems it's not supported any more in Mac OS X 10.8.

Regards,

Jean-Denis

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo/macruby-devel


Re: [MacRuby-devel] Problem with a window controller

2012-12-10 Thread Jean-Denis MUYS

On 7 déc. 2012, at 19:48:39, david kramf 
 wrote:
> 
> Message: 1
> Date: Fri, 7 Dec 2012 19:48:39 +0200
> From: david kramf 
> To: "MacRuby development discussions."
>   
> Subject: Re: [MacRuby-devel] Problem with a window controller
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="us-ascii"
> 
> Hi Bob,
> "As you become more familiar with IB, you will probably do more 
> initialization of objects in IB and less in MacRuby. Nib file expansion 
> instantiates objects and then makes calls to initialize the objects using the 
> same methods that you are using to initialize objects in MacRuby. Actually, 
> in a large application, it would difficult to hook up all of the outlets 
> without using IB."
> 
> From my modest acquaintance with MacRuby that is not exactly the case since 
> when the NIB instantiates  an NSWindowController object , it does not call 
> "initialize"

Cocoa, whether accessed from Ruby, Python, Objective-C or any language, uses 
the Cocoa initialization patterns. It's unrealistic to assume the framework 
patterns to change when you change the client language.

> ,as defined in Ruby , but calls "awakeFromNib".

It does, but caveat: awakeFromNib is *not* an initialization method, even 
though it is often used as such. I was bitten before. The correct 
initialization method to use for Nib files is initWithCoder:. What's the 
difference, says you (and me)? Behold:  awakeFromNib can be called several 
times in the lifetime of an object. This is no big deals for most 
initializations, but becomes a major issue in others. In my case, I was 
registering for notifications in awakeFromNib. Since I was registered several 
times, I got the notifications multiple times, and since I only unsubscribed 
once in dealloc, my app would crash.

Many cases when awakeFromNib is called more than once are programming errors, 
but not all. And since there *is* a real initializer, I recommend using it.

So in that case why is there an awakeFromNib method at all? It is because at 
initWithCoder: time, IB outlets are not yet loaded and are all nil. So 
awakeFromNib is meant to for initialization code that configures outlet.

So here is a recipe:

1- Does you initialization code requires IB outlets to be alive? If not, 
override initWithCoder:
2- If so, put it in awakeFromNib
3- Does that awakeFromNib initialization code need to be called once only? if 
so, make it conditional on it having been already be called.
4- Optional: assert that awakeFromNib was not called before, and if that assert 
fires, investigate whether the case is legitimate or due to a bug in your code.

> Only when you instantiate your controller from the code itself , you get your 
> "initialize"method called.  

That is a bonus you just can be happy to have due to the deep integration of 
MacRuby in the Objective-C runtime system. There is no reason to assume that 
bonus to expand to objects created by the framework.

> I know I still have a lot of practicing on IB. What I find disturbing ,is 
> that when I do something  with IB I cannot see the code created to 
> accommodate my actions ( maybe because I only work in MacRuby and not 
> Objective-C?).

No. This is simply because there **no code created**. At all. IB does't 
generate code. And lest I forget: Interface Builder is not a code generation 
tool. IB instantiates and populates objects, and then serializes them to disk. 
Those objects are then simply deserialized from disk in your app. At no point 
ever is any code generated. Therefore, there is no "code created to accommodate 
your actions" for you to see. Even in Objective-C.

Best regards,

Jean-Denis

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo/macruby-devel