I have been working on the following script to set breakpoint is XCode. I am not a Ruby expert and I am sure I am doing something wrong. Any help would be appreciated.
Currenly my script looks like so:
proect = %x{"#{ENV['TM_BUNDLE_SUPPORT']}/bin/find_xcode_project.rb"} named = File.basename(proect) xCodeProject = named.sub(/.(xcodeproj|xcode|pbproj)/?$/, "") breakLine = #{ENV['TM_LINE_NUMBER']}
print xCodeProject
astring = "osascript -e 'tell application "TextMate" set myName to name of front document end tell tell application "Xcode" tell project named "#{xCodeProject}"\r\n set bp to make new file breakpoint set file reference of bp to file reference named myName set enabled of bp to true end tell end tell'"
print astring
%x{#{astring}}
My output is:
iPhoto2PBase osascript -e 'tell application "TextMate" set myName to name of front document end tell tell application "Xcode" tell project named "HelloWorld "
set bp to make new file breakpoint set file reference of bp to file reference named myName set enabled of bp to true end tell end tell'
For some reason i have a bunch of white space after my project's name.
Also how do i put { and } into a string so they are printable?
On 18/9/2006, at 17:07, Scott Andrew wrote:
I have been working on the following script to set breakpoint is XCode. I am not a Ruby expert and I am sure I am doing something wrong. Any help would be appreciated.
Currenly my script looks like so:
proect = %x{"#{ENV['TM_BUNDLE_SUPPORT']}/bin/find_xcode_project.rb"}
Try add .chomp to remove the potential newline.
astring = "osascript -e 'tell application "TextMate" set myName to name of front document
I think you need “set myName to path of front document”.
Also how do i put { and } into a string so they are printable?
What kind of string would that be? and what seems to be the problem with just writing it?