diff --git a/.gitignore b/.gitignore index 5d2a807f..b29d1dd1 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,5 @@ doc/api/ # (Library packages only! Remove pattern if developing an application package) pubspec.lock -rethinkdb_data/ \ No newline at end of file +rethinkdb_data/ +.idea \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..3c801a88 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# 1.1.0 +* Moved to `package:rethinkdb_driver` +* Fixed references to old hooked event names. \ No newline at end of file diff --git a/lib/src/rethink_service.dart b/lib/src/rethink_service.dart index b655f3b1..da37906f 100644 --- a/lib/src/rethink_service.dart +++ b/lib/src/rethink_service.dart @@ -1,8 +1,8 @@ import 'dart:async'; -import 'dart:io'; +//import 'dart:io'; import 'package:angel_framework/angel_framework.dart'; import 'package:json_god/json_god.dart' as god; -import 'package:rethinkdb_driver2/rethinkdb_driver2.dart'; +import 'package:rethinkdb_driver/rethinkdb_driver.dart'; // Extends a RethinkDB query. typedef RqlQuery QueryCallback(RqlQuery query); @@ -130,21 +130,21 @@ class RethinkService extends Service { hookedService.fireEvent( hookedService.afterCreated, new HookedServiceEvent( - true, null, null, this, HookedServiceEvent.CREATED, + true, null, null, this, HookedServiceEvent.created, result: newVal)); } else if (type == 'change') { // Update hookedService.fireEvent( hookedService.afterCreated, new HookedServiceEvent( - true, null, null, this, HookedServiceEvent.UPDATED, + true, null, null, this, HookedServiceEvent.updated, result: newVal, id: oldVal['id'], data: newVal)); } else if (type == 'remove') { // Remove hookedService.fireEvent( hookedService.afterCreated, new HookedServiceEvent( - true, null, null, this, HookedServiceEventREMOVED, + true, null, null, this, HookedServiceEvent.removed, result: oldVal, id: oldVal['id'])); } }); @@ -187,7 +187,7 @@ class RethinkService extends Service { try { await read(d['id'], params); } on AngelHttpException catch (e) { - if (e.statusCode == HttpStatus.NOT_FOUND) + if (e.statusCode == 404) return await create(data, params); else rethrow; @@ -207,7 +207,7 @@ class RethinkService extends Service { try { await read(d['id'], params); } on AngelHttpException catch (e) { - if (e.statusCode == HttpStatus.NOT_FOUND) + if (e.statusCode == 404) return await create(data, params); else rethrow; diff --git a/pubspec.yaml b/pubspec.yaml index 242f29cd..9d5c6ce1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,13 +1,16 @@ name: angel_rethink -version: 1.0.7 +version: 1.1.0 description: RethinkDB-enabled services for the Angel framework. author: Tobe O environment: - sdk: ">=1.19.0" + sdk: ">=1.19.0 <3.0.0" homepage: https://github.com/angel-dart/rethink dependencies: - angel_framework: ^1.0.0-dev - rethinkdb_driver2: ^2.3.1 + angel_framework: ^1.1.0 + json_god: ^2.0.0-beta + rethinkdb_driver: ^2.3.1 dev_dependencies: - angel_test: ^1.0.0-dev + angel_client: ^1.1.0 + angel_test: ^1.1.0 + logging: ^0.11.3 test: ^0.12.0 \ No newline at end of file diff --git a/test/bootstrap.dart b/test/bootstrap.dart index f137f1b3..5186437d 100644 --- a/test/bootstrap.dart +++ b/test/bootstrap.dart @@ -1,5 +1,5 @@ import 'dart:io'; -import 'package:rethinkdb_driver2/rethinkdb_driver2.dart'; +import 'package:rethinkdb_driver/rethinkdb_driver.dart'; main() async { var r = new Rethinkdb(); diff --git a/test/generic_test.dart b/test/generic_test.dart index 7d9aec5e..ee9ee169 100644 --- a/test/generic_test.dart +++ b/test/generic_test.dart @@ -2,7 +2,8 @@ import 'package:angel_client/angel_client.dart' as c; import 'package:angel_framework/angel_framework.dart'; import 'package:angel_rethink/angel_rethink.dart'; import 'package:angel_test/angel_test.dart'; -import 'package:rethinkdb_driver2/rethinkdb_driver2.dart'; +import 'package:logging/logging.dart'; +import 'package:rethinkdb_driver/rethinkdb_driver.dart'; import 'package:test/test.dart'; import 'common.dart'; @@ -23,10 +24,7 @@ main() { print('Whoops: $e'); }; - app.fatalErrorStream.listen((e) { - print('Whoops: ${e.error}'); - print(e.stack); - }); + app.logger = new Logger.detached('angel')..onRecord.listen(print); client = await connectTo(app); todoService = client.service('todos');