Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
labordep committed Oct 1, 2024
1 parent f5f8c97 commit 32f8fd8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Molecule-IDE/MolDefineComponentCmdCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,19 @@ MolDefineComponentCmdCommand >> description [
^'Define this component: force to generate methods from contract definition'
]

{ #category : #accessing }
{ #category : #execution }
MolDefineComponentCmdCommand >> execute [
| componentsToDefine nbOfDefinedComponents |
| componentsToDefine nbOfDefinedComponents text |

componentsToDefine := self selectedComponentClasses.
componentsToDefine do:[ :c | MolComponentFactory defineComponent: c ].

nbOfDefinedComponents := componentsToDefine size.
self executionResult: nbOfDefinedComponents.

self inform: nbOfDefinedComponents asString, ' component', (nbOfDefinedComponents > 1 ifTrue:['s'] ifFalse:['']) ,' defined'.
text := nbOfDefinedComponents = 1
ifTrue:[ 'Define component: ', componentsToDefine first printString ]
ifFalse:[ nbOfDefinedComponents asString, ' component', (nbOfDefinedComponents > 1 ifTrue:['s'] ifFalse:['']) ,' defined' ].

MolUtils showInformation: text.
]

0 comments on commit 32f8fd8

Please sign in to comment.