JQuery Cycler

While working on the Pier editor, I've ran into several issues understanding the code (see Displaying Variables in Pier). To get a little more momentum, I started working on one of the Pier Components, the JQuery Cycler.

After working for a while, this may not be the most effective work - a slideshow like this can be done in CSS and HTML (see this example):

This is from when I removed the tile in my kitchen and added drywall.

Posted by John Borden at 10 December 2021, 1:18 am link

User in Changes Report

After upgrading this wiki to the latest code, the changes report displays the user as:

PUUser [1234] name: 'jborden'
While this only affects logged-in users who view the changes, it is annoying.

When researching this, I found:

  • The message PRContext(Object)>>#magritteDescriptionBuilders is missing QCDescriptionBuilderContainer (from the Magritte-Model package). This is also missing in an older image
  • This area also involves some internal code: Pragma allNamed: #magritteBuilder from: PRContext to: Object - For working and non-working, this returns an empty array.
  • When I was looking into PRHistoryView>>buildReport in the debugger, inspecting self buildDescription raised an error for kernel sent to nil

One option that resolves the issue:

PUUser>>#printOn: aStream
	"Needed so the changes view displays without 'PUUser[1234..] name: admin'."

	aStream nextPutAll: self name

This seems like a better solution since there are many problems. One is Pier does not yet work on Pharo 9 (first issue is in Pillar). I also noticed problems running Exercism in the new version too (seems to work best on Pharo 8).

More information on the Pier changes feature can be found on Complete Task in List of Changes.

Posted by John Borden at 28 August 2021, 5:11 pm link

Pier on Docker

This uses the Buenos Aires Smalltalk group's docker work and here-docs (just create the files with the text between the greater-thans and the closing bang if your shell does not support it):

0 Johns-MacBook-Pro$ mkdir pharo-pier; cd pharo-pier
0 Johns-MacBook-Pro$ cat > start.st <<-!
Transcript show: 'Pier should be running in the background'.

"Suspend UI process, not needed on headless"
(Process allSubInstances reject: #isTerminated)
	detect: [ :process | process name includesSubstring: 'UI Process' ]
	ifFound: [ :process | process suspend ].
Processor activeProcess suspend.
0 Johns-MacBook-Pro$ cat > load-project.st <<-!
Metacello new
  repository: 'github://Pier-CMS/Pier3:main/repository';
0 Johns-MacBook-Pro$ cat > Dockerfile <<-!
# Use the images generated from this repository as base
FROM basmalltalk/pharo:8.0-image

# Put the load-project.st script in the docker image and then load the project
COPY load-project.st ./
RUN pharo Pharo.image load-project.st --save --quit

# Put start.st in the docker image and configure the docker image to start it
COPY start.st ./
CMD [ "pharo", "Pharo.image", "start.st" ]
0 Johns-MacBook-Pro$ docker build . -t pharo-pier                                       
0 Johns-MacBook-Pro$ docker run --interactive --tty --rm --publish 8080:8080 pharo-pier

The last command should display the transcript message of pier running. If one connects to http://localhost:8080/pier the basic pier in a web browser. By changing load-project.st with another pier project or branch then a larger project can be tested.

Posted by John Borden at 14 July 2021, 3:06 pm link

Workout Export

The process of upgrading the underlying server for this site has quite a few manual tasks, one being exporting any PierWorkout. When running PRKernelCreatorForPier, any PRWorkoutLog has the workouts exported as an array of PRExerciseEntries, like:

structure workouts: #(5 sets on 1 June 2015 6 sets on 3 June 2015

Initially I had planned to build a parser to use a state machine and read in each entry building up a workout. Then I saw it would be easier to modify how it is printed in:


These now display a workout with the same format used for testing in PRWorkoutTest. Modifying PRWorkoutLog>>workouts: as:

	workouts := (aCollectionOfPRWorkouts asOrderedCollection
		collectAll: [ :e |
			e isString
				ifTrue: [ self class workoutsBasedOnString: e ]
				ifFalse: [ OrderedCollection with: e ] ])
		sorted: [ :a :b | a date < b date ]
Posted by John Borden at 11 June 2021, 12:26 pm link

Rename Banch to Main

While working through an user-add issue in Pier, I decided to rename the primary branch from master to main. Personally I don't have strong feelings concerning the name, however if it makes others feel more comfortable contributing to a project that doesn't conjure up master/slave images, then it is worth the effort.

One nice aspect of Pier is that it allows pages to be embedded in other pages, which reduces the number of updates. An example is:

The Loading with Metacello core version 3.2 can be loaded from GitHub using Metacello:

Metacello new
 repository: 'github://Pier-CMS/Pier3:main/repository';

The #onConflict... code is due to a Grease version mismatch between Seaside and Magritte.

For the full install with all the addons, it can be loaded with:

Metacello new
 repository: 'github://Pier-CMS/Pier3:main/repository';

The PierToDo code depends on the add-ons, it can be loaded with:

Metacello new
 repository: 'github://Pier-CMS/Pier3:main/repository';

Posted by John Borden at 13 May 2021, 3:30 am link
<< 1 2 3 4 5 6 7 8 9 10 >>