Latest 0.3.0
Homepage https://github.com/junkpiano/scientist
License MIT
Platforms ios 9.0
Authors

CocoaPods
Carthage
Build Status
codecov
Documentation

A Swift library for carefully refactoring critical paths.

Installation

Cocoapods

pod 'Scientist', '~> 0.3.0'

Carthage

github "junkpiano/scientist" ~> 0.3.0

Swift Package Manager

(snip)
dependencies: [
    .package(url: "https://github.com/junkpiano/scientist.git", from: "0.3.0")
]
(snip)

Usage

func allow(user: User) -> Bool {
  do {
    return try Scienctist<Bool>().science({
      experiment in
      // required to enable Experiment
      experiment.enabled = { return true }

      // alternatively, you can use A/B test-like logic.
      experiment.enabled = {
        return Int(arc4random_uniform(6) + 1) % 3 == 0
      }

      experiment.publish = { result in
        // do something to publish Result data.
        // send to your log server(Graphite, InfluxDB, etc.), or 3rd party logger like NewRelic, Firebase.
      }

      experiment.use {
        return module.check_user(user)
      }

      experiment.tryNew {
        return user.allowed
      }
    })
  } catch {
    return false
  }
}

Full Documentation is available Here.

Development

Simply,

open Scientist.xcodeproj

please run test before you send pull request

swift test

Porting from

Author

Latest podspec

{
    "name": "Scientist",
    "version": "0.3.0",
    "license": {
        "type": "MIT"
    },
    "homepage": "https://github.com/junkpiano/scientist",
    "authors": {
        "Yusuke Ohashi": "[email protected]"
    },
    "summary": "A Swift library for carefully refactoring critical paths.",
    "source": {
        "git": "https://github.com/junkpiano/scientist.git",
        "tag": "0.3.0"
    },
    "source_files": "Sources/**/*.swift",
    "swift_version": "4.0",
    "platforms": {
        "ios": "9.0"
    }
}

Pin It on Pinterest

Share This