Commit f8ee5112 authored by Marius Rackwitz's avatar Marius Rackwitz

Support module imports in header files

parent abf23761
......@@ -15,12 +15,17 @@ module Pod
#
attr_accessor :imports
# @return [Array<String>] The list of the modules to import.
#
attr_accessor :module_imports
# @param [Symbol] platform
# @see platform
#
def initialize(platform)
@platform = platform
@imports = []
@module_imports = []
end
# Generates the contents of the header according to the platform.
......@@ -41,6 +46,13 @@ module Pod
result << %|#import "#{import}"\n|
end
unless module_imports.empty?
module_imports.each do |import|
result << %|\n@import #{import}|
end
result << "\n"
end
result
end
......
......@@ -16,6 +16,16 @@ module Pod
EOS
end
it 'includes the module imports' do
@gen.module_imports << 'Module'
@gen.generate.should == <<-EOS.strip_heredoc
#import <UIKit/UIKit.h>
@import Module
EOS
end
it 'imports UIKit in iOS platforms' do
@gen.stubs(:platform).returns(Pod::Platform.ios)
@gen.generate.should.include?('#import <UIKit/UIKit.h>')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment