@@ -1,3 +1,22 @@
## 0.9.2

[CocoaPods](http://git.io/AVlRKg) • [Xcodeproj](http://git.io/xHbc0w)

###### Bug fixes

- When generating the PodsDummy class, make that class unique to each target. [#402](http://git.io/NntYiQ)
- Raise an informative error message when the platform in the `Podfile` is omitted or incorrect. [#403](http://git.io/k5EcUQ)


## 0.9.1

[CocoaPods](http://git.io/_kqAbw)

###### Bug fixes

- CocoaPods 0.9.x needs Xcodeproj 0.3.0.


## 0.9.0

[CocoaPods](http://git.io/kucJQw) • [Xcodeproj](http://git.io/5eLL8g)
@@ -1,14 +1,14 @@
GIT
remote: git://github.com/CocoaPods/Xcodeproj.git
revision: d7806ab0513b90d7f285a4af78e7bf19e4fb1481
revision: e5e7bdf8acb0363042adc78feca8d6136950f7d7
specs:
xcodeproj (0.3.0)
xcodeproj (0.3.1)
activesupport (~> 3.2.6)

PATH
remote: .
specs:
cocoapods (0.9.0)
cocoapods (0.9.1)
activesupport (~> 3.2.6)
colored (~> 1.2)
escape (~> 0.0.4)
@@ -13,7 +13,7 @@
end

module Pod
VERSION = '0.9.1'
VERSION = '0.9.2'

class PlainInformative < StandardError
end
@@ -257,7 +257,7 @@ def podfile_from_spec
podspec = file.realpath.to_s
platform = @platform
podfile = Pod::Podfile.new do
platform(platform)
platform(platform.to_sym, platform.deployment_target)
pod name, :podspec => podspec
end
podfile
@@ -1,11 +1,18 @@
module Pod
module Generator
class DummySource
attr_reader :class_name

def initialize(class_name_identifier)
validated_class_name_identifier = class_name_identifier.gsub(/[^0-9a-z_]/i, '_')
@class_name = "PodsDummy_#{validated_class_name_identifier}"
end

def save_as(pathname)
pathname.open('w') do |source|
source.puts "@interface PodsDummy : NSObject"
source.puts "@interface #{class_name} : NSObject"
source.puts "@end"
source.puts "@implementation PodsDummy"
source.puts "@implementation #{class_name}"
source.puts "@end"
end
end
@@ -107,10 +107,10 @@ def install!
acknowledgements_path = target_installer.target_definition.acknowledgements_path
Generator::Acknowledgements.new(target_installer.target_definition,
pods_for_target).save_as(acknowledgements_path)
generate_dummy_source(target_installer)
end

generate_lock_file!(specifications)
generate_dummy_source

puts "- Running post install hooks" if config.verbose?
# Post install hooks run _before_ saving of project, so that they can alter it before saving.
@@ -172,17 +172,17 @@ def generate_lock_file!(specs)
end
end

def generate_dummy_source
filename = "PodsDummy.m"
def generate_dummy_source(target_installer)
class_name_identifier = target_installer.target_definition.label
dummy_source = Generator::DummySource.new(class_name_identifier)
filename = "#{dummy_source.class_name}.m"
pathname = Pathname.new(sandbox.root + filename)
Generator::DummySource.new.save_as(pathname)
dummy_source.save_as(pathname)

project_file = project.files.new('path' => filename)
project.group("Targets Support Files") << project_file

target_installers.each do |target_installer|
target_installer.target.source_build_phases.first << project_file
end
target_installer.target.source_build_phases.first << project_file
end

def specs_by_target
@@ -199,6 +199,8 @@ def platform(name, target = nil)
target = '4.3'
when :osx
target = '10.6'
else
raise Informative, "Unsupported platform: platform must be one of [:ios, :osx]"
end
end
@target_definition.platform = Platform.new(name, target)
@@ -114,8 +114,31 @@ def should_xcodebuild(target_definition)
installer = SpecHelper::Installer.new(podfile)
installer.install!

dummy = (config.project_pods_root + 'PodsDummy.m').read
dummy.should.include?('@implementation PodsDummy')
dummy = (config.project_pods_root + 'PodsDummy_Pods.m').read
dummy.should.include?('@implementation PodsDummy_Pods')
end

it "installs a dummy source file unique to the target" do
create_config!
podfile = Pod::Podfile.new do
self.platform :ios
xcodeproj 'dummy'
pod do |s|
s.name = 'JSONKit'
s.version = '1.2'
s.source = { :git => SpecHelper.fixture('integration/JSONKit').to_s, :tag => 'v1.2' }
s.source_files = 'JSONKit.*'
end
target :AnotherTarget do
pod 'ASIHTTPRequest'
end
end

installer = SpecHelper::Installer.new(podfile)
installer.install!

dummy = (config.project_pods_root + 'PodsDummy_Pods_AnotherTarget.m').read
dummy.should.include?('@implementation PodsDummy_Pods_AnotherTarget')
end

it "installs a library with a podspec defined inline" do
@@ -61,7 +61,7 @@ def stub_podspec(pattern = nil, replacement = nil)
linter.warnings.should.not.be.empty
end

it "validates in lenient mode if there are no erros but there are warnings" do
it "validates in lenient mode if there are no errors but there are warnings" do
spec, file = write_podspec(stub_podspec(/.*license.*/, ""))
linter = Pod::Command::Spec::Linter.new(spec)
linter.lenient, linter.quick = true, true
@@ -107,7 +107,7 @@ def stub_podspec(pattern = nil, replacement = nil)
linter.errors.join(' | ').should.include "The resources did not match any file"
end

it "Uses the deployment target of the specification" do
it "uses the deployment target of the specification" do
spec, file = write_podspec(stub_podspec)
spec.stubs(:available_platforms).returns([Pod::Platform.new(:ios, "5.0")])
linter = Pod::Command::Spec::Linter.new(spec)
@@ -11,15 +11,28 @@
teardown_temporary_directory
end

it "generates a dummy sourcefile with the appropriate class" do
generator = Pod::Generator::DummySource.new
it "generates a dummy sourcefile with the appropriate class for the class name identifier" do
generator = Pod::Generator::DummySource.new('SomeIdentification')
file = temporary_directory + 'PodsDummy.m'
generator.save_as(file)
file.read.should == <<-EOS
@interface PodsDummy : NSObject
@interface PodsDummy_SomeIdentification : NSObject
@end
@implementation PodsDummy
@implementation PodsDummy_SomeIdentification
@end
EOS
end

it "generates a dummy sourcefile with the appropriate class, replacing non-alphanumeric characters with underscores" do
generator = Pod::Generator::DummySource.new('This!has_non-alphanumeric+characters in it.0123456789')
file = temporary_directory + 'PodsDummy.m'
generator.save_as(file)
file.read.should == <<-EOS
@interface PodsDummy_This_has_non_alphanumeric_characters_in_it_0123456789 : NSObject
@end
@implementation PodsDummy_This_has_non_alphanumeric_characters_in_it_0123456789
@end
EOS
end

end
@@ -16,6 +16,12 @@
podfile.target_definitions[:default].platform.deployment_target.should == Pod::Version.new('4.3')
end

it "raise error if unsupported platform is supplied" do
lambda {
Pod::Podfile.new { platform :iOS }
}.should.raise(StandardError, "Unsupported platform")
end

it "adds dependencies" do
podfile = Pod::Podfile.new { pod 'ASIHTTPRequest'; pod 'SSZipArchive', '>= 0.1' }
podfile.dependencies.size.should == 2