1
0
mirror of https://github.com/bspeice/dtparse synced 2025-07-03 06:45:01 -04:00

3 Commits

Author SHA1 Message Date
4d7c5dd995 Now with 100% more WASM!
Version bump and README update
2018-08-14 22:49:24 -04:00
afb7747cdf Fix target name 2018-08-14 22:38:05 -04:00
22e0300275 Test adding WASM support 2018-08-14 21:53:35 -04:00
7 changed files with 48 additions and 7 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ Cargo.lock
.vscode .vscode
*.pyc *.pyc
.idea/ .idea/
*.swp

View File

@ -5,6 +5,8 @@ dist: trusty
language: rust language: rust
services: docker services: docker
sudo: required sudo: required
addons:
chrome: stable
env: env:
global: global:
@ -90,6 +92,10 @@ matrix:
- env: TARGET=x86_64-unknown-linux-gnu - env: TARGET=x86_64-unknown-linux-gnu
rust: 1.27.0 rust: 1.27.0
# WASM support
- env: TARGET=asmjs-unknown-emscripten USE_CARGO_WEB=true
rust: nightly
before_install: before_install:
- set -e - set -e

View File

@ -1,3 +1,11 @@
Version 1.0.2 (2018-08-14)
==========================
Misc
----
- Add tests for WASM
Version 1.0.1 (2018-08-11) Version 1.0.1 (2018-08-11)
========================== ==========================

View File

@ -1,6 +1,6 @@
[package] [package]
name = "dtparse" name = "dtparse"
version = "1.0.1" version = "1.0.2"
authors = ["Bradlee Speice <bradlee@speice.io>"] authors = ["Bradlee Speice <bradlee@speice.io>"]
description = "A dateutil-compatible timestamp parser for Rust" description = "A dateutil-compatible timestamp parser for Rust"
repository = "https://github.com/bspeice/dtparse.git" repository = "https://github.com/bspeice/dtparse.git"
@ -20,4 +20,4 @@ name = "dtparse"
chrono = "0.4" chrono = "0.4"
lazy_static = "1.1" lazy_static = "1.1"
num-traits = "0.2" num-traits = "0.2"
rust_decimal = "0.10" rust_decimal = "^0.10.1"

View File

@ -68,7 +68,7 @@ Further examples can be found in the [examples](examples) directory on internati
# Usage # Usage
`dtparse` requires a minimum Rust version of 1.21 to build, but is tested on Windows, OSX, `dtparse` requires a minimum Rust version of 1.21 to build, but is tested on Windows, OSX,
BSD, and Linux. The build is also compiled against the iOS and Android SDK's, but is not BSD, Linux, and WASM. The build is also compiled against the iOS and Android SDK's, but is not
tested against them. tested against them.
[dateutil]: https://github.com/dateutil/dateutil [dateutil]: https://github.com/dateutil/dateutil

View File

@ -14,7 +14,27 @@ main() {
cross test --target $TARGET --release cross test --target $TARGET --release
} }
main_web() {
CARGO_WEB_RELEASE="$(curl -L -s -H 'Accept: application/json' https://github.com/koute/cargo-web/releases/latest)"
CARGO_WEB_VERSION="$(echo $CARGO_WEB_RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')"
CARGO_WEB_URL="https://github.com/koute/cargo-web/releases/download/$CARGO_WEB_VERSION/cargo-web-x86_64-unknown-linux-gnu.gz"
echo "Downloading cargo-web from: $CARGO_WEB_URL"
curl -L "$CARGO_WEB_URL" | gzip -d > cargo-web
chmod +x cargo-web
mkdir -p ~/.cargo/bin
mv cargo-web ~/.cargo/bin
cargo web build --target $TARGET
cargo web test --target $TARGET --release
}
# we don't run the "test phase" when doing deploys # we don't run the "test phase" when doing deploys
if [ -z $TRAVIS_TAG ]; then if [ -z $TRAVIS_TAG ]; then
if [ -z "$USE_CARGO_WEB" ]; then
main main
else
main_web
fi
fi fi

View File

@ -61,6 +61,12 @@
//! //!
//! Further examples can be found in the `examples` directory on international usage. //! Further examples can be found in the `examples` directory on international usage.
//! //!
//! # Usage
//!
//! `dtparse` requires a minimum Rust version of 1.21 to build, but is tested on Windows, OSX,
//! BSD, Linux, and WASM. The build is also compiled against the iOS and Android SDK's, but is not
//! tested against them.
//!
//! [dateutil]: https://github.com/dateutil/dateutil //! [dateutil]: https://github.com/dateutil/dateutil
#[macro_use] #[macro_use]