Re: [MacRuby-devel] REXML UTF-8 Encoding not found

2011-10-08 Thread Watson
Hi

> https://github.com/ferrous26/MacRuby/commit/e4525fc4f9d91ffbad155340b99710e750aef5b7

I merged Mark's patch.
This problem would be fixed with MacRuby nightly build.

Thanks.

2011/10/8 Mark Rada :
> It seems that I lied a little, the commit where I made the change is here:
>
> https://github.com/MacRuby/MacRuby/commit/b98b9da5d7da09a7dfa65d298df5d1c880d36ff2
>
> but that is all the way back in May. It felt like it was just the other day. 
> On the upside though, I have prepared a fix for the problem:
>
> https://github.com/ferrous26/MacRuby/commit/e4525fc4f9d91ffbad155340b99710e750aef5b7
>
> It is just a matter of testing that it works now. If it does, then it will be 
> merged into MacRuby and available in a nightly build in the next day or two.
>
>
>
> On 2011-10-08, at 12:16 AM, Shaun August wrote:
>
>> Hi Mark,
>>
>> Thanks for the reply. If I were to roll back to a nightly build could you 
>> estimate what date I should be looking for?
>>
>> Thank you,
>>
>> Shaun
>>
>>
>> On 2011-10-07, at 2:36 PM, Mark Rada wrote:
>>
>>> Hi Shaun,
>>>
>>> The problem here is that "rexml/encoding.rb" is trying to load "UTF-8.rb". 
>>> The problem is that files should not include the file extension when 
>>> requiring a file or else it will always load the .rb file and have to JIT 
>>> the code instead of loading the .rbo file and use the already compiled code.
>>>
>>> I made a change to macruby_deploy a little while ago to remove .rb files if 
>>> the .rbo file was present in order to shrink the MacRuby.framework that you 
>>> embed, but it seems that there are some places in the stdlib which do not 
>>> follow this practice. At this point, it is not a simple matter changing the 
>>> rexml source. Hmmm...
>>>
>>>
>>>
>>>
>>> On 2011-10-07, at 3:10 PM, Shaun August wrote:
>>>
 Hi Eloy,

 Thanks for responding. I tried to add the --stdlib rexml command and I now 
 get an error about fileutils not being available. I was reading in Matt's 
 excellent book (does that count as a quote?) that the --stdlib can only 
 load one library rather than the entire set of libraries when I pass 
 --embed?

 I looked in the structure of my app and the rexml/encodings/   folder is 
 present in the app when I deploy with --embed but the UTF-8.rb file isn't 
 there. There is a UTF-8.rbo file.

 Is this because I am deploying with --compile and --embed?

 Thank you,

 Shaun




 On 2011-10-05, at 12:27 AM, Eloy Durán wrote:

> Did you include the standard library when running macruby_deploy? If you 
> are excluding it, then you should be able to fix this with passing this 
> to macruby_deploy: `--stdlib rexml`.
>
> On Oct 3, 2011, at 6:32 AM, saugust wrote:
>
>> Hi Everyone,
>>
>> I am trying to deploy an app that uses XMLSimple and I am getting an 
>> error when I try to run the app on computers other than my own.
>>
>> Here is the error message:
>>
>> 11-10-02 9:14:17.289 PM [0x0-0x39039].com.blah.blah: 
>> /Users/me/Desktop/MyApp.app/Contents/Resources/rb_main.rb:18:in `block': 
>> no such file to load -- rexml/encodings/UTF-8.rb (LoadError)
>>
>> The only difference I can see is my development machine is running ruby 
>> 1.9.2 and the test environment is still at 1.8.6. Should the REXML be 
>> looking to the MacRuby framework? I am using XMLSimple as a file in my 
>> app not a gem.
>>
>> Any suggestions would be greatly appreciated.
>>
>> Thank you,
>>
>> Shaun
>>
>> ___
>> 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

 ___
 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
>>
>> ___
>> 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
>
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] Overriding +autosavesInPlace

2011-10-08 Thread Sven A. Schmidt
Hi all,

I'm trying to add autosave and versions to an application and as far as I can 
tell from the docs it should be as simple as overriding +(BOOL)autosavesInPlace 
to return YES from my core data document application. So what I have is 
essentially:

class MyDocument < NSPersistentDocument

  ...

  def autosavesInPlace
return YES
  end

end

However, I don't get autosave or versions behavior (i.e. I've still got the 
"dirty dot", no versions menu in the title bar etc). Also, autosavesInPlace 
doesn't seem to get called. When I print a log message in there it never shows 
up in the console.

Should this be working the way I'm doing it? Unfortunately, I don't have a 
Cocoa application to compare (yet) so I'm not sure if I'm doing something wrong 
at the frameworks end or on the MacRuby side.

One thing I was wondering (since I'm rather new to both Ruby and MacRuby): I'm 
overriding a class method here (+(BOOL), not -(BOOL)), is there anything 
special I need to consider when doing this from MacRuby?

Cheers,
Sven



smime.p7s
Description: S/MIME cryptographic signature
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] Overriding +autosavesInPlace

2011-10-08 Thread Keith Gautreaux
I'm not a Macruby expert and I don't know anything about Cocoa,
particularly as it relates to new Lion features such as autosave, but
the example code you gave is defining an instance method, not a class
method.

To override a class method you would need to do something like:

class MyDocument < NSPersistentDocument

...

  def self.autosavesInPlace
return YES
  end
end

There are other ways of defining class methods but this is the easiest
when you just have one method.

HTH

On Sat, Oct 8, 2011 at 10:25 AM, Sven A. Schmidt  wrote:
> Hi all,
>
> I'm trying to add autosave and versions to an application and as far as I can 
> tell from the docs it should be as simple as overriding 
> +(BOOL)autosavesInPlace to return YES from my core data document application. 
> So what I have is essentially:
>
> class MyDocument < NSPersistentDocument
>
>  ...
>
>  def autosavesInPlace
>    return YES
>  end
>
> end
>
> However, I don't get autosave or versions behavior (i.e. I've still got the 
> "dirty dot", no versions menu in the title bar etc). Also, autosavesInPlace 
> doesn't seem to get called. When I print a log message in there it never 
> shows up in the console.
>
> Should this be working the way I'm doing it? Unfortunately, I don't have a 
> Cocoa application to compare (yet) so I'm not sure if I'm doing something 
> wrong at the frameworks end or on the MacRuby side.
>
> One thing I was wondering (since I'm rather new to both Ruby and MacRuby): 
> I'm overriding a class method here (+(BOOL), not -(BOOL)), is there anything 
> special I need to consider when doing this from MacRuby?
>
> Cheers,
> Sven
>
>
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>



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


Re: [MacRuby-devel] Overriding +autosavesInPlace

2011-10-08 Thread Sven A. Schmidt
Yes, that's what I was suspecting and the "self." prefix was exactly what I was 
missing :) (And I just noticed "YES" is not available in MacRuby.)

The following works then:

  def self.autosavesInPlace
return true
  end

Thanks,
Sven

On Oct 8, 2011, at 17:36, Keith Gautreaux wrote:

> I'm not a Macruby expert and I don't know anything about Cocoa,
> particularly as it relates to new Lion features such as autosave, but
> the example code you gave is defining an instance method, not a class
> method.
> 
> To override a class method you would need to do something like:
> 
> class MyDocument < NSPersistentDocument
> 
> ...
> 
>  def self.autosavesInPlace
>return YES
>  end
> end
> 
> There are other ways of defining class methods but this is the easiest
> when you just have one method.
> 
> HTH
> 
> On Sat, Oct 8, 2011 at 10:25 AM, Sven A. Schmidt  wrote:
>> Hi all,
>> 
>> I'm trying to add autosave and versions to an application and as far as I 
>> can tell from the docs it should be as simple as overriding 
>> +(BOOL)autosavesInPlace to return YES from my core data document 
>> application. So what I have is essentially:
>> 
>> class MyDocument < NSPersistentDocument
>> 
>>  ...
>> 
>>  def autosavesInPlace
>>return YES
>>  end
>> 
>> end
>> 
>> However, I don't get autosave or versions behavior (i.e. I've still got the 
>> "dirty dot", no versions menu in the title bar etc). Also, autosavesInPlace 
>> doesn't seem to get called. When I print a log message in there it never 
>> shows up in the console.
>> 
>> Should this be working the way I'm doing it? Unfortunately, I don't have a 
>> Cocoa application to compare (yet) so I'm not sure if I'm doing something 
>> wrong at the frameworks end or on the MacRuby side.
>> 
>> One thing I was wondering (since I'm rather new to both Ruby and MacRuby): 
>> I'm overriding a class method here (+(BOOL), not -(BOOL)), is there anything 
>> special I need to consider when doing this from MacRuby?
>> 
>> Cheers,
>> Sven
>> 
>> 
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>> 
>> 
> 
> 
> 
> -- 
> Keith
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

--

Dr. Sven A. Schmidt
abstracture GmbH & Co. KG
Wilhelm-Theodor-Römheld-Straße 28
55130 Mainz

Fon  +49 6131 696 29 0
Fax  +49 6131 696 29 29
Mail [email protected]

Amtsgericht Mainz HRA 40625
USt-IdNr.: DE258454694

Persönlich haftender Gesellschafter:
abstracture IT-Beratungs- und Beteiligungsgesellschaft mbH, Sitz Mainz, 
Amtsgericht Mainz HRB 41357

Geschäftsführer: Dr. U. Koch, T. Meyer, A. Misok, Dr. S.A. Schmidt, Dr. V. 
Schönharting



smime.p7s
Description: S/MIME cryptographic signature
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel