Skip to content

Commit

Permalink
Merge pull request #3 from yahoo/fix/readme2
Browse files Browse the repository at this point in the history
Polished README, Add Mantle example note, proper license
  • Loading branch information
adamkaplan committed Aug 7, 2015
2 parents 9a654fb + 821fe8b commit 13109e3
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .slather.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage_service: coveralls
xcodeproj: YMCache.xcodeproj
35 changes: 24 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
# references:
# * http://www.objc.io/issue-6/travis-ci.html
# * https://github.com/supermarin/xcpretty#usage

language: objective-c
# cache: cocoapods
# podfile: Example/Podfile
# before_install:
# - gem install cocoapods # Since Travis is not always on latest version
# - pod install --project-directory=Example
install:
osx_image: xcode6.4
xcode_project: YMCache.xcodeproj
xcode_scheme: YMCache-iOS
before_install:
- brew update || brew update
- brew install carthage || brew outdated carthage || brew upgrade carthage
- brew install xctool || brew outdated xctool || brew upgrade xctool
- gem install xcpretty --no-rdoc --no-ri --no-document --quiet
- gem install slather --no-rdoc --no-ri --no-document --quiet
- "./script/travis-codesign-setup.sh"
install:
- carthage bootstrap --verbose
after_install:
- "./script/travis-codesign-teardown.sh"
script:
- set -o pipefail && xcodebuild test -workspace Example/YMCache.xcworkspace -scheme YMCache-Example -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO | xcpretty -c
- set -o pipefail && xctool test -project YMCache.xcodeproj -scheme YMCache-iOS -sdk
iphonesimulator ONLY_ACTIVE_ARCH=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
| xcpretty -c
- set -o pipefail && xctool test -project YMCache.xcodeproj -scheme YMCache-Mac -sdk
macosx ONLY_ACTIVE_ARCH=NO GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES
| xcpretty -c
- pod lib lint --quick
after_success:
- slather
env:
global:
secure: XjmvN8ABJy19pzTQtCnbi8PKei+fJ8m20LU2cuNEDP3LfTwt34tVtYGNaI4YTEiPpEvKTSWQpRUUQWzw3l2AyY6ia282URtxYXi3lSlH2WW0zjqkueWlFDCnrTeuv+DLQVE1uQt1F8ErWYTSCT81t13WeCgE3NKDGB0eDmEncUYqQOr7w8kMFoOZWxp7PRNHGDzqsZXTAmkLvoEwjEnWy/nXrO2ES4xckYR91NofFk6mfCecsWCmM/ZLOC/nRLG2GtHhvWWWkdaMqr7o8/n/YU/0uW3tR4J/D3YtdKgiNA1pROdqXZnIt6+MQO9M2v84BB123LMIeANxv9OyAzL1fZq/7h1hePOUW2gSo2HLOju1wtC2t6d+WuKLuUFB2l9hYj5fJggmVk9O3a25wlzMtP/LQMgQ/kCmrIVqMNSsLPuNXgYFb1tD65qd1zFHFPFoO+caTRoGyDAWO84CyOJGmBuOmkswZk70qtPbDPuHfKSf53lZaIfxAZ0mWGCOB4/UiT7Yy3cx2Q60o2rQTskZExL2dBpExCkRnSTBknrN13UFljBbZ16W9OiN5Q0BUVOcO3JjvGOOr4QCgYVh50cfWONJyiq6xxz/6WNESj6qTYJ7/uRtwhdW9oCOq53ci9q8pYFJ/VSojzNQjjPOyx8N8dtJ019PE6nGiREnd6a0EIU=
34 changes: 22 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# YMCache

YMCache is a lightweight object caching solution for iOS and Mac OS X that is designed for highly parallel access scenarios. YMCache presents a familiar interface enumating `NSMutableDictionary`, while internally leveraging Apple's [Grand Central Dispath](https://developer.apple.com/library/ios/documentation/Performance/Reference/GCD_libdispatch_Ref/index.html) technology to strike a balance between perforamnce and consistency.
[![Build Status](https://travis-ci.org/yahoo/YMCache.svg?branch=master)](https://travis-ci.org/yahoo/YMCache)
[![Coverage Status](https://coveralls.io/repos/yahoo/YMCache/badge.svg?branch=master&service=github)](https://coveralls.io/github/yahoo/YMCache?branch=master)

The Yahoo Finance iOS team uses YMCache to multiplex access to it's database of thousands of real-time stocks which change in unpredictable ways, at an unpredictable cadence. YMcache helps relieve the complexity of multi-thread access to a central data store by providing a set of easy to understand [reader-writer](https://en.wikipedia.org/wiki/Readers–writer_lock) access semantics.
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-brightgreen.svg)](https://github.com/Carthage/Carthage)
[![CocoaPods Compatible](https://img.shields.io/badge/CocoaPods-compatible-brightgreen.svg)](https://github.com/CocoaPods/CocoaPods)
[![GitHub license](https://img.shields.io/github/license/yahoo/YMCache.svg)](https://raw.githubusercontent.com/yahoo/YMCache/master/LICENSE.md)
[![Supported Platforms](https://img.shields.io/cocoapods/p/YMCache.svg)]()

---

YMCache is a lightweight object caching solution for iOS and Mac OS X that is designed for highly parallel access scenarios. YMCache presents a familiar interface emulating `NSMutableDictionary`, while internally leveraging Apple's [Grand Central Dispath](https://developer.apple.com/library/ios/documentation/Performance/Reference/GCD_libdispatch_Ref/index.html) technology to strike a balance between perforamnce and consistency.

The Yahoo Finance iOS team uses YMCache to multiplex access to it's database of thousands of real-time stocks, which change in unpredictable ways, with an unpredictable cadence. YMCache helps relieve the complexity of multi-thread access to a central data store by providing a set of easy to understand [reader-writer](https://en.wikipedia.org/wiki/Readers–writer_lock) access semantics.

### Parallel Access

Expand All @@ -12,16 +22,12 @@ The Yahoo Finance iOS team uses YMCache to multiplex access to it's database of

The above rules allow for multiple readers, but a single writer. A nice result of this approach is that reads are serialized with respect to writes, enforcing a sensible order: you may read with the confidence that the expected data has been fully written.

### Single vs Bulks Reads & Writes

YMCache provides support for both single-value reads/writes, and efficient multi-value reads/writes. Bulk reads and writes follow the [Parallel Access](#ParallelAccess) rules, but count as a single operation.

### Features

- Persistence: save/load a cache from disk once, or at intervals
- Eviction: handle low memory situations in-band, using whatever logic suits your needs
- Serialization: support for arbitrary model transformations comes for free. You can use Mantle, NSJSONSerialization or any serialization format you can think up!
- Bulk operations: efficient multi-value reads/writes. (Bulk operations follow the [Parallel Access](#ParallelAccess) rules, but count as a single operation)
- **Persistence**: save/load a cache from disk once, or at a defined interval
- **Eviction**: handle low memory situations in-band, using whatever logic suits your needs
- **Serialization**: arbitrary model transformations comes for free. You can use Mantle, straight NSJSONSerialization or any other format you can think up!
- **Bulk operations**: efficient multi-value reads/writes. (Bulk operations follow the [Parallel Access](#ParallelAccess) rules, but count as a single operation)

## SETUP

Expand Down Expand Up @@ -53,12 +59,16 @@ We support the [CocoaPods](http://github.com/CocoaPods/CocoaPods) and [Carthage]
## Usage
To run the example project, clone the repo, and run `pod install` from the Example directory first.
To run the example projects, clone the repo, and run `pod install` from one of the directories in Example.
### Example: Mantle Serialization
It's very easy to use Mantle – version 1 or 2 – to serialize your cache to disk! Check out the pre-built, production-ready example in [Examples/Mantle](https://github.com/yahoo/YMCache/tree/master/Examples/Mantle).
## Support & Contributing
Report any bugs or send feature requests to the GitHub issues. Pull requests are very much welcomed. See [CONTRIBUTING](https://github.com/yahoo/YMCache/blob/master/CONTRIBUTING.md) for details.
## License
Apache 2.0 license. See the [LICENSE](https://github.com/yahoo/YMCache/blob/master/LICENSE) file for details.
MIT license. See the [LICENSE](https://github.com/yahoo/YMCache/blob/master/LICENSE) file for details.
Binary file added script/certificates/Development.p12
Binary file not shown.
20 changes: 20 additions & 0 deletions script/travis-codesign-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

KEYCHAIN=ios-build.keychain
PASSWORD=cibuild
SCRIPT_DIR=$(dirname "$0")

# Create a temporary keychain for code signing.
security create-keychain -p "$PASSWORD" "$KEYCHAIN"
security default-keychain -s "$KEYCHAIN"
security unlock-keychain -p "$PASSWORD" "$KEYCHAIN"
security set-keychain-settings -t 3600 -l "$KEYCHAIN"

# Download the certificate for the Apple Worldwide Developer Relations
# Certificate Authority.
CERTPATH="$SCRIPT_DIR/apple_wwdr.cer"
curl 'https://developer.apple.com/certificationauthority/AppleWWDRCA.cer' > "$CERTPATH"
security import "$CERTPATH" -k "$KEYCHAIN" -T /usr/bin/codesign

# Import our development certificate.
security import "$SCRIPT_DIR/certificates/Development.p12" -k "$KEYCHAIN" -P "$KEY_PASSWORD" -T /usr/bin/codesign
6 changes: 6 additions & 0 deletions script/travis-codesign-teardown.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

KEYCHAIN=ios-build.keychain

# Delete temporary keychain
security delete-keychain "$KEYCHAIN"

0 comments on commit 13109e3

Please sign in to comment.