-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
2,285 additions
and
188 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,33 +1,175 @@ | ||
## Loading Chapter Code@cha:loadingThis chapter contains the expressions to load the code described in each of the chapters.Such expressions can be executed in any Pharo 8.0 \(or above\) image.Nevertheless, using the Pharo MOOC image \(cf. Pharo Launcher\) is usually faster because it already includes several libraries such as: Seaside, Voyage, ...When you start for example the chapter 4, you can load all the code of the previous chapters \(1, 2, and 3\) by following the process described in the following section 'Chapter 4'.Obviously, we believe that this is better that you use you own code but having our code at hand can help you in case you would be stuck.### Chapter 3: Extending and Testing the ModelYou can load the correction of the previous chapter as follow:```Metacello new | ||
## Loading Chapter Code | ||
|
||
@cha:loading | ||
|
||
This chapter contains the expressions to load the code described in each of the chapters. | ||
Such expressions can be executed in any Pharo 8.0 (or above) image. | ||
Nevertheless, using the Pharo MOOC image (cf. Pharo Launcher) is usually faster because it already includes several libraries such as: Seaside, Voyage, ... | ||
|
||
When you start for example the chapter 4, you can load all the code of the previous Chapters (1, 2, and 3) by following the process described in the following section 'Chapter 4'. | ||
|
||
Obviously, we believe that this is better that you use you own code but having our code at hand can help you in case you would be stuck. | ||
|
||
### Chapter 3: Extending and Testing the Model | ||
|
||
|
||
You can load the correction of the previous chapter as follows: | ||
|
||
``` | ||
Metacello new | ||
baseline:'TinyBlog'; | ||
repository: 'github://LucFabresse/TinyBlog:chapter2/src'; | ||
onConflict: [ :ex | ex useLoaded ]; | ||
load```Run the tests!To do so, you can use the TestRunner \(Tools menu > Test Runner\), look for the package TinyBlog-Tests and click on "Run Selected".All tests should be green.### Chapter 4: Data Persitency using Voyage and MongoYou can load the correction of the previous chapter as follow:```Metacello new | ||
load | ||
``` | ||
|
||
|
||
Run the tests! | ||
To do so, you can use the TestRunner (Tools menu > Test Runner), look for the package TinyBlog-Tests, and click on "Run Selected". | ||
All tests should be green. | ||
|
||
### Chapter 4: Data Persistency using Voyage and Mongo | ||
|
||
|
||
You can load the correction of the previous chapter as follows: | ||
|
||
``` | ||
Metacello new | ||
baseline:'TinyBlog'; | ||
repository: 'github://LucFabresse/TinyBlog:chapter3/src'; | ||
onConflict: [ :ex | ex useLoaded ]; | ||
load```Once loaded execute the tests.### Chapter 5: First Steps with SeasideYou can load the correction of the previous chapter as follow:```Metacello new | ||
load | ||
``` | ||
|
||
|
||
Once loaded execute the tests. | ||
|
||
### Chapter 5: First Steps with Seaside | ||
|
||
|
||
You can load the correction of the previous chapter as follows: | ||
|
||
``` | ||
Metacello new | ||
baseline:'TinyBlog'; | ||
repository: 'github://LucFabresse/TinyBlog:chapter4/src'; | ||
onConflict: [ :ex | ex useLoaded ]; | ||
load```Execute the tests.To test the application, start the HTTP server:```ZnZincServerAdaptor startOn: 8080.```Open your web browser at `http://localhost:8080/TinyBlog`You may need to recreate some posts as follows:```TBBlog reset ; createDemoPosts```### Chapitre 6: Web Components for TinyBlogYou can load the correction of the previous chapter as follow:```Metacello new | ||
load | ||
``` | ||
|
||
|
||
Execute the tests. | ||
|
||
To test the application, start the HTTP server: | ||
``` | ||
ZnZincServerAdaptor startOn: 8080. | ||
``` | ||
|
||
|
||
Open your web browser at `http://localhost:8080/TinyBlog` | ||
|
||
You may need to recreate some posts as follows: | ||
|
||
``` | ||
TBBlog reset ; createDemoPosts | ||
``` | ||
|
||
|
||
### Chapitre 6: Web Components for TinyBlog | ||
|
||
|
||
You can load the correction of the previous chapter as follows: | ||
|
||
``` | ||
Metacello new | ||
baseline:'TinyBlog'; | ||
repository: 'github://LucFabresse/TinyBlog:chapter5/src'; | ||
onConflict: [ :ex | ex useLoaded ]; | ||
load```Same process as above.### Chapitre 7: Managing CategoriesYou can load the correction of the previous chapter as follow:```Metacello new | ||
load | ||
``` | ||
|
||
|
||
Same process as above. | ||
|
||
### Chapitre 7: Managing Categories | ||
|
||
|
||
You can load the correction of the previous chapter as follows: | ||
|
||
``` | ||
Metacello new | ||
baseline:'TinyBlog'; | ||
repository: 'github://LucFabresse/TinyBlog:chapter6/src'; | ||
onConflict: [ :ex | ex useLoaded ]; | ||
load```To test the application, start the HTTP server:```ZnZincServerAdaptor startOn: 8080.```Open your web browser at `http://localhost:8080/TinyBlog`You may need to recreate some posts as follows:```TBBlog reset ; createDemoPosts```### Chapitre 8: Authentication and SessionYou can load the correction of the previous chapter as follow:```Metacello new | ||
load | ||
``` | ||
|
||
|
||
|
||
To test the application, start the HTTP server: | ||
|
||
``` | ||
ZnZincServerAdaptor startOn: 8080. | ||
``` | ||
|
||
|
||
Open your web browser at `http://localhost:8080/TinyBlog` | ||
|
||
|
||
You may need to recreate some posts as follows: | ||
|
||
``` | ||
TBBlog reset ; createDemoPosts | ||
``` | ||
|
||
|
||
|
||
|
||
### Chapitre 8: Authentication and Session | ||
|
||
|
||
You can load the correction of the previous chapter as follows: | ||
|
||
``` | ||
Metacello new | ||
baseline:'TinyBlog'; | ||
repository: 'github://LucFabresse/TinyBlog:chapter7/src'; | ||
onConflict: [ :ex | ex useLoaded ]; | ||
load```To test the application, start the HTTP server:```ZnZincServerAdaptor startOn: 8080.```### Chapitre 9: Administration Web Interface and Automatic Form GenerationYou can load the correction of the previous chapter as follow:```Metacello new | ||
load | ||
``` | ||
|
||
|
||
To test the application, start the HTTP server: | ||
|
||
``` | ||
ZnZincServerAdaptor startOn: 8080. | ||
``` | ||
|
||
|
||
### Chapitre 9: Administration Web Interface and Automatic Form Generation | ||
|
||
|
||
|
||
You can load the correction of the previous chapter as follows: | ||
|
||
``` | ||
Metacello new | ||
baseline:'TinyBlog'; | ||
repository: 'github://LucFabresse/TinyBlog:chapter8/src'; | ||
onConflict: [ :ex | ex useLoaded ]; | ||
load```### Latest Version of TinyBlogThe most up-to-date version of TinyBlog can be loaded as follow:```Metacello new | ||
load | ||
``` | ||
|
||
|
||
### Latest Version of TinyBlog | ||
|
||
|
||
The most up-to-date version of TinyBlog can be loaded as follows: | ||
|
||
``` | ||
Metacello new | ||
baseline:'TinyBlog'; | ||
repository: 'github://LucFabresse/TinyBlog/src'; | ||
onConflict: [ :ex | ex useLoaded ]; | ||
load.``` | ||
load. | ||
``` |
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 |
---|---|---|
@@ -1 +1,19 @@ | ||
## Save your codeWhen you save the Pharo image \(Pharo Menu > Save menuentry\), it contains all objects of the system as well as all classes.This solution is useful but fragile.We will show you how Pharoers save their code directly using Iceberg.Iceberg is the Pharo code versionning tools \(introduced in Pharo 7.0\) that directly send code to well-known Web sites such as: github, bitbucket, or gitlab.We suggest you read the chapter in the book "Managing Your Code with Iceberg" \(available at [http://books.pharo.org](http://books.pharo.org)\).We list the key points here:- Create an account on [http://www.github.com](http://www.github.com) or similar.- Create a project on [http://www.github.com](http://www.github.com) or similar.- Add a new project into Iceberg by choosing the option: clone from github.- Create a folder `'src'` with the filelist or using the command line in the folder that you just cloned.- Open your project and add your packages \(Define a baseline to be able to reload your code -- check [https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Baselines.md](https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Baselines.md)\)- Commit your code.- Push your code on github. | ||
## Save your code | ||
|
||
|
||
When you save the Pharo image (Pharo Menu > Save menu entry), it contains all objects of the system as well as all classes. | ||
This solution is useful but fragile. | ||
We will show you how Pharoers save their code directly using Iceberg. | ||
Iceberg is the Pharo code versioning tools (introduced in Pharo 7.0) that directly send code to well-known Web sites such as: github, bitbucket, or gitlab. | ||
|
||
We suggest you read the chapter in the book "Managing Your Code with Iceberg" \(available at [http://books.pharo.org](http://books.pharo.org)\). | ||
|
||
We list the key points here: | ||
|
||
- Create an account on [http://www.github.com](http://www.github.com) or similar. | ||
- Create a project on [http://www.github.com](http://www.github.com) or similar. | ||
- Add a new project into Iceberg by choosing the option: clone from github. | ||
- Create a folder `'src'` with the filelist or using the command line in the folder that you just cloned. | ||
- Open your project and add your packages (Define a baseline to be able to reload your code -- check [https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Baselines.md](https://github.com/pharo-open-documentation/pharo-wiki/blob/master/General/Baselines.md)) | ||
- Commit your code. | ||
- Push your code on github. |