1.Make a copy of the .xib in the Finder.
2. Open the copied file in a text editor.
3. Change “com.apple.InterfaceBuilder3.CocoaTouch.XIB” to “com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB”.
4. Change all instances of “IBCocoaTouchFramework” to “IBIPadFramework”.
5. Search for sizes like {480, 320} and edit them. Or just reopen the file in Xcode and use the GUI to resize items as needed.

 

May be there is another better method to do this. If you have the better way to do it, please tell me.
BTW, below code were successful running in rails3 and ruby 1.8.7

1. first, you should add open4 gem to your Rails project Gemfile

gem 'open4'

and run “bundle install” in terminal to install it in project dir.

2. add below code to config/deploy.rb, please change the namespace name to your own

namespace :your_namespance_name do
  require 'open4'
  rails_root = File.expand_path(File.join(File.dirname(__FILE__), '..'))
  stdin, stdout, stderr = Open4::popen4("cd #{rails_root} && rake -T")
  #please replace :your_namespance_name to your own, this code to grap you special of namespance rake tasks
  stderr.read.scan(/your_namespance_name\:(\w+)/).each do |match|
    desc "rake task named '#{match.last}'"
    task match.last.to_sym, :roles => :app do
      run "cd #{current_path}; RAILS_ENV=production rake railscasts:#{match}"
    end
  end
end

after do that, when you run cap -T in you command shell, you will be found the tasks from rake, also, it can invoked from the remote server of you own.

 
 gem list | cut -d" " -f1 | xargs gem uninstall -aIx
 
# config/environment.rb
config.load_paths += %W{ #{Rails.root}/app/observers }
Dir.chdir("#{Rails.root}/app/observers") do
  config.active_record.observers = Dir["*_observer.rb"].collect {|ob_name| ob_name.split(".").first}
end
 
  def random_string( len )
    returning String.new do |string|
      chars = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a
      1.upto(len) { string << chars[rand(chars.size - 1)] }
    end
  end
  def random_string( len )
    chars = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a
    chars.shuffle[1..len].join
  end
 

here is the ruby script for generation @synthesize, dealloc and @property code.

#!/usr/bin/env ruby
puts "useage: iphone <@interface block code here>\n, ctrl-d stop input"
code = $stdin.read
code.each_line do |line|
  if(match = line.match(/\*?_(\w+);/))
    puts "@synthesize #{match[1]} = _#{match[1]};"
  end
end
puts
code.each_line do |line|
  if(match = line.match(/(\w+)\s+(\*?\w+);/))
    puts "@property (nonatomic, #{line =~ /\*/ ? 'retain' : 'assign'}) #{match[1]} #{match[2].gsub('_', '')};"
  end
end

puts
code.each_line do |line|
  if(match = line.match(/\*_(\w+);/))
    puts "[_#{match[1]} release];"
  end
end
 
# Ruby on Rails
*.tmproj
tmp/**/*
config/database.yml
config/*.sphinx.conf
db/sphinx/**/*
db/schema.rb
log/*

# Mac OS X Finder and whatnot
.DS_Store

# XCode (and ancestors) per-user config (very noisy, and not relevant)
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
*.pbxuser

# Generated files
VersionX-revision.h

# build products
build/
*.[oa]

# Other source repository archive directories (protects when importing)
.hg
.svn/*/**
CVS

# automatic backup files
*~.nib
*.swp
*~
*(Autosaved).rtfd/
Backup[ ]of[ ]*.pages/
Backup[ ]of[ ]*.key/
Backup[ ]of[ ]*.numbers/

做了一个ruby脚本,自动生成该模板

#!/usr/bin/env ruby
require "rubygems"
content = <<-TEMPLATE
# Ruby on Rails
*.tmproj
tmp/**/*
config/database.yml
config/*.sphinx.conf
db/sphinx/**/*
db/schema.rb
log/*

# Mac OS X Finder and whatnot
.DS_Store

# XCode (and ancestors) per-user config (very noisy, and not relevant)
*.mode1
*.mode1v3
*.mode2v3
*.perspective
*.perspectivev3
*.pbxuser

# Generated files
VersionX-revision.h

# build products
build/
*.[oa]

# Other source repository archive directories (protects when importing)
.hg
.svn/*/**
CVS

# automatic backup files
*~.nib
*.swp
*~
*(Autosaved).rtfd/
Backup[ ]of[ ]*.pages/
Backup[ ]of[ ]*.key/
Backup[ ]of[ ]*.numbers/
TEMPLATE
system("echo '#{content}' > #{File.join(Dir.getwd, ".gitignore")}")
 

1. Open rewrite module

sudo a2enmod rewrite

2. add this to /etc/apache2/httpd.conf

<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>

3.add this to you directory config in httpd.conf

Options FollowSymLinks
AllowOverride All

4. restart apache2

/etc/init.d/apache2 restart

5. change settings in WP of Permalinks

 

最近装了RVM,切换到ree,安装好所需的gem,突然发现原来的goo无法正确读取ree下的gem list,还好robin将goo开源并放到了github上,下载代码,进行简单的修改后目前已支持rvm,添加的关键代码如下:

	NSString *path = [[NSBundle mainBundle] pathForResource:@"gem_helper" ofType:@"rb"];
	NSTask *task = [[NSTask alloc] init];
	[task setLaunchPath:@"/bin/bash"];
	NSArray *arguments = [NSArray arrayWithObjects:@"-l", @"-c", path, nil];
	[task setArguments:arguments];
	NSPipe *outPipe = [[NSPipe alloc] init];
	[task setStandardOutput:outPipe];
	[outPipe release];
	[task launch];

下载地址:goo for rvm build by XCode Base SDK Mac OS X 10.5
代码下载:github

© 2012 { joycodes blog } Suffusion theme by Sayontan Sinha