Daniel Zepeda wrote:
Alex F. wrote:
- the rakefile can detect which ruby is running it more portably (patch
attached)
I read this through the Ruby Forum’s web interface, I don’t get the
emails, so I didn’t see the attached patch. Should I change my
preferences or something?
Strange, the reply has also disappeared completely from our own
archives:
http://rubyforge.org/pipermail/wxruby-users/2009-April/thread.html
Patch copied inline below.
By ‘not fully working’ do you mean you weren’t able to get a working
package on Windows? I verified it on my copy of Windows XP, so maybe
you are using a different kind of Windows?
It was on OS X. The methods app_ruby_executable and ruby_executable test
RUBY_PLATFORM for “i686-darwin9”, but for my standard ruby
(/usr/bin/ruby) the platform is “universal-darwin9” so the case
statement falls through and raises. That’s why I tried
def ruby_executable_name
Config::CONFIG[‘RUBY_INSTALL_NAME’] + Config::CONFIG[‘EXEEXT’]
end
def app_ruby_executable_name
Environment.app_name + Config::CONFIG[‘EXEEXT’]
end
But that’s not quite all that’s needed, because build/bin/ruby hasn’t
been copied.
Really all that does is rename the ruby executable to a name associated
with the packaged program. I’m not sure that it is really necessary.
It’s just a little bit of polish. It affects how the app is labelled in
the Dock (OSX) and in Alt-Tab, Task Manager (Windows), otherwise it
shows as ‘ruby’.
What I was thinking of was a ripped-off idea from rails, have a script
that generates the structure and scripts initially, going the
‘convention-over-configuration’ route as much as possible. The
pre-defined structure also makes it easier to get off-and-running on a
new project.
Yep, I’ve only tried rails once a while ago, but I liked the ‘scaffold’
feature.
best
alex
diff --git a/Rakefile b/Rakefile
index 7750810…4689030 100644
— a/Rakefile
+++ b/Rakefile
@@ -15,7 +15,9 @@ end
desc “Run Project”
task :run => Environment.base_class_path do
ENV[Environment.app_env_const] = ‘development’
- executable = RUBY_PLATFORM =~ /darwin/ ? “/opt/local/bin/ruby” :
“c:/ruby-1.8.7-p72/bin/ruby.exe”
@@ -40,4 +42,4 @@ def make_bases_relative
end
end
-task :default => :spec
\ No newline at end of file
+task :default => :spec