Skip to content

Commit

Permalink
improve reading out the directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jorishermans committed Jul 20, 2014
1 parent a143c77 commit 9f81013
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This file contains highlights of what changes on each version of the force package.

#### Pub version 0.3.2+1 ####

- Small improvement in reading out a directory.

#### Pub version 0.3.2 ####

- Introducing off(key, datachangelistener) and offAll(key) method, to remove the listeners
Expand Down
8 changes: 4 additions & 4 deletions lib/src/server/file_backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ class FileBackend extends Cargo {
dir.list(recursive: true, followLinks: false)
.listen((FileSystemEntity entity) {
var path = entity.path;
RegExp exp = new RegExp(r"^\\(.+\\)*(.+)\.(.+)$");

if (exp.hasMatch(path) && path.indexOf(".json") > 1) {
Match fileName = exp.firstMatch(path);

if (path.indexOf(".json") > 1) {
var fileName = path.split('\\').last;
fileName = fileName.replaceAll(".json", '');
keys.add(fileName.toString());
}
}).onDone(() {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: cargo
version: 0.3.2
version: 0.3.2+1
author: Joris Hermans <hermansj@gmail.com>
description: A key value, storage library for dart
homepage: https://github.com/jorishermans/cargo
Expand Down

0 comments on commit 9f81013

Please sign in to comment.