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,28 @@
|
|
1
|
+
import Foundation
|
2
|
+
|
3
|
+
extension QuerySet {
|
4
|
+
public func asQKQuerySet() -> QKQuerySet {
|
5
|
+
let entityDescription = NSEntityDescription.entityForName(entityName, inManagedObjectContext: context)
|
6
|
+
|
7
|
+
var nsrange:NSRange = NSMakeRange(NSNotFound, NSNotFound)
|
8
|
+
if let range = self.range {
|
9
|
+
nsrange = NSMakeRange(range.startIndex, range.endIndex - range.startIndex)
|
10
|
+
}
|
11
|
+
|
12
|
+
return QKQuerySet(managedObjectContext: context, entityDescription: entityDescription, predicate: predicate, sortDescriptors: sortDescriptors, range:nsrange)
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
extension QKQuerySet {
|
17
|
+
public func asQuerySet() -> QuerySet<NSManagedObject> {
|
18
|
+
let queryset = QuerySet<NSManagedObject>(managedObjectContext, entityDescription.name!)
|
19
|
+
.orderBy(sortDescriptors as [NSSortDescriptor])
|
20
|
+
.filter(predicate)
|
21
|
+
|
22
|
+
if range.location != NSNotFound {
|
23
|
+
return queryset[range.location..<(range.location + range.length)]
|
24
|
+
}
|
25
|
+
|
26
|
+
return queryset
|
27
|
+
}
|
28
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
//
|
2
|
+
// Predicate.swift
|
3
|
+
// QueryKit
|
4
|
+
//
|
5
|
+
// Created by Kyle Fuller on 19/06/2014.
|
6
|
+
//
|
7
|
+
//
|
8
|
+
|
9
|
+
import Foundation
|
10
|
+
|
11
|
+
public func && (left: NSPredicate, right: NSPredicate) -> NSPredicate {
|
12
|
+
return NSCompoundPredicate(type: NSCompoundPredicateType.AndPredicateType, subpredicates: [left, right])
|
13
|
+
}
|
14
|
+
|
15
|
+
public func || (left: NSPredicate, right: NSPredicate) -> NSPredicate {
|
16
|
+
return NSCompoundPredicate(type: NSCompoundPredicateType.OrPredicateType, subpredicates: [left, right])
|
17
|
+
}
|
18
|
+
|
19
|
+
prefix public func ! (left: NSPredicate) -> NSPredicate {
|
20
|
+
return NSCompoundPredicate(type: NSCompoundPredicateType.NotPredicateType, subpredicates: [left])
|
21
|
+
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
//
|
2
|
+
// QueryKit.h
|
3
|
+
// QueryKit
|
4
|
+
//
|
5
|
+
// Created by Kyle Fuller on 19/06/2014.
|
6
|
+
//
|
7
|
+
//
|
8
|
+
|
9
|
+
#import <Foundation/Foundation.h>
|
10
|
+
|
11
|
+
//! Project version number for QueryKit.
|
12
|
+
FOUNDATION_EXPORT double QueryKitVersionNumber;
|
13
|
+
|
14
|
+
//! Project version string for QueryKit.
|
15
|
+
FOUNDATION_EXPORT const unsigned char QueryKitVersionString[];
|
16
|
+
|
17
|
+
// In this header, you should import all the public headers of your framework using statements like #import <QueryKit/PublicHeader.h>
|
18
|
+
#import <QueryKit/QKAttribute.h>
|
19
|
+
#import <QueryKit/QKQuerySet.h>
|
@@ -0,0 +1,237 @@
|
|
1
|
+
//
|
2
|
+
// QuerySet.swift
|
3
|
+
// QueryKit
|
4
|
+
//
|
5
|
+
// Created by Kyle Fuller on 06/07/2014.
|
6
|
+
//
|
7
|
+
//
|
8
|
+
|
9
|
+
import Foundation
|
10
|
+
import CoreData
|
11
|
+
|
12
|
+
|
13
|
+
/// Represents a lazy database lookup for a set of objects.
|
14
|
+
public class QuerySet<T : NSManagedObject> : SequenceType, Equatable {
|
15
|
+
/// Returns the managed object context that will be used to execute any requests.
|
16
|
+
public let context:NSManagedObjectContext
|
17
|
+
|
18
|
+
/// Returns the name of the entity the request is configured to fetch.
|
19
|
+
public let entityName:String
|
20
|
+
|
21
|
+
/// Returns the sort descriptors of the receiver.
|
22
|
+
public let sortDescriptors = [NSSortDescriptor]()
|
23
|
+
|
24
|
+
/// Returns the predicate of the receiver.
|
25
|
+
public let predicate:NSPredicate?
|
26
|
+
|
27
|
+
public let range:Range<Int>?
|
28
|
+
|
29
|
+
// MARK: Initialization
|
30
|
+
|
31
|
+
public init(_ context:NSManagedObjectContext, _ entityName:String) {
|
32
|
+
self.context = context
|
33
|
+
self.entityName = entityName
|
34
|
+
}
|
35
|
+
|
36
|
+
public init(queryset:QuerySet<T>, sortDescriptors:[NSSortDescriptor]?, predicate:NSPredicate?, range:Range<Int>?) {
|
37
|
+
self.context = queryset.context
|
38
|
+
self.entityName = queryset.entityName
|
39
|
+
|
40
|
+
if let sortDescriptors = sortDescriptors {
|
41
|
+
self.sortDescriptors = sortDescriptors
|
42
|
+
}
|
43
|
+
|
44
|
+
self.predicate = predicate
|
45
|
+
self.range = range
|
46
|
+
}
|
47
|
+
|
48
|
+
// MARK: Sorting
|
49
|
+
|
50
|
+
/// Returns a new QuerySet containing objects ordered by the given sort descriptor.
|
51
|
+
public func orderBy(sortDescriptor:NSSortDescriptor) -> QuerySet<T> {
|
52
|
+
return orderBy([sortDescriptor])
|
53
|
+
}
|
54
|
+
|
55
|
+
/// Returns a new QuerySet containing objects ordered by the given sort descriptors.
|
56
|
+
public func orderBy(sortDescriptors:[NSSortDescriptor]) -> QuerySet<T> {
|
57
|
+
return QuerySet(queryset:self, sortDescriptors:sortDescriptors, predicate:predicate, range:range)
|
58
|
+
}
|
59
|
+
|
60
|
+
/// Reverses the ordering of the QuerySet
|
61
|
+
public func reverse() -> QuerySet<T> {
|
62
|
+
return QuerySet(queryset:self, sortDescriptors:sortDescriptors.reverse(), predicate:predicate, range:range)
|
63
|
+
}
|
64
|
+
|
65
|
+
// MARK: Filtering
|
66
|
+
|
67
|
+
/// Returns a new QuerySet containing objects that match the given predicate.
|
68
|
+
public func filter(predicate:NSPredicate) -> QuerySet<T> {
|
69
|
+
var futurePredicate = predicate
|
70
|
+
|
71
|
+
if let existingPredicate = self.predicate {
|
72
|
+
futurePredicate = NSCompoundPredicate(type: NSCompoundPredicateType.AndPredicateType, subpredicates: [existingPredicate, predicate])
|
73
|
+
}
|
74
|
+
|
75
|
+
return QuerySet(queryset:self, sortDescriptors:sortDescriptors, predicate:futurePredicate, range:range)
|
76
|
+
}
|
77
|
+
|
78
|
+
/// Returns a new QuerySet containing objects that match the given predicates.
|
79
|
+
public func filter(predicates:[NSPredicate]) -> QuerySet<T> {
|
80
|
+
let newPredicate = NSCompoundPredicate(type: NSCompoundPredicateType.AndPredicateType, subpredicates: predicates)
|
81
|
+
return filter(newPredicate)
|
82
|
+
}
|
83
|
+
|
84
|
+
/// Returns a new QuerySet containing objects that exclude the given predicate.
|
85
|
+
public func exclude(predicate:NSPredicate) -> QuerySet<T> {
|
86
|
+
let excludePredicate = NSCompoundPredicate(type: NSCompoundPredicateType.NotPredicateType, subpredicates: [predicate])
|
87
|
+
return filter(excludePredicate)
|
88
|
+
}
|
89
|
+
|
90
|
+
/// Returns a new QuerySet containing objects that exclude the given predicates.
|
91
|
+
public func exclude(predicates:[NSPredicate]) -> QuerySet<T> {
|
92
|
+
let excludePredicate = NSCompoundPredicate(type: NSCompoundPredicateType.AndPredicateType, subpredicates: predicates)
|
93
|
+
return exclude(excludePredicate)
|
94
|
+
}
|
95
|
+
|
96
|
+
// MARK: Subscripting
|
97
|
+
|
98
|
+
public subscript(index: Int) -> (object:T?, error:NSError?) {
|
99
|
+
get {
|
100
|
+
var request = fetchRequest
|
101
|
+
request.fetchOffset = index
|
102
|
+
request.fetchLimit = 1
|
103
|
+
|
104
|
+
var error:NSError?
|
105
|
+
if let items = context.executeFetchRequest(request, error:&error) {
|
106
|
+
return (object:items.first as T?, error:error)
|
107
|
+
} else {
|
108
|
+
return (object: nil, error: error)
|
109
|
+
}
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
/// Returns the object at the specified index.
|
114
|
+
public subscript(index: Int) -> T? {
|
115
|
+
get {
|
116
|
+
return self[index].object
|
117
|
+
}
|
118
|
+
}
|
119
|
+
|
120
|
+
public subscript(range:Range<Int>) -> QuerySet<T> {
|
121
|
+
get {
|
122
|
+
var fullRange = range
|
123
|
+
|
124
|
+
if let currentRange = self.range {
|
125
|
+
fullRange = Range<Int>(start: currentRange.startIndex + range.startIndex, end: range.endIndex)
|
126
|
+
}
|
127
|
+
|
128
|
+
return QuerySet(queryset:self, sortDescriptors:sortDescriptors, predicate:predicate, range:fullRange)
|
129
|
+
}
|
130
|
+
}
|
131
|
+
|
132
|
+
// Mark: Getters
|
133
|
+
public var first: T? {
|
134
|
+
get {
|
135
|
+
return self[0].object
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
|
140
|
+
// MARK: Conversion
|
141
|
+
|
142
|
+
public var fetchRequest:NSFetchRequest {
|
143
|
+
var request = NSFetchRequest(entityName:entityName)
|
144
|
+
request.predicate = predicate
|
145
|
+
request.sortDescriptors = sortDescriptors
|
146
|
+
|
147
|
+
if let range = range {
|
148
|
+
request.fetchOffset = range.startIndex
|
149
|
+
request.fetchLimit = range.endIndex - range.startIndex
|
150
|
+
}
|
151
|
+
|
152
|
+
return request
|
153
|
+
}
|
154
|
+
|
155
|
+
public func array() -> (objects:([T]?), error:NSError?) {
|
156
|
+
var error:NSError?
|
157
|
+
var objects = context.executeFetchRequest(fetchRequest, error:&error) as? [T]
|
158
|
+
return (objects:objects, error:error)
|
159
|
+
}
|
160
|
+
|
161
|
+
public func array() -> [T]? {
|
162
|
+
return array().objects
|
163
|
+
}
|
164
|
+
|
165
|
+
// MARK: Count
|
166
|
+
|
167
|
+
public func count() -> (count:Int?, error:NSError?) {
|
168
|
+
var error:NSError?
|
169
|
+
var count:Int? = context.countForFetchRequest(fetchRequest, error: &error)
|
170
|
+
|
171
|
+
if count! == NSNotFound {
|
172
|
+
count = nil
|
173
|
+
}
|
174
|
+
|
175
|
+
return (count:count, error:error)
|
176
|
+
}
|
177
|
+
|
178
|
+
/// Returns the count of objects matching the QuerySet.
|
179
|
+
public func count() -> Int? {
|
180
|
+
return count().count
|
181
|
+
}
|
182
|
+
|
183
|
+
// MARK: Exists
|
184
|
+
|
185
|
+
/** Returns true if the QuerySet contains any results, and false if not.
|
186
|
+
:note: Returns nil if the operation could not be completed.
|
187
|
+
*/
|
188
|
+
public func exists() -> Bool? {
|
189
|
+
let result:Int? = count()
|
190
|
+
|
191
|
+
if let result = result {
|
192
|
+
return result > 0
|
193
|
+
}
|
194
|
+
|
195
|
+
return nil
|
196
|
+
}
|
197
|
+
|
198
|
+
// MARK: Deletion
|
199
|
+
|
200
|
+
/// Deletes all the objects matching the QuerySet.
|
201
|
+
public func delete() -> (count:Int, error:NSError?) {
|
202
|
+
var result = array() as (objects:([T]?), error:NSError?)
|
203
|
+
var deletedCount = 0
|
204
|
+
|
205
|
+
if let objects = result.objects {
|
206
|
+
for object in objects {
|
207
|
+
context.deleteObject(object)
|
208
|
+
}
|
209
|
+
|
210
|
+
deletedCount = objects.count
|
211
|
+
}
|
212
|
+
|
213
|
+
return (count:deletedCount, error:result.error)
|
214
|
+
}
|
215
|
+
|
216
|
+
// MARK: Sequence
|
217
|
+
|
218
|
+
public func generate() -> IndexingGenerator<Array<T>> {
|
219
|
+
var result = self.array() as (objects:([T]?), error:NSError?)
|
220
|
+
|
221
|
+
if let objects = result.objects {
|
222
|
+
return objects.generate()
|
223
|
+
}
|
224
|
+
|
225
|
+
return [].generate()
|
226
|
+
}
|
227
|
+
}
|
228
|
+
|
229
|
+
public func == <T : NSManagedObject>(lhs: QuerySet<T>, rhs: QuerySet<T>) -> Bool {
|
230
|
+
let context = lhs.context == rhs.context
|
231
|
+
let entityName = lhs.entityName == rhs.entityName
|
232
|
+
let sortDescriptors = lhs.sortDescriptors == rhs.sortDescriptors
|
233
|
+
let predicate = lhs.predicate == rhs.predicate
|
234
|
+
let startIndex = lhs.range?.startIndex == rhs.range?.startIndex
|
235
|
+
let endIndex = lhs.range?.endIndex == rhs.range?.endIndex
|
236
|
+
return context && entityName && sortDescriptors && predicate && startIndex && endIndex
|
237
|
+
}
|
@@ -0,0 +1,151 @@
|
|
1
|
+
QueryKit
|
2
|
+
========
|
3
|
+
|
4
|
+
[![Build Status](http://img.shields.io/travis/QueryKit/QueryKit/master.svg?style=flat)](https://travis-ci.org/QueryKit/QueryKit)
|
5
|
+
|
6
|
+
QueryKit, a simple CoreData query language.
|
7
|
+
|
8
|
+
## Usage
|
9
|
+
|
10
|
+
```swift
|
11
|
+
Person.queryset(context).filter(Person.name == "Kyle").delete()
|
12
|
+
```
|
13
|
+
|
14
|
+
### Querying
|
15
|
+
|
16
|
+
To retrieve objects from CoreData with QueryKit, you can construct a QuerySet
|
17
|
+
for your model in a managed object context.
|
18
|
+
|
19
|
+
A queryset is an immutable object, any operation will return a new queryset
|
20
|
+
instead of modifying the queryset.
|
21
|
+
|
22
|
+
```swift
|
23
|
+
var queryset = Person.queryset(context)
|
24
|
+
```
|
25
|
+
|
26
|
+
#### Filtering
|
27
|
+
|
28
|
+
You can filter a queryset using the `filter` and `exclude` methods, which
|
29
|
+
accept a predicate and return a new queryset.
|
30
|
+
|
31
|
+
```swift
|
32
|
+
queryset.filter(NSPredicate(format:"name == %@", "Kyle"))
|
33
|
+
queryset.filter(Person.name == "Kyle")
|
34
|
+
queryset.exclude(Person.age < 21)
|
35
|
+
queryset.exclude(Person.isEmployed)
|
36
|
+
```
|
37
|
+
|
38
|
+
#### Ordering
|
39
|
+
|
40
|
+
You can order a queryset's results by using the `orderBy` method which accepts
|
41
|
+
a collection of sort descriptors:
|
42
|
+
|
43
|
+
```swift
|
44
|
+
queryset.orderBy(NSSortDescriptor(key: "name", ascending: true))
|
45
|
+
queryset.orderBy(Person.name.ascending)
|
46
|
+
queryset.orderBy([Person.name.ascending, Person.age.descending])
|
47
|
+
```
|
48
|
+
|
49
|
+
#### Slicing
|
50
|
+
|
51
|
+
You can use slicing to limit a queryset to a range. For example, to get the
|
52
|
+
first 5 items:
|
53
|
+
|
54
|
+
```swift
|
55
|
+
queryset[0..5]
|
56
|
+
```
|
57
|
+
|
58
|
+
### Fetching
|
59
|
+
|
60
|
+
#### Single object
|
61
|
+
|
62
|
+
```swift
|
63
|
+
var kyle = queryset.filter(Person.name == "Kyle").get()
|
64
|
+
```
|
65
|
+
|
66
|
+
#### Object at index
|
67
|
+
|
68
|
+
```swift
|
69
|
+
var orta = queryset[3]
|
70
|
+
```
|
71
|
+
|
72
|
+
#### Count
|
73
|
+
|
74
|
+
```swift
|
75
|
+
queryset.count()
|
76
|
+
```
|
77
|
+
|
78
|
+
#### Iteration
|
79
|
+
|
80
|
+
```swift
|
81
|
+
for person in queryset {
|
82
|
+
println(person.name)
|
83
|
+
}
|
84
|
+
```
|
85
|
+
|
86
|
+
#### Conversion to an array
|
87
|
+
|
88
|
+
```swift
|
89
|
+
queryset.array()
|
90
|
+
```
|
91
|
+
|
92
|
+
### Deleting
|
93
|
+
|
94
|
+
This method immediately deletes the objects in your queryset and returns a
|
95
|
+
count and an error if the operation failed.
|
96
|
+
|
97
|
+
```swift
|
98
|
+
queryset.delete()
|
99
|
+
```
|
100
|
+
|
101
|
+
### Attributes
|
102
|
+
|
103
|
+
The `Attribute` is a generic structure for creating predicates providing
|
104
|
+
type-safety.
|
105
|
+
|
106
|
+
```swift
|
107
|
+
let name = Attribute<String>("name")
|
108
|
+
let age = Attribute<Int>("age")
|
109
|
+
|
110
|
+
name == "Kyle"
|
111
|
+
name << ["Kyle", "Katie"]
|
112
|
+
|
113
|
+
age == 27
|
114
|
+
age >= 25
|
115
|
+
age << (22...30)
|
116
|
+
```
|
117
|
+
|
118
|
+
#### Operators
|
119
|
+
|
120
|
+
| Comparison | Meaning |
|
121
|
+
| ------- |:--------:|
|
122
|
+
| == | x equals y |
|
123
|
+
| != | x is not equal to y |
|
124
|
+
| < | x is less than y |
|
125
|
+
| <= | x is less than or equal to y |
|
126
|
+
| > | x is more than y |
|
127
|
+
| >= | x is more than or equal to y |
|
128
|
+
| ~= | x is like y |
|
129
|
+
| ~= | x is like y |
|
130
|
+
| << | x IN y, where y is an array |
|
131
|
+
| << | x BETWEEN y, where y is a range |
|
132
|
+
|
133
|
+
## Predicate extensions
|
134
|
+
|
135
|
+
We've extended NSPredicate to add support for the `!`, `&&` and `||` operators
|
136
|
+
for joining predicates together.
|
137
|
+
|
138
|
+
```swift
|
139
|
+
NSPredicate(format:"name == Kyle") || NSPredicate(format:"name == Katie")
|
140
|
+
NSPredicate(format:"age >= 21") && !NSPredicate(format:"name == Kyle")
|
141
|
+
```
|
142
|
+
|
143
|
+
```swift
|
144
|
+
Person.name == "Kyle" || Person.name == "Katie"
|
145
|
+
Person.age >= 21 || Person.name != "Kyle"
|
146
|
+
```
|
147
|
+
|
148
|
+
## License
|
149
|
+
|
150
|
+
QueryKit is released under the BSD license. See [LICENSE](LICENSE).
|
151
|
+
|