From 227255fdd9e3f897b9e05e36482216366e5bc5d7 Mon Sep 17 00:00:00 2001 From: Matthew Butler Date: Wed, 29 Aug 2012 11:39:58 -0300 Subject: [PATCH 1/3] Update src/site/docs/pub-package-manager/index.markdown update simple example to include required 'name' parameter. --- .../docs/pub-package-manager/index.markdown | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/site/docs/pub-package-manager/index.markdown b/src/site/docs/pub-package-manager/index.markdown index c5a9f25b0..b913253ef 100644 --- a/src/site/docs/pub-package-manager/index.markdown +++ b/src/site/docs/pub-package-manager/index.markdown @@ -85,16 +85,17 @@ package" or "application package". To turn your app into an application package so it can use other packages, you just need to give it a **pubspec**. This file is written using the [YAML language](http://yaml.org) and is named `pubspec.yaml`. The simplest -possible pubspec contains nothing, so just create an empty file and save it as -`pubspec.yaml` in the root directory of your app. +possible pubspec contains only your application's name, so in the editor highlight the +top most folder for your project then right click and click on 'New File...' (or +alternatively click on File > New File... Ensure your top-most folder is selected +as the parent folder. In the **File Name:** field enter in `pubspec.yaml` +and click Finish. - $ cd path/to/your_app - $ touch pubspec.yaml +Enter the following in the new file and save. - +{% highlight yaml %} +name: your_app +{% endhighlight %} Now `your_app` is a pub package! @@ -112,9 +113,11 @@ on the `handle_stache` package. -You specify your package's dependencies in the pubspec, like so: +You specify your package's dependencies in the pubspec file immediately after +your package name, like so: {% highlight yaml %} +name: your_app dependencies: handle_stache: git: git://github.com/munificent/handle_stache.git From 99d1e390e60625a7dcdbdee75cc170708a6e29f9 Mon Sep 17 00:00:00 2001 From: Matthew Butler Date: Thu, 30 Aug 2012 17:23:08 -0300 Subject: [PATCH 2/3] Update try/catch syntax. --- .../_includes/language-tour/exceptions/index.markdown | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/site/_includes/language-tour/exceptions/index.markdown b/src/site/_includes/language-tour/exceptions/index.markdown index 200fd95de..bb2e0cd8f 100644 --- a/src/site/_includes/language-tour/exceptions/index.markdown +++ b/src/site/_includes/language-tour/exceptions/index.markdown @@ -40,7 +40,7 @@ Catching an exception gives you a chance to handle it. {% highlight dart %} try { breedMoreLlamas(); -} catch (final OutOfLlamasException e) { +} on OutOfLlamasException catch (e) { buyMoreLlamas(); } {% endhighlight %} @@ -54,11 +54,11 @@ clause does not specify a type, that clause can handle any type of thrown object {% highlight dart %} try { breedMoreLlamas(); -} catch (final OutOfLlamasException e) { // A specific exception +} on OutOfLlamasException catch (e) { // A specific exception buyMoreLlamas(); -} catch (final Exception e) { // Anything that is an exception +} on Exception catch (e) { // Anything that is an exception print("Unknown exception: $e"); -} catch (final e) { // No specified type, handles all +} catch (e) { // No specified type, handles all print("Something really unknown: $e"); } {% endhighlight %} @@ -85,7 +85,7 @@ The finally clause runs after any matching catch clauses. {% highlight dart %} try { breedMoreLlamas(); -} catch (final e) { +} catch (e) { print("Error: $e"); // Handle exception first. } finally { cleanLlamaStalls(); // Then clean up. From 217df42f519fd2ccd064949092d641104e2437f4 Mon Sep 17 00:00:00 2001 From: Matthew Butler Date: Thu, 30 Aug 2012 17:28:47 -0300 Subject: [PATCH 3/3] update to match upstream --- .../docs/pub-package-manager/index.markdown | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/src/site/docs/pub-package-manager/index.markdown b/src/site/docs/pub-package-manager/index.markdown index fc02ad75a..480e70350 100644 --- a/src/site/docs/pub-package-manager/index.markdown +++ b/src/site/docs/pub-package-manager/index.markdown @@ -83,18 +83,6 @@ package" or "application package". To turn your app into an application package so it can use other packages, you just need to give it a **pubspec**. This file is written using the [YAML language](http://yaml.org) and is named `pubspec.yaml`. The simplest -<<<<<<< HEAD -possible pubspec contains only your application's name, so in the editor highlight the -top most folder for your project then right click and click on 'New File...' (or -alternatively click on File > New File... Ensure your top-most folder is selected -as the parent folder. In the **File Name:** field enter in `pubspec.yaml` -and click Finish. - -Enter the following in the new file and save. - -{% highlight yaml %} -name: your_app -======= possible pubspec just contains the name of the package. Save the pubspec file as `pubspec.yaml` in the root directory of your app. @@ -102,7 +90,6 @@ Behold, the most simple `pubspec.yaml`: {% highlight yaml %} name: my_app ->>>>>>> upstream/master {% endhighlight %} Now `my_app` is a pub package! @@ -122,17 +109,10 @@ on the `handle_stache` package. You specify your package's dependencies in the pubspec file immediately after -<<<<<<< HEAD -your package name, like so: - -{% highlight yaml %} -name: your_app -======= your package name. For example: {% highlight yaml %} name: my_app ->>>>>>> upstream/master dependencies: handle_stache: git: git://github.com/munificent/handle_stache.git