Skip to content
This repository has been archived by the owner on Jun 11, 2018. It is now read-only.

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
danthorpe committed Oct 27, 2015
2 parents 06fdeb8 + 5bb1da7 commit 9c7b691
Show file tree
Hide file tree
Showing 18 changed files with 677 additions and 73 deletions.
6 changes: 6 additions & 0 deletions .buildkite/pipeline.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -eu

# Makes sure all the steps run on this same agent
sed "s/\$BUILDKITE_AGENT_META_DATA_NAME/$BUILDKITE_AGENT_META_DATA_NAME/" .buildkite/pipeline.template.yml
23 changes: 23 additions & 0 deletions .buildkite/pipeline.template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
steps:
-
name: ":bundler: Update Bundler"
command: .scripts/update-bundler.sh
agents:
name: "$BUILDKITE_AGENT_META_DATA_NAME"
-
name: ":fastlane: Test Mac OS X"
command: .scripts/test-osx.sh
agents:
name: "$BUILDKITE_AGENT_META_DATA_NAME"
-
name: ":fastlane: Test iOS"
command: .scripts/test-ios.sh
agents:
name: "$BUILDKITE_AGENT_META_DATA_NAME"
-
type: "waiter"
-
name: ":codecov: Send Coverage"
command: .scripts/send-coverage.sh
agents:
name: "$BUILDKITE_AGENT_META_DATA_NAME"
2 changes: 1 addition & 1 deletion .fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ platform :ios do
lane :test do
xctest scheme: 'ValueCoding-iOS',
sdk: 'iphonesimulator',
destination: 'platform=iOS Simulator,name=iPhone 6,OS=9.0',
destination: 'platform=iOS Simulator,name=iPhone 6,OS=9.1',
destination_timeout: 120,
derivedDataPath: '.fastlane/xcodebuild-data'
end
Expand Down
2 changes: 2 additions & 0 deletions .scripts/send-coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
bash <(curl -s https://codecov.io/bash) -D .fastlane/xcodebuild-data
4 changes: 2 additions & 2 deletions .scripts/test-ios.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
source /usr/local/opt/chruby/share/chruby/chruby.sh
chruby ruby
bundle update && bundle exec fastlane ios test
bash <(curl -s https://codecov.io/bash) -D .fastlane/xcodebuild-data
bundle exec fastlane ios test

2 changes: 1 addition & 1 deletion .scripts/test-osx.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
source /usr/local/opt/chruby/share/chruby/chruby.sh
chruby ruby
bundle update && bundle exec fastlane mac test
bundle exec fastlane mac test
4 changes: 4 additions & 0 deletions .scripts/update-bundler.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash
source /usr/local/opt/chruby/share/chruby/chruby.sh
chruby ruby
bundle update && fastlane enable_crash_reporting
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 1.1.0
1. [[VCD-4](https://github.com/danthorpe/ValueCoding/pull/4)]: Supports tvOS platform, and updates to Xcode 7.1

# 1.0.1
1. [[VCD-1](https://github.com/danthorpe/ValueCoding/pull/1)]: Sets up cross platform project
2. [[VCD-2](https://github.com/danthorpe/ValueCoding/pull/2)]: Adds podspec
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
source 'https://rubygems.org'

gem 'fastlane', '>= 1.16'
gem 'scan'
gem 'fastlane', '>= 1.35'
gem 'xcpretty'
136 changes: 97 additions & 39 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ GEM
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.3.8)
autoparse (0.3.3)
addressable (>= 2.3.1)
extlib (>= 0.9.15)
multi_json (>= 1.0.0)
aws-sdk (1.66.0)
aws-sdk-v1 (= 1.66.0)
aws-sdk-v1 (1.66.0)
Expand All @@ -20,7 +24,7 @@ GEM
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
cert (0.3.3)
cert (1.0.0)
fastlane_core (>= 0.19.0, < 1.0.0)
spaceship (>= 0.6.0)
claide (0.9.1)
Expand All @@ -29,51 +33,54 @@ GEM
colored (1.2)
commander (4.3.5)
highline (~> 1.7.2)
credentials_manager (0.9.0)
credentials_manager (0.10.0)
colored
highline (>= 1.7.1)
security
deliver (1.3.0)
credentials_manager (>= 0.8.2)
deliver (1.3.3)
credentials_manager (>= 0.9.0)
fastimage (~> 1.6.3)
fastlane_core (>= 0.19.0, < 1.0.0)
plist (~> 3.1.0)
spaceship (>= 0.11.2, <= 1.0.0)
spaceship (>= 0.11.4, <= 1.0.0)
domain_name (0.5.25)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.0.2)
excon (0.45.4)
extlib (0.9.16)
faraday (0.9.2)
multipart-post (>= 1.2, < 3)
faraday_middleware (0.10.0)
faraday (>= 0.7.4, < 0.10)
fastimage (1.6.8)
addressable (~> 2.3, >= 2.3.5)
fastlane (1.32.1)
fastlane (1.35.0)
addressable (~> 2.3.8)
cert (>= 0.3.2, < 1.0.0)
credentials_manager (>= 0.8.2, < 1.0.0)
deliver (>= 1.2.0, < 2.0.0)
fastlane_core (>= 0.18.2, < 1.0.0)
cert (>= 1.0.0, < 2.0.0)
credentials_manager (>= 0.10.0, < 1.0.0)
deliver (>= 1.3.3, < 2.0.0)
fastlane_core (>= 0.25.3, < 1.0.0)
frameit (>= 2.2.1, < 3.0.0)
gym (>= 0.8.4, < 1.0.0)
gym (>= 1.0.0, < 2.0.0)
krausefx-shenzhen (>= 0.14.5)
nokogiri (~> 1.6)
pbxplorer (~> 1.0.0)
pem (>= 0.8.0, < 1.0.0)
pilot (>= 0.2.1, < 1.0.0)
pem (>= 1.0.0, < 2.0.0)
pilot (>= 1.0.0, < 2.0.0)
plist (~> 3.1.0)
produce (>= 0.6.2, < 1.0.0)
produce (>= 1.0.0, < 2.0.0)
rest-client (~> 1.8.0)
sigh (>= 0.10.8, < 1.0.0)
slack-notifier (~> 1.0)
snapshot (>= 0.10.0, < 1.0.0)
spaceship (>= 0.11.2, < 1.0.0)
scan (>= 0.1.2, < 1.0.0)
sigh (>= 1.1.0, < 2.0.0)
slack-notifier (~> 1.3)
snapshot (>= 1.0.2, < 2.0.0)
spaceship (>= 0.12.2, < 1.0.0)
supply (>= 0.1.0, < 1.0.0)
terminal-notifier (~> 1.6.2)
terminal-table (~> 1.4.5)
xcodeproj (>= 0.20, < 1.0.0)
xcpretty (>= 0.1.11)
fastlane_core (0.20.0)
fastlane_core (0.25.3)
babosa
capybara (~> 2.4.3)
colored
Expand All @@ -87,23 +94,43 @@ GEM
plist (~> 3.1)
poltergeist (~> 1.5.1)
rubyzip (~> 1.1.6)
sentry-raven (~> 0.15)
terminal-table (~> 1.4.5)
frameit (2.2.1)
deliver (> 0.3)
fastimage (~> 1.6.3)
fastlane_core (>= 0.16.0, < 1.0.0)
mini_magick (~> 4.0.2)
gym (0.9.0)
fastlane_core (>= 0.20.0, < 1.0.0)
google-api-client (0.8.6)
activesupport (>= 3.2)
addressable (~> 2.3)
autoparse (~> 0.3)
extlib (~> 0.9)
faraday (~> 0.9)
googleauth (~> 0.3)
launchy (~> 2.4)
multi_json (~> 1.10)
retriable (~> 1.4)
signet (~> 0.6)
googleauth (0.4.2)
faraday (~> 0.9)
jwt (~> 1.4)
logging (~> 2.0)
memoist (~> 0.12)
multi_json (~> 1.11)
signet (~> 0.6)
gym (1.1.0)
fastlane_core (>= 0.25.0, < 1.0.0)
plist
rubyzip (>= 1.1.7)
terminal-table
xcpretty
xcpretty (~> 0.1)
highline (1.7.8)
http-cookie (1.0.2)
domain_name (~> 0.5)
i18n (0.7.0)
json (1.8.3)
jwt (1.5.1)
krausefx-shenzhen (0.14.5)
aws-sdk (~> 1.0)
commander (~> 4.3)
Expand All @@ -117,11 +144,18 @@ GEM
rubyzip (~> 1.1)
security (~> 0.1.3)
terminal-table (~> 1.4.5)
launchy (2.4.3)
addressable (~> 2.3)
little-plugger (1.1.4)
logging (2.0.0)
little-plugger (~> 1.1)
multi_json (~> 1.10)
memoist (0.12.0)
method_source (0.8.2)
mime-types (2.6.2)
mini_magick (4.0.4)
mini_portile (0.6.2)
minitest (5.8.1)
minitest (5.8.2)
multi_json (1.11.2)
multi_xml (0.5.5)
multipart-post (2.0.0)
Expand All @@ -132,25 +166,25 @@ GEM
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
pbxplorer (1.0.0)
pem (0.8.1)
fastlane_core (>= 0.19.0, < 1.0.0)
spaceship (>= 0.11.2)
pem (1.0.0)
fastlane_core (>= 0.21.0, < 1.0.0)
spaceship (>= 0.12.0, < 1.0.0)
phantomjs (1.9.8.0)
pilot (0.2.3)
pilot (1.0.0)
credentials_manager (>= 0.3.0)
fastlane_core (>= 0.16.1, < 1.0.0)
spaceship (>= 0.7.0, < 1.0.0)
spaceship (>= 0.12.0, < 1.0.0)
terminal-table (~> 1.4.5)
plist (3.1.0)
poltergeist (1.5.1)
capybara (~> 2.1)
cliver (~> 0.3.1)
multi_json (~> 1.0)
websocket-driver (>= 0.2.0)
produce (0.6.5)
fastlane_core (>= 0.16.0, < 1.0.0)
spaceship (>= 0.6.0)
pry (0.10.2)
produce (1.0.0)
fastlane_core (>= 0.22.3, < 1.0.0)
spaceship (>= 0.12.0)
pry (0.10.3)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
Expand All @@ -161,18 +195,35 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
retriable (1.4.1)
rubyzip (1.1.7)
scan (0.1.2)
fastlane_core (>= 0.25.3, < 1.0.0)
slack-notifier (~> 1.3)
terminal-table
xcpretty (~> 0.1.12)
xcpretty-travis-formatter (~> 0.0.3)
security (0.1.3)
sigh (0.10.9)
sentry-raven (0.15.2)
faraday (>= 0.7.6)
sigh (1.1.0)
fastlane_core (>= 0.19.0, < 1.0.0)
plist (~> 3.1)
spaceship (>= 0.6.0)
slack-notifier (1.3.1)
spaceship (>= 0.12.3)
signet (0.6.1)
addressable (~> 2.3)
extlib (~> 0.9)
faraday (~> 0.9)
jwt (~> 1.5)
multi_json (~> 1.10)
slack-notifier (1.4.0)
slop (3.6.0)
snapshot (0.10.1)
snapshot (1.0.3)
fastimage (~> 1.6.3)
fastlane_core (>= 0.16.1, < 1.0.0)
spaceship (0.11.5)
fastlane_core (>= 0.21.0, < 1.0.0)
plist (~> 3.1.0)
xcpretty
spaceship (0.12.3)
colored
credentials_manager (>= 0.9.0)
faraday (~> 0.9)
Expand All @@ -181,6 +232,10 @@ GEM
multi_xml (~> 0.5)
plist (~> 3.1)
pry
supply (0.1.0)
credentials_manager (>= 0.8.2)
fastlane_core (>= 0.19.0)
google-api-client (~> 0.8.6)
terminal-notifier (1.6.3)
terminal-table (1.4.5)
thread_safe (0.3.5)
Expand All @@ -197,14 +252,17 @@ GEM
claide (~> 0.9.1)
colored (~> 1.2)
xcpretty (0.1.12)
xcpretty-travis-formatter (0.0.3)
xcpretty (~> 0.1, >= 0.0.7)
xpath (2.0.0)
nokogiri (~> 1.3)

PLATFORMS
ruby

DEPENDENCIES
fastlane (>= 1.16)
fastlane (>= 1.35)
scan
xcpretty

BUNDLED WITH
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
[![Build status](https://badge.buildkite.com/482fd5558d9ccf05b669c55f40450166033522f32314a1bbb2.svg)](https://buildkite.com/blindingskies/valuecoding)
[![codecov.io](http://codecov.io/github/danthorpe/ValueCoding/coverage.svg?branch=development)](http://codecov.io/github/danthorpe/ValueCoding?branch=development)

ValueCoding is a simple pair of protocols to support the archiving and unarchiving of Swift value types.
ValueCoding is a simple pair of protocols to support the coding of Swift value types.

It works by allowing a value type, which must conform to `ValueCoding` to define via a typealias its *archiver*. The archiver is another type which implements the `ArchiverType` protocol. This type will typically be an `NSObject` which implements `NSCoding` and is an adaptor which is responsible for encoding and decoding the properties of the value.
It works by allowing a value type, which must conform to `ValueCoding` to define via a typealias its *coder*. The coder is another type which implements the `CoderType` protocol. This type will typically be an `NSObject` which implements `NSCoding` and is an adaptor which is responsible for encoding and decoding the properties of the value.

A minimal example for a simple `struct` is shown below:

Expand Down Expand Up @@ -48,7 +48,7 @@ The framework provides static methods and properties for types which conform to
let data = NSKeyedArchiver.archivedDataWithRootObject(foo.encoded)
```

and likewise, unarchiving can be done:
and likewise, unarchiving (and decoding) can be done:

```swift
if let foo = Foo.decode(NSKeyedUnarchiver.unarchiveObjectWithData(data)) {
Expand All @@ -65,7 +65,7 @@ let foos = Set(arrayLiteral: Foo(), Foo(), Foo())
let data = NSKeyedArchiver.archivedDataWithRootObject(foos.encoded)
```

When decoding an `NSArray`, perform a conditional cast to `[AnyObject]` before passing it to `decode`. The result will be an `Array<Foo>` which will be empty if the object was not cast successfully. In addition, any members of `[AnyObject]` which did not unarchive will filtered from the result. This means that the length of the result will be less than the original archived array if there was an issue decoding.
When decoding an `NSArray`, perform a conditional cast to `[AnyObject]` before passing it to `decode`. The result will be an `Array<Foo>` which will be empty if the object was not cast successfully. In addition, any members of `[AnyObject]` which did not decode will filtered from the result. This means that the length of the result will be less than the original encoded array if there was an issue decoding.

```swift
let foos = Foo.decode(NSKeyedUnarchiver.unarchiveObjectWithData(data) as? [AnyObject])
Expand Down
3 changes: 2 additions & 1 deletion ValueCoding.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "ValueCoding"
s.version = "1.0.1"
s.version = "1.1.0"
s.summary = "Swift protocols for encoding/decoding value types."
s.description = <<-DESC
Expand All @@ -23,6 +23,7 @@ Pod::Spec.new do |s|
s.requires_arc = true
s.ios.deployment_target = '8.0'
s.osx.deployment_target = '10.10'
s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0'
s.source_files = 'ValueCoding/*.swift'
end
Expand Down
Loading

0 comments on commit 9c7b691

Please sign in to comment.