On Tue, Aug 2, 2011 at 04:55, Caio Chassot wrote:
> On Tue, Aug 2, 2011 at 04:26, Terry Moore wrote:
>> Sounds like an asynchronous issue. Try adding a completion selector and
>> calling nsrunloop.
> Tried both, no dice.
Side talk for the curious:
http://tweetlib
On Tue, Aug 2, 2011 at 04:26, Terry Moore wrote:
> Sounds like an asynchronous issue. Try adding a completion selector and
> calling nsrunloop.
Tried both, no dice.
@jacknutting mostly nails it:
> core problem is that AppKit classes are really meant for use in a full app
> (w/ GUI). Foundatio
On Tue, Aug 2, 2011 at 03:24, Caio Chassot wrote:
> At this point I'm sure this is not a MacRuby bug, just some Cocoa
> weirdness. I'd love to understand exactly what the hell is going on,
> if anyone knows…
…and to back that, it fails in ObjC too, and adding a sleep
On Tue, Aug 2, 2011 at 03:01, Caio Chassot wrote:
> Weird. So maybe there's something I don't understand about NSWorkspace?
Some meh progress: adding sleep 0.1 before the puts sets things right.
At this point I'm sure this is not a MacRuby bug, just some Cocoa
weirdness. I
> The equivalent code works fine in Nu.
Oh, actually I went ahead and tested again in nu, this time both
interactively under nush, and as a script with nush in the shebang
line. Interactively it works, as shebang it fails silently, same as
macruby/irb.
Weird. So maybe there's something I don't un
NSWorkspace.sharedWorkspace.recycleURLs:completionHandler: fails for
me when run via normal macruby, yet works in macirb.
Sample code:
#!/usr/bin/env macruby
framework 'Cocoa'
path = "#{ENV['HOME']}/Desktop/Y-U-NO-TRASH-ME-MACRUBY.txt"
system "touch #{path}"
url = NSURL.fileU
On Fri, Jul 1, 2011 at 05:38, isaac kearse wrote:
> --format-executable doesn't seem to work. In fact its worse - it just
> overwrites the MRI gem binary without giving a warning at all. Thanks
> for the idea though.
Interesting. It should work:
$ macirb
>> require 'rubygems'
>> Gem.default_ex
--format-executable may help, as it should prefix everything with mac-, then.
You may even want to put that in your .gemrc for the install and
update commands.
On Fri, Jul 1, 2011 at 04:07, isaac kearse wrote:
> At the moment macgem will prompt the user with this warning when
> trying to install
On 2011-05-16, at 00:37 , Laurent Sansonetti wrote:
> Filling dups is always a good idea as it helps up prioritizing work.
Oh Laurent, please let's not encourage this terrible dupes-as-voting-system
practice; just add a +1 button to tickets.
Filling proper tickets is hard work. Time shouldn't b
Hi,
Can you post some sample code?
Thanks
On Sun, May 15, 2011 at 11:50, Yasu Imao wrote:
> Hi,
>
> I just wrote a simple script for text processing and encountered a problem
> with String#sub/gsub.
>
> Original text: UTF-8 encoded ASCII character only text
> Replacing text: UTF-8 encoded text
On Mon, Apr 18, 2011 at 20:18, Joshua Ballanco wrote:
> they aren't...quite... The issue is that if you need a string, sometimes an
> NSString is sufficient and in those cases you'd want the NSString to report
> itself as being the same as a String. In other cases, however, they are
> different be
On Mon, Apr 18, 2011 at 22:06, Robert Rice wrote:
> But for consistency, you may want to add the .to_data method to the NSString
See the recent thread "Hash Table", it explains the funny business going on.
I also posted something to discuss this general matter a few months
ago but don't really r
On 2011-03-27, at 13:05 , Glenn Gillen wrote:
> regexp `[\u{80}-\u{D7FF}\u{E000}-\u{FFFD}\u{1}-\u{10}]' compilation
> error: U_REGEX_BAD_ESCAPE_SEQUENCE (RegexpError)
>
> Any ideas what I can do apart from forking Sass and opting for the 1.8
> compatible regexp?
MacRuby ditched Onigurum
Same here.
And while I'm all too curious about the case conversion implementations, I'm in
agreement it'd be a bad fit for the official distribution, and a major
annoyance with clashing styles in shared code.
Sent from my iPhone
On 12 Feb 2011, at 23:06, Matt Aimonetti wrote:
> It is not,
So everything in ruby is an object, which means that when using format strings
with Objective-C methods like String+stringWithFormat and NSLog, the only
formatter that makes sense is "%@". Other formatters generally give unexpected
results. E.g. "%d" will print the value of the pointer to the nu
On 2011-02-12, at 04:40 , Caio Chassot wrote:
>
> On 2011-02-12, at 01:59 , Robert Payne wrote:
>>
>> The behavior I'm expecting is to see "Hello world" in the console but it
>> seems as if the entire Objective-C method was deleted. I don't have a me
On 2011-02-12, at 01:59 , Robert Payne wrote:
>
> The behavior I'm expecting is to see "Hello world" in the console but it
> seems as if the entire Objective-C method was deleted. I don't have a method
> in the Ruby class called helloWorld.
There's likely something wrong somewhere else in your
On 2011-02-11, at 15:25 , Matt Aimonetti wrote:
>
> Magically converting a snake_case method call to a CamelCase method dispatch
> is bad for peformance and documentation.
I'm not suggesting that this be done as part of MacRuby, but should one want to
go ahead on their on…
Wouldn't it be possib
Quick test:
$ ruby -e 'open("|pbcopy", "w") { |io| io << "test #{rand}" };
puts(`pbpaste`)'
test 0.8639874244022235
$ macruby -e 'open("|pbcopy", "w") { |io| io << "test #{rand}" };
puts(`pbpaste`)'
-e:1:in `': not opened for writing (IOError)
Why the error with MacRuby?
___
On 2011-02-04, at 22:55 , Vincent Isambart wrote:
>
> IMPORTANT: If you are developing a MacRuby application you should wait before
> installing it: Xcode 3 get upgraded to Xcode 4. However there is currently no
> support for MacRuby in Xcode 4:
But I can choose a custom path and everything wil
On 2011-02-04, at 07:30 , Jean-Denis Muys wrote:
>
> I am at the other end of the spectrum: I am an experienced Cocoa/Objective-C
> programmer and a Ruby newbie.
And I'm back at the ruby expert, cocoa newbie, yet…
> I expect the book to address two facets of software development with MacRuby:
On 2011-02-04, at 01:26 , Rich Morin wrote:
>
> One of my concerns with both MacRuby and JRuby is
> that the resulting code doesn't look much like Ruby.
I'm sure the situation in JRuby land is worse, but generally, using Cocoa stuff
from MacRuby feels enough like ruby, save for the HorridCamelCa
On 2011-01-30, at 23:55 , Mark Rada wrote:
>
> Should both types of arrays work the same way? An instance of NSMutableArray
> says its class is Array, so I thought that they would.
There's something weird going on in there, I don't really know the details of
it, but:
A while back I had issues
On 2011-01-29, at 02:11 , Matt Aimonetti wrote:
>
> IMHO adding Bundler as a dependency would be a huge mistake. First, Bundler
> code is overly complicated and tries to do way too much.
(You forgot to mention slow.)
I think I agree here. I just like the Gemfile format. Don't think we need to
On 2011-01-28, at 21:36 , Laurent Sansonetti wrote:
>
> I would rather avoid any dependency. I agree that keeping track of the gems
> you need in a single place is a good idea, though.
>
> Maybe we should refactor the Xcode templates to do so, eventually.
I'd classify Xcode as a dependency. Sim
On 2011-01-28, at 20:30 , Laurent Sansonetti wrote:
>
> As I suggested on IRC yesterday, I think we should add a --gem argument to
> macruby_deploy, which would make sure the given gems and their dependencies
> are unpacked inside the application bundle.
It could be great if this involved a bit
On 2011-01-27, at 21:27 , Laurent Sansonetti wrote:
> Hi guys,
>
> I think it's time to release trunk as 0.9. I expect to do it next week, if
> possible.
Are we gonna have 0.10, 0.11, etc, or is 1.0 the next target?
___
MacRuby-devel mailing list
MacRu
On 2011-01-26, at 20:22 , Laurent Sansonetti wrote:
>
> For 1.0, we should either document this or try to make
> proposedSelRangePtr[0].location=42 work, as I suspect people will hit the
> same problem. Could you file a ticket? We will continue the investigation
> there.
Ok, will get on to tha
Hi all,
NSFormatter defines a method with the following selector:
isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription:
This is its signature:
- (BOOL)isPartialStringValid:(NSString **)partialStringPtr
proposedSelectedRange:(NS
> platform for Mac development. So I'm trying to wrap my head around why
> people would use it (Ruby) instead of C/C++/Objective C or Python for that
> matter.
I guess we all have our reasons, but:
Over Obj C: succinctness + ruby std libary
Over Python: First class cocoa citizen, not a bridge
On 2011-01-19, at 21:43 , Robert Rice wrote:
>
> Hi Caio:
>
> Is macruby similar to macirb but without the prompts?
It's not interactive. It just reads from stdin and executes that.
And implementation-wise, macirb is a whole other beast.
This is not particular to macruby. It's how standard rub
On 2011-01-19, at 20:55 , Robert Rice wrote:
>
> Entering macruby by mistake on the console command line instead of macirb
> gets no reply. The user must type ctrl-C to abort it.
>
> Probably macruby should reply with usage information and exit.
Not really. macruby is expecting input. If you ty
On 2011-01-19, at 20:50 , Robert Rice wrote:
>
> You instantiated AnArray. Try this:
>
> class AnArray < Array; end
>
> AnArray.kind_of?( Array ) will return false
Is this what you're looking for?
$ macirb
irb(main):001:0> class AnArray < Array; end
=> nil
irb(main):002:0> AnArray <= Array
I'm not perfectly sure this applies to MacRuby, but I suspect it should since
our Array is implemented on top of NSMutableArray:
http://ridiculousfish.com/blog/archives/2005/12/23/array/
But the gist is CFArrays more or less switch to using hashes internally at some
point.
On 2011-01-14, at 0
On 2011-01-11, at 17:59 , Laurent Sansonetti wrote:
>
> Hi Caio,
>
> I think it's a macirb problem, and that it should work fine outside of it.
>
> Can you confirm? Yes, a ticket would be appreciated :)
Indeed, macirb-only.
https://www.macruby.org/trac/ticket/1110
_
Hey all,
It appears the ->{} syntax for lambdas is not supported.
Known? Need ticket?
$ irb
irb(main):001:0> ->{}
=> #
$ macirb
irb(main):001:0> ->{}
SyntaxError: compile error
___
MacRuby-devel mailing list
MacRuby-devel@lis
On 2011-01-11, at 14:30 , Martin Hawkins wrote:
> sharedAEManager.setEventHandler(self,
> andSelector: :"getURL:event:withReplyEvent:returnEvent",
> forEventClass: KInternetEventClass, andEventID:KAEGetURL)
> …
>
> def getURL(event, withReplyEvent:returnEvent)
So the selector for that method d
On 2011-01-10, at 19:19 , Laurent Sansonetti wrote:
>
> Assuming your array contains ASCII fixnum representation of characters,
> messaging #pack('c*') on it should give you a string object back.
>
> I dislike this method, but here I don't see a better choice.
numbers = [65, 195, 169]
s = numbe
in):001:0> framework 'Foundation'
> => true
> irb(main):002:0> KInternetEventClass
> NameError: uninitialized constant KInternetEventClass
>
> irb(main):003:0> framework 'Cocoa'
> => true
> irb(main):004:0> KInternetEventClass
> NameError
On 2011-01-10, at 16:47 , Martin Hawkins wrote:
>
> Excellent Caio - thanks.
> Now I've gone full circle and am getting
> 'AppDelegate::KInternetEventClass (NameError)
> from /Users/martin/work/macruby/experimental/build/Debug/
> experimental.app/Contents/'
Maybe that constant is not there
On 2011-01-10, at 15:52 , Martin Hawkins wrote:
>
> Thanks Matt, I've got the book but missed that point.
> Any suggestions re my second issue. i.e. translating the selector part
You can pass a selector as a symbol or string:
m.setEventHandler(self, andSelector:
:"getURL:event:withReplyEvent:re
So It seems to me the only change there is uninlining the lambda and assigning
it to a throwaway variable. That feels like busywork.
I suspect this has to do with keeping a reference so it doesn't get GC'd. Just
a hunch. Am I getting there?
Why is this needed?
On 2011-01-09, at 17:10 , Matt A
On 2010-12-20, at 19:22 , Laurent Sansonetti wrote:
>
> Excellent! In this snippet, n is a 64-bit bignum, so I suspect something is
> going wrong in the converter
I couldn't help but prod around in bignum.c but I'm in way over my head.
How do you go about debugging this? I suppose I'd try to ru
On 2010-12-20, at 19:22 , Laurent Sansonetti wrote:
>
> Excellent! In this snippet, n is a 64-bit bignum, so I suspect something is
> going wrong in the converter. Could you file a ticket? We will get that fixed
> for 1.0.
https://www.macruby.org/trac/ticket/1068
I wonder if MRI ruby 1.9 is no
On 2010-12-20, at 16:37 , Caio Chassot wrote:
>
> Could someone try to reduce this and take the notification center and iTunes
> out of the picture and see if it's just a problem with NSNumber?
Oh, that was easier than I thought.
#!/usr/bin/env macruby
n = 0x8C2CACEF
I was trying to get the PersistentID from iTunes tracks from both
ScriptingBridge and the notifications iTunes posts to
NSDistributedNotificationCenter. I noticed I was getting different results from
each.
The first byte from the number read from the notification is nearly always
garbled (I su
On 2010-12-18, at 19:58 , russell muetzelfeldt wrote:
>
> then bar will be included twice since '../bar' does not match './lib/bar'.
> what you should do is add the lib directory to $: and then change the require
> lines in main.rb to
I thought $" expanded the paths on its own. I'm stupidly laz
On 2010-12-07, at 22:13 , Laurent Sansonetti wrote:
>
> Hi Saul,
>
> Did you install the BridgeSupport preview 1 release? Without it, C blocks
> won't work in MacRuby.
>
> http://www.macruby.org/blog/2010/10/08/bridgesupport-preview.html
Is this part of trunk, nightlies, and a future 0.8 by de
On 2010-12-01, at 20:15 , Laurent Sansonetti wrote:
>
> MacRuby is using ICU. I'm not aware of ICU's internals, but I suspect the
> performance issue is probably elsewhere here, given the huge difference
> against 1.8.
>
I know we've talked about this before and you found ICU and Oniguruma to
On 2010-12-01, at 07:45 , denny trebbin wrote:
>
> GitHub or BitBucket (I love Mercurial, its pretty much easier then Git, IMO)
> doesn't really matter but I think a switch to almost newer source control
> system will stop by the use of Xcode. Because Xcode is crappy and supports
> not distribu
On 2010-11-30, at 14:36 , Rich Morin wrote:
>
> I'd like to know a bit more about the activities (and
> required skills) for the Bug smash days. For example,
> my C/C++/Objective-C skills are rather rusty and in any
> case, I have no knowledge about MacRuby internals...
I too would like to know
On 2010-11-29, at 14:50 , Alan Skipp wrote:
>
> There's a brief article here
> http://www.oreillynet.com/ruby/blog/2006/01/ruby_design_patterns_observer.html
>
> The procedure for setting up observers is quite different to KVO and I
> imagine it has different advantages/disadvantages to KVO, tho
On 2010-11-16, at 21:22 , Ryan Davis wrote:
>
> an assignment inside a conditional is
>
> do_something(x) if x = logical_statement
I'm particularly fond of:
x = logical_statement and do_something(x)
Hate me now.
___
MacRuby-devel mailing list
MacR
On 2010-10-28, at 08:26 , Robert Rice wrote:
>
> Thanks David:
>
> But I still get the the LoadError and I don't know how to fix a gem.
ParseDate has been removed from ruby 1.9, of which MacRuby is a fork.
That github fork of the rtf gem fixes the dependency on parsedate:
http://github.com/clbu
On 2010-10-24, at 05:06 , Matt Aimonetti wrote:
Is there any difference if I do these instead:
> pointer = Pointer.new_with_type("f")
p = Pointer.new(:float) #<= new instead of new_with_type
> pointer.assign(3.2)
p[0] = 3.2 #<= #[]= instead of #assign
I have used both successf
On 2010-10-11, at 16:07 , Shaun August wrote:
>
> The script works in ruby and I can get both the "\030" and the "\220" values
> to test true
When in MRI, are you testing in ruby 1.9? This reeks of encoding issues.
> If I have to do a work around is there any way to tell what encodings are
> b
On 2010-10-04, at 03:29 , Caio Chassot wrote:
>
> I wrote these today: http://github.com/kch/macruby-programming-cocoa
Updated that. Now done up to chapter 19.
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.or
On 2010-10-10, at 17:23 , Laurent Sansonetti wrote:
>
> You seem to have found a bug in the parser :)
It seems I'm getting good at it ;)
> Could you file that as a ticket?
https://www.macruby.org/trac/ticket/950
___
MacRuby-devel mailing list
MacRub
On 2010-10-10, at 17:24 , Laurent Sansonetti wrote:
>
> Indeed, +initialize won't be called for pure-Ruby classes. I recommend to use
> the Ruby idiom here, it's simpler :)
So, the problem I'm seeing is what I alluded to earlier: writing stuff in the
class body is more like +load than +initiali
On 2010-10-10, at 15:53 , Caius Durling wrote:
>
>> Now, the interesting part here is the ", ..." at the end. It takes variable
>> arguments at the end that work as formatting arguments for informativeText,
>> eg. sprintf(informativeText, ...).
>
> Does it work if you pass an array in as the la
I'm playing again with implementing the Hillegass book in MacRuby, and ran
across this method:
+ (NSAlert *)alertWithMessageText:(NSString *)messageTitle
defaultButton:(NSString *)defaultButtonTitle
alternateButton:(NSString *)alternateButtonTitle
On 2010-10-10, at 15:15 , Matt Aimonetti wrote:
>
> The problem in your example is that in Ruby, the constructor is an instance
> method, not a class method.
> So your mistake was to define self.initialize instead of just initialize.
I'm afraid you misunderstood my question.
I'm not talking abou
On 2010-10-10, at 13:33 , Matt Aimonetti wrote:
>
> You might want to refresh your browser,
One such page: http://www.macruby.org/contact-us.html
> otherwise there is a section in the documentation explaining how to
> contribute content for the website using a github repo.
For lurkers and futu
Hi,
It looks like self.initialize is a no-go:
class Foo
def self.initialize
NSLog("self.initialize is a sd panda") # <- never runs
end
end
The ruby idiom for that would be just:
class Foo
NSLog("IM IN UR CLASS INITIALIZEEN FROM RUBY")
end
is that
Hi,
Is the MacRuby website on a public repo?
I'm seeing a lot of pages still say "Current Version: 0.6". Other than that
there's a bunch of outdated info.
It would be great if the site were on, say, github, so everyone could submit
fixes.
Is it available anywhere?
___
On 2010-10-05, at 18:20 , Laurent Sansonetti wrote:
>
> Hi Caio,
>
> Could you file a ticket and attach either a patch or a new copy of the
> templates? (Also, make sure you do not use Xcode4 for this.)
There: http://www.macruby.org/trac/ticket/932
Speaking of Trac, can we maybe change it to
On 2010-10-05, at 18:15 , Laurent Sansonetti wrote:
>
> You found out an exception :) As you know, NSArray responds to -count which
> simply return the number of elements it contains. But Ruby Array defines
> #count which has different semantics.
>
> To not conflict with NSArray, the Ruby #coun
I wrote these today: http://github.com/kch/macruby-programming-cocoa
I strived for very idiomatic ruby. This code is 100% Objective-C-isms-free.
• Each exercise has its own branch
• Each commit in the branch is one completed stage in the book
• Each commit message mentions the chapter for the pro
Hi all,
Code first:
cocoa_array = NSArray.new
ruby_array = []
puts ruby_array.count # => 0
puts ruby_array.count { true } # => 0
puts ruby_array.count("whatever") # => 0
puts cocoa_array.count # => 0
puts cocoa_array.count { true }
I had to make the following changes to make it work:
- Change File's Owner class to MyDocument
- Connect File's Owner window to Window
- Connect Window's deletage to File's Owner
Makes sense?
I'd submit a patch but OMG so much ugly XML. Is this the right way to do it?
Edit it in Interface Buil
On 2010-09-16, at 22:43 , Laurent Sansonetti wrote:
>
>
> Nope, seems good :) I would however pass :"foo:bar:" instead. I believe
> MacRuby will add the trailing : for you but it's clearer to be explicit here.
Oh, actually I tried that first, and it added a second :, and failed.
___
Hi,
Can I define Objective-style interspersed-selector methods dynamically with
define_method?
I did this:
class Foo
# def foo(a, bar:b); puts a, b end
define_method :"foo:bar" do |a, b| puts a, b end
end
Foo.new.foo(0, bar:1)
and it seems to work. Is that it, or di
On 2010-09-15, at 19:30 , Iain Barnett wrote:
>
> On 15 Sep 2010, at 22:43, Ryan Davis wrote:
>>
>> rubygems and/or macruby should probably be patched to include RUBY_ENGINE
>> somewhere in the gem path.
>
> That's a really good idea. Either that or just accept that macruby is a
> separate thi
On 2010-09-09, at 22:57 , Scott Ribe wrote:
>
> I sure as heck hope that Apple is planning on changing this, once they get
> the RAM in these devices up to 1 o2 gb
I'd bet on an iOS-tailored (maybe a subset of) MacRuby with reference counting
before iOS gets GC.
__
On 2010-09-09, at 20:44 , Henry Maddocks wrote:
>
> Do the recent changes mean we can use MacRuby to write iPhone apps?
No, MacRuby is garbage-collected, and there's no garbage collection in iOS.
You can use Nu, tho.
___
MacRuby-devel mailing list
Mac
On 2010-08-25, at 02:03 , Rob Gleeson wrote:
>
>
> Thanks for the reply Caio,
>
> Yeah that application looks promising but it doesn't do what I want, exactly.
> It's still nice and proof that it's most likely possible to do something like
> this.
So I guess you could ask the Witch author abo
On 2010-08-25, at 01:13 , Rob Gleeson wrote:
>
> Kind of :-) cmd+` seems to cycle focus between windows belonging to a single
> application.
> I'd like to group a random number of windows that don't belong to a single
> application, and cycle
> through those.
>
> It's quite possible my google f
(repost from http://stackoverflow.com/questions/3519436 under recommendation
from @lrz)
I suspect this is not strictly a MacRuby issue since I can more or less cause
it in pure Objective-C with GC. I observe the same NSRunLoop issue in Nu, in
addition to crashing. Anyhoo:
I'm writing an OS X
78 matches
Mail list logo