Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
769 commits
Select commit Hold shift + click to select a range
710fc58
Fixing typo
Nov 20, 2025
88590d2
Fixing missing extension name
Nov 20, 2025
f84a9fb
Different lookup mechanism in DynamicVariable for Pharo and GemStone
Nov 20, 2025
788beaa
In GemStone ZnClientTest is child of different superclass than in Pharo
Nov 20, 2025
ad03d09
Fixing incorrect superclass name
Nov 20, 2025
9b65fea
Fixing incorrectly merged file
Nov 20, 2025
bfdef21
Fixing incorrect superclass name
Nov 20, 2025
72c1c12
Fixed malformed message to correctly parse path
Nov 20, 2025
da7242c
Comments that actually tell what is happening; more elegant solution
Nov 20, 2025
dcabadc
Differentiate different implementation for Pharo and GemStone
Nov 21, 2025
6df0c30
GemStone needs to have a Symbol in an Array
Nov 21, 2025
e69c310
Pharo needs correct extesion protocol for it to load it
Nov 21, 2025
ffc03d8
Creating as it is present at Globals dictionary
Nov 21, 2025
4da0fa0
Fixing protocol name in extended code so it can be loaded
Nov 21, 2025
b5b32a1
Adding missing method - merging GemStone and Pharo code
Nov 21, 2025
5d11051
Revert "Merging code and removing superfluous packages"
Nov 21, 2025
f33f292
Revert "Removing packages from baseline so Zinc can be loaded to GS"
Nov 21, 2025
bb3cf3c
Revert "Class is empty shell"
Nov 21, 2025
848009f
Revert "Similar file, functionally same, is in the core package"
Nov 21, 2025
ccef2ac
Revert "Classes are in the main core package"
Nov 21, 2025
f851972
Returning back package as there is part of Zinc in Globals dictionary
Nov 21, 2025
59a52c7
Zinc is in Globals dictionary - moving code around
Nov 21, 2025
8f25c19
Zinc is in Globals dictionary - removal of whole core package
Nov 21, 2025
2caa3bc
Zinc is in Globals dictionary - removal of whole test package
Nov 21, 2025
30c653e
Baseline restructuring due to moving code and removing packages
Nov 21, 2025
a16822b
Correcting protocol name after move
Nov 21, 2025
a5b709b
Code has to be in the v37 package otherwise it won't load to GS 3.7.x
Nov 21, 2025
505880e
Separating GemStone only code in extension
Nov 24, 2025
84d76db
Class already in Globals just extending it
Nov 24, 2025
b00f16b
In Pharo ByteArray is inheriting from ArrayedCollection, but not in GS
Nov 24, 2025
92f37de
Class already in Globals dictionary - extending it
Nov 24, 2025
e508257
Tests run platform identification, which is not compatible with GemStone
Nov 24, 2025
a4fd434
Class already in Globals dictionary - extending it
Nov 24, 2025
6f58f6f
GS requires to use ANSI version of the streams here
Nov 25, 2025
0fc882d
Zinc requires binary write stream code in GemStone
Nov 25, 2025
6b82d45
Class missing must be added in order to load it to GS
Nov 25, 2025
039a6a2
Class was probably removed sometime in the past
Nov 25, 2025
7a48d01
Fixing typo
Nov 25, 2025
0a35291
Improving write stream test
Nov 25, 2025
8ca52a8
Comment should make sense
Nov 25, 2025
5355a69
Zinc requires binary read stream code in GemStone
Nov 25, 2025
b3c9f1d
Adding missing test for reading binary stream
Nov 25, 2025
0032d46
Extending the Globals ZnCharacterRead/ReadWrite/WriteStream
Nov 25, 2025
66828c7
Adding missing methods as extension (GemStone)
Nov 25, 2025
50f52e0
Adding extension code
Nov 26, 2025
d7c7c00
Some of character stream packages are present in Globals some not
Nov 26, 2025
0abe254
Renamed old package name extension style
Nov 26, 2025
d6a83e6
Creating package that extends code loaded by GS v.37 package
Nov 26, 2025
f80790a
Renamed old package name extension style
Nov 26, 2025
b587d07
Reorganizing the baseline again for the package to load
Nov 26, 2025
17c4c30
Fixing protocol for loading
Nov 26, 2025
e4aaa5c
Adding socket stream as requirement; moving non-Globals extesions
Nov 26, 2025
7db649f
Zinc loads SocketStream so it should be extended here
Nov 26, 2025
2dbd395
Removing dependency loop
Nov 26, 2025
94bec69
Adding missing messages
Nov 26, 2025
03e827a
Adding missing classes
Nov 26, 2025
637b70d
Extending encoded read/write stream code in Globals
Nov 26, 2025
7c3bab9
Adding missing classes
Nov 26, 2025
79945dc
Commit updated ZnPercentEncoder code
Nov 26, 2025
b9e5138
Adding missing class
Nov 26, 2025
234c675
Adding missing classes
Nov 26, 2025
9ee1040
Moving extended code to correct package
Nov 26, 2025
49ba150
Adding missing alias - needed for unicode tests
Nov 26, 2025
d744f1a
Zinc needs to be able to move back in a stream
Nov 26, 2025
0619450
Needed for the UTF16Encoder to work on GemStone
Nov 26, 2025
ab74896
Method overload as SequenceableCollection uses non-portable stream
Nov 26, 2025
6838e0c
Updating code to be up-to-date
Nov 26, 2025
32ddfc2
Updating class definition to match updated code
Nov 27, 2025
9832a5b
Removing code that is not present in updated code
Nov 27, 2025
dbe6242
Adding code that is missing
Nov 27, 2025
fe78b6a
Updating code for extension
Nov 27, 2025
9836fb0
Due to different inheritance on new Zinc have to change class name
Nov 27, 2025
b5a76b6
Must change class name due to method with identical name having new code
Nov 28, 2025
c52c927
In GemStone we have to encode with GS UTF8 encoder
Nov 28, 2025
8dab1f7
Default encoder is needed in different class place for GS and Pharo
Nov 28, 2025
ce754aa
Must change class name due to method with identical name having new code
Nov 28, 2025
cfa2b23
Missed changing the protocol name
Nov 28, 2025
fb0bbf1
URL is now an object so it needs to be converted first
Nov 28, 2025
1042684
Trying out same ZnClinet as in Pharo
Nov 28, 2025
3b0f11b
Making ZnLogEvent fit GemStone
Nov 28, 2025
a518527
GemStone has a different way to get current process than Pharo
Dec 1, 2025
2761866
Creating system logout notification based on system login notification
Dec 1, 2025
e5be5b8
We don't necessarily need to start/end session
Dec 2, 2025
105daf8
Separate login/logout notification in case one service registering both
Dec 2, 2025
ae33f84
Adding missing method
Dec 2, 2025
8bb83bb
The GS is superfluous
Dec 2, 2025
8b3eb4b
String has different hierarchy in Pharo than in GemStone
Dec 2, 2025
38e50b5
Updated method
Dec 2, 2025
b5c125c
There is no SmallDictionary in GemStone. Using Grease one.
Dec 2, 2025
151879d
Debugging UTF8 string is processed differently in Pharo and GemStone
Dec 2, 2025
9535196
Method on class not on instance side
Dec 2, 2025
28429ae
Simplifying GemStone test code
Dec 3, 2025
75071f4
Adding required package as parent of the class is in it
Dec 3, 2025
885a2a2
Fixing incorrect category
Dec 3, 2025
7d600ff
Addressing differences in ZnClient for Pharo and GemStone
Dec 4, 2025
c86cdf6
There is different approach to logging in Pharo and GemStone
Dec 4, 2025
8be90e0
Different kind of ZiUrl extension based on environment
Dec 4, 2025
5aa54c1
Differentiate between instance variable and method one
Dec 4, 2025
8545fad
Misplaced methods - should be class
Dec 4, 2025
2b5e321
Missing file
Dec 4, 2025
093e10c
Incorrect sender was specified
Dec 4, 2025
f144f81
After ZnClient executes request response it needs this class
Dec 4, 2025
e9d0067
Connection cleanup is different for Pharo and GemStone
Dec 5, 2025
814c252
Should be on the class side
Dec 5, 2025
411e3a5
GemStone uses QuadByteString instead of WideString
Dec 5, 2025
ad8c7f1
Using GS code for ZnUTF8EncoderGS
Dec 5, 2025
081ef77
Using Gs code for ZnPercentEncoder
Dec 5, 2025
284d4dd
Code separation between Pharo and GemStone
Dec 5, 2025
2e878f6
Adding missing DynamicVariable class
Dec 5, 2025
63f0071
Old style of getting socket timeout value
Dec 5, 2025
9857f22
Making sure timeout is available for GemStone too
Dec 5, 2025
214d710
Method different need to separate code
Dec 5, 2025
5bb058e
Adding missing methods
Dec 5, 2025
829035f
Prevent mixing Symbols with Strings in an Array
Dec 9, 2025
8ac35f9
On GemStone start we should start default session
Dec 8, 2025
b26d3ba
Method on incorrect side
Dec 8, 2025
f8f4b07
UTF8 encoder needs identifier
Dec 9, 2025
8543f53
Adding missing code to byte encoder
Dec 8, 2025
0c89a00
Extending collection code as it is used in one of the Zinc tests
Dec 9, 2025
9f41692
Missing from utf8 encoder
Dec 9, 2025
21f0c19
Leftover code must update
Dec 9, 2025
943f411
Missing code from UTF8 encoder
Dec 9, 2025
78cc345
This code should not be on UTF8 encoder
Dec 9, 2025
91ed85d
Missing code from UTF8 encoder
Dec 9, 2025
a8b1e36
Adding missing code for testing
Dec 9, 2025
931b227
Need to properly decode UTF32
Dec 9, 2025
8159c6f
Prevent code duplication by moving it to superclass
Dec 10, 2025
5c87acf
These methods are called from a superclass (ZnCharacterEncoderGS)
Dec 10, 2025
cc7d990
Old test replaced by a new one
Dec 10, 2025
e2b7016
Resuming exception done with default resume value
Dec 10, 2025
f3f609c
retreive contents is same for Pharo and GemStone
Dec 10, 2025
b2b1dac
Without disabled certificate verification test will expect it and fail
Dec 10, 2025
12b67a2
Adding missing protocol
Dec 11, 2025
61b7c6b
Test uses shortcut for raisedTo:
Dec 11, 2025
d38879e
Adding missing code
Dec 11, 2025
d477890
encoder method already present, need to overwrite it with this call
Dec 11, 2025
8f773ae
Extending portable stream as ZnCharacterStreamTests are using it
Dec 11, 2025
4c52d01
Raising correct exception in test
Dec 11, 2025
7203c7b
Finding out line endings adjusted to GemStone
Dec 11, 2025
558a5ad
Tests required the code change in order to pass
Dec 11, 2025
7bad899
Extending class to add missing code
Dec 11, 2025
56c9da5
Exception added as it is expected to exist for positionable read stream
Dec 11, 2025
f80fd2d
Removing setting signaler variable as it is not used in Zinc
Dec 11, 2025
8e790f4
Use the default encoder which is different in GS than in Pharo
Dec 11, 2025
0a0109c
Adapting new code which enables different kind of encodings
Dec 11, 2025
9ccb288
Loader can't load a category that does not contain full package name
Dec 11, 2025
566a1ae
The code is missing in pharo if it is gemstone only code
Dec 11, 2025
f5a51c9
Must split code as GS is using ZnCharacterEncoderGS for encoding
Dec 11, 2025
44ed7c4
Separating ZnHTTPSTest code needed for GS from Pharo
Dec 11, 2025
f36820a
Don't need pharo only test running on GemStone
Dec 11, 2025
ca17f8f
Having same extension in to packages creates issues
Dec 11, 2025
7a13f0b
Test is skipped moving to Pharo where was it originally
Dec 11, 2025
a292ced
Fixing incorrect protocol
Dec 11, 2025
890bc07
Common code is moved to a class; differ code moved to extensions
Dec 12, 2025
63055f2
Updating notification class based on Pharo example
Dec 12, 2025
9349b4a
Harmonizing zn client logging and execution between Pharo and GS
Dec 12, 2025
633539b
Baseline created new package to host different code for GS
Dec 12, 2025
5db66fa
Adding missing code for zinc options
Dec 12, 2025
439ee83
In extension fixing protocols
Dec 12, 2025
72af361
Removing the old log style from receive/send cookies
Dec 12, 2025
78fab2e
Harmonizing zn client connection between Pharo and GS
Dec 12, 2025
50c5aed
GS needs different approach to TLS setup than Pharo
Dec 18, 2025
3f65838
Zinc networking utils need different intialization for GS and Pharo
Dec 19, 2025
f832aa8
Correct certificate enable/disable and reporting serverName errors
Dec 22, 2025
3f770ce
Make ByteEncoder test compatible with both Pharo and GemStone
Dec 22, 2025
93df5a0
Adding missing package which loads code needed for the defined package
Dec 22, 2025
cff0950
Changing to GS compatible message
Dec 22, 2025
b28b592
Extending methods in GRSmallDictionary that Zinc expects to have there
Dec 22, 2025
a4b5888
More articulate dependency in baseline
Jan 5, 2026
f6b85aa
Package has similar meta information as its extensions for each env.
Jan 5, 2026
37dd98d
Fixing dependency bug
Jan 5, 2026
da48a81
Moving method to separate environment package overwrites original code
Jan 5, 2026
1c475b4
Method is identical for Pharo and GemStone
Jan 5, 2026
da74549
Different concepts of image path in Pharo and GemStone
Jan 5, 2026
d254e25
Adding a plus as space decoding for percent encoder
Jan 5, 2026
40d9c71
Code is identical in Pharo and GemStone
Jan 5, 2026
8810aa5
ifTrue:ifFalse: implemented differently in Pharo and GemStone
Jan 5, 2026
ee11025
Downloading under ZnClient is now same for Pharo and GemStone
Jan 5, 2026
6941db7
Adding .png file (Pharo logo) to the test class with test adjusted
Jan 5, 2026
f932074
Fixing base64 encoding/decoding for GemStone
Jan 6, 2026
542bace
Fixing PNG Pharo logo so it can be loaded to GemStone
Jan 6, 2026
3d4ee7d
Using Dictionary to prevent code duplication
Jan 6, 2026
853a58b
Splitting test in order to for it to run on Pharo and GemStone
Jan 6, 2026
758fa0d
Splitting test due to a fact it contains Pharo only code
Jan 7, 2026
f5eadc4
Windows path test is needed only in Pharo; GemStone does not run on Win
Jan 7, 2026
d163f71
Adding a Pharo compatibility Exception code into GemStone for Zinc
Jan 7, 2026
3930157
ModificationForbidden migrated to GemStone with limitations
Jan 7, 2026
3fc7f38
Forgot to delete the test after splitting for Pharo and GemStone
Jan 7, 2026
0d39034
Pharo version is being propagated to GemStone
Jan 12, 2026
3c55619
Merge single threaded server code for both smalltalk environments
Jan 12, 2026
ed04735
Moving message to correct package/class
Jan 12, 2026
674c4d0
Better error message
Jan 12, 2026
eefc640
Merge multi-threaded server code for both smalltalk environments
Jan 12, 2026
2af5ecc
Adding missing test package in the library baseline
Jan 12, 2026
378528f
Merging code - test now works for both Pharo and GemStone
Jan 13, 2026
99241fa
Tests that can be run on Pharo only moved to Pharo only package
Jan 13, 2026
ed740a7
Merging code for managing multi threaded server as much as possible
Jan 13, 2026
02ab8f2
Merging the Pharo and GemStone parse code
Jan 13, 2026
9113d92
Fixing issue that asserting has correct class but equals does not
Jan 13, 2026
262e599
Splitting code due to different class in Pharo and GemStone
Jan 13, 2026
8627864
Merging code for test - same test for Pharo and GS
Jan 13, 2026
a968b3f
Adapting the new version to GemStone
Jan 13, 2026
0e2d3fd
Message is used to set binary status by other class
Jan 13, 2026
3fbd1df
Different message needed for GemStone - split code between environments
Jan 13, 2026
cbf8c51
Pharo extension code was correct - merging Pharo and GS code
Jan 13, 2026
a24e07c
Merging Pharo and GemStone code with comment fix
Jan 14, 2026
7608a8e
Zinc expects announcing method - adding it there
Jan 14, 2026
9b0c142
GemStone should unsubscribe subscriptions similary as in Pharo
Jan 15, 2026
ec9045f
Adding missing message that is needed for ZnCookieJar class
Jan 15, 2026
50b36ec
Fixing line end decision. For now only between Win and Linux
Jan 15, 2026
eb7ac7e
Merging Pharo and GemStone test code
Jan 15, 2026
a75364f
ZnLogEvent uses #crTrace: so extending Object with it
Jan 16, 2026
83a9f1a
Ston file had two different sections. Cleaning up
Jan 16, 2026
bc89ac3
Moving test to Pharo only because it is for MS Windows
Jan 16, 2026
326f267
Pharo uses network resolving, but GS not. Adjusting test to work.
Jan 16, 2026
c709bc5
Moving test to Pharo only because it is for MS Windows
Jan 16, 2026
e402ef2
GemStone returns seconds with greater precision - rounding it
Jan 16, 2026
735112f
Taking over standard timeout from Pharo socket
Jan 16, 2026
cf2a982
Correctly identify line ends on GemStone
Jan 16, 2026
bc7df6f
Merging Pharo and GemStone version into one code
Jan 16, 2026
e592dff
Unused in current version
Jan 16, 2026
5e4b663
Updating GemStone code to the newer version
Jan 16, 2026
62f23a1
Adding decimal digit length detection as ZnEntity needs it
Jan 19, 2026
57bbbc7
Revert "Zinc expects announcing method - adding it there"
Jan 19, 2026
959d1ef
ZnClient code merge (between Pharo and GemStone) for new library version
Jan 19, 2026
3e053e7
Fixing copying test from Pharo
Jan 19, 2026
1976314
Merging Pharo and GemStone for two test classes
Jan 19, 2026
c38bbf1
Fixing missing test file suffix
Jan 19, 2026
aae29a3
Zinc tests needs the message
Jan 19, 2026
4b86fea
Pharo uses different way to find out file size than GemStone
Jan 19, 2026
2e10f84
Zinc tests need identification what kind of string is being used
Jan 20, 2026
41099c6
There is no wordSize detection from VM in GemStone (uses wordSize=8)
Jan 20, 2026
377b44a
Formatting - improving readability
Jan 20, 2026
e923d3e
Adding test for isWideString to make sure it is extended properly
Jan 20, 2026
5dea64f
GemStone has different exception for non-existing host
Jan 20, 2026
fb61cc9
Skipping test on specified reason is now possible
Jan 20, 2026
daaeb1b
Split tests code - skipping if condition(s) are not met
Jan 20, 2026
786fa6a
Moving skipped test to Pharo only in case a developer wants to test it
Jan 20, 2026
6e6a41a
Fixing a bug ImproperOperation occurred - Expected nil to be a Boolean
Jan 21, 2026
3b7a27b
Fixing a bug which does not allow to run assert
Jan 21, 2026
69e1db2
Failing certificate verification code works differently in Pharo and GS
Jan 21, 2026
5d02393
Extending #Exception for returning message that signaled the receiver
Jan 21, 2026
43626f0
Counting in Smalltalk starts from 1 not like in C from 0
Jan 21, 2026
17daff4
Adding forgotten message for the extended Exception
Jan 22, 2026
54c121f
unused
Jan 22, 2026
e21c23b
The common code from Zinc-HTTP was missing during load
Jan 22, 2026
9c3cd5e
chnage super class in order for the tests to load
Jan 26, 2026
add9a86
Merge remote-tracking branch 'GsDevKitPortUpstream/gs_master' into gs…
Feb 2, 2026
e8f4c7d
Merge remote-tracking branch 'GsDevKitPortUpstream/gs_master' into gs…
Feb 13, 2026
7727a5d
Enable running tests in correct class context (adding a comment for it)
Feb 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Bash needs lf even on windows/cygwin
*.st eol=lf
*.sh eol=lf

# st files are always text, even if they contain invalid encoded chars
*.st text diff

# GitHub is unable to properly detect Smalltalk code, so help it a bit
*.st linguist-language=Smalltalk
19 changes: 19 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI

on: [ push, pull_request, workflow_dispatch ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
smalltalk: [ Pharo64-13, Pharo64-12, Pharo64-11, Pharo64-10 , Pharo64-9.0 , Pharo64-8.0 , Pharo64-7.0 ]
name: ${{ matrix.smalltalk }}
steps:
- uses: actions/checkout@v3
- uses: hpi-swa/setup-smalltalkCI@v1
with:
smalltalk-version: ${{ matrix.smalltalk }}
- run: smalltalkci -s ${{ matrix.smalltalk }}
shell: bash
timeout-minutes: 5
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
Session.vim
.netrwhist
*~
.DS_Store
3 changes: 3 additions & 0 deletions .project
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
'srcDirectory' : 'repository'
}
11 changes: 11 additions & 0 deletions .smalltalk_gemstone.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'ZincHTTPComponents',
#load : [ 'default', 'SSL' ],
#directory : 'repository',
#onWarningLog : true,
#platforms : [ #gemstone ]
}
]
}
9 changes: 9 additions & 0 deletions .smalltalk_pharo.ston
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
SmalltalkCISpec {
#loading : [
SCIMetacelloLoadSpec {
#baseline : 'ZincHTTPComponents',
#directory: 'repository',
#platforms : [ #pharo ]
}
]
}
39 changes: 39 additions & 0 deletions README-gemstone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Zinc HTTP Components

## For GemStone


Zinc HTTP Components is an open-source Smalltalk framework
to deal with the HTTP networking protocol.


Base [Readme](README.md)


## Loading into GemStone

1. [Upgrade to GLASS 1.0-beta.9](http://code.google.com/p/glassdb/wiki/GemToolsUpdate#Update_GLASS)

2. Install Zinc:

```Smalltalk
"GemStone 2.4"
Metacello new
baseline: 'Zinc';
repository: 'github://glassdb/zinc:gemstone2.4/repository';
load: 'Tests'.

"GemStone 3.1"
Metacello new
baseline: 'Zinc';
repository: 'github://glassdb/zinc:gemstone3.1/repository';
load: 'Tests'.
```

*See the [Releases page](https://github.com/glassdb/zinc/releases/) for instructions for installing specific Zinc releases.*

## Travis Status

**GemStone2.4.x** [![Build Status](https://travis-ci.org/glassdb/zinc.png?branch=gemstone2.4)](https://travis-ci.org/glassdb/zinc)

**GemStone3.1.x** [![Build Status](https://travis-ci.org/glassdb/zinc.png?branch=gemstone3.1)](https://travis-ci.org/glassdb/zinc)
146 changes: 141 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,134 @@
Zinc HTTP Components is an open-source Smalltalk framework
to deal with the HTTP networking protocol.

Based on core classes modelling all main HTTP concepts,
a full featured HTTP client and server are provided.

<http://zn.stfx.eu>
Zinc is part of any [Pharo Smalltalk](https://www.pharo.org) version since 1.3.


## Please read the [Zinc HTTP Components](https://github.com/svenvc/zinc/blob/master/zinc-http-components-paper.md) paper
## CI Actions

[![CI](https://github.com/svenvc/zinc/actions/workflows/CI.yml/badge.svg)](https://github.com/svenvc/zinc/actions/workflows/CI.yml)
[![Pharo 7.0](https://img.shields.io/badge/Pharo-7.0-informational)](https://pharo.org)
[![Pharo 8.0](https://img.shields.io/badge/Pharo-8.0-informational)](https://pharo.org)
[![Pharo 9.0](https://img.shields.io/badge/Pharo-9.0-informational)](https://pharo.org)
[![Pharo 10](https://img.shields.io/badge/Pharo-10-informational)](https://pharo.org)
[![Pharo 11](https://img.shields.io/badge/Pharo-11-informational)](https://pharo.org)
[![Pharo 12](https://img.shields.io/badge/Pharo-12-informational)](https://pharo.org)
[![Pharo 13](https://img.shields.io/badge/Pharo-13-informational)](https://pharo.org)

*Sven Van Caekenberghe*

## API

Here are a couple of simple examples to give an impression of the API.
You start a default (easy to reference) HTTP server with just one line of code.

```Smalltalk
ZnServer startDefaultOn: 1701.
```

Now you can browse locally to http://localhost:1701 - in particular
have a look at the `/routes` section and `/echo` - these are part of a set of demonstration handlers.

Accessing the server that we just started from code is easy too.

```Smalltalk
ZnClient new
url: ZnServer default localUrl;
addPathSegment: #echo;
entity: (ZnEntity text: 'Hello');
post.
```

This builds an HTTP POST to our server's `/echo` handler with a simple text as resource.
The server will echo information about the request it received, including the text resource that you posted.

By default, the demonstration server has a couple of handlers, mostly for testing.
You can add your own, to do additions (sum two numbers), for example.


```Smalltalk
ZnServer default delegate
map: #adder to: [ :request | | x y sum |
x := (request uri queryAt: #x) asNumber.
y := (request uri queryAt: #y) asNumber.
sum := x + y.
ZnResponse ok: (ZnEntity text: sum asString) ].
```

This creates a new handler `/adder` that will take 2 query arguments, converts them to numbers and returns the result of adding them together.

Using the full client, we can test our new functionality.

```Smalltalk
ZnClient new
url: ZnServer default localUrl;
addPathSegment: #adder;
queryAt: #x put: 1;
queryAt: #y put: 2;
get.
```

This builds an appropriate request to our `/adder` and executes it.
By entering the proper URL directly, this becomes a one liner.

```Smalltalk
'http://localhost:1701/adder?x=1&y=2' asUrl retrieveContents.
```

[MIT Licensed](https://github.com/svenvc/zinc/blob/master/license.txt)

## Documentation


Over the years, various documentation has been written about Zinc HTTP Components.
Some of it is somewhat outdated. We list the most recent first.

The code base has decent class and method comments, as well as unit tests and examples.

The best starter documentation can be found in the
[Pharo Enterprise](https://books.pharo.org/enterprise-pharo/) book.

My [Blog](https://blog.stfx.eu) contains several entries about Zinc.

In particular, in the following chapters (these no longer seem to exist):
- [Client](https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/Zinc-HTTP-Client/Zinc-HTTP-Client.html)
- [Server](https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/Zinc-HTTP-Server/Zinc-HTTP-Server.html)
- [WebApp](https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/WebApp/WebApp.html)
- [TeaPot](https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/Teapot/Teapot.html)
- [Encoding](https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/Zinc-Encoding-Meta/Zinc-Encoding-Meta.html)
- [WebSockets](https://ci.inria.fr/pharo-contribution/job/EnterprisePharoBook/lastSuccessfulBuild/artifact/book-result/WebSockets/WebSockets.html)

A live website can be found at [https://zn.stfx.eu](https://zn.stfx.eu). You can run part of this website locally.

The original [Zinc HTTP Components](doc/zinc-http-components-paper.md) paper.

The [Building and deploying your first web app with Pharo](doc/build-and-deploy-1st-webapp/build-deploy-1st-webapp.md) tutorial.

There is a separate [GemStone README](README-gemstone.md).

## Loading

```smalltalk
Metacello new
repository: 'github://svenvc/zinc/repository';
baseline: 'ZincHTTPComponents';
load.
```

When loading code in an image that already contains Zinc or Zodiac,
it could be helpful to configure a bunch of options to make sure
the latest code gets loaded from this repository.

```smalltalk
Metacello new
repository: 'github://svenvc/zinc/repository';
baseline: 'ZincHTTPComponents';
onConflict: [ :e | e useIncoming ];
onUpgrade: [ :e | e useIncoming ];
onWarning: [ :e | e load ];
load.
```

## Loading into GemStone

Expand Down Expand Up @@ -50,6 +166,26 @@ Gofer new
load: 'Tests' ].
```

## Ethymology

Any project needs a name. We also needed a namespace prefix for our Smalltalk classes.
We choose `Zinc` and `Zn` or `zn` respectively.

```
zinc |zi ng k|
noun
the chemical element of atomic number 30, a silvery-white metal
that is a constituent of brass and is used for coating (galvanizing)
iron and steel to protect against corrosion. (Symbol: Zn)
ORIGIN mid 17th cent.: from German Zink, of unknown origin.
```

Here is the Wikipedia entry: [Zinc](https://en.wikipedia.org/wiki/Zinc).
Apart from the fact that this is a nice name, don't go searching for a hidden meaning:
there is none.

## Travis Status [![Build Status](https://travis-ci.org/GsDevKit/zinc.png?branch=gs_master)](https://travis-ci.org/GsDevKit/zinc)

*Sven Van Caekenberghe*


[MIT Licensed](https://github.com/svenvc/zinc/blob/master/license.txt)
Binary file added doc/build-and-deploy-1st-webapp/add-repo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/build-and-deploy-1st-webapp/breakpoint-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/build-and-deploy-1st-webapp/breakpoint-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading