-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
202: More small fixes r=behnam a=behnam
- Loading branch information
Showing
54 changed files
with
786 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
// Copyright 2017 The UNIC Project Developers. | ||
// | ||
// See the COPYRIGHT file at the top-level directory of this distribution. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
#![forbid(unsafe_code)] | ||
|
||
//! Command-line tool to list versions of UNIC components. | ||
extern crate unic; | ||
|
||
macro_rules! print_component_desc { | ||
( $component:tt ) => ( | ||
println!("Component: {}", unic::$component::PKG_DESCRIPTION); | ||
); | ||
} | ||
|
||
macro_rules! print_component_name_version { | ||
( $component:tt ) => ( | ||
println!( | ||
"Package: {} ({})", | ||
unic::$component::PKG_NAME, | ||
unic::$component::PKG_VERSION | ||
); | ||
); | ||
} | ||
|
||
macro_rules! print_unicode_version { | ||
( $component:tt ) => ( | ||
println!( | ||
"Unicode Version: {}.{}.{}", | ||
unic::$component::UNICODE_VERSION.major, | ||
unic::$component::UNICODE_VERSION.minor, | ||
unic::$component::UNICODE_VERSION.micro | ||
); | ||
); | ||
} | ||
|
||
macro_rules! print_emoji_version { | ||
( $component:tt ) => ( | ||
println!( | ||
"Emoji Version: {}.{}.{}", | ||
unic::$component::EMOJI_VERSION.major, | ||
unic::$component::EMOJI_VERSION.minor, | ||
unic::$component::EMOJI_VERSION.micro | ||
); | ||
); | ||
} | ||
|
||
macro_rules! print_component_info { | ||
( $component:tt ) => ( | ||
print_component_desc!($component); | ||
print_component_name_version!($component); | ||
println!(); | ||
); | ||
} | ||
|
||
macro_rules! print_component_info_with_unicode_version { | ||
( $component:tt ) => ( | ||
print_component_desc!($component); | ||
print_component_name_version!($component); | ||
print_unicode_version!($component); | ||
println!(); | ||
); | ||
} | ||
|
||
macro_rules! print_component_info_with_emoji_version { | ||
( $component:tt ) => ( | ||
print_component_desc!($component); | ||
print_component_name_version!($component); | ||
print_emoji_version!($component); | ||
println!(); | ||
); | ||
} | ||
|
||
fn main() { | ||
println!("UNIC: Unicode and Internationalization Crates for Rust"); | ||
println!("Package: unic ({})", unic::PKG_VERSION); | ||
println!(); | ||
|
||
print_component_info!(char); | ||
|
||
print_component_info_with_unicode_version!(ucd); | ||
print_component_info_with_unicode_version!(bidi); | ||
print_component_info_with_unicode_version!(normal); | ||
print_component_info_with_unicode_version!(idna); | ||
|
||
print_component_info_with_emoji_version!(emoji); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2017 The UNIC Project Developers. | ||
# | ||
# See the COPYRIGHT file at the top-level directory of this distribution. | ||
# | ||
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
# option. This file may not be copied, modified, or distributed | ||
# except according to those terms. | ||
|
||
# Since `cargo publish --all` does not exist yet, we use this dumb alternative | ||
# solution for now. | ||
# | ||
# Main downside of this approch is that there are separate `target/` | ||
# directories used for each component, increasing the test and publish process | ||
# time. | ||
|
||
set -e | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
. "$DIR/common.sh" | ||
|
||
|
||
# Steps | ||
|
||
# Package all components | ||
for component in $COMPONENTS; do | ||
pkg_file="$component/src/pkg_info.rs" | ||
if [ ! -f "$pkg_file" ] | ||
then | ||
echo "Missing pkg_file: $component" | ||
fi | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2017 The UNIC Project Developers. | ||
// | ||
// See the COPYRIGHT file at the top-level directory of this distribution. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
//! Package information | ||
/// UNIC component version. | ||
pub const PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); | ||
|
||
/// UNIC component name. | ||
pub const PKG_NAME: &str = env!("CARGO_PKG_NAME"); | ||
|
||
/// UNIC component description. | ||
pub const PKG_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "unic-common" | ||
version = "0.6.0" | ||
authors = ["The UNIC Project Developers"] | ||
repository = "https://github.com/behnam/rust-unic/" | ||
license = "MIT/Apache-2.0" | ||
description = "UNIC - Common Utilities" | ||
keywords = ["unicode", "version"] | ||
categories = ["internationalization", "text-processing"] | ||
|
||
# No tests/benches that depends on /data/ | ||
exclude = [] | ||
|
||
[features] | ||
default = [] | ||
unstable = [] # Rust nightly features | ||
|
||
[badges] | ||
travis-ci = { repository = "behnam/rust-unic", branch = "master" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# UNIC — Common Utilities | ||
|
||
[![Crates.io](https://img.shields.io/crates/v/unic-common.svg)](https://crates.io/crates/unic-common) | ||
[![Documentation](https://docs.rs/unic-common/badge.svg)](https://docs.rs/unic-common/) | ||
|
||
This UNIC component provides common types, algorithms and macros not shared | ||
between many components. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright 2017 The UNIC Project Developers. | ||
// | ||
// See the COPYRIGHT file at the top-level directory of this distribution. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
#![no_std] | ||
#![forbid(unsafe_code, missing_docs, unconditional_recursion)] | ||
#![cfg_attr(feature = "unstable", feature(unicode))] | ||
|
||
//! # UNIC — Common Utilities | ||
//! | ||
//! A component of [`unic`: Unicode and Internationalization Crates for Rust](/unic/). | ||
//! | ||
//! This UNIC component provides common types, algorithms and macros not shared between many | ||
//! components. | ||
mod pkg_info; | ||
pub use pkg_info::{PKG_DESCRIPTION, PKG_NAME, PKG_VERSION}; | ||
|
||
pub mod version; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright 2017 The UNIC Project Developers. | ||
// | ||
// See the COPYRIGHT file at the top-level directory of this distribution. | ||
// | ||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | ||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | ||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
||
//! Package information | ||
/// UNIC component version. | ||
pub const PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); | ||
|
||
/// UNIC component name. | ||
pub const PKG_NAME: &str = env!("CARGO_PKG_NAME"); | ||
|
||
/// UNIC component description. | ||
pub const PKG_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION"); |
Oops, something went wrong.