Skip to content

Commit 93398d1

Browse files
committed
extra: move glob to libglob
In line with the dissolution of libextra - moves glob to its own library libglob. Changes based on PR #11787. Updates .gitignore to ignore doc/glob.
1 parent 4d0d3da commit 93398d1

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ src/.DS_Store
7777
/doc/arena
7878
/doc/extra
7979
/doc/flate
80+
/doc/glob
8081
/doc/green
8182
/doc/native
8283
/doc/rustc

doc/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ li {list-style-type: none; }
3939

4040
* [The `arena` allocation library](arena/index.html)
4141
* [The `flate` compression library](flate/index.html)
42+
* [The `glob` file path matching library](glob/index.html)
4243

4344
# Tooling
4445

mk/crates.mk

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# automatically generated for all stage/host/target combinations.
5050
################################################################################
5151

52-
TARGET_CRATES := std extra green rustuv native flate arena
52+
TARGET_CRATES := std extra green rustuv native flate arena glob
5353
HOST_CRATES := syntax rustc rustdoc rustpkg
5454
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5555
TOOLS := compiletest rustpkg rustdoc rustc
@@ -65,6 +65,7 @@ DEPS_rustdoc := rustc native:sundown
6565
DEPS_rustpkg := rustc
6666
DEPS_flate := std native:miniz
6767
DEPS_arena := std extra
68+
DEPS_glob := std
6869

6970
TOOL_DEPS_compiletest := extra green rustuv
7071
TOOL_DEPS_rustpkg := rustpkg green rustuv

src/libextra/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ pub mod ebml;
6767
pub mod getopts;
6868
pub mod json;
6969
pub mod tempfile;
70-
pub mod glob;
7170
pub mod term;
7271
pub mod time;
7372
pub mod base64;

src/libextra/glob.rs renamed to src/libglob/lib.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
* `glob`/`fnmatch` functions.
2424
*/
2525

26+
#[crate_id = "glob#0.10-pre"];
27+
#[crate_type = "rlib"];
28+
#[crate_type = "dylib"];
29+
#[license = "MIT/ASL2"];
30+
2631
use std::{os, path};
2732
use std::io;
2833
use std::io::fs;
@@ -53,7 +58,7 @@ pub struct Paths {
5358
/// `puppies.jpg` and `hamsters.gif`:
5459
///
5560
/// ```rust
56-
/// use extra::glob::glob;
61+
/// use glob::glob;
5762
///
5863
/// for path in glob("/media/pictures/*.jpg") {
5964
/// println!("{}", path.display());
@@ -297,7 +302,7 @@ impl Pattern {
297302
* # Example
298303
*
299304
* ```rust
300-
* use extra::glob::Pattern;
305+
* use glob::Pattern;
301306
*
302307
* assert!(Pattern::new("c?t").matches("cat"));
303308
* assert!(Pattern::new("k[!e]tteh").matches("kitteh"));
@@ -537,7 +542,7 @@ impl MatchOptions {
537542
#[cfg(test)]
538543
mod test {
539544
use std::os;
540-
use super::*;
545+
use super::{glob, Pattern, MatchOptions};
541546

542547
#[test]
543548
fn test_absolute_pattern() {

src/test/run-pass/glob-std.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
// xfail-win32 TempDir may cause IoError on windows: #10462
1313

1414
extern mod extra;
15+
extern mod glob;
1516

16-
use extra::glob::glob;
17+
use glob::glob;
1718
use extra::tempfile::TempDir;
1819
use std::unstable::finally::Finally;
1920
use std::{os, unstable};

0 commit comments

Comments
 (0)