FYI, Paul has made a cross-platform wrapper for web api clients
:)
> Begin forwarded message:
>
> From: Paul DeBruicker <pdebruic(a)gmail.com>
> Subject: Re: [Pharo-users] REST client hints
> Date: 5. Dezember 2017 um 19:46:48 MEZ
> To: pharo-users(a)lists.pharo.org
> Reply-To: Any question about pharo is welcome <pharo-users(a)lists.pharo.org>
>
> Hi Ben,
>
>
> I've made a few REST Clients
>
> http://smalltalkhub.com/#!/~pdebruic/Stripe
> http://smalltalkhub.com/#!/~pdebruic/Tropo
> http://smalltalkhub.com/#!/~pdebruic/SegmentIO
>
> And the elasticsearch one but its been advanced mostly lately by Sho Yoshida
> (https://github.com/newapplesho) here
> https://github.com/newapplesho/elasticsearch-smalltalk
>
> He has also made REST clients for Twilio, AWS, SendGrid, Salesforce, and
> Mixpanel among others.
>
> Norbert Hartl made one for Mandrill (Mailchimps transactional email service)
> http://smalltalkhub.com/#!/~NorbertHartl/Mandrill
>
> And Francois Stephany made one for Postmark (another transactional email
> service) http://smalltalkhub.com/#!/~PharoExtras/Postmark
>
>
> So those are some examples of different approaches.
>
>
vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> I also started/made a cross platform web client wrapper (just wraps calls to
> ZnClient or WebClient on Squeak)
> http://smalltalkhub.com/#!/~pdebruic/HTTPAPIClient
>
> But IIRC I only used it in the Stripe API client.
>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> Hope this gives you some ideas about how to approach your own solution
>
> Paul
>
>
>
> Ben Coman wrote
>> I'm just about to write my first client interface to a REST service.
>> In some respects I understand this is as simple as doing GET responses
>> using Zinc,
>> but I'm inquiring about tutorials or libraries that might help. Most
>> of the stuff turned up by searches is about server-side of REST.
>>
>> cheers -ben
>
>
>
>
>
> --
> Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html
>
A new version of Protocols was added to project The Inbox:
http://source.squeak.org/inbox/Protocols-nice.49.mcz
==================== Summary ====================
Name: Protocols-nice.49
Author: nice
Time: 11 December 2017, 9:47:58.015 pm
UUID: 4d293bcf-9f74-4e4b-93e6-6c5c8d56dea9
Ancestors: Protocols-topa.48
No use to send '-- all --' asSymbol, since it is already interned.
You can test this with
Symbol findInterned: '-- all --' .
'-- all --' asSymbol chasePointers.
=============== Diff against Protocols-topa.48 ===============
Item was changed:
----- Method: Vocabulary>>allCategoryName (in category 'queries') -----
allCategoryName
"Answer the name by which the 'all' category is known. This is redundant with two other things, including ClassOrganizer allCategory, at the moment -- should be cleaned up someday."
+ ^ #'-- all --'!
- ^ '-- all --' asSymbol!
Nicolas Cellier uploaded a new version of Files to project Squeak 4.6:
http://source.squeak.org/squeak46/Files-nice.145.mcz
==================== Summary ====================
Name: Files-nice.145
Author: nice
Time: 11 December 2017, 6:56:01.168 pm
UUID: 14fc2b3b-7138-41e8-8dde-9ebcccc011d2
Ancestors: Files-cmm.144
Backport workaround for truncated .changes readOnlyCopy on linux.
=============== Diff against Files-cmm.144 ===============
Item was changed:
----- Method: StandardFileStream>>readOnlyCopy (in category 'read, write, position') -----
readOnlyCopy
+ self flush. "Some linux open a truncated readOnlyCopy. Force it to take latest bytes written into account."
-
^ self class readOnlyFileNamed: self name.
!
David T. Lewis uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-dtl.981.mcz
==================== Summary ====================
Name: System-dtl.981
Author: dtl
Time: 6 December 2017, 9:52:13.947225 pm
UUID: d00b5ac2-0e56-40d3-91d6-7803be283e1c
Ancestors: System-mt.980
For emergency evaluator handling, Project class>>handlePrimitiveError: will first try to find a parent project of different type (e.g. MVC if current project is Morphic, or vice versa). If found, the other project is opened, and the error is handled there. If no such project is found, then the traditional emergency evaluator transcript is opened.
Extend this strategy by first checking parent project types, and if not successful search all projects to find any project of different type.
A typical scenario is the case of an image with many Morphic projects, and one MVC project anywhere in the project hierarchy. In the event of an unrecoverable error in any of the Morphic projects, the MVC project will be identified as the project for emergency recovery. This permits an MVC debugger to be used to recover from the error condition, after which the failed Morphic user interface can be reentered.
=============== Diff against System-mt.980 ===============
Item was changed:
----- Method: Project class>>tryOtherProjectForRecovery: (in category 'error recovery') -----
tryOtherProjectForRecovery: errorMessage
"Try entering the parent project if it uses a different user interface. We determine this by comparing the project's class."
| safeProject nextProject |
nextProject := Project current.
safeProject := nil.
[safeProject notNil or: [nextProject isTopProject]] whileFalse: [
nextProject := nextProject parent.
(Project current isKindOf: nextProject class)
ifFalse: [safeProject := nextProject]].
+
+ "Parent project was not of a different type. Search through all known
+ projects to find any one that is of different project type."
+ safeProject ifNil: [
+ Smalltalk garbageCollect.
+ safeProject := Project allSubInstances
+ detect: [ :proj | proj class ~= Project
+ or: [ (proj isKindOf: Project current class) not ] ]
+ ifNone: [ nil ] ].
+
safeProject ifNotNil: [:p |
p enterForEmergencyRecovery.
"Active process will usually suspend after this."].!
A new version of ST80 was added to project The Inbox:
http://source.squeak.org/inbox/ST80-dtl.233.mcz
==================== Summary ====================
Name: ST80-dtl.233
Author: dtl
Time: 10 December 2017, 1:57:45.015948 pm
UUID: b442c904-3b1e-462a-9b74-14e97e5ee2b0
Ancestors: ST80-nice.232
Move SoundService stop handling in #finalExitActions from Project to MVCProject in order to allow MorphicProject to handle differently (but also call super).
=============== Diff against ST80-nice.232 ===============
Item was changed:
----- Method: MVCProject>>finalExitActions: (in category 'enter') -----
finalExitActions: enteringProject
super finalExitActions: enteringProject.
+ SoundService stop.
self world unCacheWindows.
Sensor flushAllButDandDEvents.
ScheduledControllers := nil.!
David T. Lewis uploaded a new version of ST80 to project The Trunk:
http://source.squeak.org/trunk/ST80-dtl.233.mcz
==================== Summary ====================
Name: ST80-dtl.233
Author: dtl
Time: 10 December 2017, 1:57:45.015948 pm
UUID: b442c904-3b1e-462a-9b74-14e97e5ee2b0
Ancestors: ST80-nice.232
Move SoundService stop handling in #finalExitActions from Project to MVCProject in order to allow MorphicProject to handle differently (but also call super).
=============== Diff against ST80-nice.232 ===============
Item was changed:
----- Method: MVCProject>>finalExitActions: (in category 'enter') -----
finalExitActions: enteringProject
super finalExitActions: enteringProject.
+ SoundService stop.
self world unCacheWindows.
Sensor flushAllButDandDEvents.
ScheduledControllers := nil.!
David T. Lewis uploaded a new version of System to project The Inbox:
http://source.squeak.org/inbox/System-dtl.983.mcz
==================== Summary ====================
Name: System-dtl.983
Author: dtl
Time: 10 December 2017, 1:54:57.456518 pm
UUID: 0df950ab-8484-4d7e-bf0a-09d5450b3a0b
Ancestors: System-dtl.982
Fix logic for project selection in #tryOtherProjectForRecovery:
=============== Diff against System-dtl.982 ===============
Item was changed:
----- Method: Project class>>tryOtherProjectForRecovery: (in category 'error recovery') -----
tryOtherProjectForRecovery: errorMessage
"Try entering the parent project if it uses a different user interface. We determine this by comparing the project's class."
| safeProject nextProject |
nextProject := Project current.
safeProject := nil.
[safeProject notNil or: [nextProject isTopProject]] whileFalse: [
nextProject := nextProject parent.
(Project current isKindOf: nextProject class)
ifFalse: [safeProject := nextProject]].
"Parent project was not of a different type. Search through all known
projects to find any one that is of different project type."
+ safeProject ifNil: [Smalltalk garbageCollect.
- safeProject ifNil: [
- Smalltalk garbageCollect.
safeProject := Project allSubInstances
+ detect: [:proj | (proj isKindOf: Project current class) not
+ and: [proj class ~= Project]]
+ ifNone: []].
- detect: [ :proj | proj class ~= Project
- or: [ (proj isKindOf: Project current class) not ] ]
- ifNone: [ nil ] ].
-
safeProject ifNotNil: [:p |
p enterForEmergencyRecovery.
"Active process will usually suspend after this."].!
A new version of ToolBuilder-Morphic was added to project The Inbox:
http://source.squeak.org/inbox/ToolBuilder-Morphic-jr.202.mcz
==================== Summary ====================
Name: ToolBuilder-Morphic-jr.202
Author: jr
Time: 10 December 2017, 5:21:48.408893 pm
UUID: 4731ca9c-b924-514d-8f13-19a9913addb5
Ancestors: ToolBuilder-Morphic-tpr.201
fix choice from an empty list
Before the preceding changes in 2016, the MorphicUIManager would answer 0 when the list to choose from was empty.
After the changes, it would signal an error here:
dialog selectedButtonIndex: 1.
So guard against an empty list and answer 0 immediately.
The case can be triggered in a fresh trunk image when you try to add a repository to an existing package without first adding an additional repository via the '+ Repository' button. There will be zero repositories to choose from.
=============== Diff against ToolBuilder-Morphic-tpr.201 ===============
Item was changed:
----- Method: MorphicUIManager>>chooseFrom:lines:title: (in category 'ui requests') -----
chooseFrom: aList lines: linesArray title: aString
"Choose an item from the given list. Answer the index of the selected item."
+ aList ifEmpty: [^ 0].
aList size <= 7 ifTrue: [
| dialog |
dialog := DialogWindow new
title: 'Please Choose';
message: aString;
filterEnabled: true;
autoCancel: true;
yourself.
aList doWithIndex: [:ea :index |
dialog createButton: ea value: index].
dialog selectedButtonIndex: 1.
^ dialog getUserResponseAtHand ifNil: [0]].
^ ListChooser chooseFrom: aList title: aString!