Testing future collections.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2023-12-10 13:44:11 -05:00
parent ef3218a343
commit f0dfea31b5
2 changed files with 1 additions and 52 deletions

View File

@ -1,51 +0,0 @@
"
I model an Airtable (https://airtable.com/) database (or Base as they call it).
"
Class {
#name : #Airtable,
#superclass : #Object,
#instVars : [
'id',
'apiKey'
],
#category : #Brea
}
{ #category : #accessing }
Airtable >> apiKey [
^ apiKey
]
{ #category : #accessing }
Airtable >> apiKey: aString [
apiKey := aString
]
{ #category : #accessing }
Airtable >> id [
^ id
]
{ #category : #accessing }
Airtable >> id: aString [
id := aString
]
{ #category : #'as yet unclassified' }
Airtable >> rawRecords [
(self id isNil or: [ self apiKey isNil ]) ifTrue: [ ^ self ].
^ ZnClient new
url: (self id);
headerAt: 'Authorization' put: 'Bearer ', (self apiKey);
get.
]
{ #category : #'as yet unclassified' }
Airtable >> records [
^ ((NeoJSONReader fromString: (self rawRecords)) at: 'records')
select: [ :each | (each at: 'fields') isNotEmpty ]
]

View File

@ -83,7 +83,7 @@ BreaPage >> exportAsHTML [
self splitters ifNotEmpty: [ actionsArray := actionsArray copyWith: [ self split ] future ]. self splitters ifNotEmpty: [ actionsArray := actionsArray copyWith: [ self split ] future ].
self bodyTag ifNotNil: [ self bodyTag ifNotNil: [
actionsArray := actionsArray copyWith: [ self populateBodyAs: self bodyTag ] future ]. actionsArray := actionsArray copyWith: [ self populateBodyAs: self bodyTag ] future ].
allActions := TKTFuture all: actionsArray. allActions := TKTFuture fromCollectionOfFutures: actionsArray.
semaphore := Semaphore new. semaphore := Semaphore new.
allActions onSuccessDo: [ :values | allActions onSuccessDo: [ :values |
result := values last. result := values last.