lib/ib/generator.rb in ib-0.2.2 vs lib/ib/generator.rb in ib-0.2.3
- old
+ new
@@ -29,22 +29,27 @@
end
end
def generate_objc files
- src = files.map do |path, info|
-<<-OBJC
+ output = ""
+ files.map do |path, infos|
+ infos.each do |info|
+ output << <<-OBJC
@interface #{info[:class][0][0]} : #{info[:class][0][1]}
#{info[:outlets].map {|name, type| "@property IBOutlet #{generate_type(type)} #{name};" }.join("\n")}
#{info[:outlet_collections].map {|name, type| "@property IBOutletCollection(#{type}) NSArray * #{name};" }.join("\n")}
#{info[:actions].map {|action| "-(IBAction) #{generate_action(action)};" }.join("\n")}
@end
OBJC
- end.join("\n" * 2)
+ output << "\n\n"
+ end
+ end
+ output
end
def generate_objc_impl files
src = files.map do |path, info|
<<-OBJC