Permalink
Browse files

Merge pull request #99 from atomicobject/develop

Merging develop into master.
  • Loading branch information...
2 parents adbf302 + 2269c9d commit 2d0dd07d19bac707b6b3cdeb54105db08b033c75 @thestoics thestoics committed Oct 16, 2015
Showing 711 changed files with 17,763 additions and 22,218 deletions.
View
@@ -0,0 +1,6 @@
+[submodule "Vendor/Quick"]
+ path = Vendor/Quick
+ url = https://github.com/Quick/Quick.git
+[submodule "Vendor/Nimble"]
+ path = Vendor/Nimble
+ url = https://github.com/Quick/Nimble.git
View
@@ -1,3 +1,5 @@
language: objective-c
script: rake specs:all
-
+osx_image: xcode6.4
+install:
+ - bundle install
View
@@ -0,0 +1,28 @@
+# 1.4
+
+**[Breaking changes](#breaking-changes)**
+
+Nothing in this version has changed that would cause those that are upgrading from 1.3.1 any problems
+
+**[Changes](#changes)**
+
+1. Providers can be defined as a singletons, which means that Objection will save the first value generated by the provider.
+2. Fixed an issue where an object that is registered as a singleton in a module could not be an _eager singleton_
+
+# 1.6
+
+**[Breaking changes](#breaking-changes)**
+
+Nothing in this version has changed that would cause those that are upgrading from 1.4 any problems
+
+**[Changes](#changes)**
+
+1. Ad-Hoc initializers can be used via the JSObjectionInjector and JSObjectFactory
+
+# 1.6.1
+
+**[Changes](#changes)**
+
+1. Fixed build issues in XCode 6.4 and updated Nimble & Quick testing libraries
+2. Improved test output via xcpretty
+3. Fixed regression raised in issue #94 (https://github.com/atomicobject/objection/issues/94)
View
@@ -0,0 +1,2 @@
+source "http://rubygems.org"
+gem "xcpretty"
View
@@ -0,0 +1,10 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ xcpretty (0.1.10)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ xcpretty
View
@@ -7,16 +7,16 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
- <string>com.atomicobject.${PRODUCT_NAME:rfc1.3.14identifier}</string>
+ <string>com.atomicobject.${PRODUCT_NAME:rfc1.44identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
- <string>1.3.1</string>
+ <string>1.6.1</string>
<key>CFBundleSignature</key>
<string>ATOM</string>
<key>CFBundleVersion</key>
- <string>1.3.1</string>
+ <string>1.6.1</string>
</dict>
</plist>
View
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|
s.name = 'Objection'
- s.version = '1.3.1'
+ s.version = '1.6.1'
s.summary = 'A lightweight dependency injection framework for Objective-C.'
s.author = { 'Justin DeWind' => 'dewind@atomicobject.com' }
s.source = { :git => 'https://github.com/atomicobject/objection.git', :tag => "#{s.version}" }
s.homepage = 'http://www.objection-framework.org'
s.source_files = 'Source'
- s.license = "https://github.com/atomicobject/objection/blob/master/LICENSE"
+ s.license = { :type => "MIT" }
s.requires_arc = true
- s.ios.deployment_target = '5.0'
- s.osx.deployment_target = '10.7'
+ s.ios.deployment_target = '7.0'
+ s.osx.deployment_target = '10.8'
end

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0500"
+ LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -39,6 +39,15 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "D2AAC07D0554694100DB518D"
+ BuildableName = "libObjection-StaticLib.a"
+ BlueprintName = "Objection-StaticLib"
+ ReferencedContainer = "container:Objection.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0500"
+ LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -39,6 +39,15 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "4B25BE4A1291C43400821DC1"
+ BuildableName = "Objection-iOS"
+ BlueprintName = "Objection-iOS"
+ ReferencedContainer = "container:Objection.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0500"
+ LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -39,6 +39,15 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "4BED511512AA8B7A00CA6B36"
+ BuildableName = "Objection.framework"
+ BlueprintName = "Objection"
+ ReferencedContainer = "container:Objection.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0500"
+ LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -17,7 +17,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4B42587413F56EA3006BC001"
- BuildableName = "Specs-OSX.octest"
+ BuildableName = "Specs-OSX.xctest"
BlueprintName = "Specs-OSX"
ReferencedContainer = "container:Objection.xcodeproj">
</BuildableReference>
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
- LastUpgradeVersion = "0500"
+ LastUpgradeVersion = "0640"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
@@ -17,7 +17,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4B42580713F56CC0006BC001"
- BuildableName = "Specs-iOS.octest"
+ BuildableName = "Specs-iOS.xctest"
BlueprintName = "Specs-iOS"
ReferencedContainer = "container:Objection.xcodeproj">
</BuildableReference>
View
@@ -12,6 +12,7 @@ Objection is a lightweight dependency injection framework for Objective-C for Ma
* Meta Class Bindings
* Protocol Bindings
* Instance Bindings
+ * Named Bindings
* Lazily instantiates dependencies
* Eager Singletons
* Initializer Support
@@ -248,6 +249,36 @@ A class can be scoped as a singleton in a module. Conversely, a registered singl
@end
```
+### Named Bindings
+
+Dependencies of the same class or protocol can be identified using the *objection_requires_names* macro, which takes a dictionary of names to properties as a parameter.
+
+#### Example
+```objective-c
+@interface ShinyCar : NSObject
+@property (nonatomic, strong) Headlight *leftHeadlight;
+@property (nonatomic, strong) Headlight *rightHeadlight;
+@end
+
+@implementation ShinyCar
+objection_register(ShinyCar)
+objection_requires_names((@{@"LeftHeadlight":@"leftHeadlight", @"RightHeadlight":@"rightHeadlight"}))
+@synthesize leftHeadlight, rightHeadlight;
+@end
+
+@implementation NamedModule
+
+- (void)configure
+{
+ [self bind:[[Headlight alloc]init] toClass:[Headlight class] named:@"RightHeadlight"];
+ [self bindClass:[HIDHeadlight class] toClass:[Headlight class] named:@"LeftHeadlight"];
+
+}
+@end
+
+```
+
+
### Eager Singletons
You can mark registered singleton classes as eager singletons. Eager singletons will be instantiated during the creation of the injector rather than being lazily instantiated.
@@ -295,7 +326,7 @@ objection_initializer(initWithMake:model:)
@synthesize make;
@synthesize model;
-- (id)initWithMake:(NSString *)make model:(NSString *)model {
+- (instancetype)initWithMake:(NSString *)make model:(NSString *)model {
...
}
@end
@@ -306,6 +337,33 @@ objection_initializer(initWithMake:model:)
}
```
+#### Class Method Initializer
+```objective-c
+@implementation Truck
+objection_requires(@"engine", @"brakes")
+objection_initializer(truckWithMake:model:)
++ (instancetype)truckWithMake:(NSString *) make model: (NSString *)model {
+ ...
+}
+@end
+
+```
+
+#### Ad-Hoc Initializer
+```objective-c
+@implementation ConfigurableCar
+- (instancetype) initWithModel:(NSString *)model {
+ //....
+}
+@end
+
+- (void)buildCar {
+ ConfigurableCar *car = [self.objectFactory getObject:[ConfigurableCar class],
+ initializer: @selector(initWithModel:)
+ withArgumentList:@[@"Passat"]];
+}
+```
+
## Testing
If you're using [Kiwi](https://github.com/allending/Kiwi) for testing, checkout [MSSpec](https://github.com/mindsnacks/MSSpec). It provides a convenient way inject mocks into your specs using Objection.
@@ -318,12 +376,12 @@ If you're using [Kiwi](https://github.com/allending/Kiwi) for testing, checkout
### Static Framework and Linkable Framework
-It can be downloaded [here](http://objection-framework.org/files/Objection-1.3.1.tar.gz)
+It can be downloaded [here](https://github.com/atomicobject/objection/releases/download/1.6.1/Objection-1.6.1.tar.gz)
### Building Static Framework
git clone git://github.com/atomicobject/objection.git
- git checkout 1.3.1
+ git checkout 1.6.1
#### iOS
@@ -350,7 +408,7 @@ It can be downloaded [here](http://objection-framework.org/files/Objection-1.3.1
Edit your Pofile
edit Podfile
- pod 'Objection', '1.3.1'
+ pod 'Objection', '1.6.1'
Now you can install Objection
@@ -371,8 +429,8 @@ gem install motion-objection
## Requirements
-* MacOS X 10.7 +
-* iOS 5.0 +
+* MacOS X 10.8 +
+* iOS 7.0 +
## Authors
View
@@ -2,7 +2,7 @@ PROJECT_NAME = "Objection"
CONFIGURATION = "Debug"
SPECS_TARGET_NAME = "Specs-OSX"
UI_SPECS_TARGET_NAME = "Specs-iOS"
-IOS_VERSION = "6.1"
+IOS_VERSION = "7.1"
SDK_DIR = "iphonesimulator#{IOS_VERSION}"
def xcodebuild_executable
@@ -30,12 +30,12 @@ end
namespace :artifact do
desc "Build OSX Framework"
task :osx => :clean do
- system_or_exit(%Q[#{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -target Objection -configuration Release build], nil)
+ system_or_exit(%Q[set -o pipefail; #{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -target Objection -configuration Release build | xcpretty -c], nil)
end
desc "Build iOS Framework"
task :ios => :clean do
- system_or_exit(%Q[#{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -target Objection-iOS -configuration Release build], nil)
+ system_or_exit(%Q[set -o pipefail; #{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -target Objection-iOS -configuration Release build | xcpretty -c] , nil)
end
require 'rake/clean'
@@ -56,28 +56,36 @@ end
task :clean do
stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "clean.output") if (ENV['IS_CI_BOX'])
- system_or_exit(%Q[#{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -alltargets -configuration #{CONFIGURATION} clean], stdout)
+ system_or_exit(%Q[set -o pipefail; #{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -alltargets -configuration #{CONFIGURATION} clean | xcpretty -c], stdout)
end
task :build_all do
stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "build_all.output") if (ENV['IS_CI_BOX'])
- system_or_exit(%Q[#{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -alltargets -configuration #{CONFIGURATION} build], stdout)
+ system_or_exit(%Q[set -o pipefail; #{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -alltargets -configuration #{CONFIGURATION} build | xcpretty -c], stdout)
end
+namespace :pod do
+ desc "Publish CocoaPod"
+ task :publish do
+ system_or_exit %Q[pod trunk push Objection.podspec --allow-warnings]
+ end
+end
+
+
namespace :specs do
desc "All Specs"
task :all => [:osx, :ios]
desc "OS X Specs"
task :osx do
stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "build_specs.output") if (ENV['IS_CI_BOX'])
- system_or_exit(%Q[#{xcodebuild_executable} test -project #{PROJECT_NAME}.xcodeproj -scheme #{SPECS_TARGET_NAME} -configuration #{CONFIGURATION}], stdout)
+ system_or_exit(%Q[set -o pipefail; #{xcodebuild_executable} test -project #{PROJECT_NAME}.xcodeproj -scheme #{SPECS_TARGET_NAME} -configuration #{CONFIGURATION} | xcpretty -c], stdout)
end
desc "iOS Specs"
task :ios do
stdout = File.join(ENV['CC_BUILD_ARTIFACTS'], "build_uispecs.output") if (ENV['IS_CI_BOX'])
ENV["TEST_AFTER_BUILD"] = "Yes"
- system_or_exit(%Q[#{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -scheme #{UI_SPECS_TARGET_NAME} -sdk iphonesimulator -configuration #{CONFIGURATION} test ], stdout)
+ system_or_exit(%Q[set -o pipefail; #{xcodebuild_executable} -project #{PROJECT_NAME}.xcodeproj -scheme #{UI_SPECS_TARGET_NAME} -sdk iphonesimulator -configuration #{CONFIGURATION} -destination 'platform=iOS Simulator,name=iPhone 6,OS=latest' test | xcpretty -c], stdout)
end
end
Oops, something went wrong.

0 comments on commit 2d0dd07

Please sign in to comment.