cocoapods-deintegrate 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +16 -19
- data/cocoapods_deintegrate.gemspec +1 -1
- data/lib/cocoapods_deintegrate.rb +1 -1
- data/lib/pod/command/deintegrate.rb +27 -15
- data/spec/command/deintegrate_spec.rb +47 -1
- data/spec/fixtures/Project/Frameworks/Podfile +12 -0
- data/spec/fixtures/Project/Frameworks/Podfile.lock +42 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/QueryKit/QKAttribute.h +210 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/QueryKit/QKQuerySet.h +155 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/QueryKit/QueryKit.h +19 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/Quick/NSString+QCKSelectorName.h +17 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/Quick/QCKDSL.h +211 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/Quick/Quick.h +13 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/Quick/QuickConfiguration.h +30 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Private/Quick/QuickSpec.h +48 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/QueryKit/QKAttribute.h +210 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/QueryKit/QKQuerySet.h +155 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/QueryKit/QueryKit.h +19 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/Quick/NSString+QCKSelectorName.h +17 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/Quick/QCKDSL.h +211 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/Quick/Quick.h +13 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/Quick/QuickConfiguration.h +30 -0
- data/spec/fixtures/Project/Frameworks/Pods/Headers/Public/Quick/QuickSpec.h +48 -0
- data/spec/fixtures/Project/Frameworks/Pods/Manifest.lock +42 -0
- data/spec/fixtures/Project/Frameworks/Pods/Pods.xcodeproj/project.pbxproj +995 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/LICENSE +23 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/Attribute.swift +124 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/Expression.swift +41 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/ObjectiveC/QKAttribute.h +210 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/ObjectiveC/QKAttribute.m +315 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/ObjectiveC/QKAttribute.swift +13 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/ObjectiveC/QKQuerySet.h +155 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/ObjectiveC/QKQuerySet.m +314 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/ObjectiveC/QKQuerySet.swift +28 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/Predicate.swift +21 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/QueryKit.h +19 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/QueryKit/QuerySet.swift +237 -0
- data/spec/fixtures/Project/Frameworks/Pods/QueryKit/README.md +151 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/LICENSE +201 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Callsite.swift +28 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Configuration/Configuration.swift +147 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Configuration/QuickConfiguration.h +30 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Configuration/QuickConfiguration.m +83 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/DSL/DSL.swift +227 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/DSL/QCKDSL.h +211 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/DSL/QCKDSL.m +70 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/DSL/World+DSL.swift +100 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Example.swift +103 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/ExampleGroup.swift +97 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/ExampleMetadata.swift +22 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Failure.swift +16 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Filter.swift +29 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Hooks/Closures.swift +35 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Hooks/ExampleHooks.swift +36 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Hooks/SuiteHooks.swift +34 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/NSString+QCKSelectorName.h +17 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/NSString+QCKSelectorName.m +33 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/Quick.h +13 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/QuickSpec.h +48 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/QuickSpec.m +142 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/Quick/World.swift +197 -0
- data/spec/fixtures/Project/Frameworks/Pods/Quick/README.md +979 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Info.plist +26 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit-Private.xcconfig +9 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit-dummy.m +5 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit-prefix.pch +5 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit-umbrella.h +9 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit.modulemap +6 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit.xcconfig b/data/spec/fixtures/Project/Frameworks/Pods/Target Support → Files/Pods-TestProject-QueryKit/Pods-TestProject-QueryKit.xcconfig +0 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Info.plist +26 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-acknowledgements.markdown +30 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-acknowledgements.plist +60 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-dummy.m +5 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-environment.h +74 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-frameworks.sh +55 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-resources.sh +74 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-umbrella.h +6 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject.debug.xcconfig +9 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject.modulemap +6 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProject/Pods-TestProject.release.xcconfig +9 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Info.plist +26 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Pods-TestProjectTests-Quick-Private.xcconfig +9 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Pods-TestProjectTests-Quick-dummy.m +5 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Pods-TestProjectTests-Quick-prefix.pch +5 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Pods-TestProjectTests-Quick-umbrella.h +11 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Pods-TestProjectTests-Quick.modulemap +6 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests-Quick/Pods-TestProjectTests-Quick.xcconfig +2 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Info.plist +26 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-acknowledgements.markdown +208 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-acknowledgements.plist +238 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-dummy.m +5 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-environment.h +14 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-frameworks.sh +55 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-resources.sh +74 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-umbrella.h +6 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests.debug.xcconfig +9 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests.modulemap +6 -0
- data/spec/fixtures/Project/Frameworks/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests.release.xcconfig +9 -0
- data/spec/fixtures/Project/Frameworks/TestProject.xcodeproj/project.pbxproj +557 -0
- data/spec/fixtures/Project/Frameworks/TestProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/spec/fixtures/Project/Frameworks/TestProject.xcworkspace/contents.xcworkspacedata +10 -0
- data/spec/fixtures/Project/Frameworks/TestProject/AppDelegate.swift +46 -0
- data/spec/fixtures/Project/Frameworks/TestProject/Base.lproj/LaunchScreen.xib +41 -0
- data/spec/fixtures/Project/Frameworks/TestProject/Base.lproj/Main.storyboard +25 -0
- data/spec/fixtures/Project/Frameworks/TestProject/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
- data/spec/fixtures/Project/Frameworks/TestProject/Info.plist +40 -0
- data/spec/fixtures/Project/Frameworks/TestProject/ViewController.swift +25 -0
- data/spec/fixtures/Project/Frameworks/TestProjectTests/Info.plist +24 -0
- data/spec/fixtures/Project/Frameworks/TestProjectTests/TestProjectTests.swift +36 -0
- data/spec/fixtures/Project/None/TestProject.xcodeproj/project.pbxproj +420 -0
- data/spec/fixtures/Project/None/TestProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/spec/fixtures/Project/None/TestProject/AppDelegate.swift +46 -0
- data/spec/fixtures/Project/None/TestProject/Base.lproj/LaunchScreen.xib +41 -0
- data/spec/fixtures/Project/None/TestProject/Base.lproj/Main.storyboard +25 -0
- data/spec/fixtures/Project/None/TestProject/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
- data/spec/fixtures/Project/None/TestProject/Info.plist +40 -0
- data/spec/fixtures/Project/None/TestProject/ViewController.swift +25 -0
- data/spec/fixtures/Project/None/TestProjectTests/Info.plist +24 -0
- data/spec/fixtures/Project/None/TestProjectTests/TestProjectTests.swift +36 -0
- data/spec/fixtures/Project/StaticLibraries/Podfile +12 -0
- data/spec/fixtures/Project/StaticLibraries/Podfile.lock +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/LICENSE +19 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/README.md +308 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPBackwardCompatibility.h +42 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPBackwardCompatibility.m +17 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPBlockDefinedMatcher.h +25 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPBlockDefinedMatcher.m +60 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPDefines.h +17 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPDoubleTuple.h +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPDoubleTuple.m +42 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPExpect.h +45 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPExpect.m +214 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPFloatTuple.h +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPFloatTuple.m +42 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPMatcher.h +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPUnsupportedObject.h +11 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/EXPUnsupportedObject.m +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/Expecta.h +27 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/Expecta.m +15 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/ExpectaSupport.h +64 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/ExpectaSupport.m +187 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/NSObject+Expecta.h +14 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/NSValue+Expecta.h +8 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/NSValue+Expecta.m +21 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatcherHelpers.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatcherHelpers.m +9 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beCloseTo.h +7 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beCloseTo.m +49 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beFalsy.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beFalsy.m +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beGreaterThan.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beGreaterThan.m +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beGreaterThanOrEqualTo.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beGreaterThanOrEqualTo.m +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beIdenticalTo.h +10 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beIdenticalTo.m +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beInTheRangeOf.m +30 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.h +7 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beInstanceOf.m +27 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beKindOf.m +27 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beLessThan.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beLessThan.m +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beLessThanOrEqualTo.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beLessThanOrEqualTo.m +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beNil.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beNil.m +16 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beSubclassOf.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beSubclassOf.m +27 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beSupersetOf.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beSupersetOf.m +57 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beTruthy.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beTruthy.m +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beginWith.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+beginWith.m +49 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+conformTo.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+conformTo.m +33 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+contain.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+contain.m +38 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+endWith.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+endWith.m +49 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+equal.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+equal.m +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+haveCountOf.h +10 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+haveCountOf.m +36 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+notify.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+notify.m +63 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+raise.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+raise.m +30 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+raiseWithReason.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+raiseWithReason.m +35 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+respondTo.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers+respondTo.m +28 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Expecta/src/matchers/EXPMatchers.h +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPBackwardCompatibility.h +42 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPBlockDefinedMatcher.h +25 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPDefines.h +17 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPDoubleTuple.h +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPExpect.h +45 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPFloatTuple.h +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatcher.h +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatcherHelpers.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beCloseTo.h +7 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beFalsy.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beGreaterThan.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beGreaterThanOrEqualTo.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beIdenticalTo.h +10 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beInTheRangeOf.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beInstanceOf.h +7 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beKindOf.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beLessThan.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beLessThanOrEqualTo.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beNil.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beSubclassOf.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beSupersetOf.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beTruthy.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+beginWith.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+conformTo.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+contain.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+endWith.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+equal.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+haveCountOf.h +10 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+notify.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+raise.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+raiseWithReason.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers+respondTo.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPMatchers.h +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/EXPUnsupportedObject.h +11 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/Expecta.h +27 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/ExpectaSupport.h +64 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/NSObject+Expecta.h +14 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/Expecta/NSValue+Expecta.h +8 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Private/NSAttributedString+CCLFormat/NSAttributedString+CCLFormat.h +21 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPBackwardCompatibility.h +42 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPBlockDefinedMatcher.h +25 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPDefines.h +17 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPDoubleTuple.h +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPExpect.h +45 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPFloatTuple.h +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatcher.h +20 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatcherHelpers.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beCloseTo.h +7 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beFalsy.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beGreaterThan.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beGreaterThanOrEqualTo.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beIdenticalTo.h +10 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beInTheRangeOf.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beInstanceOf.h +7 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beKindOf.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beLessThan.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beLessThanOrEqualTo.h +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beNil.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beSubclassOf.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beSupersetOf.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beTruthy.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+beginWith.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+conformTo.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+contain.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+endWith.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+equal.h +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+haveCountOf.h +10 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+notify.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+raise.h +4 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+raiseWithReason.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers+respondTo.h +3 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPMatchers.h +24 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/EXPUnsupportedObject.h +11 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/Expecta.h +27 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/ExpectaSupport.h +64 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/NSObject+Expecta.h +14 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/Expecta/NSValue+Expecta.h +8 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Headers/Public/NSAttributedString+CCLFormat/NSAttributedString+CCLFormat.h +21 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Manifest.lock +13 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/NSAttributedString+CCLFormat/LICENSE +23 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/NSAttributedString+CCLFormat/NSAttributedString+CCLFormat.h +21 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/NSAttributedString+CCLFormat/NSAttributedString+CCLFormat.m +51 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/NSAttributedString+CCLFormat/README.md +57 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Pods.xcodeproj/project.pbxproj +943 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject-NSAttributedString+CCLFormat/Pods-TestProject-NSAttributedString+CCLFormat-Private.xcconfig +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject-NSAttributedString+CCLFormat/Pods-TestProject-NSAttributedString+CCLFormat-dummy.m +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject-NSAttributedString+CCLFormat/Pods-TestProject-NSAttributedString+CCLFormat-prefix.pch +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject-NSAttributedString+CCLFormat/Pods-TestProject-NSAttributedString+CCLFormat.xcconfig b/data/spec/fixtures/Project/StaticLibraries/Pods/Target Support → Files/Pods-TestProject-NSAttributedString+CCLFormat/Pods-TestProject-NSAttributedString+CCLFormat.xcconfig +0 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-acknowledgements.markdown +30 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-acknowledgements.plist +60 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-dummy.m +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-environment.h +14 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject-resources.sh +74 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject.debug.xcconfig +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProject/Pods-TestProject.release.xcconfig +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests-Expecta/Pods-TestProjectTests-Expecta-Private.xcconfig +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests-Expecta/Pods-TestProjectTests-Expecta-dummy.m +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests-Expecta/Pods-TestProjectTests-Expecta-prefix.pch +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests-Expecta/Pods-TestProjectTests-Expecta.xcconfig +1 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-acknowledgements.markdown +26 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-acknowledgements.plist +56 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-dummy.m +5 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-environment.h +14 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests-resources.sh +74 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests.debug.xcconfig +6 -0
- data/spec/fixtures/Project/StaticLibraries/Pods/Target Support Files/Pods-TestProjectTests/Pods-TestProjectTests.release.xcconfig +6 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject.xcodeproj/project.pbxproj +525 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject.xcworkspace/contents.xcworkspacedata +10 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject/AppDelegate.swift +46 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject/Base.lproj/LaunchScreen.xib +41 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject/Base.lproj/Main.storyboard +25 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject/Info.plist +40 -0
- data/spec/fixtures/Project/StaticLibraries/TestProject/ViewController.swift +25 -0
- data/spec/fixtures/Project/StaticLibraries/TestProjectTests/Info.plist +24 -0
- data/spec/fixtures/Project/StaticLibraries/TestProjectTests/TestProjectTests.swift +36 -0
- metadata +620 -7
@@ -0,0 +1,13 @@
|
|
1
|
+
import Foundation
|
2
|
+
|
3
|
+
extension Attribute {
|
4
|
+
public func asQKAttribute() -> QKAttribute {
|
5
|
+
return QKAttribute(name: name)
|
6
|
+
}
|
7
|
+
}
|
8
|
+
|
9
|
+
extension QKAttribute {
|
10
|
+
public func asAttribute() -> Attribute<AnyObject> {
|
11
|
+
return Attribute<AnyObject>(name)
|
12
|
+
}
|
13
|
+
}
|
@@ -0,0 +1,155 @@
|
|
1
|
+
//
|
2
|
+
// QKQuerySet.h
|
3
|
+
// QueryKit
|
4
|
+
//
|
5
|
+
// Created by Kyle Fuller on 30/04/2013.
|
6
|
+
//
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <Foundation/Foundation.h>
|
10
|
+
#import <CoreData/CoreData.h>
|
11
|
+
|
12
|
+
/**
|
13
|
+
Represents a lazy Core Data lookup for a set of objects.
|
14
|
+
|
15
|
+
This object is immutable, any changes will normally be done to a copy. Such
|
16
|
+
as with the `-filter:`, `-exclude:`, `-orderBy:` and `-reverse` methods.
|
17
|
+
*/
|
18
|
+
|
19
|
+
@interface QKQuerySet : NSObject <NSFastEnumeration, NSCopying>
|
20
|
+
|
21
|
+
/// The managed object context for the query set
|
22
|
+
@property (nonatomic, strong, readonly) NSManagedObjectContext *managedObjectContext;
|
23
|
+
|
24
|
+
/// The entity descriptor for the object
|
25
|
+
@property (nonatomic, strong, readonly) NSEntityDescription *entityDescription;
|
26
|
+
|
27
|
+
/** This is a read only property to hold any predicates set on this object. You can use the `filter:` and `exclude:` methods to effect this value on a child */
|
28
|
+
@property (nonatomic, copy, readonly) NSPredicate *predicate;
|
29
|
+
|
30
|
+
/** This is a read only property to hold any sort descriptors set on this object. You can use the `orderBy:` and `reverse` methods to effect this value on a child */
|
31
|
+
@property (nonatomic, copy, readonly) NSArray *sortDescriptors;
|
32
|
+
|
33
|
+
/** This is a read only property to hold a range set. */
|
34
|
+
@property (nonatomic, assign, readonly) NSRange range;
|
35
|
+
|
36
|
+
#pragma mark - Creation
|
37
|
+
|
38
|
+
- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)managedObjectContext entityDescription:(NSEntityDescription *)entityDescription __attribute((nonnull));
|
39
|
+
- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)managedObjectContext entityDescription:(NSEntityDescription *)entityDescription predicate:(NSPredicate *)predicate sortDescriptors:(NSArray *)sortDescriptors range:(NSRange)range __attribute((nonnull(1, 2)));
|
40
|
+
- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)managedObjectContext fetchRequest:(NSFetchRequest *)fetchRequest __attribute((nonnull));
|
41
|
+
|
42
|
+
#pragma mark - Equality
|
43
|
+
|
44
|
+
/** Returns a Boolean value that indicates whether a given queryset is equal to the receiver
|
45
|
+
@param queryset The queryset to compare against the receiver
|
46
|
+
@return YES if queryset is equivalent to the receiver
|
47
|
+
*/
|
48
|
+
- (BOOL)isEqualToQuerySet:(QKQuerySet *)queryset;
|
49
|
+
|
50
|
+
#pragma mark -
|
51
|
+
|
52
|
+
/** Returns a fetch request for the queryset */
|
53
|
+
- (NSFetchRequest *)fetchRequest;
|
54
|
+
|
55
|
+
/** Returns the amount of objects matching the set predicate
|
56
|
+
@param error If there is a problem fetching the count, upon return contains an instance of NSError that describes the problem.
|
57
|
+
@return The number of objects matching the set predicate
|
58
|
+
*/
|
59
|
+
- (NSUInteger)count:(NSError **)error;
|
60
|
+
|
61
|
+
/** Returns all objects matching the set predicate ordered by any set sort descriptors as an array
|
62
|
+
@param error If there is a problem fetching the objects, upon return contains an instance of NSError that describes the problem.
|
63
|
+
@return An array containing all matched objects
|
64
|
+
*/
|
65
|
+
- (NSArray *)array:(NSError **)error;
|
66
|
+
|
67
|
+
/** Returns all objects matching the set predicate ordered by any set sort descriptors as an ordered set
|
68
|
+
@param error If there is a problem fetching the objects, upon return contains an instance of NSError that describes the problem.
|
69
|
+
@return An ordered set containing all matched objects
|
70
|
+
*/
|
71
|
+
- (NSSet *)set:(NSError **)error;
|
72
|
+
|
73
|
+
/** Returns all objects matching the set predicate ordered by any set sort descriptors as a set
|
74
|
+
@param error If there is a problem fetching the objects, upon return contains an instance of NSError that describes the problem.
|
75
|
+
@return A set containing all matched objects
|
76
|
+
*/
|
77
|
+
- (NSOrderedSet *)orderedSet:(NSError **)error;
|
78
|
+
|
79
|
+
#pragma mark - Enumeration
|
80
|
+
|
81
|
+
/** Enumerate all objects matching the set predicate ordered by any set sort descriptors
|
82
|
+
@param block The block to apply to elements in the array
|
83
|
+
@param error If there is a problem fetching the objects, upon return contains an instance of NSError that describes the problem.
|
84
|
+
@return YES if the operation succeeded.
|
85
|
+
*/
|
86
|
+
- (BOOL)enumerateObjects:(void (^)(NSManagedObject *object, NSUInteger index, BOOL *stop))block error:(NSError **)error;
|
87
|
+
|
88
|
+
/** Enumerate all objects matching the set predicate ordered by any set sort descriptors
|
89
|
+
@param block The block to apply to all objects
|
90
|
+
@param error If there is a problem fetching the objects, upon return contains an instance of NSError that describes the problem.
|
91
|
+
@return YES if the operation succeeded.
|
92
|
+
*/
|
93
|
+
- (BOOL)each:(void (^)(NSManagedObject *managedObject))block error:(NSError **)error;
|
94
|
+
|
95
|
+
#pragma mark - Deletion
|
96
|
+
|
97
|
+
/** Delete all objects matching the set predicate
|
98
|
+
@param error If there is a problem deleting the objects, upon return contains an instance of NSError that describes the problem.
|
99
|
+
@return Returns the amount of objects that were deleted
|
100
|
+
*/
|
101
|
+
- (NSUInteger)deleteObjects:(NSError **)error;
|
102
|
+
|
103
|
+
@end
|
104
|
+
|
105
|
+
/// Methods to sort an query set
|
106
|
+
@interface QKQuerySet (Sorting)
|
107
|
+
|
108
|
+
/** Returns a copy and the sort descriptors */
|
109
|
+
- (instancetype)orderBy:(NSArray *)sortDescriptors;
|
110
|
+
|
111
|
+
/** Returns a copy and reverses any sort descriptors */
|
112
|
+
- (instancetype)reverse;
|
113
|
+
|
114
|
+
@end
|
115
|
+
|
116
|
+
/// Filtering related methods of QKQuerySet
|
117
|
+
@interface QKQuerySet (Filtering)
|
118
|
+
|
119
|
+
/** Returns a copy filtered by a predicate */
|
120
|
+
- (instancetype)filter:(NSPredicate *)predicate;
|
121
|
+
|
122
|
+
/** Returns a copy excluding a predicate */
|
123
|
+
- (instancetype)exclude:(NSPredicate *)predicate;
|
124
|
+
|
125
|
+
@end
|
126
|
+
|
127
|
+
/// Fetching single objects in QKQuerySet
|
128
|
+
@interface QKQuerySet (SingleObject)
|
129
|
+
|
130
|
+
/** Returns a single object matching the filters, if there is more than one. An error will instead be returned.
|
131
|
+
@param error If there is a problem fetching the object or there is more than one object, upon return contains an instance of NSError that describes the problem.
|
132
|
+
@return Returns the object matching the set predicate, or nil.
|
133
|
+
*/
|
134
|
+
- (NSManagedObject *)object:(NSError **)error;
|
135
|
+
|
136
|
+
/** Returns the first object matching the filters ordered by the set sort descriptors.
|
137
|
+
@param error If there is a problem fetching the object, upon return contains an instance of NSError that describes the problem.
|
138
|
+
@return Returns the first object matching the set predicate, or nil.
|
139
|
+
*/
|
140
|
+
- (NSManagedObject *)firstObject:(NSError **)error;
|
141
|
+
|
142
|
+
/** Returns the last object matching the filters ordered by the set sort descriptors.
|
143
|
+
@param error If there is a problem fetching the object, upon return contains an instance of NSError that describes the problem.
|
144
|
+
@return Returns the last object matching the set predicate, or nil.
|
145
|
+
*/
|
146
|
+
- (NSManagedObject *)lastObject:(NSError **)error;
|
147
|
+
|
148
|
+
@end
|
149
|
+
|
150
|
+
|
151
|
+
@interface NSManagedObject (QKQuerySet)
|
152
|
+
|
153
|
+
+ (QKQuerySet *)querySetWithManagedObjectContext:(NSManagedObjectContext *)context;
|
154
|
+
|
155
|
+
@end
|
@@ -0,0 +1,314 @@
|
|
1
|
+
//
|
2
|
+
// QKQuerySet.m
|
3
|
+
// QueryKit
|
4
|
+
//
|
5
|
+
// Created by Kyle Fuller on 30/04/2013.
|
6
|
+
//
|
7
|
+
//
|
8
|
+
|
9
|
+
#import "QKQuerySet.h"
|
10
|
+
|
11
|
+
NSString * const QKQuerySetErrorDomain = @"QKQuerySetErrorDomain";
|
12
|
+
|
13
|
+
@interface QKQuerySet ()
|
14
|
+
|
15
|
+
@property (nonatomic, strong) NSArray *resultsCache;
|
16
|
+
|
17
|
+
@end
|
18
|
+
|
19
|
+
@implementation QKQuerySet
|
20
|
+
|
21
|
+
#pragma mark - Creation
|
22
|
+
|
23
|
+
- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)managedObjectContext entityDescription:(NSEntityDescription *)entityDescription {
|
24
|
+
return [self initWithManagedObjectContext:managedObjectContext entityDescription:entityDescription predicate:nil sortDescriptors:nil range:NSMakeRange(NSNotFound, NSNotFound)];
|
25
|
+
}
|
26
|
+
|
27
|
+
- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)managedObjectContext fetchRequest:(NSFetchRequest *)fetchRequest {
|
28
|
+
NSParameterAssert(fetchRequest != nil);
|
29
|
+
|
30
|
+
NSEntityDescription *entityDescription = [fetchRequest entity];
|
31
|
+
NSPredicate *predicate = [fetchRequest predicate];
|
32
|
+
NSArray *sortDescriptors = [fetchRequest sortDescriptors];
|
33
|
+
|
34
|
+
return [self initWithManagedObjectContext:managedObjectContext entityDescription:entityDescription predicate:predicate sortDescriptors:sortDescriptors range:NSMakeRange(NSNotFound, NSNotFound)];
|
35
|
+
}
|
36
|
+
|
37
|
+
- (instancetype)initWithManagedObjectContext:(NSManagedObjectContext *)managedObjectContext entityDescription:(NSEntityDescription *)entityDescription predicate:(NSPredicate *)predicate sortDescriptors:(NSArray *)sortDescriptors range:(NSRange)range {
|
38
|
+
NSParameterAssert(managedObjectContext != nil);
|
39
|
+
NSParameterAssert(entityDescription != nil);
|
40
|
+
|
41
|
+
if (self = [super init]) {
|
42
|
+
_managedObjectContext = managedObjectContext;
|
43
|
+
_entityDescription = entityDescription;
|
44
|
+
_predicate = [predicate copy];
|
45
|
+
_sortDescriptors = sortDescriptors? [sortDescriptors copy] : @[];
|
46
|
+
_range = range;
|
47
|
+
}
|
48
|
+
|
49
|
+
return self;
|
50
|
+
}
|
51
|
+
|
52
|
+
- (instancetype)init {
|
53
|
+
NSString *reason = [NSString stringWithFormat:@"%@ Failed to call designated initializer.", NSStringFromClass([self class])];
|
54
|
+
@throw [NSException exceptionWithName:NSInternalInconsistencyException reason:reason userInfo:nil];
|
55
|
+
}
|
56
|
+
|
57
|
+
#pragma mark - Equality
|
58
|
+
|
59
|
+
- (NSUInteger)hash {
|
60
|
+
return [self.managedObjectContext hash];
|
61
|
+
}
|
62
|
+
|
63
|
+
- (BOOL)isEqual:(id)object {
|
64
|
+
if (self == object) {
|
65
|
+
return YES;
|
66
|
+
}
|
67
|
+
|
68
|
+
if ([object isKindOfClass:[QKQuerySet class]] == NO) {
|
69
|
+
return NO;
|
70
|
+
}
|
71
|
+
|
72
|
+
return [self isEqualToQuerySet:object];
|
73
|
+
}
|
74
|
+
|
75
|
+
- (BOOL)isEqualToQuerySet:(QKQuerySet *)queryset {
|
76
|
+
return (
|
77
|
+
[self.managedObjectContext isEqual:[queryset managedObjectContext]] &&
|
78
|
+
[self.entityDescription isEqual:[queryset entityDescription]] &&
|
79
|
+
[self.predicate isEqual:[queryset predicate]] &&
|
80
|
+
[self.sortDescriptors isEqual:[queryset sortDescriptors]] &&
|
81
|
+
NSEqualRanges(self.range, queryset.range)
|
82
|
+
);
|
83
|
+
}
|
84
|
+
|
85
|
+
#pragma mark - NSCopying
|
86
|
+
|
87
|
+
- (instancetype)copyWithZone:(NSZone *)zone {
|
88
|
+
return [[[self class] allocWithZone:zone] initWithManagedObjectContext:self.managedObjectContext entityDescription:self.entityDescription predicate:self.predicate sortDescriptors:self.sortDescriptors range:self.range];
|
89
|
+
}
|
90
|
+
|
91
|
+
#pragma mark - NSFastEnumeration
|
92
|
+
|
93
|
+
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id __unsafe_unretained [])buffer count:(NSUInteger)len {
|
94
|
+
if (_resultsCache == nil) {
|
95
|
+
[self array:nil];
|
96
|
+
}
|
97
|
+
|
98
|
+
return [_resultsCache countByEnumeratingWithState:state objects:buffer count:len];
|
99
|
+
}
|
100
|
+
|
101
|
+
#pragma mark - Fetching
|
102
|
+
|
103
|
+
- (NSFetchRequest *)fetchRequest {
|
104
|
+
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
|
105
|
+
[fetchRequest setEntity:_entityDescription];
|
106
|
+
[fetchRequest setPredicate:self.predicate];
|
107
|
+
[fetchRequest setSortDescriptors:self.sortDescriptors];
|
108
|
+
|
109
|
+
if (self.range.location != NSNotFound) {
|
110
|
+
fetchRequest.fetchOffset = self.range.location;
|
111
|
+
fetchRequest.fetchLimit = self.range.length;
|
112
|
+
}
|
113
|
+
|
114
|
+
return fetchRequest;
|
115
|
+
}
|
116
|
+
|
117
|
+
- (NSUInteger)count:(NSError **)error {
|
118
|
+
NSUInteger count = 0;
|
119
|
+
|
120
|
+
if (_resultsCache) {
|
121
|
+
count = [_resultsCache count];
|
122
|
+
} else {
|
123
|
+
NSFetchRequest *fetchRequest = [self fetchRequest];
|
124
|
+
count = [self.managedObjectContext countForFetchRequest:fetchRequest error:error];
|
125
|
+
}
|
126
|
+
|
127
|
+
return count;
|
128
|
+
}
|
129
|
+
|
130
|
+
- (NSArray *)array:(NSError **)error {
|
131
|
+
if (_resultsCache == nil) {
|
132
|
+
_resultsCache = [self.managedObjectContext executeFetchRequest:[self fetchRequest] error:error];
|
133
|
+
}
|
134
|
+
|
135
|
+
return _resultsCache;
|
136
|
+
}
|
137
|
+
|
138
|
+
- (NSSet *)set:(NSError **)error {
|
139
|
+
NSArray *array = [self array:error];
|
140
|
+
NSSet *set;
|
141
|
+
|
142
|
+
if (array != nil) {
|
143
|
+
set = [NSSet setWithArray:array];
|
144
|
+
}
|
145
|
+
|
146
|
+
return set;
|
147
|
+
}
|
148
|
+
|
149
|
+
- (NSOrderedSet *)orderedSet:(NSError **)error {
|
150
|
+
NSArray *array = [self array:error];
|
151
|
+
NSOrderedSet *orderedSet;
|
152
|
+
|
153
|
+
if (array != nil) {
|
154
|
+
orderedSet = [NSOrderedSet orderedSetWithArray:array];
|
155
|
+
}
|
156
|
+
|
157
|
+
return orderedSet;
|
158
|
+
}
|
159
|
+
|
160
|
+
- (BOOL)enumerateObjects:(void (^)(NSManagedObject *object, NSUInteger index, BOOL *stop))block error:(NSError **)error {
|
161
|
+
NSArray *array = [self array:error];
|
162
|
+
|
163
|
+
if (array != nil) {
|
164
|
+
[array enumerateObjectsUsingBlock:block];
|
165
|
+
}
|
166
|
+
|
167
|
+
return array != nil;
|
168
|
+
}
|
169
|
+
|
170
|
+
- (BOOL)each:(void (^)(NSManagedObject *managedObject))block error:(NSError **)error {
|
171
|
+
NSArray *array = [self array:error];
|
172
|
+
|
173
|
+
if (array != nil) {
|
174
|
+
for (NSManagedObject *managedObject in array) {
|
175
|
+
block(managedObject);
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
return array != nil;
|
180
|
+
}
|
181
|
+
|
182
|
+
#pragma mark - Deletion
|
183
|
+
|
184
|
+
- (NSUInteger)deleteObjects:(NSError **)error {
|
185
|
+
NSArray *array = [self array:error];
|
186
|
+
|
187
|
+
NSUInteger count = 0;
|
188
|
+
|
189
|
+
if (array != nil) {
|
190
|
+
NSManagedObjectContext *managedObjectContext = self.managedObjectContext;
|
191
|
+
|
192
|
+
for (NSManagedObject *managedObject in array) {
|
193
|
+
[managedObjectContext deleteObject:managedObject];
|
194
|
+
++count;
|
195
|
+
}
|
196
|
+
}
|
197
|
+
|
198
|
+
return count;
|
199
|
+
}
|
200
|
+
|
201
|
+
@end
|
202
|
+
|
203
|
+
@implementation QKQuerySet (Sorting)
|
204
|
+
|
205
|
+
- (instancetype)orderBy:(NSArray *)sortDescriptors {
|
206
|
+
return [[QKQuerySet alloc] initWithManagedObjectContext:_managedObjectContext entityDescription:_entityDescription predicate:_predicate sortDescriptors:sortDescriptors range:self.range];
|
207
|
+
}
|
208
|
+
|
209
|
+
- (instancetype)reverse {
|
210
|
+
NSMutableArray *sortDescriptors = [[NSMutableArray alloc] initWithCapacity:[_sortDescriptors count]];
|
211
|
+
|
212
|
+
for (NSSortDescriptor *sortDescriptor in _sortDescriptors) {
|
213
|
+
[sortDescriptors addObject:[sortDescriptor reversedSortDescriptor]];
|
214
|
+
}
|
215
|
+
|
216
|
+
return [[QKQuerySet alloc] initWithManagedObjectContext:_managedObjectContext entityDescription:_entityDescription predicate:_predicate sortDescriptors:sortDescriptors range:self.range];
|
217
|
+
}
|
218
|
+
|
219
|
+
@end
|
220
|
+
|
221
|
+
@implementation QKQuerySet (Filtering)
|
222
|
+
|
223
|
+
- (instancetype)exclude:(NSPredicate *)predicate {
|
224
|
+
predicate = [[NSCompoundPredicate alloc] initWithType:NSNotPredicateType subpredicates:@[predicate]];
|
225
|
+
|
226
|
+
if (_predicate) {
|
227
|
+
predicate = [[NSCompoundPredicate alloc] initWithType:NSAndPredicateType subpredicates:@[_predicate, predicate]];
|
228
|
+
}
|
229
|
+
|
230
|
+
return [[QKQuerySet alloc] initWithManagedObjectContext:_managedObjectContext entityDescription:_entityDescription predicate:predicate sortDescriptors:_sortDescriptors range:self.range];
|
231
|
+
}
|
232
|
+
|
233
|
+
- (instancetype)filter:(NSPredicate *)predicate {
|
234
|
+
if (_predicate) {
|
235
|
+
predicate = [[NSCompoundPredicate alloc] initWithType:NSAndPredicateType subpredicates:@[_predicate, predicate]];
|
236
|
+
}
|
237
|
+
|
238
|
+
return [[QKQuerySet alloc] initWithManagedObjectContext:_managedObjectContext entityDescription:_entityDescription predicate:predicate sortDescriptors:_sortDescriptors range:self.range];
|
239
|
+
}
|
240
|
+
|
241
|
+
@end
|
242
|
+
|
243
|
+
@implementation QKQuerySet (SingleObject)
|
244
|
+
|
245
|
+
- (NSManagedObject *)object:(NSError **)error {
|
246
|
+
NSManagedObject *managedObject;
|
247
|
+
NSArray *array;
|
248
|
+
|
249
|
+
if (_resultsCache) {
|
250
|
+
array = _resultsCache;
|
251
|
+
} else {
|
252
|
+
NSFetchRequest *fetchRequest = [self fetchRequest];
|
253
|
+
fetchRequest.fetchBatchSize = 1; // Only request one
|
254
|
+
|
255
|
+
array = [self.managedObjectContext executeFetchRequest:fetchRequest error:error];
|
256
|
+
}
|
257
|
+
|
258
|
+
NSUInteger count = [array count];
|
259
|
+
|
260
|
+
if (count == 1) {
|
261
|
+
managedObject = [array firstObject];
|
262
|
+
} else if ((count > 1) && error != nil) {
|
263
|
+
*error = [NSError errorWithDomain:QKQuerySetErrorDomain code:0 userInfo:@{
|
264
|
+
NSLocalizedDescriptionKey: @"Find object in fetch request failed, should only result in a single result.",
|
265
|
+
}];
|
266
|
+
}
|
267
|
+
|
268
|
+
return managedObject;
|
269
|
+
}
|
270
|
+
|
271
|
+
- (NSManagedObject *)firstObject:(NSError **)error {
|
272
|
+
NSManagedObject *managedObject;
|
273
|
+
|
274
|
+
if (_resultsCache) {
|
275
|
+
managedObject = [_resultsCache firstObject];
|
276
|
+
} else {
|
277
|
+
NSFetchRequest *fetchRequest = [self fetchRequest];
|
278
|
+
[fetchRequest setFetchLimit:1];
|
279
|
+
|
280
|
+
NSArray *array = [self.managedObjectContext executeFetchRequest:fetchRequest error:error];
|
281
|
+
managedObject = [array firstObject];
|
282
|
+
}
|
283
|
+
|
284
|
+
return managedObject;
|
285
|
+
}
|
286
|
+
|
287
|
+
- (NSManagedObject *)lastObject:(NSError **)error {
|
288
|
+
NSManagedObject *managedObject;
|
289
|
+
|
290
|
+
if (_resultsCache) {
|
291
|
+
managedObject = [_resultsCache lastObject];
|
292
|
+
} else {
|
293
|
+
NSFetchRequest *fetchRequest = [self fetchRequest];
|
294
|
+
NSArray *array = [self.managedObjectContext executeFetchRequest:fetchRequest error:error];
|
295
|
+
managedObject = [array lastObject];
|
296
|
+
}
|
297
|
+
|
298
|
+
return managedObject;
|
299
|
+
}
|
300
|
+
|
301
|
+
@end
|
302
|
+
|
303
|
+
@implementation NSManagedObject (QKQuerySet)
|
304
|
+
|
305
|
+
+ (NSString *)entityName {
|
306
|
+
return NSStringFromClass([self class]);
|
307
|
+
}
|
308
|
+
|
309
|
+
+ (QKQuerySet *)querySetWithManagedObjectContext:(NSManagedObjectContext *)context {
|
310
|
+
NSEntityDescription *entityDescription = [NSEntityDescription entityForName:[self entityName] inManagedObjectContext:context];
|
311
|
+
return [[QKQuerySet alloc] initWithManagedObjectContext:context entityDescription:entityDescription];
|
312
|
+
}
|
313
|
+
|
314
|
+
@end
|