Skip to content

Commit

Permalink
Updates latest Carthage checkouts
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettmoon committed Jun 28, 2017
1 parent 2a8f62f commit 11f195f
Show file tree
Hide file tree
Showing 22 changed files with 302 additions and 217 deletions.
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "pinterest/PINOperation" "1.0.3"
git "https://chromium.googlesource.com/webm/libwebp" "v0.5.1"
github "pinterest/PINCache" "3.0.1-beta.4"
github "pinterest/PINCache" "3.0.1-beta.5"
4 changes: 0 additions & 4 deletions Carthage/Checkouts/PINCache/.buildkite/pipeline.yml

This file was deleted.

43 changes: 25 additions & 18 deletions Carthage/Checkouts/PINCache/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,70 @@
### 2.2.1 -- 2016 Mar 5 ###
## master

* Add your own contributions to the next release on the line below this with your name.

## 3.0.1 -- Beta 5
- [new] Added an ability to set custom encoder/decoder for file names: [#192](https://github.com/pinterest/PINCache/pull/192)

## 2.2.1 -- 2016 Mar 5
- [new] Removed need for extension macro: [#72](https://github.com/pinterest/PINCache/pull/72)

### 2.2.1 -- 2016 Feb 15 ###
## 2.2.1 -- 2016 Feb 15

- [fixed] When ttlCache is enabled, skip updating the file modification time when accessing `fileURLForKey:` [#70](https://github.com/pinterest/PINCache/pull/70)

### 2.2 -- 2016 Feb 10 ###
## 2.2 -- 2016 Feb 10

- [new] Allow caches to behave like a TTLCache [#66](https://github.com/pinterest/PINCache/pull/66)

### 2.1.2 -- 2015 Nov 19 ###
## 2.1.2 -- 2015 Nov 19

- [fix] Fix disk caching bug due to incorrect string encoding [#42](https://github.com/pinterest/PINCache/pull/42)


### 2.1.1 -- 2015 Nov 17 ###
## 2.1.1 -- 2015 Nov 17

- [new] Added `tvOS` support
- [fixed] PINDiskCache byteCount tracking bug [#30](https://github.com/pinterest/PINCache/pull/30)


### 2.1 -- 2015 Aug 24 ###
## 2.1 -- 2015 Aug 24

- [new] Xcode 7 support
- [fixed] Invalid task ID's used for expiration handler on background tasks [#13](https://github.com/pinterest/PINCache/issues/13)
- [fixed] Support for OS X since UIBackgroundTask is only on iOS [#19](https://github.com/pinterest/PINCache/pull/19)


### 2.0.1 -- 2015 May 1 ###
## 2.0.1 -- 2015 May 1

- [new] Added support for using PINCache in extensions
- [new] Adopting nullability annotations.


### 2.0 -- 2015 February 25 ###
## 2.0 -- 2015 February 25

- [fix] PINCache redesign to avoid deadlocks


### 1.2.3 -- 2014 December 13 ###
## 1.2.3 -- 2014 December 13

- [fix] TMDiskCache/TMMemoryCache: import `UIKit` to facilitate Swift usage (thanks [digabriel](https://github.com/tumblr/TMCache/pull/57)!)
- [fix] TMDiskCache: add try catch to ensure an exception isn’t thrown if a file on disk is unable to be unarchived (thanks [leonskywalker](https://github.com/tumblr/TMCache/pull/62)!)
- [fix] TMDiskCache: create trash directory asynchronously to avoid race condition (thanks [napoapo77](https://github.com/tumblr/TMCache/pull/68)!)


### 1.2.2 -- 2014 October 6 ###
## 1.2.2 -- 2014 October 6

- [new] Remove deprecated `documentation` property from Podspec


### 1.2.1 -- 2013 July 28 ###
## 1.2.1 -- 2013 July 28

- [new] TMDiskCache: introduced concept of "trash" for rapid wipeouts
- [new] TMDiskCache: `nil` checks to prevent crashes
- [new] TMCache/TMDiskCache/TMMemoryCache: import Foundation to facilitate Swift usage


### 1.2.0 -- 2013 May 24 ###
## 1.2.0 -- 2013 May 24

- [new] TMDiskCache: added method `enumerateObjectsWithBlock:completionBlock:`
- [new] TMDiskCache: added method `enumerateObjectsWithBlock:`
Expand All @@ -72,31 +79,31 @@
- [del] TMCache: removed `cost` methods pending a solution for disk-based cost


### 1.1.2 -- 2013 May 13 ###
## 1.1.2 -- 2013 May 13

- [fix] TMCache: prevent `objectForKey:block:` from hitting the thread ceiling
- [new] TMCache: added a test to make sure we don't deadlock the queue


### 1.1.1 -- 2013 May 1 ###
## 1.1.1 -- 2013 May 1

- [fix] simplified appledoc arguments in podspec, updated doc script


### 1.1.0 -- 2013 April 29 ###
## 1.1.0 -- 2013 April 29

- [new] TMCache: added method `setObject:forKey:withCost:`
- [new] TMCache: documentation


### 1.0.3 -- 2013 April 27 ###
## 1.0.3 -- 2013 April 27

- [new] TMCache: added property `diskByteCount` (for convenience)
- [new] TMMemoryCache: `totalCost` now returned synchronously from queue
- [fix] TMMemoryCache: `totalCost` set to zero immediately after `removeAllObjects:`


### 1.0.2 -- 2013 April 26 ###
## 1.0.2 -- 2013 April 26

- [fix] TMCache: cache hits from memory will now update access time on disk
- [fix] TMDiskCache: set & remove methods now acquire a `UIBackgroundTaskIdentifier`
Expand All @@ -110,7 +117,7 @@
- [new] TMCache: added unit tests


### 1.0.1 -- 2013 April 23 ###
## 1.0.1 -- 2013 April 23

- added an optional "cost limit" to `TMMemoryCache`, including new properties and methods
- calling `[TMDiskCache trimToDate:]` with `[NSDate distantPast]` will now clear the cache
Expand Down
4 changes: 4 additions & 0 deletions Carthage/Checkouts/PINCache/CI/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -eo pipefail

make all
5 changes: 5 additions & 0 deletions Carthage/Checkouts/PINCache/CI/exclude-from-build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
"^plans/",
"^docs/",
"^CI/exclude-from-build.json$"
]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
23 changes: 23 additions & 0 deletions Carthage/Checkouts/PINCache/Dangerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
source_pattern = /(\.m|\.mm|\.h)$/

# Sometimes it's a README fix, or something like that - which isn't relevant for
# including in a project's CHANGELOG for example
declared_trivial = github.pr_title.include? "#trivial"
has_changes_in_source_directory = !git.modified_files.grep(/Source/).empty?

modified_source_files = git.modified_files.grep(source_pattern)
has_modified_source_files = !modified_source_files.empty?
added_source_files = git.added_files.grep(source_pattern)
has_added_source_files = !added_source_files.empty?

# Make it more obvious that a PR is a work in progress and shouldn't be merged yet
warn("PR is classed as Work in Progress") if github.pr_title.include? "[WIP]"

# Warn when there is a big PR
warn("This is a big PR, please consider splitting it up to ease code review.") if git.lines_of_code > 500

# Changelog entries are required for changes to source files.
no_changelog_entry = !git.modified_files.include?("CHANGELOG.md")
if has_changes_in_source_directory && no_changelog_entry && !declared_trivial
warn("Any source code changes should have an entry in CHANGELOG.md or have #trivial in their title.")
end
4 changes: 4 additions & 0 deletions Carthage/Checkouts/PINCache/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'

gem 'danger'
gem 'danger-slack'
2 changes: 1 addition & 1 deletion Carthage/Checkouts/PINCache/PINCache.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'PINCache'
s.version = '3.0.1-beta.3'
s.version = '3.0.1-beta.5'
s.homepage = 'https://github.com/pinterest/PINCache'
s.summary = 'Fast, thread safe, parallel object cache for iOS and OS X.'
s.authors = { 'Garrett Moon' => 'garrett@pinterest.com', 'Justin Ouellette' => 'jstn@tumblr.com' }
Expand Down
10 changes: 9 additions & 1 deletion Carthage/Checkouts/PINCache/PINCache.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@
CC0105A81E271A1600890935 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0730;
LastUpgradeCheck = 0820;
ORGANIZATIONNAME = Pinterest;
TargetAttributes = {
CC0105B01E271A1600890935 = {
Expand Down Expand Up @@ -741,8 +741,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -790,8 +792,10 @@
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
Expand Down Expand Up @@ -823,6 +827,7 @@
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -844,6 +849,7 @@
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -865,6 +871,7 @@
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand All @@ -889,6 +896,7 @@
isa = XCBuildConfiguration;
buildSettings = {
APPLICATION_EXTENSION_API_ONLY = YES;
"CODE_SIGN_IDENTITY[sdk=appletvos*]" = "";
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0730"
LastUpgradeVersion = "0820"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
33 changes: 27 additions & 6 deletions Carthage/Checkouts/PINCache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,51 @@

`PINCache` and `PINDiskCache` accept any object conforming to [NSCoding](https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Protocols/NSCoding_Protocol/Reference/Reference.html). Put things in like this:

**Objective-C**
```objective-c
UIImage *img = [[UIImage alloc] initWithData:data scale:[[UIScreen mainScreen] scale]];
[[PINCache sharedCache] setObject:img forKey:@"image" block:nil]; // returns immediately
```
**Swift**
```swift
let img = UIImage(data: data, scale:UIScreen.main.scale)
PINCache.shared().setObject(img, forKey: "img")
```

Get them back out like this:

```objective-c
[[PINCache sharedCache] objectForKey:@"image"
block:^(PINCache *cache, NSString *key, id object) {
UIImage *image = (UIImage *)object;
NSLog(@"image scale: %f", image.scale);
}];
**Objective-C**
```objc
[[PINCache sharedCache] objectForKeyAsync:@"image" block:^(PINCache *cache, NSString *key, id object) {
UIImage *image = (UIImage *)object;
NSLog(@"image scale: %f", image.scale);
}];
```
**Swift**
```swift
PINCache.shared().object(forKey: "image") { (cache, key, object) in
if let image = object as? UIImage {
print("image scale: %f", image.scale)
}
}
```

Both `PINMemoryCache` and PINDiskCache use locks to protect reads and writes. `PINCache` coordinates them so that objects added to memory are available immediately to other threads while being written to disk safely in the background. Both caches are public properties of `PINCache`, so it's easy to manipulate one or the other separately if necessary.

Collections work too. Thanks to the magic of `NSKeyedArchiver`, objects repeated in a collection only occupy the space of one on disk:

**Objective-C**
```objective-c
NSArray *images = @[ image, image, image ];
[[PINCache sharedCache] setObject:images forKey:@"images"];
NSLog(@"3 for the price of 1: %d", [[[PINCache sharedCache] diskCache] byteCount]);
```
**Swift**
```swift
let images = [image, image, image]
PINCache.shared.setObject(images, forKey: "images")
print("3 for the prices of 1: %d", PINCache.shared.diskCache.byteCount)
```

## Installation

Expand Down
Loading

0 comments on commit 11f195f

Please sign in to comment.