Open alloy opened 12 years ago
This is one of the issues that I wanted to test, to ensure that I'm not linking to absolute paths. I'm going to clean up the rake file so you can build it in your system. But were you able to launch the app?
Yup, the app definitely works! This was when I tried to ‘install’ a Podfile.
Although I have MacRuby installed locally etc. The best way to test OS X apps is to test it in a virgin env, by using, for instance, VirtualBox.
(After creating a VM image, make a copy so you can start with a clean env every time without spending too much time on installing OS X.)
Ruby should be fine now. However, I'm not able to figure out how to patch gems with extensions: https://github.com/irrationalfab/Ikeda/blob/master/Rakefile#L66
I launch Ruby with an NSTask that calls:
- CocoaPodsApp.app/Contents/MacOS/pod # bash wrapper that redirects to the ruby in same folder.
This in turn behind the scenes calls:
CocoaPodsApp.app/Contents/MacOS/ruby # another bash wrapper redirects to the bundled ruby.
CocoaPodsApp.app/Contents/Frameworks/ruby/bin/ruby.
CocoaPodsApp.app/Contents/Frameworks/gems/bin/pod.
A bit dirty hacky but it allows to place the app bundle in an arbitrary location.
Other important paths are:
CocoaPodsApp.app/Contents/Frameworks/gems/gems/xcodeproj-0.3.2/ext/xcodeproj_ext.bundle # requires libruby.1.9.1.dylib
CocoaPodsApp.app/Contents/Frameworks/ruby/lib/libruby.1.9.1.dylib
To my understanding, nowithstanding the matryoshkas, @executable_path
is the Mach-O executable CocoaPodsApp.app/Contents/Frameworks/ruby/bin/ruby
. So the relative load path should be:
@executable_path/../lib/libruby.1.9.1.dylib
But it doesn't work. @alloy Do you have any experience with this stuff?
I have done stuff like this in the past, but I don’t remember it from the top of my head. I’ll let you know if I find the solution.
Btw, what about the static version of Ruby s described in Yehuda’s post?
Never mind, it is working. I can't believe I've spent so much time on this thinking that I wasn't working! I'll upload the update soon.
:D
Btw, what about the static version of Ruby s described in Yehuda’s post?
This is what we are using. Tokaido is one of the results of his KickStarter project.
At its core, Tokaido is a binary distribution of Ruby without any external dependencies on your system. This means that Ruby itself, as well as all of the compiled elements of the standard library, will come in a self-contained directory with no additional requirements.
The binary will also have no hardcoded paths, so it will be possible to move the directory anywhere on the file system and have it continue to work as long as its bin directory is on the $PATH. This is an important goal, as Tokaido will ship as a downloadable .app which should work wherever it is dropped on the file system.
I started to do the work myself and the found it... I was :joy_cat: :joy_cat: Thanks Yehuda :joy_cat:
Now I found that he also posted about the gems, and this work that I've done is likely useless :sob: because we have rake-compiler which is much more robust (and doesn't misuses bundler) :joy_cat:.
Further investigation reveals that rake-compiler is not what I thought it was, but can be used to make the vendoring less hacky.
I've uploaded a new version of the app that should work out of the box (fingers crossed).
It appears that embedding the MacRuby framework did not work correctly:
Dyld Error Message:
Library not loaded: /Library/Frameworks/MacRuby.framework/Versions/0.12/usr/lib/libmacruby.dylib
Referenced from: /Users/USER/Downloads/CocoaPodsApp.app/Contents/XPCServices/org.cocoapods.macrubyservice.xpc/Contents/MacOS/org.cocoapods.macrubyservice
Reason: image not found
I forgot to archive the deployment target :-). Fixed!
Btw, virtual box is definitely the way to go. I need to find the time to set up the image.
Works!
Although I had an empty dir in the spec repo (not sure why), which made the MacRuby service crash:
*** Terminating app due to uncaught exception 'Pod::Informative', reason: '/Users/eloy/Downloads/CocoaPodsApp.app/Contents/Frameworks/gems/gems/cocoapods-0.14.0/lib/cocoapods/specification.rb:25:in `from_file': [31m[!] No podspec exists at path `/Users/eloy/.cocoapods/master/NLCoreData/0.2.1/NLCoreData.podspec'.
[0m (Pod::Informative)
from /Users/eloy/Downloads/CocoaPodsApp.app/Contents/Frameworks/gems/gems/cocoapods-0.14.0/lib/cocoapods/specification/set.rb:44:in `specification'
from /Users/eloy/Downloads/CocoaPodsApp.app/Contents/Frameworks/gems/gems/cocoapods-0.14.0/lib/cocoapods/command/presenter/cocoa_pod.rb:28:in `spec'
from /Users/eloy/Downloads/CocoaPodsApp.app/Contents/Frameworks/gems/gems/cocoapods-0.14.0/lib/cocoapods/command/presenter/cocoa_pod.rb:32:in `authors'
from /Users/eloy/Downloads/CocoaPodsApp.app/Contents/XPCServices/org.cocoapods.macrubyservice.xpc/Contents/Resources/exported_object.rb:55:in `block'
from /Users/eloy/Downloads/CocoaPodsApp.app/Contents/XPCServices/org.cocoapods.macrubyservice.xpc/Contents/Resources/exported_object.rb:54:in `set_to_hash'
from /Users/eloy/Downloads/CocoaPodsApp.app/Contents/XPCServices/org.cocoapods.macrubyservice.xpc/Contents/Resources/exported_object.rb:43:in `block'
from /Users/eloy/Downloads/CocoaPodsApp.app/Contents/XPCServices/org.cocoapods.macrubyservice.xpc/Contents/Resources/exported_object.rb:41:in `specs'
After removing the empty dir it worked again. But the error isn’t being handled, which you probably know already :)
Works!
:tada:
Although I had an empty dir in the spec repo (not sure why), which made the MacRuby service crash
I think that we should fix that in the Gem.
What do you think of the tentative UI?
@irrationalfab
What do you think of the tentative UI?
I know the question wasn't directed at me, but I'll answer. ;) I think using an HUD window in a sheet is a Bad Idea. HUD windows have traditionally been used as panels, and using it as a sheet just is confusing and does not fit. A traditional window with a bottom border would be much more aesthetically appropriate and pleasing. I can do a pull request on that for you if you'd like.
I agree with @jwilling on the install sheet.
I do like the main styling, but I’m no fan of the real ‘not OS X’ controls (e.g. the button in the install sheet). Overall it will need a bit more design think work (e.g. the forward/back buttons that are not all the way to the left because then it would be positioned above the source list (?)). I’ll dump any thoughts that may come to me here.
@jwilling
I know the question wasn't directed at me, but I'll answer. ;)
Thanks for joining the discussion :-)
I think using an HUD window in a sheet is a Bad Idea. HUD windows have traditionally been used as panels, and using it as a sheet just is confusing and does not fit. A traditional window with a bottom border would be much more aesthetically appropriate and pleasing.
It was a weak attempt to have an UI reminiscent of a terminal. Anyways, I agree that it didn't turn out to be a great idea.
I can do a pull request on that for you if you'd like.
That would be awesome! By the way let me know if you would like push access.
Feel free to apply any improvements that you feel reasonable. As the goal of this build was to have a concrete implementation as a starting point for the discussion.
@alloy
I’m no fan of the real ‘not OS X’ controls (e.g. the button in the install sheet).
Does this applies to the buttons in the Podspec detail view? Btw, they are supposed to be light gray, but I haven't found the time yet.
Overall it will need a bit more design think work (e.g. the forward/back buttons that are not all the way to the left because then it would be positioned above the source list (?))
What about moving them to the left and adding the title to the center?
My ideas and doubts dump:
Pods
section? A permanent button in the title area of the window?NSLayoutManager
) should not be that hard. Is this a good idea?Recents projects
section in the outline view?pod push
).Finally I feel that we should start a testing suite, but I don't have a clear idea on what would be the best approach.
It’s probably best to start writing a set of requirements, based on that it should be easier to make design decisions. E.g. We could work on a few mockups that would implement the necessary UI and discuss those.
Do you have a tool you prefer to write user stories/requirements in? If not, we have our own tool, I could make a stub with a couple of stories based on the current UI, so that you get a feel for it?
Finally I feel that we should start a testing suite, but I don't have a clear idea on what would be the best approach.
Approach regarding what exactly?
Do you have a tool you prefer to write user stories/requirements in? If not, we have our own tool, I could make a stub with a couple of stories based on the current UI, so that you get a feel for it?
That would be great!
Approach regarding what exactly?
Have good integrations and UI tests. I have to admit that my Cocoa TTD, is weak.
Have good integrations and UI tests. I have to admit that my Cocoa TTD, is weak.
Last time I worked on a big Cocoa app, I did mainly unit testing of models and controllers. Back then I did it with MacRuby/Bacon, but that would lead to the same ARC issues in this case, so in this case something like Kiwi might be more apt.
I will see what the current state is of real integration testing for Cocoa apps.
That would be great!
Done. I’ve added a few stories based on what is currently in the app and what you have said you wanted to do in the app. Let me know if you have difficulties adding extra stories.
I’ve added a few rake tasks to add IDs for new stories and convert to HTML. See the Saga readme for more info.
Done. I’ve added a few stories based on what is currently in the app and what you have said you wanted to do in the app. Let me know if you have difficulties adding extra stories.
Very nice and elegant :-) I've already added a story and works very well.
I rewrote it a bit, please check if I had the intent correct :)
Should I run one of the rake tasks first? Or is this a TODO?